diff options
Diffstat (limited to 'arch/h8300')
-rw-r--r-- | arch/h8300/Kconfig | 4 | ||||
-rw-r--r-- | arch/h8300/include/asm/asm-offsets.h | 1 | ||||
-rw-r--r-- | arch/h8300/include/asm/cacheflush.h | 1 | ||||
-rw-r--r-- | arch/h8300/include/asm/elf.h | 1 | ||||
-rw-r--r-- | arch/h8300/include/asm/io.h | 2 | ||||
-rw-r--r-- | arch/h8300/include/asm/module.h | 2 | ||||
-rw-r--r-- | arch/h8300/include/asm/ptrace.h | 2 | ||||
-rw-r--r-- | arch/h8300/include/asm/socket.h | 2 | ||||
-rw-r--r-- | arch/h8300/include/asm/unistd.h | 3 | ||||
-rw-r--r-- | arch/h8300/kernel/irq.c | 4 | ||||
-rw-r--r-- | arch/h8300/kernel/process.c | 7 | ||||
-rw-r--r-- | arch/h8300/kernel/ptrace.c | 82 | ||||
-rw-r--r-- | arch/h8300/kernel/sys_h8300.c | 217 | ||||
-rw-r--r-- | arch/h8300/kernel/syscalls.S | 6 | ||||
-rw-r--r-- | arch/h8300/kernel/vmlinux.lds.S | 1 | ||||
-rw-r--r-- | arch/h8300/mm/init.c | 2 | ||||
-rw-r--r-- | arch/h8300/mm/kmap.c | 1 | ||||
-rw-r--r-- | arch/h8300/mm/memory.c | 5 | ||||
-rw-r--r-- | arch/h8300/platform/h8300h/ptrace_h8300h.c | 6 | ||||
-rw-r--r-- | arch/h8300/platform/h8s/ptrace_h8s.c | 4 |
20 files changed, 36 insertions, 317 deletions
diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig index 9420648352b8..53cc669e6d59 100644 --- a/arch/h8300/Kconfig +++ b/arch/h8300/Kconfig | |||
@@ -10,6 +10,10 @@ config H8300 | |||
10 | default y | 10 | default y |
11 | select HAVE_IDE | 11 | select HAVE_IDE |
12 | 12 | ||
13 | config SYMBOL_PREFIX | ||
14 | string | ||
15 | default "_" | ||
16 | |||
13 | config MMU | 17 | config MMU |
14 | bool | 18 | bool |
15 | default n | 19 | default n |
diff --git a/arch/h8300/include/asm/asm-offsets.h b/arch/h8300/include/asm/asm-offsets.h new file mode 100644 index 000000000000..d370ee36a182 --- /dev/null +++ b/arch/h8300/include/asm/asm-offsets.h | |||
@@ -0,0 +1 @@ | |||
#include <generated/asm-offsets.h> | |||
diff --git a/arch/h8300/include/asm/cacheflush.h b/arch/h8300/include/asm/cacheflush.h index 5ffdca217b95..4cf2df20c1ce 100644 --- a/arch/h8300/include/asm/cacheflush.h +++ b/arch/h8300/include/asm/cacheflush.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #define flush_cache_dup_mm(mm) do { } while (0) | 15 | #define flush_cache_dup_mm(mm) do { } while (0) |
16 | #define flush_cache_range(vma,a,b) | 16 | #define flush_cache_range(vma,a,b) |
17 | #define flush_cache_page(vma,p,pfn) | 17 | #define flush_cache_page(vma,p,pfn) |
18 | #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0 | ||
18 | #define flush_dcache_page(page) | 19 | #define flush_dcache_page(page) |
19 | #define flush_dcache_mmap_lock(mapping) | 20 | #define flush_dcache_mmap_lock(mapping) |
20 | #define flush_dcache_mmap_unlock(mapping) | 21 | #define flush_dcache_mmap_unlock(mapping) |
diff --git a/arch/h8300/include/asm/elf.h b/arch/h8300/include/asm/elf.h index 94e2284c8816..c24fa250d653 100644 --- a/arch/h8300/include/asm/elf.h +++ b/arch/h8300/include/asm/elf.h | |||
@@ -34,7 +34,6 @@ typedef unsigned long elf_fpregset_t; | |||
34 | 34 | ||
35 | #define ELF_PLAT_INIT(_r) _r->er1 = 0 | 35 | #define ELF_PLAT_INIT(_r) _r->er1 = 0 |
36 | 36 | ||
37 | #define USE_ELF_CORE_DUMP | ||
38 | #define ELF_EXEC_PAGESIZE 4096 | 37 | #define ELF_EXEC_PAGESIZE 4096 |
39 | 38 | ||
40 | /* This is the location that an ET_DYN program is loaded if exec'ed. Typical | 39 | /* This is the location that an ET_DYN program is loaded if exec'ed. Typical |
diff --git a/arch/h8300/include/asm/io.h b/arch/h8300/include/asm/io.h index 33e842f3284b..c1a8df22080f 100644 --- a/arch/h8300/include/asm/io.h +++ b/arch/h8300/include/asm/io.h | |||
@@ -25,7 +25,7 @@ | |||
25 | * memory location directly. | 25 | * memory location directly. |
26 | */ | 26 | */ |
27 | /* ++roman: The assignments to temp. vars avoid that gcc sometimes generates | 27 | /* ++roman: The assignments to temp. vars avoid that gcc sometimes generates |
28 | * two accesses to memory, which may be undesireable for some devices. | 28 | * two accesses to memory, which may be undesirable for some devices. |
29 | */ | 29 | */ |
30 | 30 | ||
31 | /* | 31 | /* |
diff --git a/arch/h8300/include/asm/module.h b/arch/h8300/include/asm/module.h index de23231f3196..8e46724b7c09 100644 --- a/arch/h8300/include/asm/module.h +++ b/arch/h8300/include/asm/module.h | |||
@@ -8,6 +8,4 @@ struct mod_arch_specific { }; | |||
8 | #define Elf_Sym Elf32_Sym | 8 | #define Elf_Sym Elf32_Sym |
9 | #define Elf_Ehdr Elf32_Ehdr | 9 | #define Elf_Ehdr Elf32_Ehdr |
10 | 10 | ||
11 | #define MODULE_SYMBOL_PREFIX "_" | ||
12 | |||
13 | #endif /* _ASM_H8/300_MODULE_H */ | 11 | #endif /* _ASM_H8/300_MODULE_H */ |
diff --git a/arch/h8300/include/asm/ptrace.h b/arch/h8300/include/asm/ptrace.h index c2e05e4b512e..d866c0efba87 100644 --- a/arch/h8300/include/asm/ptrace.h +++ b/arch/h8300/include/asm/ptrace.h | |||
@@ -55,6 +55,8 @@ struct pt_regs { | |||
55 | /* Find the stack offset for a register, relative to thread.esp0. */ | 55 | /* Find the stack offset for a register, relative to thread.esp0. */ |
56 | #define PT_REG(reg) ((long)&((struct pt_regs *)0)->reg) | 56 | #define PT_REG(reg) ((long)&((struct pt_regs *)0)->reg) |
57 | 57 | ||
58 | #define arch_has_single_step() (1) | ||
59 | |||
58 | #define user_mode(regs) (!((regs)->ccr & PS_S)) | 60 | #define user_mode(regs) (!((regs)->ccr & PS_S)) |
59 | #define instruction_pointer(regs) ((regs)->pc) | 61 | #define instruction_pointer(regs) ((regs)->pc) |
60 | #define profile_pc(regs) instruction_pointer(regs) | 62 | #define profile_pc(regs) instruction_pointer(regs) |
diff --git a/arch/h8300/include/asm/socket.h b/arch/h8300/include/asm/socket.h index 1547f01c8e22..04c0f4596eb5 100644 --- a/arch/h8300/include/asm/socket.h +++ b/arch/h8300/include/asm/socket.h | |||
@@ -60,4 +60,6 @@ | |||
60 | #define SO_PROTOCOL 38 | 60 | #define SO_PROTOCOL 38 |
61 | #define SO_DOMAIN 39 | 61 | #define SO_DOMAIN 39 |
62 | 62 | ||
63 | #define SO_RXQ_OVFL 40 | ||
64 | |||
63 | #endif /* _ASM_SOCKET_H */ | 65 | #endif /* _ASM_SOCKET_H */ |
diff --git a/arch/h8300/include/asm/unistd.h b/arch/h8300/include/asm/unistd.h index 99f3c3561ecb..50f2c5a36591 100644 --- a/arch/h8300/include/asm/unistd.h +++ b/arch/h8300/include/asm/unistd.h | |||
@@ -336,6 +336,7 @@ | |||
336 | #define __ARCH_WANT_STAT64 | 336 | #define __ARCH_WANT_STAT64 |
337 | #define __ARCH_WANT_SYS_ALARM | 337 | #define __ARCH_WANT_SYS_ALARM |
338 | #define __ARCH_WANT_SYS_GETHOSTNAME | 338 | #define __ARCH_WANT_SYS_GETHOSTNAME |
339 | #define __ARCH_WANT_SYS_IPC | ||
339 | #define __ARCH_WANT_SYS_PAUSE | 340 | #define __ARCH_WANT_SYS_PAUSE |
340 | #define __ARCH_WANT_SYS_SGETMASK | 341 | #define __ARCH_WANT_SYS_SGETMASK |
341 | #define __ARCH_WANT_SYS_SIGNAL | 342 | #define __ARCH_WANT_SYS_SIGNAL |
@@ -348,6 +349,8 @@ | |||
348 | #define __ARCH_WANT_SYS_LLSEEK | 349 | #define __ARCH_WANT_SYS_LLSEEK |
349 | #define __ARCH_WANT_SYS_NICE | 350 | #define __ARCH_WANT_SYS_NICE |
350 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT | 351 | #define __ARCH_WANT_SYS_OLD_GETRLIMIT |
352 | #define __ARCH_WANT_SYS_OLD_MMAP | ||
353 | #define __ARCH_WANT_SYS_OLD_SELECT | ||
351 | #define __ARCH_WANT_SYS_OLDUMOUNT | 354 | #define __ARCH_WANT_SYS_OLDUMOUNT |
352 | #define __ARCH_WANT_SYS_SIGPENDING | 355 | #define __ARCH_WANT_SYS_SIGPENDING |
353 | #define __ARCH_WANT_SYS_SIGPROCMASK | 356 | #define __ARCH_WANT_SYS_SIGPROCMASK |
diff --git a/arch/h8300/kernel/irq.c b/arch/h8300/kernel/irq.c index 5c913d472119..c25dc2c2b1da 100644 --- a/arch/h8300/kernel/irq.c +++ b/arch/h8300/kernel/irq.c | |||
@@ -186,7 +186,7 @@ int show_interrupts(struct seq_file *p, void *v) | |||
186 | seq_puts(p, " CPU0"); | 186 | seq_puts(p, " CPU0"); |
187 | 187 | ||
188 | if (i < NR_IRQS) { | 188 | if (i < NR_IRQS) { |
189 | spin_lock_irqsave(&irq_desc[i].lock, flags); | 189 | raw_spin_lock_irqsave(&irq_desc[i].lock, flags); |
190 | action = irq_desc[i].action; | 190 | action = irq_desc[i].action; |
191 | if (!action) | 191 | if (!action) |
192 | goto unlock; | 192 | goto unlock; |
@@ -200,7 +200,7 @@ int show_interrupts(struct seq_file *p, void *v) | |||
200 | seq_printf(p, ", %s", action->name); | 200 | seq_printf(p, ", %s", action->name); |
201 | seq_putc(p, '\n'); | 201 | seq_putc(p, '\n'); |
202 | unlock: | 202 | unlock: |
203 | spin_unlock_irqrestore(&irq_desc[i].lock, flags); | 203 | raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags); |
204 | } | 204 | } |
205 | return 0; | 205 | return 0; |
206 | } | 206 | } |
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c index e2f33d0f9969..8c8b0ffa6ad7 100644 --- a/arch/h8300/kernel/process.c +++ b/arch/h8300/kernel/process.c | |||
@@ -32,11 +32,11 @@ | |||
32 | #include <linux/stddef.h> | 32 | #include <linux/stddef.h> |
33 | #include <linux/unistd.h> | 33 | #include <linux/unistd.h> |
34 | #include <linux/ptrace.h> | 34 | #include <linux/ptrace.h> |
35 | #include <linux/slab.h> | ||
36 | #include <linux/user.h> | 35 | #include <linux/user.h> |
37 | #include <linux/interrupt.h> | 36 | #include <linux/interrupt.h> |
38 | #include <linux/reboot.h> | 37 | #include <linux/reboot.h> |
39 | #include <linux/fs.h> | 38 | #include <linux/fs.h> |
39 | #include <linux/slab.h> | ||
40 | 40 | ||
41 | #include <asm/uaccess.h> | 41 | #include <asm/uaccess.h> |
42 | #include <asm/system.h> | 42 | #include <asm/system.h> |
@@ -218,15 +218,12 @@ asmlinkage int sys_execve(char *name, char **argv, char **envp,int dummy,...) | |||
218 | char * filename; | 218 | char * filename; |
219 | struct pt_regs *regs = (struct pt_regs *) ((unsigned char *)&dummy-4); | 219 | struct pt_regs *regs = (struct pt_regs *) ((unsigned char *)&dummy-4); |
220 | 220 | ||
221 | lock_kernel(); | ||
222 | filename = getname(name); | 221 | filename = getname(name); |
223 | error = PTR_ERR(filename); | 222 | error = PTR_ERR(filename); |
224 | if (IS_ERR(filename)) | 223 | if (IS_ERR(filename)) |
225 | goto out; | 224 | return error; |
226 | error = do_execve(filename, argv, envp, regs); | 225 | error = do_execve(filename, argv, envp, regs); |
227 | putname(filename); | 226 | putname(filename); |
228 | out: | ||
229 | unlock_kernel(); | ||
230 | return error; | 227 | return error; |
231 | } | 228 | } |
232 | 229 | ||
diff --git a/arch/h8300/kernel/ptrace.c b/arch/h8300/kernel/ptrace.c index d32bbf02fc48..df114122ebdf 100644 --- a/arch/h8300/kernel/ptrace.c +++ b/arch/h8300/kernel/ptrace.c | |||
@@ -34,25 +34,20 @@ | |||
34 | /* cpu depend functions */ | 34 | /* cpu depend functions */ |
35 | extern long h8300_get_reg(struct task_struct *task, int regno); | 35 | extern long h8300_get_reg(struct task_struct *task, int regno); |
36 | extern int h8300_put_reg(struct task_struct *task, int regno, unsigned long data); | 36 | extern int h8300_put_reg(struct task_struct *task, int regno, unsigned long data); |
37 | extern void h8300_disable_trace(struct task_struct *child); | 37 | |
38 | extern void h8300_enable_trace(struct task_struct *child); | 38 | |
39 | void user_disable_single_step(struct task_struct *child) | ||
40 | { | ||
41 | } | ||
39 | 42 | ||
40 | /* | 43 | /* |
41 | * does not yet catch signals sent when the child dies. | 44 | * does not yet catch signals sent when the child dies. |
42 | * in exit.c or in signal.c. | 45 | * in exit.c or in signal.c. |
43 | */ | 46 | */ |
44 | 47 | ||
45 | inline | ||
46 | static int read_long(struct task_struct * tsk, unsigned long addr, | ||
47 | unsigned long * result) | ||
48 | { | ||
49 | *result = *(unsigned long *)addr; | ||
50 | return 0; | ||
51 | } | ||
52 | |||
53 | void ptrace_disable(struct task_struct *child) | 48 | void ptrace_disable(struct task_struct *child) |
54 | { | 49 | { |
55 | h8300_disable_trace(child); | 50 | user_disable_single_step(child); |
56 | } | 51 | } |
57 | 52 | ||
58 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) | 53 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) |
@@ -60,17 +55,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
60 | int ret; | 55 | int ret; |
61 | 56 | ||
62 | switch (request) { | 57 | switch (request) { |
63 | case PTRACE_PEEKTEXT: /* read word at location addr. */ | ||
64 | case PTRACE_PEEKDATA: { | ||
65 | unsigned long tmp; | ||
66 | |||
67 | ret = read_long(child, addr, &tmp); | ||
68 | if (ret < 0) | ||
69 | break ; | ||
70 | ret = put_user(tmp, (unsigned long *) data); | ||
71 | break ; | ||
72 | } | ||
73 | |||
74 | /* read the word at location addr in the USER area. */ | 58 | /* read the word at location addr in the USER area. */ |
75 | case PTRACE_PEEKUSR: { | 59 | case PTRACE_PEEKUSR: { |
76 | unsigned long tmp = 0; | 60 | unsigned long tmp = 0; |
@@ -109,11 +93,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
109 | } | 93 | } |
110 | 94 | ||
111 | /* when I and D space are separate, this will have to be fixed. */ | 95 | /* when I and D space are separate, this will have to be fixed. */ |
112 | case PTRACE_POKETEXT: /* write the word at location addr. */ | ||
113 | case PTRACE_POKEDATA: | ||
114 | ret = generic_ptrace_pokedata(child, addr, data); | ||
115 | break; | ||
116 | |||
117 | case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ | 96 | case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ |
118 | if ((addr & 3) || addr < 0 || addr >= sizeof(struct user)) { | 97 | if ((addr & 3) || addr < 0 || addr >= sizeof(struct user)) { |
119 | ret = -EIO; | 98 | ret = -EIO; |
@@ -131,53 +110,6 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
131 | } | 110 | } |
132 | ret = -EIO; | 111 | ret = -EIO; |
133 | break ; | 112 | break ; |
134 | case PTRACE_SYSCALL: /* continue and stop at next (return from) syscall */ | ||
135 | case PTRACE_CONT: { /* restart after signal. */ | ||
136 | ret = -EIO; | ||
137 | if (!valid_signal(data)) | ||
138 | break ; | ||
139 | if (request == PTRACE_SYSCALL) | ||
140 | set_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
141 | else | ||
142 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
143 | child->exit_code = data; | ||
144 | wake_up_process(child); | ||
145 | /* make sure the single step bit is not set. */ | ||
146 | h8300_disable_trace(child); | ||
147 | ret = 0; | ||
148 | } | ||
149 | |||
150 | /* | ||
151 | * make the child exit. Best I can do is send it a sigkill. | ||
152 | * perhaps it should be put in the status that it wants to | ||
153 | * exit. | ||
154 | */ | ||
155 | case PTRACE_KILL: { | ||
156 | |||
157 | ret = 0; | ||
158 | if (child->exit_state == EXIT_ZOMBIE) /* already dead */ | ||
159 | break; | ||
160 | child->exit_code = SIGKILL; | ||
161 | h8300_disable_trace(child); | ||
162 | wake_up_process(child); | ||
163 | break; | ||
164 | } | ||
165 | |||
166 | case PTRACE_SINGLESTEP: { /* set the trap flag. */ | ||
167 | ret = -EIO; | ||
168 | if (!valid_signal(data)) | ||
169 | break; | ||
170 | clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE); | ||
171 | child->exit_code = data; | ||
172 | h8300_enable_trace(child); | ||
173 | wake_up_process(child); | ||
174 | ret = 0; | ||
175 | break; | ||
176 | } | ||
177 | |||
178 | case PTRACE_DETACH: /* detach a process that was attached. */ | ||
179 | ret = ptrace_detach(child, data); | ||
180 | break; | ||
181 | 113 | ||
182 | case PTRACE_GETREGS: { /* Get all gp regs from the child. */ | 114 | case PTRACE_GETREGS: { /* Get all gp regs from the child. */ |
183 | int i; | 115 | int i; |
@@ -210,7 +142,7 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
210 | } | 142 | } |
211 | 143 | ||
212 | default: | 144 | default: |
213 | ret = -EIO; | 145 | ret = ptrace_request(child, request, addr, data); |
214 | break; | 146 | break; |
215 | } | 147 | } |
216 | return ret; | 148 | return ret; |
diff --git a/arch/h8300/kernel/sys_h8300.c b/arch/h8300/kernel/sys_h8300.c index 8cb5d73a0e35..f9b3f44da69f 100644 --- a/arch/h8300/kernel/sys_h8300.c +++ b/arch/h8300/kernel/sys_h8300.c | |||
@@ -26,223 +26,6 @@ | |||
26 | #include <asm/traps.h> | 26 | #include <asm/traps.h> |
27 | #include <asm/unistd.h> | 27 | #include <asm/unistd.h> |
28 | 28 | ||
29 | /* common code for old and new mmaps */ | ||
30 | static inline long do_mmap2( | ||
31 | unsigned long addr, unsigned long len, | ||
32 | unsigned long prot, unsigned long flags, | ||
33 | unsigned long fd, unsigned long pgoff) | ||
34 | { | ||
35 | int error = -EBADF; | ||
36 | struct file * file = NULL; | ||
37 | |||
38 | flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); | ||
39 | if (!(flags & MAP_ANONYMOUS)) { | ||
40 | file = fget(fd); | ||
41 | if (!file) | ||
42 | goto out; | ||
43 | } | ||
44 | |||
45 | down_write(¤t->mm->mmap_sem); | ||
46 | error = do_mmap_pgoff(file, addr, len, prot, flags, pgoff); | ||
47 | up_write(¤t->mm->mmap_sem); | ||
48 | |||
49 | if (file) | ||
50 | fput(file); | ||
51 | out: | ||
52 | return error; | ||
53 | } | ||
54 | |||
55 | asmlinkage long sys_mmap2(unsigned long addr, unsigned long len, | ||
56 | unsigned long prot, unsigned long flags, | ||
57 | unsigned long fd, unsigned long pgoff) | ||
58 | { | ||
59 | return do_mmap2(addr, len, prot, flags, fd, pgoff); | ||
60 | } | ||
61 | |||
62 | /* | ||
63 | * Perform the select(nd, in, out, ex, tv) and mmap() system | ||
64 | * calls. Linux/m68k cloned Linux/i386, which didn't use to be able to | ||
65 | * handle more than 4 system call parameters, so these system calls | ||
66 | * used a memory block for parameter passing.. | ||
67 | */ | ||
68 | |||
69 | struct mmap_arg_struct { | ||
70 | unsigned long addr; | ||
71 | unsigned long len; | ||
72 | unsigned long prot; | ||
73 | unsigned long flags; | ||
74 | unsigned long fd; | ||
75 | unsigned long offset; | ||
76 | }; | ||
77 | |||
78 | asmlinkage int old_mmap(struct mmap_arg_struct *arg) | ||
79 | { | ||
80 | struct mmap_arg_struct a; | ||
81 | int error = -EFAULT; | ||
82 | |||
83 | if (copy_from_user(&a, arg, sizeof(a))) | ||
84 | goto out; | ||
85 | |||
86 | error = -EINVAL; | ||
87 | if (a.offset & ~PAGE_MASK) | ||
88 | goto out; | ||
89 | |||
90 | a.flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); | ||
91 | |||
92 | error = do_mmap2(a.addr, a.len, a.prot, a.flags, a.fd, a.offset >> PAGE_SHIFT); | ||
93 | out: | ||
94 | return error; | ||
95 | } | ||
96 | |||
97 | #if 0 /* DAVIDM - do we want this */ | ||
98 | struct mmap_arg_struct64 { | ||
99 | __u32 addr; | ||
100 | __u32 len; | ||
101 | __u32 prot; | ||
102 | __u32 flags; | ||
103 | __u64 offset; /* 64 bits */ | ||
104 | __u32 fd; | ||
105 | }; | ||
106 | |||
107 | asmlinkage long sys_mmap64(struct mmap_arg_struct64 *arg) | ||
108 | { | ||
109 | int error = -EFAULT; | ||
110 | struct file * file = NULL; | ||
111 | struct mmap_arg_struct64 a; | ||
112 | unsigned long pgoff; | ||
113 | |||
114 | if (copy_from_user(&a, arg, sizeof(a))) | ||
115 | return -EFAULT; | ||
116 | |||
117 | if ((long)a.offset & ~PAGE_MASK) | ||
118 | return -EINVAL; | ||
119 | |||
120 | pgoff = a.offset >> PAGE_SHIFT; | ||
121 | if ((a.offset >> PAGE_SHIFT) != pgoff) | ||
122 | return -EINVAL; | ||
123 | |||
124 | if (!(a.flags & MAP_ANONYMOUS)) { | ||
125 | error = -EBADF; | ||
126 | file = fget(a.fd); | ||
127 | if (!file) | ||
128 | goto out; | ||
129 | } | ||
130 | a.flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE); | ||
131 | |||
132 | down_write(¤t->mm->mmap_sem); | ||
133 | error = do_mmap_pgoff(file, a.addr, a.len, a.prot, a.flags, pgoff); | ||
134 | up_write(¤t->mm->mmap_sem); | ||
135 | if (file) | ||
136 | fput(file); | ||
137 | out: | ||
138 | return error; | ||
139 | } | ||
140 | #endif | ||
141 | |||
142 | struct sel_arg_struct { | ||
143 | unsigned long n; | ||
144 | fd_set *inp, *outp, *exp; | ||
145 | struct timeval *tvp; | ||
146 | }; | ||
147 | |||
148 | asmlinkage int old_select(struct sel_arg_struct *arg) | ||
149 | { | ||
150 | struct sel_arg_struct a; | ||
151 | |||
152 | if (copy_from_user(&a, arg, sizeof(a))) | ||
153 | return -EFAULT; | ||
154 | /* sys_select() does the appropriate kernel locking */ | ||
155 | return sys_select(a.n, a.inp, a.outp, a.exp, a.tvp); | ||
156 | } | ||
157 | |||
158 | /* | ||
159 | * sys_ipc() is the de-multiplexer for the SysV IPC calls.. | ||
160 | * | ||
161 | * This is really horribly ugly. | ||
162 | */ | ||
163 | asmlinkage int sys_ipc (uint call, int first, int second, | ||
164 | int third, void *ptr, long fifth) | ||
165 | { | ||
166 | int version, ret; | ||
167 | |||
168 | version = call >> 16; /* hack for backward compatibility */ | ||
169 | call &= 0xffff; | ||
170 | |||
171 | if (call <= SEMCTL) | ||
172 | switch (call) { | ||
173 | case SEMOP: | ||
174 | return sys_semop (first, (struct sembuf *)ptr, second); | ||
175 | case SEMGET: | ||
176 | return sys_semget (first, second, third); | ||
177 | case SEMCTL: { | ||
178 | union semun fourth; | ||
179 | if (!ptr) | ||
180 | return -EINVAL; | ||
181 | if (get_user(fourth.__pad, (void **) ptr)) | ||
182 | return -EFAULT; | ||
183 | return sys_semctl (first, second, third, fourth); | ||
184 | } | ||
185 | default: | ||
186 | return -EINVAL; | ||
187 | } | ||
188 | if (call <= MSGCTL) | ||
189 | switch (call) { | ||
190 | case MSGSND: | ||
191 | return sys_msgsnd (first, (struct msgbuf *) ptr, | ||
192 | second, third); | ||
193 | case MSGRCV: | ||
194 | switch (version) { | ||
195 | case 0: { | ||
196 | struct ipc_kludge tmp; | ||
197 | if (!ptr) | ||
198 | return -EINVAL; | ||
199 | if (copy_from_user (&tmp, | ||
200 | (struct ipc_kludge *)ptr, | ||
201 | sizeof (tmp))) | ||
202 | return -EFAULT; | ||
203 | return sys_msgrcv (first, tmp.msgp, second, | ||
204 | tmp.msgtyp, third); | ||
205 | } | ||
206 | default: | ||
207 | return sys_msgrcv (first, | ||
208 | (struct msgbuf *) ptr, | ||
209 | second, fifth, third); | ||
210 | } | ||
211 | case MSGGET: | ||
212 | return sys_msgget ((key_t) first, second); | ||
213 | case MSGCTL: | ||
214 | return sys_msgctl (first, second, | ||
215 | (struct msqid_ds *) ptr); | ||
216 | default: | ||
217 | return -EINVAL; | ||
218 | } | ||
219 | if (call <= SHMCTL) | ||
220 | switch (call) { | ||
221 | case SHMAT: | ||
222 | switch (version) { | ||
223 | default: { | ||
224 | ulong raddr; | ||
225 | ret = do_shmat (first, (char *) ptr, | ||
226 | second, &raddr); | ||
227 | if (ret) | ||
228 | return ret; | ||
229 | return put_user (raddr, (ulong *) third); | ||
230 | } | ||
231 | } | ||
232 | case SHMDT: | ||
233 | return sys_shmdt ((char *)ptr); | ||
234 | case SHMGET: | ||
235 | return sys_shmget (first, second, third); | ||
236 | case SHMCTL: | ||
237 | return sys_shmctl (first, second, | ||
238 | (struct shmid_ds *) ptr); | ||
239 | default: | ||
240 | return -EINVAL; | ||
241 | } | ||
242 | |||
243 | return -EINVAL; | ||
244 | } | ||
245 | |||
246 | /* sys_cacheflush -- no support. */ | 29 | /* sys_cacheflush -- no support. */ |
247 | asmlinkage int | 30 | asmlinkage int |
248 | sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len) | 31 | sys_cacheflush (unsigned long addr, int scope, int cache, unsigned long len) |
diff --git a/arch/h8300/kernel/syscalls.S b/arch/h8300/kernel/syscalls.S index 4eb67faac633..faefaff7d43d 100644 --- a/arch/h8300/kernel/syscalls.S +++ b/arch/h8300/kernel/syscalls.S | |||
@@ -96,7 +96,7 @@ SYMBOL_NAME_LABEL(sys_call_table) | |||
96 | .long SYMBOL_NAME(sys_settimeofday) | 96 | .long SYMBOL_NAME(sys_settimeofday) |
97 | .long SYMBOL_NAME(sys_getgroups16) /* 80 */ | 97 | .long SYMBOL_NAME(sys_getgroups16) /* 80 */ |
98 | .long SYMBOL_NAME(sys_setgroups16) | 98 | .long SYMBOL_NAME(sys_setgroups16) |
99 | .long SYMBOL_NAME(old_select) | 99 | .long SYMBOL_NAME(sys_old_select) |
100 | .long SYMBOL_NAME(sys_symlink) | 100 | .long SYMBOL_NAME(sys_symlink) |
101 | .long SYMBOL_NAME(sys_lstat) | 101 | .long SYMBOL_NAME(sys_lstat) |
102 | .long SYMBOL_NAME(sys_readlink) /* 85 */ | 102 | .long SYMBOL_NAME(sys_readlink) /* 85 */ |
@@ -104,7 +104,7 @@ SYMBOL_NAME_LABEL(sys_call_table) | |||
104 | .long SYMBOL_NAME(sys_swapon) | 104 | .long SYMBOL_NAME(sys_swapon) |
105 | .long SYMBOL_NAME(sys_reboot) | 105 | .long SYMBOL_NAME(sys_reboot) |
106 | .long SYMBOL_NAME(sys_old_readdir) | 106 | .long SYMBOL_NAME(sys_old_readdir) |
107 | .long SYMBOL_NAME(old_mmap) /* 90 */ | 107 | .long SYMBOL_NAME(sys_old_mmap) /* 90 */ |
108 | .long SYMBOL_NAME(sys_munmap) | 108 | .long SYMBOL_NAME(sys_munmap) |
109 | .long SYMBOL_NAME(sys_truncate) | 109 | .long SYMBOL_NAME(sys_truncate) |
110 | .long SYMBOL_NAME(sys_ftruncate) | 110 | .long SYMBOL_NAME(sys_ftruncate) |
@@ -206,7 +206,7 @@ SYMBOL_NAME_LABEL(sys_call_table) | |||
206 | .long SYMBOL_NAME(sys_ni_syscall) /* streams2 */ | 206 | .long SYMBOL_NAME(sys_ni_syscall) /* streams2 */ |
207 | .long SYMBOL_NAME(sys_vfork) /* 190 */ | 207 | .long SYMBOL_NAME(sys_vfork) /* 190 */ |
208 | .long SYMBOL_NAME(sys_getrlimit) | 208 | .long SYMBOL_NAME(sys_getrlimit) |
209 | .long SYMBOL_NAME(sys_mmap2) | 209 | .long SYMBOL_NAME(sys_mmap_pgoff) |
210 | .long SYMBOL_NAME(sys_truncate64) | 210 | .long SYMBOL_NAME(sys_truncate64) |
211 | .long SYMBOL_NAME(sys_ftruncate64) | 211 | .long SYMBOL_NAME(sys_ftruncate64) |
212 | .long SYMBOL_NAME(sys_stat64) /* 195 */ | 212 | .long SYMBOL_NAME(sys_stat64) /* 195 */ |
diff --git a/arch/h8300/kernel/vmlinux.lds.S b/arch/h8300/kernel/vmlinux.lds.S index b9e24907e6ea..03d356d96e5d 100644 --- a/arch/h8300/kernel/vmlinux.lds.S +++ b/arch/h8300/kernel/vmlinux.lds.S | |||
@@ -1,4 +1,3 @@ | |||
1 | #define VMLINUX_SYMBOL(_sym_) _##_sym_ | ||
2 | #include <asm-generic/vmlinux.lds.h> | 1 | #include <asm-generic/vmlinux.lds.h> |
3 | #include <asm/page.h> | 2 | #include <asm/page.h> |
4 | 3 | ||
diff --git a/arch/h8300/mm/init.c b/arch/h8300/mm/init.c index 9942f24aff9e..7cc3380f250c 100644 --- a/arch/h8300/mm/init.c +++ b/arch/h8300/mm/init.c | |||
@@ -30,7 +30,7 @@ | |||
30 | #include <linux/highmem.h> | 30 | #include <linux/highmem.h> |
31 | #include <linux/pagemap.h> | 31 | #include <linux/pagemap.h> |
32 | #include <linux/bootmem.h> | 32 | #include <linux/bootmem.h> |
33 | #include <linux/slab.h> | 33 | #include <linux/gfp.h> |
34 | 34 | ||
35 | #include <asm/setup.h> | 35 | #include <asm/setup.h> |
36 | #include <asm/segment.h> | 36 | #include <asm/segment.h> |
diff --git a/arch/h8300/mm/kmap.c b/arch/h8300/mm/kmap.c index 5c7af09ae8d1..944a502c2e56 100644 --- a/arch/h8300/mm/kmap.c +++ b/arch/h8300/mm/kmap.c | |||
@@ -12,7 +12,6 @@ | |||
12 | #include <linux/kernel.h> | 12 | #include <linux/kernel.h> |
13 | #include <linux/string.h> | 13 | #include <linux/string.h> |
14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
15 | #include <linux/slab.h> | ||
16 | #include <linux/vmalloc.h> | 15 | #include <linux/vmalloc.h> |
17 | 16 | ||
18 | #include <asm/setup.h> | 17 | #include <asm/setup.h> |
diff --git a/arch/h8300/mm/memory.c b/arch/h8300/mm/memory.c index ccd6ade816dd..5552ddfaab5e 100644 --- a/arch/h8300/mm/memory.c +++ b/arch/h8300/mm/memory.c | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/string.h> | 22 | #include <linux/string.h> |
23 | #include <linux/types.h> | 23 | #include <linux/types.h> |
24 | #include <linux/slab.h> | ||
25 | 24 | ||
26 | #include <asm/setup.h> | 25 | #include <asm/setup.h> |
27 | #include <asm/segment.h> | 26 | #include <asm/segment.h> |
@@ -44,8 +43,8 @@ void cache_push_v (unsigned long vaddr, int len) | |||
44 | { | 43 | { |
45 | } | 44 | } |
46 | 45 | ||
47 | /* Map some physical address range into the kernel address space. The | 46 | /* |
48 | * code is copied and adapted from map_chunk(). | 47 | * Map some physical address range into the kernel address space. |
49 | */ | 48 | */ |
50 | 49 | ||
51 | unsigned long kernel_map(unsigned long paddr, unsigned long size, | 50 | unsigned long kernel_map(unsigned long paddr, unsigned long size, |
diff --git a/arch/h8300/platform/h8300h/ptrace_h8300h.c b/arch/h8300/platform/h8300h/ptrace_h8300h.c index 746b1ae672a1..4f1ed0279633 100644 --- a/arch/h8300/platform/h8300h/ptrace_h8300h.c +++ b/arch/h8300/platform/h8300h/ptrace_h8300h.c | |||
@@ -60,7 +60,7 @@ int h8300_put_reg(struct task_struct *task, int regno, unsigned long data) | |||
60 | } | 60 | } |
61 | 61 | ||
62 | /* disable singlestep */ | 62 | /* disable singlestep */ |
63 | void h8300_disable_trace(struct task_struct *child) | 63 | void user_disable_single_step(struct task_struct *child) |
64 | { | 64 | { |
65 | if((long)child->thread.breakinfo.addr != -1L) { | 65 | if((long)child->thread.breakinfo.addr != -1L) { |
66 | *child->thread.breakinfo.addr = child->thread.breakinfo.inst; | 66 | *child->thread.breakinfo.addr = child->thread.breakinfo.inst; |
@@ -264,7 +264,7 @@ static unsigned short *getnextpc(struct task_struct *child, unsigned short *pc) | |||
264 | 264 | ||
265 | /* Set breakpoint(s) to simulate a single step from the current PC. */ | 265 | /* Set breakpoint(s) to simulate a single step from the current PC. */ |
266 | 266 | ||
267 | void h8300_enable_trace(struct task_struct *child) | 267 | void user_enable_single_step(struct task_struct *child) |
268 | { | 268 | { |
269 | unsigned short *nextpc; | 269 | unsigned short *nextpc; |
270 | nextpc = getnextpc(child,(unsigned short *)h8300_get_reg(child, PT_PC)); | 270 | nextpc = getnextpc(child,(unsigned short *)h8300_get_reg(child, PT_PC)); |
@@ -276,7 +276,7 @@ void h8300_enable_trace(struct task_struct *child) | |||
276 | asmlinkage void trace_trap(unsigned long bp) | 276 | asmlinkage void trace_trap(unsigned long bp) |
277 | { | 277 | { |
278 | if ((unsigned long)current->thread.breakinfo.addr == bp) { | 278 | if ((unsigned long)current->thread.breakinfo.addr == bp) { |
279 | h8300_disable_trace(current); | 279 | user_disable_single_step(current); |
280 | force_sig(SIGTRAP,current); | 280 | force_sig(SIGTRAP,current); |
281 | } else | 281 | } else |
282 | force_sig(SIGILL,current); | 282 | force_sig(SIGILL,current); |
diff --git a/arch/h8300/platform/h8s/ptrace_h8s.c b/arch/h8300/platform/h8s/ptrace_h8s.c index e8cd46f9255c..c058ab1a8495 100644 --- a/arch/h8300/platform/h8s/ptrace_h8s.c +++ b/arch/h8300/platform/h8s/ptrace_h8s.c | |||
@@ -65,13 +65,13 @@ int h8300_put_reg(struct task_struct *task, int regno, unsigned long data) | |||
65 | } | 65 | } |
66 | 66 | ||
67 | /* disable singlestep */ | 67 | /* disable singlestep */ |
68 | void h8300_disable_trace(struct task_struct *child) | 68 | void user_disable_single_step(struct task_struct *child) |
69 | { | 69 | { |
70 | *(unsigned short *)(child->thread.esp0 + h8300_register_offset[PT_EXR]) &= ~EXR_TRACE; | 70 | *(unsigned short *)(child->thread.esp0 + h8300_register_offset[PT_EXR]) &= ~EXR_TRACE; |
71 | } | 71 | } |
72 | 72 | ||
73 | /* enable singlestep */ | 73 | /* enable singlestep */ |
74 | void h8300_enable_trace(struct task_struct *child) | 74 | void user_enable_single_step(struct task_struct *child) |
75 | { | 75 | { |
76 | *(unsigned short *)(child->thread.esp0 + h8300_register_offset[PT_EXR]) |= EXR_TRACE; | 76 | *(unsigned short *)(child->thread.esp0 + h8300_register_offset[PT_EXR]) |= EXR_TRACE; |
77 | } | 77 | } |