diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-02-04 07:40:19 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-02-04 07:40:19 +0000 |
commit | 33263fc5f9ac8e8cb2b22d06af3ce5ac1dd815e4 (patch) | |
tree | 2d1b86a40bef0958a68cf1a2eafbeb0667a70543 /arch/m68k | |
parent | 216f5f51aa02f8b113aa620ebc14a9631a217a00 (diff) |
Merge with Linux 2.3.32.
Diffstat (limited to 'arch/m68k')
-rw-r--r-- | arch/m68k/atari/stram.c | 17 | ||||
-rw-r--r-- | arch/m68k/config.in | 1 | ||||
-rw-r--r-- | arch/m68k/kernel/signal.c | 1 | ||||
-rw-r--r-- | arch/m68k/kernel/sun3-head.S | 1 | ||||
-rw-r--r-- | arch/m68k/kernel/sys_m68k.c | 82 | ||||
-rw-r--r-- | arch/m68k/mac/iop.c | 10 | ||||
-rw-r--r-- | arch/m68k/mac/macints.c | 1 | ||||
-rw-r--r-- | arch/m68k/mac/psc.c | 1 | ||||
-rw-r--r-- | arch/m68k/math-emu/fp_entry.S | 1 | ||||
-rw-r--r-- | arch/m68k/math-emu/fp_util.S | 1 | ||||
-rw-r--r-- | arch/m68k/mm/kmap.c | 2 | ||||
-rw-r--r-- | arch/m68k/sun3/prom/console.c | 1 | ||||
-rw-r--r-- | arch/m68k/sun3/prom/misc.c | 1 | ||||
-rw-r--r-- | arch/m68k/sun3/sun3ints.c | 1 |
14 files changed, 105 insertions, 16 deletions
diff --git a/arch/m68k/atari/stram.c b/arch/m68k/atari/stram.c index eabc6bc9c..471e9a85f 100644 --- a/arch/m68k/atari/stram.c +++ b/arch/m68k/atari/stram.c @@ -649,6 +649,7 @@ static int __init swap_init(unsigned long start_mem, unsigned long swap_data) /* now swapping to this device ok */ p->pages = j + k; + swap_list_lock(); nr_swap_pages += j; p->flags = SWP_WRITEOK; @@ -666,6 +667,7 @@ static int __init swap_init(unsigned long start_mem, unsigned long swap_data) } else { swap_info[prev].next = p - swap_info; } + swap_list_unlock(); printk( KERN_INFO "Using %dk (%d pages) of ST-RAM as swap space.\n", p->pages << 2, p->pages ); @@ -924,6 +926,9 @@ static int unswap_by_read(unsigned short *map, unsigned long max, DPRINTK("unswap: map[i=%lu]=%u nr_swap=%u\n", i, map[i], nr_swap_pages); + swap_device_lock(stram_swap_info); + map[i]++; + swap_device_unlock(stram_swap_info); /* Get a page for the entry, using the existing swap cache page if there is one. Otherwise, get a clean page and read the swap into it. */ @@ -945,18 +950,24 @@ static int unswap_by_read(unsigned short *map, unsigned long max, stat_swap_force++; #endif } - else if (map[i]) + else { + swap_free(entry); return -ENOMEM; + } } DPRINTK( "unswap: map[i=%lu]=%u nr_swap=%u\n", i, map[i], nr_swap_pages ); + swap_list_lock(); + swap_device_lock(stram_swap_info); map[i] = SWAP_MAP_BAD; if (stram_swap_info->lowest_bit == i) stram_swap_info->lowest_bit++; if (stram_swap_info->highest_bit == i) stram_swap_info->highest_bit--; --nr_swap_pages; + swap_device_unlock(stram_swap_info); + swap_list_unlock(); } return 0; @@ -1022,6 +1033,8 @@ static void free_stram_region( unsigned long offset, unsigned long n_pages ) return; } + swap_list_lock(); + swap_device_lock(stram_swap_info); /* un-reserve the freed pages */ for( ; n_pages > 0; ++offset, --n_pages ) { if (map[offset] != SWAP_MAP_BAD) @@ -1038,6 +1051,8 @@ static void free_stram_region( unsigned long offset, unsigned long n_pages ) if (stram_swap_info->prio > swap_info[swap_list.next].prio) swap_list.next = swap_list.head; nr_swap_pages += n_pages; + swap_device_unlock(stram_swap_info); + swap_list_unlock(); } diff --git a/arch/m68k/config.in b/arch/m68k/config.in index 4888b4b48..2d6095694 100644 --- a/arch/m68k/config.in +++ b/arch/m68k/config.in @@ -124,6 +124,7 @@ if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then fi fi +source drivers/pci/Config.in endmenu diff --git a/arch/m68k/kernel/signal.c b/arch/m68k/kernel/signal.c index f35dd94c5..81014d9c8 100644 --- a/arch/m68k/kernel/signal.c +++ b/arch/m68k/kernel/signal.c @@ -1093,6 +1093,7 @@ asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs) case SIGQUIT: case SIGILL: case SIGTRAP: case SIGIOT: case SIGFPE: case SIGSEGV: + case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ: if (do_coredump(signr, regs)) exit_code |= 0x80; /* FALLTHRU */ diff --git a/arch/m68k/kernel/sun3-head.S b/arch/m68k/kernel/sun3-head.S index fa17d83a9..66834855d 100644 --- a/arch/m68k/kernel/sun3-head.S +++ b/arch/m68k/kernel/sun3-head.S @@ -1,4 +1,3 @@ -#include <linux/config.h> #include <linux/linkage.h> #include <asm/page.h> diff --git a/arch/m68k/kernel/sys_m68k.c b/arch/m68k/kernel/sys_m68k.c index a85da4e10..1387f594b 100644 --- a/arch/m68k/kernel/sys_m68k.c +++ b/arch/m68k/kernel/sys_m68k.c @@ -44,6 +44,43 @@ asmlinkage int sys_pipe(unsigned long * fildes) return error; } +/* common code for old and new mmaps */ +static inline long do_mmap2( + unsigned long addr, unsigned long len, + unsigned long prot, unsigned long flags, + unsigned long fd, unsigned long pgoff) +{ + int error = -EBADF; + struct file * file = NULL; + + flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); + if (!(flags & MAP_ANONYMOUS)) { + file = fget(fd); + if (!file) + goto out; + } + + down(¤t->mm->mmap_sem); + lock_kernel(); + + error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); + + unlock_kernel(); + up(¤t->mm->mmap_sem); + + if (file) + fput(file); +out: + return error; +} + +asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, + unsigned long prot, unsigned long flags, + unsigned long fd, unsigned long pgoff) +{ + return do_mmap2(addr, len, prot, flags, fd, pgoff); +} + /* * Perform the select(nd, in, out, ex, tv) and mmap() system * calls. Linux/m68k cloned Linux/i386, which didn't use to be able to @@ -62,13 +99,49 @@ struct mmap_arg_struct { asmlinkage int old_mmap(struct mmap_arg_struct *arg) { - int error; - struct file * file = NULL; struct mmap_arg_struct a; + int error = -EFAULT; + + if (copy_from_user(&a, arg, sizeof(a))) + goto out; + + error = -EINVAL; + if (a.offset & ~PAGE_MASK) + goto out; + + a.flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); + + error = do_mmap2(file, a.addr, a.len, a.prot, a.flags, a.offset >> PAGE_SHIFT); +out: + return error; +} + +struct mmap_arg_struct64 { + __u32 addr; + __u32 len; + __u32 prot; + __u32 flags; + __u64 offset; /* 64 bits */ + __u32 fd; +}; + +asmlinkage long sys_mmap64(struct mmap_arg_struct64 *arg) +{ + int error = -EFAULT; + struct file * file = NULL; + struct mmap_arg_struct64 a; + unsigned long pgoff; if (copy_from_user(&a, arg, sizeof(a))) return -EFAULT; + if ((long)a.offset & ~PAGE_MASK) + return -EINVAL; + + pgoff = a.offset >> PAGE_SHIFT; + if ((a.offset >> PAGE_SHIFT) != pgoff) + return -EINVAL; + down(¤t->mm->mmap_sem); lock_kernel(); if (!(a.flags & MAP_ANONYMOUS)) { @@ -79,7 +152,7 @@ asmlinkage int old_mmap(struct mmap_arg_struct *arg) } a.flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); - error = do_mmap(file, a.addr, a.len, a.prot, a.flags, a.offset); + error = do_mmap_pgoff(file, a.addr, a.len, a.prot, a.flags, pgoff); if (file) fput(file); out: @@ -88,7 +161,6 @@ out: return error; } - extern asmlinkage int sys_select(int, fd_set *, fd_set *, fd_set *, struct timeval *); struct sel_arg_struct { @@ -103,7 +175,7 @@ asmlinkage int old_select(struct sel_arg_struct *arg) if (copy_from_user(&a, arg, sizeof(a))) return -EFAULT; - /* sys_select() does the appropriate kernel locking */ + /* sys_select() does the appropriate kernel locking */ return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp); } diff --git a/arch/m68k/mac/iop.c b/arch/m68k/mac/iop.c index 26a0518db..21969ce6f 100644 --- a/arch/m68k/mac/iop.c +++ b/arch/m68k/mac/iop.c @@ -51,6 +51,9 @@ * IOP hasn't died. * o Some of the IOP manager routines need better error checking and * return codes. Nothing major, just prettying up. + * + * + share the stuff you were smoking when you wrote the iop_get_proc_info() + * for case when CONFIG_PROC_FS is undefined. */ /* @@ -125,9 +128,10 @@ int iop_scc_present,iop_ism_present; #ifdef CONFIG_PROC_FS -static int iop_get_proc_info(char *, char **, off_t, int, int); +static int iop_get_proc_info(char *, char **, off_t, int); #else -static int iop_get_proc_info(char *, char **, off_t, int, int) {} +/* What the bloody hell is THAT ??? */ +static int iop_get_proc_info(char *, char **, off_t, int) {} #endif /* CONFIG_PROC_FS */ /* structure for tracking channel listeners */ @@ -670,7 +674,7 @@ int iop_dump_one_iop(char *buf, int iop_num, char *iop_name) return len; } -int iop_get_proc_info(char *buf, char **start, off_t pos, int count, int wr) +static int iop_get_proc_info(char *buf, char **start, off_t pos, int count) { int len, cnt; diff --git a/arch/m68k/mac/macints.c b/arch/m68k/mac/macints.c index 0068effa5..a795d82ed 100644 --- a/arch/m68k/mac/macints.c +++ b/arch/m68k/mac/macints.c @@ -115,7 +115,6 @@ * the SCC ourselves and only call the handler for the appopriate channel. */ -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/arch/m68k/mac/psc.c b/arch/m68k/mac/psc.c index 122659555..45825b113 100644 --- a/arch/m68k/mac/psc.c +++ b/arch/m68k/mac/psc.c @@ -13,7 +13,6 @@ * they aren't actually interrupt lines but data lines (to the DSP?) */ -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/mm.h> diff --git a/arch/m68k/math-emu/fp_entry.S b/arch/m68k/math-emu/fp_entry.S index f2e699c8c..55088e8e8 100644 --- a/arch/m68k/math-emu/fp_entry.S +++ b/arch/m68k/math-emu/fp_entry.S @@ -35,6 +35,7 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <linux/config.h> #include <linux/linkage.h> #include <asm/entry.h> diff --git a/arch/m68k/math-emu/fp_util.S b/arch/m68k/math-emu/fp_util.S index 7356a4a55..a909d813b 100644 --- a/arch/m68k/math-emu/fp_util.S +++ b/arch/m68k/math-emu/fp_util.S @@ -35,6 +35,7 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include <linux/config.h> #include "fp_emu.h" /* diff --git a/arch/m68k/mm/kmap.c b/arch/m68k/mm/kmap.c index 60912a5b7..86041c373 100644 --- a/arch/m68k/mm/kmap.c +++ b/arch/m68k/mm/kmap.c @@ -39,7 +39,7 @@ static inline struct vm_struct *get_io_area(unsigned long size) { - return get_vm_area(size); + return get_vm_area(size, VM_IOREMAP); } diff --git a/arch/m68k/sun3/prom/console.c b/arch/m68k/sun3/prom/console.c index cf5cdc24e..5ec12de10 100644 --- a/arch/m68k/sun3/prom/console.c +++ b/arch/m68k/sun3/prom/console.c @@ -5,7 +5,6 @@ * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) */ -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/arch/m68k/sun3/prom/misc.c b/arch/m68k/sun3/prom/misc.c index 97036f37d..1d19e8d49 100644 --- a/arch/m68k/sun3/prom/misc.c +++ b/arch/m68k/sun3/prom/misc.c @@ -5,7 +5,6 @@ * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu) */ -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/sched.h> diff --git a/arch/m68k/sun3/sun3ints.c b/arch/m68k/sun3/sun3ints.c index 687b51556..99f57b65f 100644 --- a/arch/m68k/sun3/sun3ints.c +++ b/arch/m68k/sun3/sun3ints.c @@ -6,7 +6,6 @@ * for more details. */ -#include <linux/config.h> #include <linux/types.h> #include <linux/kernel.h> #include <linux/sched.h> |