diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /arch/h8300/kernel | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'arch/h8300/kernel')
-rw-r--r-- | arch/h8300/kernel/irq.c | 79 | ||||
-rw-r--r-- | arch/h8300/kernel/process.c | 1 | ||||
-rw-r--r-- | arch/h8300/kernel/ptrace.c | 33 | ||||
-rw-r--r-- | arch/h8300/kernel/syscalls.S | 1 | ||||
-rw-r--r-- | arch/h8300/kernel/time.c | 4 | ||||
-rw-r--r-- | arch/h8300/kernel/timer/timer8.c | 2 |
6 files changed, 39 insertions, 81 deletions
diff --git a/arch/h8300/kernel/irq.c b/arch/h8300/kernel/irq.c index c25dc2c2b1da..1f67fed476af 100644 --- a/arch/h8300/kernel/irq.c +++ b/arch/h8300/kernel/irq.c | |||
@@ -38,34 +38,30 @@ static inline int is_ext_irq(unsigned int irq) | |||
38 | return (irq >= EXT_IRQ0 && irq <= (EXT_IRQ0 + EXT_IRQS)); | 38 | return (irq >= EXT_IRQ0 && irq <= (EXT_IRQ0 + EXT_IRQS)); |
39 | } | 39 | } |
40 | 40 | ||
41 | static void h8300_enable_irq(unsigned int irq) | 41 | static void h8300_enable_irq(struct irq_data *data) |
42 | { | 42 | { |
43 | if (is_ext_irq(irq)) | 43 | if (is_ext_irq(data->irq)) |
44 | IER_REGS |= 1 << (irq - EXT_IRQ0); | 44 | IER_REGS |= 1 << (data->irq - EXT_IRQ0); |
45 | } | 45 | } |
46 | 46 | ||
47 | static void h8300_disable_irq(unsigned int irq) | 47 | static void h8300_disable_irq(struct irq_data *data) |
48 | { | 48 | { |
49 | if (is_ext_irq(irq)) | 49 | if (is_ext_irq(data->irq)) |
50 | IER_REGS &= ~(1 << (irq - EXT_IRQ0)); | 50 | IER_REGS &= ~(1 << (data->irq - EXT_IRQ0)); |
51 | } | 51 | } |
52 | 52 | ||
53 | static void h8300_end_irq(unsigned int irq) | 53 | static unsigned int h8300_startup_irq(struct irq_data *data) |
54 | { | 54 | { |
55 | } | 55 | if (is_ext_irq(data->irq)) |
56 | 56 | return h8300_enable_irq_pin(data->irq); | |
57 | static unsigned int h8300_startup_irq(unsigned int irq) | ||
58 | { | ||
59 | if (is_ext_irq(irq)) | ||
60 | return h8300_enable_irq_pin(irq); | ||
61 | else | 57 | else |
62 | return 0; | 58 | return 0; |
63 | } | 59 | } |
64 | 60 | ||
65 | static void h8300_shutdown_irq(unsigned int irq) | 61 | static void h8300_shutdown_irq(struct irq_data *data) |
66 | { | 62 | { |
67 | if (is_ext_irq(irq)) | 63 | if (is_ext_irq(data->irq)) |
68 | h8300_disable_irq_pin(irq); | 64 | h8300_disable_irq_pin(data->irq); |
69 | } | 65 | } |
70 | 66 | ||
71 | /* | 67 | /* |
@@ -73,12 +69,10 @@ static void h8300_shutdown_irq(unsigned int irq) | |||
73 | */ | 69 | */ |
74 | struct irq_chip h8300irq_chip = { | 70 | struct irq_chip h8300irq_chip = { |
75 | .name = "H8300-INTC", | 71 | .name = "H8300-INTC", |
76 | .startup = h8300_startup_irq, | 72 | .irq_startup = h8300_startup_irq, |
77 | .shutdown = h8300_shutdown_irq, | 73 | .irq_shutdown = h8300_shutdown_irq, |
78 | .enable = h8300_enable_irq, | 74 | .irq_enable = h8300_enable_irq, |
79 | .disable = h8300_disable_irq, | 75 | .irq_disable = h8300_disable_irq, |
80 | .ack = NULL, | ||
81 | .end = h8300_end_irq, | ||
82 | }; | 76 | }; |
83 | 77 | ||
84 | #if defined(CONFIG_RAMKERNEL) | 78 | #if defined(CONFIG_RAMKERNEL) |
@@ -160,48 +154,13 @@ void __init init_IRQ(void) | |||
160 | 154 | ||
161 | setup_vector(); | 155 | setup_vector(); |
162 | 156 | ||
163 | for (c = 0; c < NR_IRQS; c++) { | 157 | for (c = 0; c < NR_IRQS; c++) |
164 | irq_desc[c].status = IRQ_DISABLED; | 158 | irq_set_chip_and_handler(c, &h8300irq_chip, handle_simple_irq); |
165 | irq_desc[c].action = NULL; | ||
166 | irq_desc[c].depth = 1; | ||
167 | irq_desc[c].chip = &h8300irq_chip; | ||
168 | } | ||
169 | } | 159 | } |
170 | 160 | ||
171 | asmlinkage void do_IRQ(int irq) | 161 | asmlinkage void do_IRQ(int irq) |
172 | { | 162 | { |
173 | irq_enter(); | 163 | irq_enter(); |
174 | __do_IRQ(irq); | 164 | generic_handle_irq(irq); |
175 | irq_exit(); | 165 | irq_exit(); |
176 | } | 166 | } |
177 | |||
178 | #if defined(CONFIG_PROC_FS) | ||
179 | int show_interrupts(struct seq_file *p, void *v) | ||
180 | { | ||
181 | int i = *(loff_t *) v; | ||
182 | struct irqaction * action; | ||
183 | unsigned long flags; | ||
184 | |||
185 | if (i == 0) | ||
186 | seq_puts(p, " CPU0"); | ||
187 | |||
188 | if (i < NR_IRQS) { | ||
189 | raw_spin_lock_irqsave(&irq_desc[i].lock, flags); | ||
190 | action = irq_desc[i].action; | ||
191 | if (!action) | ||
192 | goto unlock; | ||
193 | seq_printf(p, "%3d: ",i); | ||
194 | seq_printf(p, "%10u ", kstat_irqs(i)); | ||
195 | seq_printf(p, " %14s", irq_desc[i].chip->name); | ||
196 | seq_printf(p, "-%-8s", irq_desc[i].name); | ||
197 | seq_printf(p, " %s", action->name); | ||
198 | |||
199 | for (action=action->next; action; action = action->next) | ||
200 | seq_printf(p, ", %s", action->name); | ||
201 | seq_putc(p, '\n'); | ||
202 | unlock: | ||
203 | raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags); | ||
204 | } | ||
205 | return 0; | ||
206 | } | ||
207 | #endif | ||
diff --git a/arch/h8300/kernel/process.c b/arch/h8300/kernel/process.c index 97478138e361..933bd388efb2 100644 --- a/arch/h8300/kernel/process.c +++ b/arch/h8300/kernel/process.c | |||
@@ -28,7 +28,6 @@ | |||
28 | #include <linux/kernel.h> | 28 | #include <linux/kernel.h> |
29 | #include <linux/mm.h> | 29 | #include <linux/mm.h> |
30 | #include <linux/smp.h> | 30 | #include <linux/smp.h> |
31 | #include <linux/smp_lock.h> | ||
32 | #include <linux/stddef.h> | 31 | #include <linux/stddef.h> |
33 | #include <linux/unistd.h> | 32 | #include <linux/unistd.h> |
34 | #include <linux/ptrace.h> | 33 | #include <linux/ptrace.h> |
diff --git a/arch/h8300/kernel/ptrace.c b/arch/h8300/kernel/ptrace.c index df114122ebdf..497fa89b5df4 100644 --- a/arch/h8300/kernel/ptrace.c +++ b/arch/h8300/kernel/ptrace.c | |||
@@ -50,27 +50,29 @@ void ptrace_disable(struct task_struct *child) | |||
50 | user_disable_single_step(child); | 50 | user_disable_single_step(child); |
51 | } | 51 | } |
52 | 52 | ||
53 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) | 53 | long arch_ptrace(struct task_struct *child, long request, |
54 | unsigned long addr, unsigned long data) | ||
54 | { | 55 | { |
55 | int ret; | 56 | int ret; |
57 | int regno = addr >> 2; | ||
58 | unsigned long __user *datap = (unsigned long __user *) data; | ||
56 | 59 | ||
57 | switch (request) { | 60 | switch (request) { |
58 | /* read the word at location addr in the USER area. */ | 61 | /* read the word at location addr in the USER area. */ |
59 | case PTRACE_PEEKUSR: { | 62 | case PTRACE_PEEKUSR: { |
60 | unsigned long tmp = 0; | 63 | unsigned long tmp = 0; |
61 | 64 | ||
62 | if ((addr & 3) || addr < 0 || addr >= sizeof(struct user)) { | 65 | if ((addr & 3) || addr >= sizeof(struct user)) { |
63 | ret = -EIO; | 66 | ret = -EIO; |
64 | break ; | 67 | break ; |
65 | } | 68 | } |
66 | 69 | ||
67 | ret = 0; /* Default return condition */ | 70 | ret = 0; /* Default return condition */ |
68 | addr = addr >> 2; /* temporary hack. */ | ||
69 | 71 | ||
70 | if (addr < H8300_REGS_NO) | 72 | if (regno < H8300_REGS_NO) |
71 | tmp = h8300_get_reg(child, addr); | 73 | tmp = h8300_get_reg(child, regno); |
72 | else { | 74 | else { |
73 | switch(addr) { | 75 | switch (regno) { |
74 | case 49: | 76 | case 49: |
75 | tmp = child->mm->start_code; | 77 | tmp = child->mm->start_code; |
76 | break ; | 78 | break ; |
@@ -88,24 +90,23 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
88 | } | 90 | } |
89 | } | 91 | } |
90 | if (!ret) | 92 | if (!ret) |
91 | ret = put_user(tmp,(unsigned long *) data); | 93 | ret = put_user(tmp, datap); |
92 | break ; | 94 | break ; |
93 | } | 95 | } |
94 | 96 | ||
95 | /* when I and D space are separate, this will have to be fixed. */ | 97 | /* when I and D space are separate, this will have to be fixed. */ |
96 | case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ | 98 | case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ |
97 | if ((addr & 3) || addr < 0 || addr >= sizeof(struct user)) { | 99 | if ((addr & 3) || addr >= sizeof(struct user)) { |
98 | ret = -EIO; | 100 | ret = -EIO; |
99 | break ; | 101 | break ; |
100 | } | 102 | } |
101 | addr = addr >> 2; /* temporary hack. */ | ||
102 | 103 | ||
103 | if (addr == PT_ORIG_ER0) { | 104 | if (regno == PT_ORIG_ER0) { |
104 | ret = -EIO; | 105 | ret = -EIO; |
105 | break ; | 106 | break ; |
106 | } | 107 | } |
107 | if (addr < H8300_REGS_NO) { | 108 | if (regno < H8300_REGS_NO) { |
108 | ret = h8300_put_reg(child, addr, data); | 109 | ret = h8300_put_reg(child, regno, data); |
109 | break ; | 110 | break ; |
110 | } | 111 | } |
111 | ret = -EIO; | 112 | ret = -EIO; |
@@ -116,11 +117,11 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
116 | unsigned long tmp; | 117 | unsigned long tmp; |
117 | for (i = 0; i < H8300_REGS_NO; i++) { | 118 | for (i = 0; i < H8300_REGS_NO; i++) { |
118 | tmp = h8300_get_reg(child, i); | 119 | tmp = h8300_get_reg(child, i); |
119 | if (put_user(tmp, (unsigned long *) data)) { | 120 | if (put_user(tmp, datap)) { |
120 | ret = -EFAULT; | 121 | ret = -EFAULT; |
121 | break; | 122 | break; |
122 | } | 123 | } |
123 | data += sizeof(long); | 124 | datap++; |
124 | } | 125 | } |
125 | ret = 0; | 126 | ret = 0; |
126 | break; | 127 | break; |
@@ -130,12 +131,12 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
130 | int i; | 131 | int i; |
131 | unsigned long tmp; | 132 | unsigned long tmp; |
132 | for (i = 0; i < H8300_REGS_NO; i++) { | 133 | for (i = 0; i < H8300_REGS_NO; i++) { |
133 | if (get_user(tmp, (unsigned long *) data)) { | 134 | if (get_user(tmp, datap)) { |
134 | ret = -EFAULT; | 135 | ret = -EFAULT; |
135 | break; | 136 | break; |
136 | } | 137 | } |
137 | h8300_put_reg(child, i, tmp); | 138 | h8300_put_reg(child, i, tmp); |
138 | data += sizeof(long); | 139 | datap++; |
139 | } | 140 | } |
140 | ret = 0; | 141 | ret = 0; |
141 | break; | 142 | break; |
diff --git a/arch/h8300/kernel/syscalls.S b/arch/h8300/kernel/syscalls.S index faefaff7d43d..f4b2e67bcc34 100644 --- a/arch/h8300/kernel/syscalls.S +++ b/arch/h8300/kernel/syscalls.S | |||
@@ -333,6 +333,7 @@ SYMBOL_NAME_LABEL(sys_call_table) | |||
333 | .long SYMBOL_NAME(sys_ni_syscall) /* sys_move_pages */ | 333 | .long SYMBOL_NAME(sys_ni_syscall) /* sys_move_pages */ |
334 | .long SYMBOL_NAME(sys_getcpu) | 334 | .long SYMBOL_NAME(sys_getcpu) |
335 | .long SYMBOL_NAME(sys_ni_syscall) /* sys_epoll_pwait */ | 335 | .long SYMBOL_NAME(sys_ni_syscall) /* sys_epoll_pwait */ |
336 | .long SYMBOL_NAME(sys_setns) /* 320 */ | ||
336 | 337 | ||
337 | .macro call_sp addr | 338 | .macro call_sp addr |
338 | mov.l #SYMBOL_NAME(\addr),er6 | 339 | mov.l #SYMBOL_NAME(\addr),er6 |
diff --git a/arch/h8300/kernel/time.c b/arch/h8300/kernel/time.c index 165005aff9df..32263a138aa6 100644 --- a/arch/h8300/kernel/time.c +++ b/arch/h8300/kernel/time.c | |||
@@ -35,9 +35,7 @@ void h8300_timer_tick(void) | |||
35 | { | 35 | { |
36 | if (current->pid) | 36 | if (current->pid) |
37 | profile_tick(CPU_PROFILING); | 37 | profile_tick(CPU_PROFILING); |
38 | write_seqlock(&xtime_lock); | 38 | xtime_update(1); |
39 | do_timer(1); | ||
40 | write_sequnlock(&xtime_lock); | ||
41 | update_process_times(user_mode(get_irq_regs())); | 39 | update_process_times(user_mode(get_irq_regs())); |
42 | } | 40 | } |
43 | 41 | ||
diff --git a/arch/h8300/kernel/timer/timer8.c b/arch/h8300/kernel/timer/timer8.c index 3946c0fa8374..7a1533fad47d 100644 --- a/arch/h8300/kernel/timer/timer8.c +++ b/arch/h8300/kernel/timer/timer8.c | |||
@@ -61,7 +61,7 @@ | |||
61 | 61 | ||
62 | /* | 62 | /* |
63 | * timer_interrupt() needs to keep up the real-time clock, | 63 | * timer_interrupt() needs to keep up the real-time clock, |
64 | * as well as call the "do_timer()" routine every clocktick | 64 | * as well as call the "xtime_update()" routine every clocktick |
65 | */ | 65 | */ |
66 | 66 | ||
67 | static irqreturn_t timer_interrupt(int irq, void *dev_id) | 67 | static irqreturn_t timer_interrupt(int irq, void *dev_id) |