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/frv/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/frv/kernel')
-rw-r--r-- | arch/frv/kernel/entry-table.S | 4 | ||||
-rw-r--r-- | arch/frv/kernel/entry.S | 1 | ||||
-rw-r--r-- | arch/frv/kernel/futex.c | 14 | ||||
-rw-r--r-- | arch/frv/kernel/irq-mb93091.c | 30 | ||||
-rw-r--r-- | arch/frv/kernel/irq-mb93093.c | 31 | ||||
-rw-r--r-- | arch/frv/kernel/irq-mb93493.c | 25 | ||||
-rw-r--r-- | arch/frv/kernel/irq.c | 80 | ||||
-rw-r--r-- | arch/frv/kernel/process.c | 6 | ||||
-rw-r--r-- | arch/frv/kernel/ptrace.c | 32 | ||||
-rw-r--r-- | arch/frv/kernel/time.c | 14 | ||||
-rw-r--r-- | arch/frv/kernel/vmlinux.lds.S | 2 |
11 files changed, 92 insertions, 147 deletions
diff --git a/arch/frv/kernel/entry-table.S b/arch/frv/kernel/entry-table.S index bf35f33e48c9..06c5ae191e59 100644 --- a/arch/frv/kernel/entry-table.S +++ b/arch/frv/kernel/entry-table.S | |||
@@ -86,7 +86,7 @@ __break_usertrap_fixup_table: | |||
86 | .globl __break_kerneltrap_fixup_table | 86 | .globl __break_kerneltrap_fixup_table |
87 | __break_kerneltrap_fixup_table: | 87 | __break_kerneltrap_fixup_table: |
88 | 88 | ||
89 | # handler declaration for a sofware or program interrupt | 89 | # handler declaration for a software or program interrupt |
90 | .macro VECTOR_SOFTPROG tbr_tt, vec | 90 | .macro VECTOR_SOFTPROG tbr_tt, vec |
91 | .section .trap.user | 91 | .section .trap.user |
92 | .org \tbr_tt | 92 | .org \tbr_tt |
@@ -145,7 +145,7 @@ __break_kerneltrap_fixup_table: | |||
145 | .long \vec | 145 | .long \vec |
146 | .endm | 146 | .endm |
147 | 147 | ||
148 | # handler declaration for an MMU only sofware or program interrupt | 148 | # handler declaration for an MMU only software or program interrupt |
149 | .macro VECTOR_SP_MMU tbr_tt, vec | 149 | .macro VECTOR_SP_MMU tbr_tt, vec |
150 | #ifdef CONFIG_MMU | 150 | #ifdef CONFIG_MMU |
151 | VECTOR_SOFTPROG \tbr_tt, \vec | 151 | VECTOR_SOFTPROG \tbr_tt, \vec |
diff --git a/arch/frv/kernel/entry.S b/arch/frv/kernel/entry.S index 63d579bf1c29..017d6d7b784f 100644 --- a/arch/frv/kernel/entry.S +++ b/arch/frv/kernel/entry.S | |||
@@ -1526,5 +1526,6 @@ sys_call_table: | |||
1526 | .long sys_pwritev | 1526 | .long sys_pwritev |
1527 | .long sys_rt_tgsigqueueinfo /* 335 */ | 1527 | .long sys_rt_tgsigqueueinfo /* 335 */ |
1528 | .long sys_perf_event_open | 1528 | .long sys_perf_event_open |
1529 | .long sys_setns | ||
1529 | 1530 | ||
1530 | syscall_table_size = (. - sys_call_table) | 1531 | syscall_table_size = (. - sys_call_table) |
diff --git a/arch/frv/kernel/futex.c b/arch/frv/kernel/futex.c index 14f64b054c7e..d155ca9e5098 100644 --- a/arch/frv/kernel/futex.c +++ b/arch/frv/kernel/futex.c | |||
@@ -18,7 +18,7 @@ | |||
18 | * the various futex operations; MMU fault checking is ignored under no-MMU | 18 | * the various futex operations; MMU fault checking is ignored under no-MMU |
19 | * conditions | 19 | * conditions |
20 | */ | 20 | */ |
21 | static inline int atomic_futex_op_xchg_set(int oparg, int __user *uaddr, int *_oldval) | 21 | static inline int atomic_futex_op_xchg_set(int oparg, u32 __user *uaddr, int *_oldval) |
22 | { | 22 | { |
23 | int oldval, ret; | 23 | int oldval, ret; |
24 | 24 | ||
@@ -50,7 +50,7 @@ static inline int atomic_futex_op_xchg_set(int oparg, int __user *uaddr, int *_o | |||
50 | return ret; | 50 | return ret; |
51 | } | 51 | } |
52 | 52 | ||
53 | static inline int atomic_futex_op_xchg_add(int oparg, int __user *uaddr, int *_oldval) | 53 | static inline int atomic_futex_op_xchg_add(int oparg, u32 __user *uaddr, int *_oldval) |
54 | { | 54 | { |
55 | int oldval, ret; | 55 | int oldval, ret; |
56 | 56 | ||
@@ -83,7 +83,7 @@ static inline int atomic_futex_op_xchg_add(int oparg, int __user *uaddr, int *_o | |||
83 | return ret; | 83 | return ret; |
84 | } | 84 | } |
85 | 85 | ||
86 | static inline int atomic_futex_op_xchg_or(int oparg, int __user *uaddr, int *_oldval) | 86 | static inline int atomic_futex_op_xchg_or(int oparg, u32 __user *uaddr, int *_oldval) |
87 | { | 87 | { |
88 | int oldval, ret; | 88 | int oldval, ret; |
89 | 89 | ||
@@ -116,7 +116,7 @@ static inline int atomic_futex_op_xchg_or(int oparg, int __user *uaddr, int *_ol | |||
116 | return ret; | 116 | return ret; |
117 | } | 117 | } |
118 | 118 | ||
119 | static inline int atomic_futex_op_xchg_and(int oparg, int __user *uaddr, int *_oldval) | 119 | static inline int atomic_futex_op_xchg_and(int oparg, u32 __user *uaddr, int *_oldval) |
120 | { | 120 | { |
121 | int oldval, ret; | 121 | int oldval, ret; |
122 | 122 | ||
@@ -149,7 +149,7 @@ static inline int atomic_futex_op_xchg_and(int oparg, int __user *uaddr, int *_o | |||
149 | return ret; | 149 | return ret; |
150 | } | 150 | } |
151 | 151 | ||
152 | static inline int atomic_futex_op_xchg_xor(int oparg, int __user *uaddr, int *_oldval) | 152 | static inline int atomic_futex_op_xchg_xor(int oparg, u32 __user *uaddr, int *_oldval) |
153 | { | 153 | { |
154 | int oldval, ret; | 154 | int oldval, ret; |
155 | 155 | ||
@@ -186,7 +186,7 @@ static inline int atomic_futex_op_xchg_xor(int oparg, int __user *uaddr, int *_o | |||
186 | /* | 186 | /* |
187 | * do the futex operations | 187 | * do the futex operations |
188 | */ | 188 | */ |
189 | int futex_atomic_op_inuser(int encoded_op, int __user *uaddr) | 189 | int futex_atomic_op_inuser(int encoded_op, u32 __user *uaddr) |
190 | { | 190 | { |
191 | int op = (encoded_op >> 28) & 7; | 191 | int op = (encoded_op >> 28) & 7; |
192 | int cmp = (encoded_op >> 24) & 15; | 192 | int cmp = (encoded_op >> 24) & 15; |
@@ -197,7 +197,7 @@ int futex_atomic_op_inuser(int encoded_op, int __user *uaddr) | |||
197 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) | 197 | if (encoded_op & (FUTEX_OP_OPARG_SHIFT << 28)) |
198 | oparg = 1 << oparg; | 198 | oparg = 1 << oparg; |
199 | 199 | ||
200 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(int))) | 200 | if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32))) |
201 | return -EFAULT; | 201 | return -EFAULT; |
202 | 202 | ||
203 | pagefault_disable(); | 203 | pagefault_disable(); |
diff --git a/arch/frv/kernel/irq-mb93091.c b/arch/frv/kernel/irq-mb93091.c index 4dd9adaf115a..9afc2ea400dc 100644 --- a/arch/frv/kernel/irq-mb93091.c +++ b/arch/frv/kernel/irq-mb93091.c | |||
@@ -36,45 +36,45 @@ | |||
36 | /* | 36 | /* |
37 | * on-motherboard FPGA PIC operations | 37 | * on-motherboard FPGA PIC operations |
38 | */ | 38 | */ |
39 | static void frv_fpga_mask(unsigned int irq) | 39 | static void frv_fpga_mask(struct irq_data *d) |
40 | { | 40 | { |
41 | uint16_t imr = __get_IMR(); | 41 | uint16_t imr = __get_IMR(); |
42 | 42 | ||
43 | imr |= 1 << (irq - IRQ_BASE_FPGA); | 43 | imr |= 1 << (d->irq - IRQ_BASE_FPGA); |
44 | 44 | ||
45 | __set_IMR(imr); | 45 | __set_IMR(imr); |
46 | } | 46 | } |
47 | 47 | ||
48 | static void frv_fpga_ack(unsigned int irq) | 48 | static void frv_fpga_ack(struct irq_data *d) |
49 | { | 49 | { |
50 | __clr_IFR(1 << (irq - IRQ_BASE_FPGA)); | 50 | __clr_IFR(1 << (d->irq - IRQ_BASE_FPGA)); |
51 | } | 51 | } |
52 | 52 | ||
53 | static void frv_fpga_mask_ack(unsigned int irq) | 53 | static void frv_fpga_mask_ack(struct irq_data *d) |
54 | { | 54 | { |
55 | uint16_t imr = __get_IMR(); | 55 | uint16_t imr = __get_IMR(); |
56 | 56 | ||
57 | imr |= 1 << (irq - IRQ_BASE_FPGA); | 57 | imr |= 1 << (d->irq - IRQ_BASE_FPGA); |
58 | __set_IMR(imr); | 58 | __set_IMR(imr); |
59 | 59 | ||
60 | __clr_IFR(1 << (irq - IRQ_BASE_FPGA)); | 60 | __clr_IFR(1 << (d->irq - IRQ_BASE_FPGA)); |
61 | } | 61 | } |
62 | 62 | ||
63 | static void frv_fpga_unmask(unsigned int irq) | 63 | static void frv_fpga_unmask(struct irq_data *d) |
64 | { | 64 | { |
65 | uint16_t imr = __get_IMR(); | 65 | uint16_t imr = __get_IMR(); |
66 | 66 | ||
67 | imr &= ~(1 << (irq - IRQ_BASE_FPGA)); | 67 | imr &= ~(1 << (d->irq - IRQ_BASE_FPGA)); |
68 | 68 | ||
69 | __set_IMR(imr); | 69 | __set_IMR(imr); |
70 | } | 70 | } |
71 | 71 | ||
72 | static struct irq_chip frv_fpga_pic = { | 72 | static struct irq_chip frv_fpga_pic = { |
73 | .name = "mb93091", | 73 | .name = "mb93091", |
74 | .ack = frv_fpga_ack, | 74 | .irq_ack = frv_fpga_ack, |
75 | .mask = frv_fpga_mask, | 75 | .irq_mask = frv_fpga_mask, |
76 | .mask_ack = frv_fpga_mask_ack, | 76 | .irq_mask_ack = frv_fpga_mask_ack, |
77 | .unmask = frv_fpga_unmask, | 77 | .irq_unmask = frv_fpga_unmask, |
78 | }; | 78 | }; |
79 | 79 | ||
80 | /* | 80 | /* |
@@ -146,9 +146,9 @@ void __init fpga_init(void) | |||
146 | __clr_IFR(0x0000); | 146 | __clr_IFR(0x0000); |
147 | 147 | ||
148 | for (irq = IRQ_BASE_FPGA + 1; irq <= IRQ_BASE_FPGA + 14; irq++) | 148 | for (irq = IRQ_BASE_FPGA + 1; irq <= IRQ_BASE_FPGA + 14; irq++) |
149 | set_irq_chip_and_handler(irq, &frv_fpga_pic, handle_level_irq); | 149 | irq_set_chip_and_handler(irq, &frv_fpga_pic, handle_level_irq); |
150 | 150 | ||
151 | set_irq_chip_and_handler(IRQ_FPGA_NMI, &frv_fpga_pic, handle_edge_irq); | 151 | irq_set_chip_and_handler(IRQ_FPGA_NMI, &frv_fpga_pic, handle_edge_irq); |
152 | 152 | ||
153 | /* the FPGA drives the first four external IRQ inputs on the CPU PIC */ | 153 | /* the FPGA drives the first four external IRQ inputs on the CPU PIC */ |
154 | setup_irq(IRQ_CPU_EXTERNAL0, &fpga_irq[0]); | 154 | setup_irq(IRQ_CPU_EXTERNAL0, &fpga_irq[0]); |
diff --git a/arch/frv/kernel/irq-mb93093.c b/arch/frv/kernel/irq-mb93093.c index e45209031873..4d4ad09d3c91 100644 --- a/arch/frv/kernel/irq-mb93093.c +++ b/arch/frv/kernel/irq-mb93093.c | |||
@@ -35,45 +35,44 @@ | |||
35 | /* | 35 | /* |
36 | * off-CPU FPGA PIC operations | 36 | * off-CPU FPGA PIC operations |
37 | */ | 37 | */ |
38 | static void frv_fpga_mask(unsigned int irq) | 38 | static void frv_fpga_mask(struct irq_data *d) |
39 | { | 39 | { |
40 | uint16_t imr = __get_IMR(); | 40 | uint16_t imr = __get_IMR(); |
41 | 41 | ||
42 | imr |= 1 << (irq - IRQ_BASE_FPGA); | 42 | imr |= 1 << (d->irq - IRQ_BASE_FPGA); |
43 | __set_IMR(imr); | 43 | __set_IMR(imr); |
44 | } | 44 | } |
45 | 45 | ||
46 | static void frv_fpga_ack(unsigned int irq) | 46 | static void frv_fpga_ack(struct irq_data *d) |
47 | { | 47 | { |
48 | __clr_IFR(1 << (irq - IRQ_BASE_FPGA)); | 48 | __clr_IFR(1 << (d->irq - IRQ_BASE_FPGA)); |
49 | } | 49 | } |
50 | 50 | ||
51 | static void frv_fpga_mask_ack(unsigned int irq) | 51 | static void frv_fpga_mask_ack(struct irq_data *d) |
52 | { | 52 | { |
53 | uint16_t imr = __get_IMR(); | 53 | uint16_t imr = __get_IMR(); |
54 | 54 | ||
55 | imr |= 1 << (irq - IRQ_BASE_FPGA); | 55 | imr |= 1 << (d->irq - IRQ_BASE_FPGA); |
56 | __set_IMR(imr); | 56 | __set_IMR(imr); |
57 | 57 | ||
58 | __clr_IFR(1 << (irq - IRQ_BASE_FPGA)); | 58 | __clr_IFR(1 << (d->irq - IRQ_BASE_FPGA)); |
59 | } | 59 | } |
60 | 60 | ||
61 | static void frv_fpga_unmask(unsigned int irq) | 61 | static void frv_fpga_unmask(struct irq_data *d) |
62 | { | 62 | { |
63 | uint16_t imr = __get_IMR(); | 63 | uint16_t imr = __get_IMR(); |
64 | 64 | ||
65 | imr &= ~(1 << (irq - IRQ_BASE_FPGA)); | 65 | imr &= ~(1 << (d->irq - IRQ_BASE_FPGA)); |
66 | 66 | ||
67 | __set_IMR(imr); | 67 | __set_IMR(imr); |
68 | } | 68 | } |
69 | 69 | ||
70 | static struct irq_chip frv_fpga_pic = { | 70 | static struct irq_chip frv_fpga_pic = { |
71 | .name = "mb93093", | 71 | .name = "mb93093", |
72 | .ack = frv_fpga_ack, | 72 | .irq_ack = frv_fpga_ack, |
73 | .mask = frv_fpga_mask, | 73 | .irq_mask = frv_fpga_mask, |
74 | .mask_ack = frv_fpga_mask_ack, | 74 | .irq_mask_ack = frv_fpga_mask_ack, |
75 | .unmask = frv_fpga_unmask, | 75 | .irq_unmask = frv_fpga_unmask, |
76 | .end = frv_fpga_end, | ||
77 | }; | 76 | }; |
78 | 77 | ||
79 | /* | 78 | /* |
@@ -94,7 +93,7 @@ static irqreturn_t fpga_interrupt(int irq, void *_mask) | |||
94 | irq = 31 - irq; | 93 | irq = 31 - irq; |
95 | mask &= ~(1 << irq); | 94 | mask &= ~(1 << irq); |
96 | 95 | ||
97 | generic_irq_handle(IRQ_BASE_FPGA + irq); | 96 | generic_handle_irq(IRQ_BASE_FPGA + irq); |
98 | } | 97 | } |
99 | 98 | ||
100 | return IRQ_HANDLED; | 99 | return IRQ_HANDLED; |
@@ -125,7 +124,7 @@ void __init fpga_init(void) | |||
125 | __clr_IFR(0x0000); | 124 | __clr_IFR(0x0000); |
126 | 125 | ||
127 | for (irq = IRQ_BASE_FPGA + 8; irq <= IRQ_BASE_FPGA + 10; irq++) | 126 | for (irq = IRQ_BASE_FPGA + 8; irq <= IRQ_BASE_FPGA + 10; irq++) |
128 | set_irq_chip_and_handler(irq, &frv_fpga_pic, handle_edge_irq); | 127 | irq_set_chip_and_handler(irq, &frv_fpga_pic, handle_edge_irq); |
129 | 128 | ||
130 | /* the FPGA drives external IRQ input #2 on the CPU PIC */ | 129 | /* the FPGA drives external IRQ input #2 on the CPU PIC */ |
131 | setup_irq(IRQ_CPU_EXTERNAL2, &fpga_irq[0]); | 130 | setup_irq(IRQ_CPU_EXTERNAL2, &fpga_irq[0]); |
diff --git a/arch/frv/kernel/irq-mb93493.c b/arch/frv/kernel/irq-mb93493.c index ba55ecdfb245..4d034c7840c9 100644 --- a/arch/frv/kernel/irq-mb93493.c +++ b/arch/frv/kernel/irq-mb93493.c | |||
@@ -45,46 +45,46 @@ | |||
45 | * daughter board PIC operations | 45 | * daughter board PIC operations |
46 | * - there is no way to ACK interrupts in the MB93493 chip | 46 | * - there is no way to ACK interrupts in the MB93493 chip |
47 | */ | 47 | */ |
48 | static void frv_mb93493_mask(unsigned int irq) | 48 | static void frv_mb93493_mask(struct irq_data *d) |
49 | { | 49 | { |
50 | uint32_t iqsr; | 50 | uint32_t iqsr; |
51 | volatile void *piqsr; | 51 | volatile void *piqsr; |
52 | 52 | ||
53 | if (IRQ_ROUTING & (1 << (irq - IRQ_BASE_MB93493))) | 53 | if (IRQ_ROUTING & (1 << (d->irq - IRQ_BASE_MB93493))) |
54 | piqsr = __addr_MB93493_IQSR(1); | 54 | piqsr = __addr_MB93493_IQSR(1); |
55 | else | 55 | else |
56 | piqsr = __addr_MB93493_IQSR(0); | 56 | piqsr = __addr_MB93493_IQSR(0); |
57 | 57 | ||
58 | iqsr = readl(piqsr); | 58 | iqsr = readl(piqsr); |
59 | iqsr &= ~(1 << (irq - IRQ_BASE_MB93493 + 16)); | 59 | iqsr &= ~(1 << (d->irq - IRQ_BASE_MB93493 + 16)); |
60 | writel(iqsr, piqsr); | 60 | writel(iqsr, piqsr); |
61 | } | 61 | } |
62 | 62 | ||
63 | static void frv_mb93493_ack(unsigned int irq) | 63 | static void frv_mb93493_ack(struct irq_data *d) |
64 | { | 64 | { |
65 | } | 65 | } |
66 | 66 | ||
67 | static void frv_mb93493_unmask(unsigned int irq) | 67 | static void frv_mb93493_unmask(struct irq_data *d) |
68 | { | 68 | { |
69 | uint32_t iqsr; | 69 | uint32_t iqsr; |
70 | volatile void *piqsr; | 70 | volatile void *piqsr; |
71 | 71 | ||
72 | if (IRQ_ROUTING & (1 << (irq - IRQ_BASE_MB93493))) | 72 | if (IRQ_ROUTING & (1 << (d->irq - IRQ_BASE_MB93493))) |
73 | piqsr = __addr_MB93493_IQSR(1); | 73 | piqsr = __addr_MB93493_IQSR(1); |
74 | else | 74 | else |
75 | piqsr = __addr_MB93493_IQSR(0); | 75 | piqsr = __addr_MB93493_IQSR(0); |
76 | 76 | ||
77 | iqsr = readl(piqsr); | 77 | iqsr = readl(piqsr); |
78 | iqsr |= 1 << (irq - IRQ_BASE_MB93493 + 16); | 78 | iqsr |= 1 << (d->irq - IRQ_BASE_MB93493 + 16); |
79 | writel(iqsr, piqsr); | 79 | writel(iqsr, piqsr); |
80 | } | 80 | } |
81 | 81 | ||
82 | static struct irq_chip frv_mb93493_pic = { | 82 | static struct irq_chip frv_mb93493_pic = { |
83 | .name = "mb93093", | 83 | .name = "mb93093", |
84 | .ack = frv_mb93493_ack, | 84 | .irq_ack = frv_mb93493_ack, |
85 | .mask = frv_mb93493_mask, | 85 | .irq_mask = frv_mb93493_mask, |
86 | .mask_ack = frv_mb93493_mask, | 86 | .irq_mask_ack = frv_mb93493_mask, |
87 | .unmask = frv_mb93493_unmask, | 87 | .irq_unmask = frv_mb93493_unmask, |
88 | }; | 88 | }; |
89 | 89 | ||
90 | /* | 90 | /* |
@@ -139,7 +139,8 @@ void __init mb93493_init(void) | |||
139 | int irq; | 139 | int irq; |
140 | 140 | ||
141 | for (irq = IRQ_BASE_MB93493 + 0; irq <= IRQ_BASE_MB93493 + 10; irq++) | 141 | for (irq = IRQ_BASE_MB93493 + 0; irq <= IRQ_BASE_MB93493 + 10; irq++) |
142 | set_irq_chip_and_handler(irq, &frv_mb93493_pic, handle_edge_irq); | 142 | irq_set_chip_and_handler(irq, &frv_mb93493_pic, |
143 | handle_edge_irq); | ||
143 | 144 | ||
144 | /* the MB93493 drives external IRQ inputs on the CPU PIC */ | 145 | /* the MB93493 drives external IRQ inputs on the CPU PIC */ |
145 | setup_irq(IRQ_CPU_MB93493_0, &mb93493_irq[0]); | 146 | setup_irq(IRQ_CPU_MB93493_0, &mb93493_irq[0]); |
diff --git a/arch/frv/kernel/irq.c b/arch/frv/kernel/irq.c index 625136625a7f..a5f624a9f559 100644 --- a/arch/frv/kernel/irq.c +++ b/arch/frv/kernel/irq.c | |||
@@ -47,89 +47,45 @@ extern void __init mb93493_init(void); | |||
47 | 47 | ||
48 | atomic_t irq_err_count; | 48 | atomic_t irq_err_count; |
49 | 49 | ||
50 | /* | 50 | int arch_show_interrupts(struct seq_file *p, int prec) |
51 | * Generic, controller-independent functions: | ||
52 | */ | ||
53 | int show_interrupts(struct seq_file *p, void *v) | ||
54 | { | 51 | { |
55 | int i = *(loff_t *) v, cpu; | 52 | seq_printf(p, "%*s: ", prec, "ERR"); |
56 | struct irqaction * action; | 53 | seq_printf(p, "%10u\n", atomic_read(&irq_err_count)); |
57 | unsigned long flags; | ||
58 | |||
59 | if (i == 0) { | ||
60 | char cpuname[12]; | ||
61 | |||
62 | seq_printf(p, " "); | ||
63 | for_each_present_cpu(cpu) { | ||
64 | sprintf(cpuname, "CPU%d", cpu); | ||
65 | seq_printf(p, " %10s", cpuname); | ||
66 | } | ||
67 | seq_putc(p, '\n'); | ||
68 | } | ||
69 | |||
70 | if (i < NR_IRQS) { | ||
71 | raw_spin_lock_irqsave(&irq_desc[i].lock, flags); | ||
72 | action = irq_desc[i].action; | ||
73 | if (action) { | ||
74 | seq_printf(p, "%3d: ", i); | ||
75 | for_each_present_cpu(cpu) | ||
76 | seq_printf(p, "%10u ", kstat_irqs_cpu(i, cpu)); | ||
77 | seq_printf(p, " %10s", irq_desc[i].chip->name ? : "-"); | ||
78 | seq_printf(p, " %s", action->name); | ||
79 | for (action = action->next; | ||
80 | action; | ||
81 | action = action->next) | ||
82 | seq_printf(p, ", %s", action->name); | ||
83 | |||
84 | seq_putc(p, '\n'); | ||
85 | } | ||
86 | |||
87 | raw_spin_unlock_irqrestore(&irq_desc[i].lock, flags); | ||
88 | } else if (i == NR_IRQS) { | ||
89 | seq_printf(p, "Err: %10u\n", atomic_read(&irq_err_count)); | ||
90 | } | ||
91 | |||
92 | return 0; | 54 | return 0; |
93 | } | 55 | } |
94 | 56 | ||
95 | /* | 57 | /* |
96 | * on-CPU PIC operations | 58 | * on-CPU PIC operations |
97 | */ | 59 | */ |
98 | static void frv_cpupic_ack(unsigned int irqlevel) | 60 | static void frv_cpupic_ack(struct irq_data *d) |
99 | { | 61 | { |
100 | __clr_RC(irqlevel); | 62 | __clr_RC(d->irq); |
101 | __clr_IRL(); | 63 | __clr_IRL(); |
102 | } | 64 | } |
103 | 65 | ||
104 | static void frv_cpupic_mask(unsigned int irqlevel) | 66 | static void frv_cpupic_mask(struct irq_data *d) |
105 | { | 67 | { |
106 | __set_MASK(irqlevel); | 68 | __set_MASK(d->irq); |
107 | } | 69 | } |
108 | 70 | ||
109 | static void frv_cpupic_mask_ack(unsigned int irqlevel) | 71 | static void frv_cpupic_mask_ack(struct irq_data *d) |
110 | { | 72 | { |
111 | __set_MASK(irqlevel); | 73 | __set_MASK(d->irq); |
112 | __clr_RC(irqlevel); | 74 | __clr_RC(d->irq); |
113 | __clr_IRL(); | 75 | __clr_IRL(); |
114 | } | 76 | } |
115 | 77 | ||
116 | static void frv_cpupic_unmask(unsigned int irqlevel) | 78 | static void frv_cpupic_unmask(struct irq_data *d) |
117 | { | ||
118 | __clr_MASK(irqlevel); | ||
119 | } | ||
120 | |||
121 | static void frv_cpupic_end(unsigned int irqlevel) | ||
122 | { | 79 | { |
123 | __clr_MASK(irqlevel); | 80 | __clr_MASK(d->irq); |
124 | } | 81 | } |
125 | 82 | ||
126 | static struct irq_chip frv_cpu_pic = { | 83 | static struct irq_chip frv_cpu_pic = { |
127 | .name = "cpu", | 84 | .name = "cpu", |
128 | .ack = frv_cpupic_ack, | 85 | .irq_ack = frv_cpupic_ack, |
129 | .mask = frv_cpupic_mask, | 86 | .irq_mask = frv_cpupic_mask, |
130 | .mask_ack = frv_cpupic_mask_ack, | 87 | .irq_mask_ack = frv_cpupic_mask_ack, |
131 | .unmask = frv_cpupic_unmask, | 88 | .irq_unmask = frv_cpupic_unmask, |
132 | .end = frv_cpupic_end, | ||
133 | }; | 89 | }; |
134 | 90 | ||
135 | /* | 91 | /* |
@@ -161,10 +117,10 @@ void __init init_IRQ(void) | |||
161 | int level; | 117 | int level; |
162 | 118 | ||
163 | for (level = 1; level <= 14; level++) | 119 | for (level = 1; level <= 14; level++) |
164 | set_irq_chip_and_handler(level, &frv_cpu_pic, | 120 | irq_set_chip_and_handler(level, &frv_cpu_pic, |
165 | handle_level_irq); | 121 | handle_level_irq); |
166 | 122 | ||
167 | set_irq_handler(IRQ_CPU_TIMER0, handle_edge_irq); | 123 | irq_set_handler(IRQ_CPU_TIMER0, handle_edge_irq); |
168 | 124 | ||
169 | /* set the trigger levels for internal interrupt sources | 125 | /* set the trigger levels for internal interrupt sources |
170 | * - timers all falling-edge | 126 | * - timers all falling-edge |
diff --git a/arch/frv/kernel/process.c b/arch/frv/kernel/process.c index 2b63b0191f52..9d3597526467 100644 --- a/arch/frv/kernel/process.c +++ b/arch/frv/kernel/process.c | |||
@@ -16,7 +16,6 @@ | |||
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
18 | #include <linux/smp.h> | 18 | #include <linux/smp.h> |
19 | #include <linux/smp_lock.h> | ||
20 | #include <linux/stddef.h> | 19 | #include <linux/stddef.h> |
21 | #include <linux/unistd.h> | 20 | #include <linux/unistd.h> |
22 | #include <linux/ptrace.h> | 21 | #include <linux/ptrace.h> |
@@ -45,9 +44,10 @@ asmlinkage void ret_from_fork(void); | |||
45 | void (*pm_power_off)(void); | 44 | void (*pm_power_off)(void); |
46 | EXPORT_SYMBOL(pm_power_off); | 45 | EXPORT_SYMBOL(pm_power_off); |
47 | 46 | ||
48 | struct task_struct *alloc_task_struct(void) | 47 | struct task_struct *alloc_task_struct_node(int node) |
49 | { | 48 | { |
50 | struct task_struct *p = kmalloc(THREAD_SIZE, GFP_KERNEL); | 49 | struct task_struct *p = kmalloc_node(THREAD_SIZE, GFP_KERNEL, node); |
50 | |||
51 | if (p) | 51 | if (p) |
52 | atomic_set((atomic_t *)(p+1), 1); | 52 | atomic_set((atomic_t *)(p+1), 1); |
53 | return p; | 53 | return p; |
diff --git a/arch/frv/kernel/ptrace.c b/arch/frv/kernel/ptrace.c index fac028936a04..9d68f7fac730 100644 --- a/arch/frv/kernel/ptrace.c +++ b/arch/frv/kernel/ptrace.c | |||
@@ -254,23 +254,26 @@ void ptrace_disable(struct task_struct *child) | |||
254 | user_disable_single_step(child); | 254 | user_disable_single_step(child); |
255 | } | 255 | } |
256 | 256 | ||
257 | long arch_ptrace(struct task_struct *child, long request, long addr, long data) | 257 | long arch_ptrace(struct task_struct *child, long request, |
258 | unsigned long addr, unsigned long data) | ||
258 | { | 259 | { |
259 | unsigned long tmp; | 260 | unsigned long tmp; |
260 | int ret; | 261 | int ret; |
262 | int regno = addr >> 2; | ||
263 | unsigned long __user *datap = (unsigned long __user *) data; | ||
261 | 264 | ||
262 | switch (request) { | 265 | switch (request) { |
263 | /* read the word at location addr in the USER area. */ | 266 | /* read the word at location addr in the USER area. */ |
264 | case PTRACE_PEEKUSR: { | 267 | case PTRACE_PEEKUSR: { |
265 | tmp = 0; | 268 | tmp = 0; |
266 | ret = -EIO; | 269 | ret = -EIO; |
267 | if ((addr & 3) || addr < 0) | 270 | if (addr & 3) |
268 | break; | 271 | break; |
269 | 272 | ||
270 | ret = 0; | 273 | ret = 0; |
271 | switch (addr >> 2) { | 274 | switch (regno) { |
272 | case 0 ... PT__END - 1: | 275 | case 0 ... PT__END - 1: |
273 | tmp = get_reg(child, addr >> 2); | 276 | tmp = get_reg(child, regno); |
274 | break; | 277 | break; |
275 | 278 | ||
276 | case PT__END + 0: | 279 | case PT__END + 0: |
@@ -299,23 +302,18 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
299 | } | 302 | } |
300 | 303 | ||
301 | if (ret == 0) | 304 | if (ret == 0) |
302 | ret = put_user(tmp, (unsigned long *) data); | 305 | ret = put_user(tmp, datap); |
303 | break; | 306 | break; |
304 | } | 307 | } |
305 | 308 | ||
306 | case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ | 309 | case PTRACE_POKEUSR: /* write the word at location addr in the USER area */ |
307 | ret = -EIO; | 310 | ret = -EIO; |
308 | if ((addr & 3) || addr < 0) | 311 | if (addr & 3) |
309 | break; | 312 | break; |
310 | 313 | ||
311 | ret = 0; | 314 | switch (regno) { |
312 | switch (addr >> 2) { | ||
313 | case 0 ... PT__END - 1: | 315 | case 0 ... PT__END - 1: |
314 | ret = put_reg(child, addr >> 2, data); | 316 | ret = put_reg(child, regno, data); |
315 | break; | ||
316 | |||
317 | default: | ||
318 | ret = -EIO; | ||
319 | break; | 317 | break; |
320 | } | 318 | } |
321 | break; | 319 | break; |
@@ -324,25 +322,25 @@ long arch_ptrace(struct task_struct *child, long request, long addr, long data) | |||
324 | return copy_regset_to_user(child, &user_frv_native_view, | 322 | return copy_regset_to_user(child, &user_frv_native_view, |
325 | REGSET_GENERAL, | 323 | REGSET_GENERAL, |
326 | 0, sizeof(child->thread.user->i), | 324 | 0, sizeof(child->thread.user->i), |
327 | (void __user *)data); | 325 | datap); |
328 | 326 | ||
329 | case PTRACE_SETREGS: /* Set all integer regs in the child. */ | 327 | case PTRACE_SETREGS: /* Set all integer regs in the child. */ |
330 | return copy_regset_from_user(child, &user_frv_native_view, | 328 | return copy_regset_from_user(child, &user_frv_native_view, |
331 | REGSET_GENERAL, | 329 | REGSET_GENERAL, |
332 | 0, sizeof(child->thread.user->i), | 330 | 0, sizeof(child->thread.user->i), |
333 | (const void __user *)data); | 331 | datap); |
334 | 332 | ||
335 | case PTRACE_GETFPREGS: /* Get the child FP/Media state. */ | 333 | case PTRACE_GETFPREGS: /* Get the child FP/Media state. */ |
336 | return copy_regset_to_user(child, &user_frv_native_view, | 334 | return copy_regset_to_user(child, &user_frv_native_view, |
337 | REGSET_FPMEDIA, | 335 | REGSET_FPMEDIA, |
338 | 0, sizeof(child->thread.user->f), | 336 | 0, sizeof(child->thread.user->f), |
339 | (void __user *)data); | 337 | datap); |
340 | 338 | ||
341 | case PTRACE_SETFPREGS: /* Set the child FP/Media state. */ | 339 | case PTRACE_SETFPREGS: /* Set the child FP/Media state. */ |
342 | return copy_regset_from_user(child, &user_frv_native_view, | 340 | return copy_regset_from_user(child, &user_frv_native_view, |
343 | REGSET_FPMEDIA, | 341 | REGSET_FPMEDIA, |
344 | 0, sizeof(child->thread.user->f), | 342 | 0, sizeof(child->thread.user->f), |
345 | (const void __user *)data); | 343 | datap); |
346 | 344 | ||
347 | default: | 345 | default: |
348 | ret = ptrace_request(child, request, addr, data); | 346 | ret = ptrace_request(child, request, addr, data); |
diff --git a/arch/frv/kernel/time.c b/arch/frv/kernel/time.c index 0ddbbae83cb2..b457de496b70 100644 --- a/arch/frv/kernel/time.c +++ b/arch/frv/kernel/time.c | |||
@@ -50,21 +50,13 @@ static struct irqaction timer_irq = { | |||
50 | 50 | ||
51 | /* | 51 | /* |
52 | * timer_interrupt() needs to keep up the real-time clock, | 52 | * timer_interrupt() needs to keep up the real-time clock, |
53 | * as well as call the "do_timer()" routine every clocktick | 53 | * as well as call the "xtime_update()" routine every clocktick |
54 | */ | 54 | */ |
55 | static irqreturn_t timer_interrupt(int irq, void *dummy) | 55 | static irqreturn_t timer_interrupt(int irq, void *dummy) |
56 | { | 56 | { |
57 | profile_tick(CPU_PROFILING); | 57 | profile_tick(CPU_PROFILING); |
58 | /* | ||
59 | * Here we are in the timer irq handler. We just have irqs locally | ||
60 | * disabled but we don't know if the timer_bh is running on the other | ||
61 | * CPU. We need to avoid to SMP race with it. NOTE: we don't need | ||
62 | * the irq version of write_lock because as just said we have irq | ||
63 | * locally disabled. -arca | ||
64 | */ | ||
65 | write_seqlock(&xtime_lock); | ||
66 | 58 | ||
67 | do_timer(1); | 59 | xtime_update(1); |
68 | 60 | ||
69 | #ifdef CONFIG_HEARTBEAT | 61 | #ifdef CONFIG_HEARTBEAT |
70 | static unsigned short n; | 62 | static unsigned short n; |
@@ -72,8 +64,6 @@ static irqreturn_t timer_interrupt(int irq, void *dummy) | |||
72 | __set_LEDS(n); | 64 | __set_LEDS(n); |
73 | #endif /* CONFIG_HEARTBEAT */ | 65 | #endif /* CONFIG_HEARTBEAT */ |
74 | 66 | ||
75 | write_sequnlock(&xtime_lock); | ||
76 | |||
77 | update_process_times(user_mode(get_irq_regs())); | 67 | update_process_times(user_mode(get_irq_regs())); |
78 | 68 | ||
79 | return IRQ_HANDLED; | 69 | return IRQ_HANDLED; |
diff --git a/arch/frv/kernel/vmlinux.lds.S b/arch/frv/kernel/vmlinux.lds.S index 8b973f3cc90e..7e958d829ec9 100644 --- a/arch/frv/kernel/vmlinux.lds.S +++ b/arch/frv/kernel/vmlinux.lds.S | |||
@@ -37,7 +37,7 @@ SECTIONS | |||
37 | _einittext = .; | 37 | _einittext = .; |
38 | 38 | ||
39 | INIT_DATA_SECTION(8) | 39 | INIT_DATA_SECTION(8) |
40 | PERCPU(4096) | 40 | PERCPU_SECTION(L1_CACHE_BYTES) |
41 | 41 | ||
42 | . = ALIGN(PAGE_SIZE); | 42 | . = ALIGN(PAGE_SIZE); |
43 | __init_end = .; | 43 | __init_end = .; |