aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m32r/kernel
diff options
context:
space:
mode:
authorLen Brown <len.brown@intel.com>2006-01-27 17:18:29 -0500
committerLen Brown <len.brown@intel.com>2006-01-27 17:18:29 -0500
commit292dd876ee765c478b27c93cc51e93a558ed58bf (patch)
tree5b740e93253295baee2a9c414a6c66d03d44a9ef /arch/m32r/kernel
parentd4ec6c7cc9a15a7a529719bc3b84f46812f9842e (diff)
parent9fdb62af92c741addbea15545f214a6e89460865 (diff)
Pull release into acpica branch
Diffstat (limited to 'arch/m32r/kernel')
-rw-r--r--arch/m32r/kernel/m32r_ksyms.c3
-rw-r--r--arch/m32r/kernel/process.c17
-rw-r--r--arch/m32r/kernel/ptrace.c47
-rw-r--r--arch/m32r/kernel/smpboot.c2
4 files changed, 15 insertions, 54 deletions
diff --git a/arch/m32r/kernel/m32r_ksyms.c b/arch/m32r/kernel/m32r_ksyms.c
index e5ec134d81d9..dbc8a392105f 100644
--- a/arch/m32r/kernel/m32r_ksyms.c
+++ b/arch/m32r/kernel/m32r_ksyms.c
@@ -18,8 +18,6 @@
18#include <asm/irq.h> 18#include <asm/irq.h>
19#include <asm/tlbflush.h> 19#include <asm/tlbflush.h>
20 20
21extern void dump_thread(struct pt_regs *, struct user *);
22
23#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_HD) || defined(CONFIG_BLK_DEV_IDE_MODULE) || defined(CONFIG_BLK_DEV_HD_MODULE) 21#if defined(CONFIG_BLK_DEV_IDE) || defined(CONFIG_BLK_DEV_HD) || defined(CONFIG_BLK_DEV_IDE_MODULE) || defined(CONFIG_BLK_DEV_HD_MODULE)
24extern struct drive_info_struct drive_info; 22extern struct drive_info_struct drive_info;
25EXPORT_SYMBOL(drive_info); 23EXPORT_SYMBOL(drive_info);
@@ -27,7 +25,6 @@ EXPORT_SYMBOL(drive_info);
27 25
28/* platform dependent support */ 26/* platform dependent support */
29EXPORT_SYMBOL(boot_cpu_data); 27EXPORT_SYMBOL(boot_cpu_data);
30EXPORT_SYMBOL(dump_thread);
31EXPORT_SYMBOL(dump_fpu); 28EXPORT_SYMBOL(dump_fpu);
32EXPORT_SYMBOL(__ioremap); 29EXPORT_SYMBOL(__ioremap);
33EXPORT_SYMBOL(iounmap); 30EXPORT_SYMBOL(iounmap);
diff --git a/arch/m32r/kernel/process.c b/arch/m32r/kernel/process.c
index cc4b571e5db7..5dfc7ea45cf7 100644
--- a/arch/m32r/kernel/process.c
+++ b/arch/m32r/kernel/process.c
@@ -50,6 +50,10 @@ unsigned long thread_saved_pc(struct task_struct *tsk)
50 * Powermanagement idle function, if any.. 50 * Powermanagement idle function, if any..
51 */ 51 */
52void (*pm_idle)(void) = NULL; 52void (*pm_idle)(void) = NULL;
53EXPORT_SYMBOL(pm_idle);
54
55void (*pm_power_off)(void) = NULL;
56EXPORT_SYMBOL(pm_power_off);
53 57
54void disable_hlt(void) 58void disable_hlt(void)
55{ 59{
@@ -238,13 +242,10 @@ int dump_fpu(struct pt_regs *regs, elf_fpregset_t *fpu)
238int copy_thread(int nr, unsigned long clone_flags, unsigned long spu, 242int copy_thread(int nr, unsigned long clone_flags, unsigned long spu,
239 unsigned long unused, struct task_struct *tsk, struct pt_regs *regs) 243 unsigned long unused, struct task_struct *tsk, struct pt_regs *regs)
240{ 244{
241 struct pt_regs *childregs; 245 struct pt_regs *childregs = task_pt_regs(tsk);
242 unsigned long sp = (unsigned long)tsk->thread_info + THREAD_SIZE;
243 extern void ret_from_fork(void); 246 extern void ret_from_fork(void);
244 247
245 /* Copy registers */ 248 /* Copy registers */
246 sp -= sizeof (struct pt_regs);
247 childregs = (struct pt_regs *)sp;
248 *childregs = *regs; 249 *childregs = *regs;
249 250
250 childregs->spu = spu; 251 childregs->spu = spu;
@@ -257,14 +258,6 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long spu,
257} 258}
258 259
259/* 260/*
260 * fill in the user structure for a core dump..
261 */
262void dump_thread(struct pt_regs * regs, struct user * dump)
263{
264 /* M32R_FIXME */
265}
266
267/*
268 * Capture the user space registers if the task is not running (in user space) 261 * Capture the user space registers if the task is not running (in user space)
269 */ 262 */
270int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs) 263int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs)
diff --git a/arch/m32r/kernel/ptrace.c b/arch/m32r/kernel/ptrace.c
index 078d2a0e71c2..340a3bf59b88 100644
--- a/arch/m32r/kernel/ptrace.c
+++ b/arch/m32r/kernel/ptrace.c
@@ -35,23 +35,6 @@
35#include <asm/mmu_context.h> 35#include <asm/mmu_context.h>
36 36
37/* 37/*
38 * Get the address of the live pt_regs for the specified task.
39 * These are saved onto the top kernel stack when the process
40 * is not running.
41 *
42 * Note: if a user thread is execve'd from kernel space, the
43 * kernel stack will not be empty on entry to the kernel, so
44 * ptracing these tasks will fail.
45 */
46static inline struct pt_regs *
47get_user_regs(struct task_struct *task)
48{
49 return (struct pt_regs *)
50 ((unsigned long)task->thread_info + THREAD_SIZE
51 - sizeof(struct pt_regs));
52}
53
54/*
55 * This routine will get a word off of the process kernel stack. 38 * This routine will get a word off of the process kernel stack.
56 */ 39 */
57static inline unsigned long int 40static inline unsigned long int
@@ -59,7 +42,7 @@ get_stack_long(struct task_struct *task, int offset)
59{ 42{
60 unsigned long *stack; 43 unsigned long *stack;
61 44
62 stack = (unsigned long *)get_user_regs(task); 45 stack = (unsigned long *)task_pt_regs(task);
63 46
64 return stack[offset]; 47 return stack[offset];
65} 48}
@@ -72,7 +55,7 @@ put_stack_long(struct task_struct *task, int offset, unsigned long data)
72{ 55{
73 unsigned long *stack; 56 unsigned long *stack;
74 57
75 stack = (unsigned long *)get_user_regs(task); 58 stack = (unsigned long *)task_pt_regs(task);
76 stack[offset] = data; 59 stack[offset] = data;
77 60
78 return 0; 61 return 0;
@@ -208,7 +191,7 @@ static int ptrace_write_user(struct task_struct *tsk, unsigned long off,
208 */ 191 */
209static int ptrace_getregs(struct task_struct *tsk, void __user *uregs) 192static int ptrace_getregs(struct task_struct *tsk, void __user *uregs)
210{ 193{
211 struct pt_regs *regs = get_user_regs(tsk); 194 struct pt_regs *regs = task_pt_regs(tsk);
212 195
213 return copy_to_user(uregs, regs, sizeof(struct pt_regs)) ? -EFAULT : 0; 196 return copy_to_user(uregs, regs, sizeof(struct pt_regs)) ? -EFAULT : 0;
214} 197}
@@ -223,7 +206,7 @@ static int ptrace_setregs(struct task_struct *tsk, void __user *uregs)
223 206
224 ret = -EFAULT; 207 ret = -EFAULT;
225 if (copy_from_user(&newregs, uregs, sizeof(struct pt_regs)) == 0) { 208 if (copy_from_user(&newregs, uregs, sizeof(struct pt_regs)) == 0) {
226 struct pt_regs *regs = get_user_regs(tsk); 209 struct pt_regs *regs = task_pt_regs(tsk);
227 *regs = newregs; 210 *regs = newregs;
228 ret = 0; 211 ret = 0;
229 } 212 }
@@ -762,28 +745,16 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data)
762 int ret; 745 int ret;
763 746
764 lock_kernel(); 747 lock_kernel();
765 ret = -EPERM;
766 if (request == PTRACE_TRACEME) { 748 if (request == PTRACE_TRACEME) {
767 /* are we already being traced? */ 749 ret = ptrace_traceme();
768 if (current->ptrace & PT_PTRACED)
769 goto out;
770 /* set the ptrace bit in the process flags. */
771 current->ptrace |= PT_PTRACED;
772 ret = 0;
773 goto out; 750 goto out;
774 } 751 }
775 ret = -ESRCH;
776 read_lock(&tasklist_lock);
777 child = find_task_by_pid(pid);
778 if (child)
779 get_task_struct(child);
780 read_unlock(&tasklist_lock);
781 if (!child)
782 goto out;
783 752
784 ret = -EPERM; 753 child = ptrace_get_task_struct(pid);
785 if (pid == 1) /* you may not mess with init */ 754 if (IS_ERR(child)) {
755 ret = PTR_ERR(child);
786 goto out; 756 goto out;
757 }
787 758
788 if (request == PTRACE_ATTACH) { 759 if (request == PTRACE_ATTACH) {
789 ret = ptrace_attach(child); 760 ret = ptrace_attach(child);
diff --git a/arch/m32r/kernel/smpboot.c b/arch/m32r/kernel/smpboot.c
index b90c54169fa5..d7ec16e7fb25 100644
--- a/arch/m32r/kernel/smpboot.c
+++ b/arch/m32r/kernel/smpboot.c
@@ -286,7 +286,7 @@ static void __init do_boot_cpu(int phys_id)
286 /* So we see what's up */ 286 /* So we see what's up */
287 printk("Booting processor %d/%d\n", phys_id, cpu_id); 287 printk("Booting processor %d/%d\n", phys_id, cpu_id);
288 stack_start.spi = (void *)idle->thread.sp; 288 stack_start.spi = (void *)idle->thread.sp;
289 idle->thread_info->cpu = cpu_id; 289 task_thread_info(idle)->cpu = cpu_id;
290 290
291 /* 291 /*
292 * Send Startup IPI 292 * Send Startup IPI