diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2001-04-05 04:55:58 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2001-04-05 04:55:58 +0000 |
commit | 74a9f2e1b4d3ab45a9f72cb5b556c9f521524ab3 (patch) | |
tree | 7c4cdb103ab1b388c9852a88bd6fb1e73eba0b5c /arch/mips64 | |
parent | ee6374c8b0d333c08061c6a97bc77090d7461225 (diff) |
Merge with Linux 2.4.3.
Note that mingetty does no longer work with serial console, you have to
switch to another getty like getty_ps. This commit also includes a
fix for a setitimer bug which did prevent getty_ps from working on
older kernels.
Diffstat (limited to 'arch/mips64')
-rw-r--r-- | arch/mips64/defconfig | 1 | ||||
-rw-r--r-- | arch/mips64/defconfig-ip22 | 1 | ||||
-rw-r--r-- | arch/mips64/defconfig-ip27 | 1 | ||||
-rw-r--r-- | arch/mips64/kernel/head.S | 2 | ||||
-rw-r--r-- | arch/mips64/kernel/linux32.c | 14 | ||||
-rw-r--r-- | arch/mips64/kernel/syscall.c | 4 | ||||
-rw-r--r-- | arch/mips64/mm/fault.c | 10 | ||||
-rw-r--r-- | arch/mips64/mm/init.c | 118 | ||||
-rw-r--r-- | arch/mips64/mm/umap.c | 4 | ||||
-rw-r--r-- | arch/mips64/sgi-ip27/ip27-memory.c | 2 |
10 files changed, 20 insertions, 137 deletions
diff --git a/arch/mips64/defconfig b/arch/mips64/defconfig index f6c37c426..6d73c9fae 100644 --- a/arch/mips64/defconfig +++ b/arch/mips64/defconfig @@ -176,6 +176,7 @@ CONFIG_SCSI_LOGGING=y # CONFIG_SCSI_AHA1542 is not set # CONFIG_SCSI_AHA1740 is not set # CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_ADVANSYS is not set # CONFIG_SCSI_IN2000 is not set # CONFIG_SCSI_AM53C974 is not set diff --git a/arch/mips64/defconfig-ip22 b/arch/mips64/defconfig-ip22 index 8e182f626..b457a1d82 100644 --- a/arch/mips64/defconfig-ip22 +++ b/arch/mips64/defconfig-ip22 @@ -185,6 +185,7 @@ CONFIG_SGIWD93_SCSI=y # CONFIG_SCSI_AHA1542 is not set # CONFIG_SCSI_AHA1740 is not set # CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_ADVANSYS is not set # CONFIG_SCSI_IN2000 is not set # CONFIG_SCSI_AM53C974 is not set diff --git a/arch/mips64/defconfig-ip27 b/arch/mips64/defconfig-ip27 index f6c37c426..6d73c9fae 100644 --- a/arch/mips64/defconfig-ip27 +++ b/arch/mips64/defconfig-ip27 @@ -176,6 +176,7 @@ CONFIG_SCSI_LOGGING=y # CONFIG_SCSI_AHA1542 is not set # CONFIG_SCSI_AHA1740 is not set # CONFIG_SCSI_AIC7XXX is not set +# CONFIG_SCSI_AIC7XXX_OLD is not set # CONFIG_SCSI_ADVANSYS is not set # CONFIG_SCSI_IN2000 is not set # CONFIG_SCSI_AM53C974 is not set diff --git a/arch/mips64/kernel/head.S b/arch/mips64/kernel/head.S index e9e35aa20..0ed458b80 100644 --- a/arch/mips64/kernel/head.S +++ b/arch/mips64/kernel/head.S @@ -176,8 +176,6 @@ NESTED(bootstrap, 16, sp) page swapper_pg_dir, 1 page invalid_pte_table, 0 page invalid_pmd_table, 1 - page empty_bad_page_table, 0 - page empty_bad_pmd_table, 1 page kptbl, KPTBL_PAGE_ORDER .globl ekptbl page kpmdtbl, 0 diff --git a/arch/mips64/kernel/linux32.c b/arch/mips64/kernel/linux32.c index f1a6084e5..206f09377 100644 --- a/arch/mips64/kernel/linux32.c +++ b/arch/mips64/kernel/linux32.c @@ -443,10 +443,10 @@ sys32_execve(abi64_no_regargs, struct pt_regs regs) * `execve' frees all current memory we only have to do an * `munmap' if the `execve' failes. */ - down(¤t->mm->mmap_sem); + down_write(¤t->mm->mmap_sem); av = (char **) do_mmap_pgoff(0, 0, len, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, 0); - up(¤t->mm->mmap_sem); + up_write(¤t->mm->mmap_sem); if (IS_ERR(av)) return (long) av; @@ -742,7 +742,9 @@ sys32_getrusage(int who, struct rusage32 *ru) set_fs (KERNEL_DS); ret = sys_getrusage(who, &r); set_fs (old_fs); - if (put_rusage (ru, &r)) return -EFAULT; + if (put_rusage (ru, &r)) + return -EFAULT; + return ret; } @@ -752,7 +754,6 @@ get_tv32(struct timeval *o, struct timeval32 *i) return (!access_ok(VERIFY_READ, i, sizeof(*i)) || (__get_user(o->tv_sec, &i->tv_sec) | __get_user(o->tv_usec, &i->tv_usec))); - return ENOSYS; } static inline long @@ -763,7 +764,6 @@ get_it32(struct itimerval *o, struct itimerval32 *i) __get_user(o->it_interval.tv_usec, &i->it_interval.tv_usec) | __get_user(o->it_value.tv_sec, &i->it_value.tv_sec) | __get_user(o->it_value.tv_usec, &i->it_value.tv_usec))); - return ENOSYS; } static inline long @@ -777,12 +777,11 @@ put_tv32(struct timeval32 *o, struct timeval *i) static inline long put_it32(struct itimerval32 *o, struct itimerval *i) { - return (!access_ok(VERIFY_WRITE, i, sizeof(*i)) || + return (!access_ok(VERIFY_WRITE, o, sizeof(*o)) || (__put_user(i->it_interval.tv_sec, &o->it_interval.tv_sec) | __put_user(i->it_interval.tv_usec, &o->it_interval.tv_usec) | __put_user(i->it_value.tv_sec, &o->it_value.tv_sec) | __put_user(i->it_value.tv_usec, &o->it_value.tv_usec))); - return ENOSYS; } extern int do_getitimer(int which, struct itimerval *value); @@ -839,6 +838,7 @@ sys32_alarm(unsigned int seconds) /* And we'd better return too much than too little anyway */ if (it_old.it_value.tv_usec) oldalarm++; + return oldalarm; } diff --git a/arch/mips64/kernel/syscall.c b/arch/mips64/kernel/syscall.c index 8b36b6e5e..a5694b3fc 100644 --- a/arch/mips64/kernel/syscall.c +++ b/arch/mips64/kernel/syscall.c @@ -64,9 +64,9 @@ sys_mmap(unsigned long addr, size_t len, unsigned long prot, } flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); - down(¤t->mm->mmap_sem); + down_write(¤t->mm->mmap_sem); error = do_mmap(file, addr, len, prot, flags, offset); - up(¤t->mm->mmap_sem); + up_write(¤t->mm->mmap_sem); if (file) fput(file); out: diff --git a/arch/mips64/mm/fault.c b/arch/mips64/mm/fault.c index 710b6b309..42e810176 100644 --- a/arch/mips64/mm/fault.c +++ b/arch/mips64/mm/fault.c @@ -95,7 +95,7 @@ do_page_fault(struct pt_regs *regs, unsigned long write, unsigned long address) printk("Cpu%d[%s:%d:%08lx:%ld:%08lx]\n", smp_processor_id(), current->comm, current->pid, address, write, regs->cp0_epc); #endif - down(&mm->mmap_sem); + down_read(&mm->mmap_sem); vma = find_vma(mm, address); if (!vma) goto bad_area; @@ -138,7 +138,7 @@ good_area: goto out_of_memory; } - up(&mm->mmap_sem); + up_read(&mm->mmap_sem); return; /* @@ -146,7 +146,7 @@ good_area: * Fix it, but check if it's kernel or user first.. */ bad_area: - up(&mm->mmap_sem); + up_read(&mm->mmap_sem); /* * Quickly check for vmalloc range faults. @@ -209,14 +209,14 @@ no_context: * us unable to handle the page fault gracefully. */ out_of_memory: - up(&mm->mmap_sem); + up_read(&mm->mmap_sem); printk("VM: killing process %s\n", tsk->comm); if (user_mode(regs)) do_exit(SIGKILL); goto no_context; do_sigbus: - up(&mm->mmap_sem); + up_read(&mm->mmap_sem); /* * Send a sigbus, regardless of whether we were in kernel diff --git a/arch/mips64/mm/init.c b/arch/mips64/mm/init.c index 848c1dd34..d0da581b3 100644 --- a/arch/mips64/mm/init.c +++ b/arch/mips64/mm/init.c @@ -1,5 +1,4 @@ -/* $Id: init.c,v 1.13 2000/02/23 00:41:00 ralf Exp $ - * +/* * This file is subject to the terms and conditions of the GNU General Public * License. See the file "COPYING" in the main directory of this archive * for more details. @@ -40,25 +39,6 @@ unsigned long totalram_pages; -void __bad_pte_kernel(pmd_t *pmd) -{ - printk("Bad pmd in pte_alloc_kernel: %08lx\n", pmd_val(*pmd)); - pmd_set(pmd, BAD_PAGETABLE); -} - -void __bad_pte(pmd_t *pmd) -{ - printk("Bad pmd in pte_alloc: %08lx\n", pmd_val(*pmd)); - pmd_set(pmd, BAD_PAGETABLE); -} - -/* Fixme, we need something like BAD_PMDTABLE ... */ -void __bad_pmd(pgd_t *pgd) -{ - printk("Bad pgd in pmd_alloc: %08lx\n", pgd_val(*pgd)); - pgd_set(pgd, empty_bad_pmd_table); -} - void pgd_init(unsigned long page) { unsigned long *p, *end; @@ -113,72 +93,6 @@ void pmd_init(unsigned long addr, unsigned long pagetable) } } -pmd_t *get_pmd_slow(pgd_t *pgd, unsigned long offset) -{ - pmd_t *pmd; - - pmd = (pmd_t *) __get_free_pages(GFP_KERNEL, 1); - if (pgd_none(*pgd)) { - if (pmd) { - pmd_init((unsigned long)pmd, (unsigned long)invalid_pte_table); - pgd_set(pgd, pmd); - return pmd + offset; - } - pgd_set(pgd, BAD_PMDTABLE); - return NULL; - } - free_page((unsigned long)pmd); - if (pgd_bad(*pgd)) { - __bad_pmd(pgd); - return NULL; - } - return (pmd_t *) pgd_page(*pgd) + offset; -} - -pte_t *get_pte_kernel_slow(pmd_t *pmd, unsigned long offset) -{ - pte_t *page; - - page = (pte_t *) __get_free_pages(GFP_USER, 1); - if (pmd_none(*pmd)) { - if (page) { - clear_page(page); - pmd_set(pmd, page); - return page + offset; - } - pmd_set(pmd, BAD_PAGETABLE); - return NULL; - } - free_page((unsigned long)page); - if (pmd_bad(*pmd)) { - __bad_pte_kernel(pmd); - return NULL; - } - return (pte_t *) pmd_page(*pmd) + offset; -} - -pte_t *get_pte_slow(pmd_t *pmd, unsigned long offset) -{ - pte_t *page; - - page = (pte_t *) __get_free_pages(GFP_KERNEL, 0); - if (pmd_none(*pmd)) { - if (page) { - clear_page(page); - pmd_val(*pmd) = (unsigned long)page; - return page + offset; - } - pmd_set(pmd, BAD_PAGETABLE); - return NULL; - } - free_pages((unsigned long)page, 0); - if (pmd_bad(*pmd)) { - __bad_pte(pmd); - return NULL; - } - return (pte_t *) pmd_page(*pmd) + offset; -} - int do_check_pgt_cache(int low, int high) { int freed = 0; @@ -247,34 +161,6 @@ unsigned long setup_zero_pages(void) return 1UL << order; } -/* - * BAD_PAGE is the page that is used for page faults when linux - * is out-of-memory. Older versions of linux just did a - * do_exit(), but using this instead means there is less risk - * for a process dying in kernel mode, possibly leaving a inode - * unused etc.. - * - * BAD_PAGETABLE is the accompanying page-table: it is initialized - * to point to BAD_PAGE entries. - * - * ZERO_PAGE is a special page that is used for zero-initialized - * data and COW. - */ -pmd_t * __bad_pmd_table(void) -{ - return empty_bad_pmd_table; -} - -pte_t * __bad_pagetable(void) -{ - return empty_bad_page_table; -} - -pte_t __bad_page(void) -{ - return __pte(0); -} - void __init add_memory_region(unsigned long start, unsigned long size, long type) { @@ -474,8 +360,6 @@ void __init paging_init(void) pgd_init((unsigned long)swapper_pg_dir); pmd_init((unsigned long)invalid_pmd_table, (unsigned long)invalid_pte_table); memset((void *)invalid_pte_table, 0, sizeof(pte_t) * PTRS_PER_PTE); - pmd_init((unsigned long)empty_bad_pmd_table, (unsigned long)empty_bad_page_table); - memset((void *)empty_bad_page_table, 0, sizeof(pte_t) * PTRS_PER_PTE); max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; low = max_low_pfn; diff --git a/arch/mips64/mm/umap.c b/arch/mips64/mm/umap.c index 8690d9961..ba018c599 100644 --- a/arch/mips64/mm/umap.c +++ b/arch/mips64/mm/umap.c @@ -90,7 +90,7 @@ remove_mapping (struct task_struct *task, unsigned long start, unsigned long end unsigned long beg = start; pgd_t *dir; - down (&task->mm->mmap_sem); + down_write (&task->mm->mmap_sem); dir = pgd_offset (task->mm, start); flush_cache_range (task->mm, beg, end); while (start < end){ @@ -99,7 +99,7 @@ remove_mapping (struct task_struct *task, unsigned long start, unsigned long end dir++; } flush_tlb_range (task->mm, beg, end); - up (&task->mm->mmap_sem); + up_write (&task->mm->mmap_sem); } EXPORT_SYMBOL(remove_mapping); diff --git a/arch/mips64/sgi-ip27/ip27-memory.c b/arch/mips64/sgi-ip27/ip27-memory.c index 0e469ce4b..62749a773 100644 --- a/arch/mips64/sgi-ip27/ip27-memory.c +++ b/arch/mips64/sgi-ip27/ip27-memory.c @@ -234,8 +234,6 @@ void __init paging_init(void) pgd_init((unsigned long)swapper_pg_dir); pmd_init((unsigned long)invalid_pmd_table, (unsigned long)invalid_pte_table); memset((void *)invalid_pte_table, 0, sizeof(pte_t) * PTRS_PER_PTE); - pmd_init((unsigned long)empty_bad_pmd_table, (unsigned long)empty_bad_page_table); - memset((void *)empty_bad_page_table, 0, sizeof(pte_t) * PTRS_PER_PTE); for (node = 0; node < numnodes; node++) { pfn_t start_pfn = slot_getbasepfn(node, 0); |