diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /arch/score/kernel | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'arch/score/kernel')
-rw-r--r-- | arch/score/kernel/setup.c | 1 | ||||
-rw-r--r-- | arch/score/kernel/sys_score.c | 29 |
2 files changed, 7 insertions, 23 deletions
diff --git a/arch/score/kernel/setup.c b/arch/score/kernel/setup.c index 6a2503c75c4e..6f898c057878 100644 --- a/arch/score/kernel/setup.c +++ b/arch/score/kernel/setup.c | |||
@@ -49,6 +49,7 @@ static void __init bootmem_init(void) | |||
49 | 49 | ||
50 | min_low_pfn = PFN_UP(MEMORY_START); | 50 | min_low_pfn = PFN_UP(MEMORY_START); |
51 | max_low_pfn = PFN_UP(MEMORY_START + MEMORY_SIZE); | 51 | max_low_pfn = PFN_UP(MEMORY_START + MEMORY_SIZE); |
52 | max_mapnr = max_low_pfn - min_low_pfn; | ||
52 | 53 | ||
53 | /* Initialize the boot-time allocator with low memory only. */ | 54 | /* Initialize the boot-time allocator with low memory only. */ |
54 | bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn, | 55 | bootmap_size = init_bootmem_node(NODE_DATA(0), start_pfn, |
diff --git a/arch/score/kernel/sys_score.c b/arch/score/kernel/sys_score.c index 001249469866..651096ff8db4 100644 --- a/arch/score/kernel/sys_score.c +++ b/arch/score/kernel/sys_score.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/mm.h> | 28 | #include <linux/mm.h> |
29 | #include <linux/mman.h> | 29 | #include <linux/mman.h> |
30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
31 | #include <linux/slab.h> | ||
31 | #include <linux/unistd.h> | 32 | #include <linux/unistd.h> |
32 | #include <linux/syscalls.h> | 33 | #include <linux/syscalls.h> |
33 | #include <asm/syscalls.h> | 34 | #include <asm/syscalls.h> |
@@ -36,34 +37,16 @@ asmlinkage long | |||
36 | sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, | 37 | sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, |
37 | unsigned long flags, unsigned long fd, unsigned long pgoff) | 38 | unsigned long flags, unsigned long fd, unsigned long pgoff) |
38 | { | 39 | { |
39 | int error = -EBADF; | 40 | return sys_mmap_pgoff(addr, len, prot, flags, fd, pgoff); |
40 | struct file *file = NULL; | ||
41 | |||
42 | if (pgoff & (~PAGE_MASK >> 12)) | ||
43 | return -EINVAL; | ||
44 | |||
45 | flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); | ||
46 | if (!(flags & MAP_ANONYMOUS)) { | ||
47 | file = fget(fd); | ||
48 | if (!file) | ||
49 | return error; | ||
50 | } | ||
51 | |||
52 | down_write(¤t->mm->mmap_sem); | ||
53 | error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); | ||
54 | up_write(¤t->mm->mmap_sem); | ||
55 | |||
56 | if (file) | ||
57 | fput(file); | ||
58 | |||
59 | return error; | ||
60 | } | 41 | } |
61 | 42 | ||
62 | asmlinkage long | 43 | asmlinkage long |
63 | sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, | 44 | sys_mmap(unsigned long addr, unsigned long len, unsigned long prot, |
64 | unsigned long flags, unsigned long fd, off_t pgoff) | 45 | unsigned long flags, unsigned long fd, off_t offset) |
65 | { | 46 | { |
66 | return sys_mmap2(addr, len, prot, flags, fd, pgoff >> PAGE_SHIFT); | 47 | if (unlikely(offset & ~PAGE_MASK)) |
48 | return -EINVAL; | ||
49 | return sys_mmap_pgoff(addr, len, prot, flags, fd, offset >> PAGE_SHIFT); | ||
67 | } | 50 | } |
68 | 51 | ||
69 | asmlinkage long | 52 | asmlinkage long |