diff options
Diffstat (limited to 'arch/h8300')
-rw-r--r-- | arch/h8300/kernel/process.c | 28 | ||||
-rw-r--r-- | arch/h8300/kernel/ptrace.c | 39 | ||||
-rw-r--r-- | arch/h8300/kernel/time.c | 4 |
3 files changed, 16 insertions, 55 deletions
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c index 27f1fce64ce4..fe21adf3e75e 100644 --- a/arch/h8300/kernel/process.c +++ b/arch/h8300/kernel/process.c | |||
@@ -53,22 +53,18 @@ asmlinkage void ret_from_fork(void); | |||
53 | #if !defined(CONFIG_H8300H_SIM) && !defined(CONFIG_H8S_SIM) | 53 | #if !defined(CONFIG_H8300H_SIM) && !defined(CONFIG_H8S_SIM) |
54 | void default_idle(void) | 54 | void default_idle(void) |
55 | { | 55 | { |
56 | while(1) { | 56 | local_irq_disable(); |
57 | if (!need_resched()) { | 57 | if (!need_resched()) { |
58 | local_irq_enable(); | 58 | local_irq_enable(); |
59 | __asm__("sleep"); | 59 | /* XXX: race here! What if need_resched() gets set now? */ |
60 | local_irq_disable(); | 60 | __asm__("sleep"); |
61 | } | 61 | } else |
62 | schedule(); | 62 | local_irq_enable(); |
63 | } | ||
64 | } | 63 | } |
65 | #else | 64 | #else |
66 | void default_idle(void) | 65 | void default_idle(void) |
67 | { | 66 | { |
68 | while(1) { | 67 | cpu_relax(); |
69 | if (need_resched()) | ||
70 | schedule(); | ||
71 | } | ||
72 | } | 68 | } |
73 | #endif | 69 | #endif |
74 | void (*idle)(void) = default_idle; | 70 | void (*idle)(void) = default_idle; |
@@ -81,7 +77,13 @@ void (*idle)(void) = default_idle; | |||
81 | */ | 77 | */ |
82 | void cpu_idle(void) | 78 | void cpu_idle(void) |
83 | { | 79 | { |
84 | idle(); | 80 | while (1) { |
81 | while (!need_resched()) | ||
82 | idle(); | ||
83 | preempt_enable_no_resched(); | ||
84 | schedule(); | ||
85 | preempt_disable(); | ||
86 | } | ||
85 | } | 87 | } |
86 | 88 | ||
87 | void machine_restart(char * __unused) | 89 | void machine_restart(char * __unused) |
diff --git a/arch/h8300/kernel/ptrace.c b/arch/h8300/kernel/ptrace.c index 05c15e869777..0ff6f79b0fed 100644 --- a/arch/h8300/kernel/ptrace.c +++ b/arch/h8300/kernel/ptrace.c | |||
@@ -57,43 +57,10 @@ void ptrace_disable(struct task_struct *child) | |||
57 | h8300_disable_trace(child); | 57 | h8300_disable_trace(child); |
58 | } | 58 | } |
59 | 59 | ||
60 | asmlinkage int sys_ptrace(long request, long pid, long addr, long data) | 60 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) |
61 | { | 61 | { |
62 | struct task_struct *child; | ||
63 | int ret; | 62 | int ret; |
64 | 63 | ||
65 | lock_kernel(); | ||
66 | ret = -EPERM; | ||
67 | if (request == PTRACE_TRACEME) { | ||
68 | /* are we already being traced? */ | ||
69 | if (current->ptrace & PT_PTRACED) | ||
70 | goto out; | ||
71 | /* set the ptrace bit in the process flags. */ | ||
72 | current->ptrace |= PT_PTRACED; | ||
73 | ret = 0; | ||
74 | goto out; | ||
75 | } | ||
76 | ret = -ESRCH; | ||
77 | read_lock(&tasklist_lock); | ||
78 | child = find_task_by_pid(pid); | ||
79 | if (child) | ||
80 | get_task_struct(child); | ||
81 | read_unlock(&tasklist_lock); | ||
82 | if (!child) | ||
83 | goto out; | ||
84 | |||
85 | ret = -EPERM; | ||
86 | if (pid == 1) /* you may not mess with init */ | ||
87 | goto out_tsk; | ||
88 | |||
89 | if (request == PTRACE_ATTACH) { | ||
90 | ret = ptrace_attach(child); | ||
91 | goto out_tsk; | ||
92 | } | ||
93 | ret = ptrace_check_attach(child, request == PTRACE_KILL); | ||
94 | if (ret < 0) | ||
95 | goto out_tsk; | ||
96 | |||
97 | switch (request) { | 64 | switch (request) { |
98 | case PTRACE_PEEKTEXT: /* read word at location addr. */ | 65 | case PTRACE_PEEKTEXT: /* read word at location addr. */ |
99 | case PTRACE_PEEKDATA: { | 66 | case PTRACE_PEEKDATA: { |
@@ -251,10 +218,6 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data) | |||
251 | ret = -EIO; | 218 | ret = -EIO; |
252 | break; | 219 | break; |
253 | } | 220 | } |
254 | out_tsk: | ||
255 | put_task_struct(child); | ||
256 | out: | ||
257 | unlock_kernel(); | ||
258 | return ret; | 221 | return ret; |
259 | } | 222 | } |
260 | 223 | ||
diff --git a/arch/h8300/kernel/time.c b/arch/h8300/kernel/time.c index af8c5d2057dd..688a5100604c 100644 --- a/arch/h8300/kernel/time.c +++ b/arch/h8300/kernel/time.c | |||
@@ -32,10 +32,6 @@ | |||
32 | 32 | ||
33 | #define TICK_SIZE (tick_nsec / 1000) | 33 | #define TICK_SIZE (tick_nsec / 1000) |
34 | 34 | ||
35 | u64 jiffies_64; | ||
36 | |||
37 | EXPORT_SYMBOL(jiffies_64); | ||
38 | |||
39 | /* | 35 | /* |
40 | * timer_interrupt() needs to keep up the real-time clock, | 36 | * timer_interrupt() needs to keep up the real-time clock, |
41 | * as well as call the "do_timer()" routine every clocktick | 37 | * as well as call the "do_timer()" routine every clocktick |