diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/kernel/Makefile | 5 | ||||
-rw-r--r-- | arch/arm/kernel/asm-offsets.c | 20 | ||||
-rw-r--r-- | arch/arm/kernel/entry-armv.S | 67 | ||||
-rw-r--r-- | arch/arm/kernel/entry-common.S | 65 | ||||
-rw-r--r-- | arch/arm/kernel/entry-header.S | 143 | ||||
-rw-r--r-- | arch/arm/kernel/traps.c | 11 | ||||
-rw-r--r-- | arch/arm/mach-pxa/sleep.S | 56 | ||||
-rw-r--r-- | arch/ppc64/kernel/rtas_flash.c | 12 | ||||
-rw-r--r-- | arch/ppc64/kernel/scanlog.c | 4 | ||||
-rw-r--r-- | arch/ppc64/xmon/ppc-opc.c | 119 | ||||
-rw-r--r-- | arch/x86_64/kernel/signal.c | 2 |
11 files changed, 243 insertions, 261 deletions
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile index 07a56ff61494..4a2af55e134b 100644 --- a/arch/arm/kernel/Makefile +++ b/arch/arm/kernel/Makefile | |||
@@ -31,8 +31,3 @@ head-y := head.o | |||
31 | obj-$(CONFIG_DEBUG_LL) += debug.o | 31 | obj-$(CONFIG_DEBUG_LL) += debug.o |
32 | 32 | ||
33 | extra-y := $(head-y) init_task.o vmlinux.lds | 33 | extra-y := $(head-y) init_task.o vmlinux.lds |
34 | |||
35 | # Spell out some dependencies that aren't automatically figured out | ||
36 | $(obj)/entry-armv.o: $(obj)/entry-header.S include/asm-arm/constants.h | ||
37 | $(obj)/entry-common.o: $(obj)/entry-header.S include/asm-arm/constants.h \ | ||
38 | $(obj)/calls.S | ||
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c index 99d43259ff89..c1ff4d1f1bfd 100644 --- a/arch/arm/kernel/asm-offsets.c +++ b/arch/arm/kernel/asm-offsets.c | |||
@@ -64,6 +64,26 @@ int main(void) | |||
64 | DEFINE(TI_VFPSTATE, offsetof(struct thread_info, vfpstate)); | 64 | DEFINE(TI_VFPSTATE, offsetof(struct thread_info, vfpstate)); |
65 | DEFINE(TI_IWMMXT_STATE, (offsetof(struct thread_info, fpstate)+4)&~7); | 65 | DEFINE(TI_IWMMXT_STATE, (offsetof(struct thread_info, fpstate)+4)&~7); |
66 | BLANK(); | 66 | BLANK(); |
67 | DEFINE(S_R0, offsetof(struct pt_regs, ARM_r0)); | ||
68 | DEFINE(S_R1, offsetof(struct pt_regs, ARM_r1)); | ||
69 | DEFINE(S_R2, offsetof(struct pt_regs, ARM_r2)); | ||
70 | DEFINE(S_R3, offsetof(struct pt_regs, ARM_r3)); | ||
71 | DEFINE(S_R4, offsetof(struct pt_regs, ARM_r4)); | ||
72 | DEFINE(S_R5, offsetof(struct pt_regs, ARM_r5)); | ||
73 | DEFINE(S_R6, offsetof(struct pt_regs, ARM_r6)); | ||
74 | DEFINE(S_R7, offsetof(struct pt_regs, ARM_r7)); | ||
75 | DEFINE(S_R8, offsetof(struct pt_regs, ARM_r8)); | ||
76 | DEFINE(S_R9, offsetof(struct pt_regs, ARM_r9)); | ||
77 | DEFINE(S_R10, offsetof(struct pt_regs, ARM_r10)); | ||
78 | DEFINE(S_FP, offsetof(struct pt_regs, ARM_fp)); | ||
79 | DEFINE(S_IP, offsetof(struct pt_regs, ARM_ip)); | ||
80 | DEFINE(S_SP, offsetof(struct pt_regs, ARM_sp)); | ||
81 | DEFINE(S_LR, offsetof(struct pt_regs, ARM_lr)); | ||
82 | DEFINE(S_PC, offsetof(struct pt_regs, ARM_pc)); | ||
83 | DEFINE(S_PSR, offsetof(struct pt_regs, ARM_cpsr)); | ||
84 | DEFINE(S_OLD_R0, offsetof(struct pt_regs, ARM_ORIG_r0)); | ||
85 | DEFINE(S_FRAME_SIZE, sizeof(struct pt_regs)); | ||
86 | BLANK(); | ||
67 | #if __LINUX_ARM_ARCH__ >= 6 | 87 | #if __LINUX_ARM_ARCH__ >= 6 |
68 | DEFINE(MM_CONTEXT_ID, offsetof(struct mm_struct, context.id)); | 88 | DEFINE(MM_CONTEXT_ID, offsetof(struct mm_struct, context.id)); |
69 | BLANK(); | 89 | BLANK(); |
diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S index bb27c317d94b..2a5c3fe09a95 100644 --- a/arch/arm/kernel/entry-armv.S +++ b/arch/arm/kernel/entry-armv.S | |||
@@ -14,12 +14,12 @@ | |||
14 | * it to save wrong values... Be aware! | 14 | * it to save wrong values... Be aware! |
15 | */ | 15 | */ |
16 | #include <linux/config.h> | 16 | #include <linux/config.h> |
17 | #include <linux/init.h> | ||
18 | 17 | ||
19 | #include <asm/thread_info.h> | ||
20 | #include <asm/glue.h> | 18 | #include <asm/glue.h> |
21 | #include <asm/ptrace.h> | ||
22 | #include <asm/vfpmacros.h> | 19 | #include <asm/vfpmacros.h> |
20 | #include <asm/hardware.h> @ should be moved into entry-macro.S | ||
21 | #include <asm/arch/irqs.h> @ should be moved into entry-macro.S | ||
22 | #include <asm/arch/entry-macro.S> | ||
23 | 23 | ||
24 | #include "entry-header.S" | 24 | #include "entry-header.S" |
25 | 25 | ||
@@ -118,7 +118,7 @@ __dabt_svc: | |||
118 | @ | 118 | @ |
119 | @ IRQs off again before pulling preserved data off the stack | 119 | @ IRQs off again before pulling preserved data off the stack |
120 | @ | 120 | @ |
121 | disable_irq r0 | 121 | disable_irq |
122 | 122 | ||
123 | @ | 123 | @ |
124 | @ restore SPSR and restart the instruction | 124 | @ restore SPSR and restart the instruction |
@@ -198,7 +198,7 @@ __und_svc: | |||
198 | @ | 198 | @ |
199 | @ IRQs off again before pulling preserved data off the stack | 199 | @ IRQs off again before pulling preserved data off the stack |
200 | @ | 200 | @ |
201 | 1: disable_irq r0 | 201 | 1: disable_irq |
202 | 202 | ||
203 | @ | 203 | @ |
204 | @ restore SPSR and restart the instruction | 204 | @ restore SPSR and restart the instruction |
@@ -232,7 +232,7 @@ __pabt_svc: | |||
232 | @ | 232 | @ |
233 | @ IRQs off again before pulling preserved data off the stack | 233 | @ IRQs off again before pulling preserved data off the stack |
234 | @ | 234 | @ |
235 | disable_irq r0 | 235 | disable_irq |
236 | 236 | ||
237 | @ | 237 | @ |
238 | @ restore SPSR and restart the instruction | 238 | @ restore SPSR and restart the instruction |
@@ -316,7 +316,7 @@ __dabt_usr: | |||
316 | @ | 316 | @ |
317 | @ IRQs on, then call the main handler | 317 | @ IRQs on, then call the main handler |
318 | @ | 318 | @ |
319 | enable_irq r2 | 319 | enable_irq |
320 | mov r2, sp | 320 | mov r2, sp |
321 | adr lr, ret_from_exception | 321 | adr lr, ret_from_exception |
322 | b do_DataAbort | 322 | b do_DataAbort |
@@ -418,7 +418,7 @@ call_fpe: | |||
418 | movcss r7, r5, lsr #(TIF_USING_IWMMXT + 1) | 418 | movcss r7, r5, lsr #(TIF_USING_IWMMXT + 1) |
419 | bcs iwmmxt_task_enable | 419 | bcs iwmmxt_task_enable |
420 | #endif | 420 | #endif |
421 | enable_irq r7 | 421 | enable_irq |
422 | add pc, pc, r8, lsr #6 | 422 | add pc, pc, r8, lsr #6 |
423 | mov r0, r0 | 423 | mov r0, r0 |
424 | 424 | ||
@@ -472,7 +472,7 @@ fpundefinstr: | |||
472 | __pabt_usr: | 472 | __pabt_usr: |
473 | usr_entry abt | 473 | usr_entry abt |
474 | 474 | ||
475 | enable_irq r0 @ Enable interrupts | 475 | enable_irq @ Enable interrupts |
476 | mov r0, r2 @ address (pc) | 476 | mov r0, r2 @ address (pc) |
477 | mov r1, sp @ regs | 477 | mov r1, sp @ regs |
478 | bl do_PrefetchAbort @ call abort handler | 478 | bl do_PrefetchAbort @ call abort handler |
@@ -522,8 +522,9 @@ ENTRY(__switch_to) | |||
522 | /* | 522 | /* |
523 | * Vector stubs. | 523 | * Vector stubs. |
524 | * | 524 | * |
525 | * This code is copied to 0x200 or 0xffff0200 so we can use branches in the | 525 | * This code is copied to 0xffff0200 so we can use branches in the |
526 | * vectors, rather than ldr's. | 526 | * vectors, rather than ldr's. Note that this code must not |
527 | * exceed 0x300 bytes. | ||
527 | * | 528 | * |
528 | * Common stub entry macro: | 529 | * Common stub entry macro: |
529 | * Enter in IRQ mode, spsr = SVC/USR CPSR, lr = SVC/USR PC | 530 | * Enter in IRQ mode, spsr = SVC/USR CPSR, lr = SVC/USR PC |
@@ -544,7 +545,7 @@ vector_\name: | |||
544 | @ | 545 | @ |
545 | mrs r13, cpsr | 546 | mrs r13, cpsr |
546 | bic r13, r13, #MODE_MASK | 547 | bic r13, r13, #MODE_MASK |
547 | orr r13, r13, #MODE_SVC | 548 | orr r13, r13, #SVC_MODE |
548 | msr spsr_cxsf, r13 @ switch to SVC_32 mode | 549 | msr spsr_cxsf, r13 @ switch to SVC_32 mode |
549 | 550 | ||
550 | and lr, lr, #15 | 551 | and lr, lr, #15 |
@@ -552,6 +553,7 @@ vector_\name: | |||
552 | movs pc, lr @ Changes mode and branches | 553 | movs pc, lr @ Changes mode and branches |
553 | .endm | 554 | .endm |
554 | 555 | ||
556 | .globl __stubs_start | ||
555 | __stubs_start: | 557 | __stubs_start: |
556 | /* | 558 | /* |
557 | * Interrupt dispatcher | 559 | * Interrupt dispatcher |
@@ -686,37 +688,24 @@ vector_addrexcptn: | |||
686 | .LCsabt: | 688 | .LCsabt: |
687 | .word __temp_abt | 689 | .word __temp_abt |
688 | 690 | ||
691 | .globl __stubs_end | ||
689 | __stubs_end: | 692 | __stubs_end: |
690 | 693 | ||
691 | .equ __real_stubs_start, .LCvectors + 0x200 | 694 | .equ stubs_offset, __vectors_start + 0x200 - __stubs_start |
692 | 695 | ||
693 | .LCvectors: | 696 | .globl __vectors_start |
697 | __vectors_start: | ||
694 | swi SYS_ERROR0 | 698 | swi SYS_ERROR0 |
695 | b __real_stubs_start + (vector_und - __stubs_start) | 699 | b vector_und + stubs_offset |
696 | ldr pc, __real_stubs_start + (.LCvswi - __stubs_start) | 700 | ldr pc, .LCvswi + stubs_offset |
697 | b __real_stubs_start + (vector_pabt - __stubs_start) | 701 | b vector_pabt + stubs_offset |
698 | b __real_stubs_start + (vector_dabt - __stubs_start) | 702 | b vector_dabt + stubs_offset |
699 | b __real_stubs_start + (vector_addrexcptn - __stubs_start) | 703 | b vector_addrexcptn + stubs_offset |
700 | b __real_stubs_start + (vector_irq - __stubs_start) | 704 | b vector_irq + stubs_offset |
701 | b __real_stubs_start + (vector_fiq - __stubs_start) | 705 | b vector_fiq + stubs_offset |
702 | 706 | ||
703 | ENTRY(__trap_init) | 707 | .globl __vectors_end |
704 | stmfd sp!, {r4 - r6, lr} | 708 | __vectors_end: |
705 | |||
706 | mov r0, #0xff000000 | ||
707 | orr r0, r0, #0x00ff0000 @ high vectors position | ||
708 | adr r1, .LCvectors @ set up the vectors | ||
709 | ldmia r1, {r1, r2, r3, r4, r5, r6, ip, lr} | ||
710 | stmia r0, {r1, r2, r3, r4, r5, r6, ip, lr} | ||
711 | |||
712 | add r2, r0, #0x200 | ||
713 | adr r0, __stubs_start @ copy stubs to 0x200 | ||
714 | adr r1, __stubs_end | ||
715 | 1: ldr r3, [r0], #4 | ||
716 | str r3, [r2], #4 | ||
717 | cmp r0, r1 | ||
718 | blt 1b | ||
719 | LOADREGS(fd, sp!, {r4 - r6, pc}) | ||
720 | 709 | ||
721 | .data | 710 | .data |
722 | 711 | ||
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S index 53a7e0dea44d..3f8d0e3aefab 100644 --- a/arch/arm/kernel/entry-common.S +++ b/arch/arm/kernel/entry-common.S | |||
@@ -9,19 +9,10 @@ | |||
9 | */ | 9 | */ |
10 | #include <linux/config.h> | 10 | #include <linux/config.h> |
11 | 11 | ||
12 | #include <asm/thread_info.h> | ||
13 | #include <asm/ptrace.h> | ||
14 | #include <asm/unistd.h> | 12 | #include <asm/unistd.h> |
15 | 13 | ||
16 | #include "entry-header.S" | 14 | #include "entry-header.S" |
17 | 15 | ||
18 | /* | ||
19 | * We rely on the fact that R0 is at the bottom of the stack (due to | ||
20 | * slow/fast restore user regs). | ||
21 | */ | ||
22 | #if S_R0 != 0 | ||
23 | #error "Please fix" | ||
24 | #endif | ||
25 | 16 | ||
26 | .align 5 | 17 | .align 5 |
27 | /* | 18 | /* |
@@ -30,11 +21,19 @@ | |||
30 | * stack. | 21 | * stack. |
31 | */ | 22 | */ |
32 | ret_fast_syscall: | 23 | ret_fast_syscall: |
33 | disable_irq r1 @ disable interrupts | 24 | disable_irq @ disable interrupts |
34 | ldr r1, [tsk, #TI_FLAGS] | 25 | ldr r1, [tsk, #TI_FLAGS] |
35 | tst r1, #_TIF_WORK_MASK | 26 | tst r1, #_TIF_WORK_MASK |
36 | bne fast_work_pending | 27 | bne fast_work_pending |
37 | fast_restore_user_regs | 28 | |
29 | @ fast_restore_user_regs | ||
30 | ldr r1, [sp, #S_OFF + S_PSR] @ get calling cpsr | ||
31 | ldr lr, [sp, #S_OFF + S_PC]! @ get pc | ||
32 | msr spsr_cxsf, r1 @ save in spsr_svc | ||
33 | ldmdb sp, {r1 - lr}^ @ get calling r1 - lr | ||
34 | mov r0, r0 | ||
35 | add sp, sp, #S_FRAME_SIZE - S_PC | ||
36 | movs pc, lr @ return & move spsr_svc into cpsr | ||
38 | 37 | ||
39 | /* | 38 | /* |
40 | * Ok, we need to do extra processing, enter the slow path. | 39 | * Ok, we need to do extra processing, enter the slow path. |
@@ -49,7 +48,7 @@ work_pending: | |||
49 | mov r0, sp @ 'regs' | 48 | mov r0, sp @ 'regs' |
50 | mov r2, why @ 'syscall' | 49 | mov r2, why @ 'syscall' |
51 | bl do_notify_resume | 50 | bl do_notify_resume |
52 | disable_irq r1 @ disable interrupts | 51 | disable_irq @ disable interrupts |
53 | b no_work_pending | 52 | b no_work_pending |
54 | 53 | ||
55 | work_resched: | 54 | work_resched: |
@@ -59,12 +58,19 @@ work_resched: | |||
59 | */ | 58 | */ |
60 | ENTRY(ret_to_user) | 59 | ENTRY(ret_to_user) |
61 | ret_slow_syscall: | 60 | ret_slow_syscall: |
62 | disable_irq r1 @ disable interrupts | 61 | disable_irq @ disable interrupts |
63 | ldr r1, [tsk, #TI_FLAGS] | 62 | ldr r1, [tsk, #TI_FLAGS] |
64 | tst r1, #_TIF_WORK_MASK | 63 | tst r1, #_TIF_WORK_MASK |
65 | bne work_pending | 64 | bne work_pending |
66 | no_work_pending: | 65 | no_work_pending: |
67 | slow_restore_user_regs | 66 | @ slow_restore_user_regs |
67 | ldr r1, [sp, #S_PSR] @ get calling cpsr | ||
68 | ldr lr, [sp, #S_PC]! @ get pc | ||
69 | msr spsr_cxsf, r1 @ save in spsr_svc | ||
70 | ldmdb sp, {r0 - lr}^ @ get calling r1 - lr | ||
71 | mov r0, r0 | ||
72 | add sp, sp, #S_FRAME_SIZE - S_PC | ||
73 | movs pc, lr @ return & move spsr_svc into cpsr | ||
68 | 74 | ||
69 | /* | 75 | /* |
70 | * This is how we return from a fork. | 76 | * This is how we return from a fork. |
@@ -116,9 +122,26 @@ ENTRY(ret_from_fork) | |||
116 | 122 | ||
117 | .align 5 | 123 | .align 5 |
118 | ENTRY(vector_swi) | 124 | ENTRY(vector_swi) |
119 | save_user_regs | 125 | sub sp, sp, #S_FRAME_SIZE |
126 | stmia sp, {r0 - r12} @ Calling r0 - r12 | ||
127 | add r8, sp, #S_PC | ||
128 | stmdb r8, {sp, lr}^ @ Calling sp, lr | ||
129 | mrs r8, spsr @ called from non-FIQ mode, so ok. | ||
130 | str lr, [sp, #S_PC] @ Save calling PC | ||
131 | str r8, [sp, #S_PSR] @ Save CPSR | ||
132 | str r0, [sp, #S_OLD_R0] @ Save OLD_R0 | ||
120 | zero_fp | 133 | zero_fp |
121 | get_scno | 134 | |
135 | /* | ||
136 | * Get the system call number. | ||
137 | */ | ||
138 | #ifdef CONFIG_ARM_THUMB | ||
139 | tst r8, #PSR_T_BIT @ this is SPSR from save_user_regs | ||
140 | addne scno, r7, #__NR_SYSCALL_BASE @ put OS number in | ||
141 | ldreq scno, [lr, #-4] | ||
142 | #else | ||
143 | ldr scno, [lr, #-4] @ get SWI instruction | ||
144 | #endif | ||
122 | arm710_bug_check scno, ip | 145 | arm710_bug_check scno, ip |
123 | 146 | ||
124 | #ifdef CONFIG_ALIGNMENT_TRAP | 147 | #ifdef CONFIG_ALIGNMENT_TRAP |
@@ -126,14 +149,14 @@ ENTRY(vector_swi) | |||
126 | ldr ip, [ip] | 149 | ldr ip, [ip] |
127 | mcr p15, 0, ip, c1, c0 @ update control register | 150 | mcr p15, 0, ip, c1, c0 @ update control register |
128 | #endif | 151 | #endif |
129 | enable_irq ip | 152 | enable_irq |
130 | 153 | ||
131 | str r4, [sp, #-S_OFF]! @ push fifth arg | 154 | str r4, [sp, #-S_OFF]! @ push fifth arg |
132 | 155 | ||
133 | get_thread_info tsk | 156 | get_thread_info tsk |
134 | ldr ip, [tsk, #TI_FLAGS] @ check for syscall tracing | 157 | ldr ip, [tsk, #TI_FLAGS] @ check for syscall tracing |
135 | bic scno, scno, #0xff000000 @ mask off SWI op-code | 158 | bic scno, scno, #0xff000000 @ mask off SWI op-code |
136 | eor scno, scno, #OS_NUMBER << 20 @ check OS number | 159 | eor scno, scno, #__NR_SYSCALL_BASE @ check OS number |
137 | adr tbl, sys_call_table @ load syscall table pointer | 160 | adr tbl, sys_call_table @ load syscall table pointer |
138 | tst ip, #_TIF_SYSCALL_TRACE @ are we tracing syscalls? | 161 | tst ip, #_TIF_SYSCALL_TRACE @ are we tracing syscalls? |
139 | bne __sys_trace | 162 | bne __sys_trace |
@@ -144,8 +167,8 @@ ENTRY(vector_swi) | |||
144 | 167 | ||
145 | add r1, sp, #S_OFF | 168 | add r1, sp, #S_OFF |
146 | 2: mov why, #0 @ no longer a real syscall | 169 | 2: mov why, #0 @ no longer a real syscall |
147 | cmp scno, #ARMSWI_OFFSET | 170 | cmp scno, #(__ARM_NR_BASE - __NR_SYSCALL_BASE) |
148 | eor r0, scno, #OS_NUMBER << 20 @ put OS number back | 171 | eor r0, scno, #__NR_SYSCALL_BASE @ put OS number back |
149 | bcs arm_syscall | 172 | bcs arm_syscall |
150 | b sys_ni_syscall @ not private func | 173 | b sys_ni_syscall @ not private func |
151 | 174 | ||
@@ -190,7 +213,7 @@ ENTRY(sys_call_table) | |||
190 | @ r5 = syscall table | 213 | @ r5 = syscall table |
191 | .type sys_syscall, #function | 214 | .type sys_syscall, #function |
192 | sys_syscall: | 215 | sys_syscall: |
193 | eor scno, r0, #OS_NUMBER << 20 | 216 | eor scno, r0, #__NR_SYSCALL_BASE |
194 | cmp scno, #__NR_syscall - __NR_SYSCALL_BASE | 217 | cmp scno, #__NR_syscall - __NR_SYSCALL_BASE |
195 | cmpne scno, #NR_syscalls @ check range | 218 | cmpne scno, #NR_syscalls @ check range |
196 | stmloia sp, {r5, r6} @ shuffle args | 219 | stmloia sp, {r5, r6} @ shuffle args |
diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S index 4039d8c120b5..a3d40a0e2b04 100644 --- a/arch/arm/kernel/entry-header.S +++ b/arch/arm/kernel/entry-header.S | |||
@@ -1,24 +1,11 @@ | |||
1 | #include <linux/config.h> /* for CONFIG_ARCH_xxxx */ | 1 | #include <linux/config.h> |
2 | #include <linux/init.h> | ||
2 | #include <linux/linkage.h> | 3 | #include <linux/linkage.h> |
3 | 4 | ||
4 | #include <asm/assembler.h> | 5 | #include <asm/assembler.h> |
5 | #include <asm/constants.h> | 6 | #include <asm/constants.h> |
6 | #include <asm/errno.h> | 7 | #include <asm/errno.h> |
7 | #include <asm/hardware.h> | 8 | #include <asm/thread_info.h> |
8 | #include <asm/arch/irqs.h> | ||
9 | #include <asm/arch/entry-macro.S> | ||
10 | |||
11 | #ifndef MODE_SVC | ||
12 | #define MODE_SVC 0x13 | ||
13 | #endif | ||
14 | |||
15 | .macro zero_fp | ||
16 | #ifdef CONFIG_FRAME_POINTER | ||
17 | mov fp, #0 | ||
18 | #endif | ||
19 | .endm | ||
20 | |||
21 | .text | ||
22 | 9 | ||
23 | @ Bad Abort numbers | 10 | @ Bad Abort numbers |
24 | @ ----------------- | 11 | @ ----------------- |
@@ -29,113 +16,44 @@ | |||
29 | #define BAD_IRQ 3 | 16 | #define BAD_IRQ 3 |
30 | #define BAD_UNDEFINSTR 4 | 17 | #define BAD_UNDEFINSTR 4 |
31 | 18 | ||
32 | #define PT_TRACESYS 0x00000002 | ||
33 | |||
34 | @ OS version number used in SWIs | ||
35 | @ RISC OS is 0 | ||
36 | @ RISC iX is 8 | ||
37 | @ | 19 | @ |
38 | #define OS_NUMBER 9 | 20 | @ Most of the stack format comes from struct pt_regs, but with |
39 | #define ARMSWI_OFFSET 0x000f0000 | 21 | @ the addition of 8 bytes for storing syscall args 5 and 6. |
40 | |||
41 | @ | 22 | @ |
42 | @ Stack format (ensured by USER_* and SVC_*) | ||
43 | @ | ||
44 | #define S_FRAME_SIZE 72 | ||
45 | #define S_OLD_R0 68 | ||
46 | #define S_PSR 64 | ||
47 | |||
48 | #define S_PC 60 | ||
49 | #define S_LR 56 | ||
50 | #define S_SP 52 | ||
51 | #define S_IP 48 | ||
52 | #define S_FP 44 | ||
53 | #define S_R10 40 | ||
54 | #define S_R9 36 | ||
55 | #define S_R8 32 | ||
56 | #define S_R7 28 | ||
57 | #define S_R6 24 | ||
58 | #define S_R5 20 | ||
59 | #define S_R4 16 | ||
60 | #define S_R3 12 | ||
61 | #define S_R2 8 | ||
62 | #define S_R1 4 | ||
63 | #define S_R0 0 | ||
64 | #define S_OFF 8 | 23 | #define S_OFF 8 |
65 | 24 | ||
66 | .macro set_cpsr_c, reg, mode | 25 | /* |
67 | msr cpsr_c, \mode | 26 | * The SWI code relies on the fact that R0 is at the bottom of the stack |
27 | * (due to slow/fast restore user regs). | ||
28 | */ | ||
29 | #if S_R0 != 0 | ||
30 | #error "Please fix" | ||
31 | #endif | ||
32 | |||
33 | .macro zero_fp | ||
34 | #ifdef CONFIG_FRAME_POINTER | ||
35 | mov fp, #0 | ||
36 | #endif | ||
68 | .endm | 37 | .endm |
69 | 38 | ||
70 | #if __LINUX_ARM_ARCH__ >= 6 | 39 | #if __LINUX_ARM_ARCH__ >= 6 |
71 | .macro disable_irq, temp | 40 | .macro disable_irq |
72 | cpsid i | 41 | cpsid i |
73 | .endm | 42 | .endm |
74 | 43 | ||
75 | .macro enable_irq, temp | 44 | .macro enable_irq |
76 | cpsie i | 45 | cpsie i |
77 | .endm | 46 | .endm |
78 | #else | 47 | #else |
79 | .macro disable_irq, temp | 48 | .macro disable_irq |
80 | set_cpsr_c \temp, #PSR_I_BIT | MODE_SVC | 49 | msr cpsr_c, #PSR_I_BIT | SVC_MODE |
81 | .endm | 50 | .endm |
82 | 51 | ||
83 | .macro enable_irq, temp | 52 | .macro enable_irq |
84 | set_cpsr_c \temp, #MODE_SVC | 53 | msr cpsr_c, #SVC_MODE |
85 | .endm | 54 | .endm |
86 | #endif | 55 | #endif |
87 | 56 | ||
88 | .macro save_user_regs | ||
89 | sub sp, sp, #S_FRAME_SIZE | ||
90 | stmia sp, {r0 - r12} @ Calling r0 - r12 | ||
91 | add r8, sp, #S_PC | ||
92 | stmdb r8, {sp, lr}^ @ Calling sp, lr | ||
93 | mrs r8, spsr @ called from non-FIQ mode, so ok. | ||
94 | str lr, [sp, #S_PC] @ Save calling PC | ||
95 | str r8, [sp, #S_PSR] @ Save CPSR | ||
96 | str r0, [sp, #S_OLD_R0] @ Save OLD_R0 | ||
97 | .endm | ||
98 | |||
99 | .macro restore_user_regs | ||
100 | ldr r1, [sp, #S_PSR] @ Get calling cpsr | ||
101 | disable_irq ip @ disable IRQs | ||
102 | ldr lr, [sp, #S_PC]! @ Get PC | ||
103 | msr spsr_cxsf, r1 @ save in spsr_svc | ||
104 | ldmdb sp, {r0 - lr}^ @ Get calling r0 - lr | ||
105 | mov r0, r0 | ||
106 | add sp, sp, #S_FRAME_SIZE - S_PC | ||
107 | movs pc, lr @ return & move spsr_svc into cpsr | ||
108 | .endm | ||
109 | |||
110 | /* | ||
111 | * Must be called with IRQs already disabled. | ||
112 | */ | ||
113 | .macro fast_restore_user_regs | ||
114 | ldr r1, [sp, #S_OFF + S_PSR] @ get calling cpsr | ||
115 | ldr lr, [sp, #S_OFF + S_PC]! @ get pc | ||
116 | msr spsr_cxsf, r1 @ save in spsr_svc | ||
117 | ldmdb sp, {r1 - lr}^ @ get calling r1 - lr | ||
118 | mov r0, r0 | ||
119 | add sp, sp, #S_FRAME_SIZE - S_PC | ||
120 | movs pc, lr @ return & move spsr_svc into cpsr | ||
121 | .endm | ||
122 | |||
123 | /* | ||
124 | * Must be called with IRQs already disabled. | ||
125 | */ | ||
126 | .macro slow_restore_user_regs | ||
127 | ldr r1, [sp, #S_PSR] @ get calling cpsr | ||
128 | ldr lr, [sp, #S_PC]! @ get pc | ||
129 | msr spsr_cxsf, r1 @ save in spsr_svc | ||
130 | ldmdb sp, {r0 - lr}^ @ get calling r1 - lr | ||
131 | mov r0, r0 | ||
132 | add sp, sp, #S_FRAME_SIZE - S_PC | ||
133 | movs pc, lr @ return & move spsr_svc into cpsr | ||
134 | .endm | ||
135 | |||
136 | .macro mask_pc, rd, rm | ||
137 | .endm | ||
138 | |||
139 | .macro get_thread_info, rd | 57 | .macro get_thread_info, rd |
140 | mov \rd, sp, lsr #13 | 58 | mov \rd, sp, lsr #13 |
141 | mov \rd, \rd, lsl #13 | 59 | mov \rd, \rd, lsl #13 |
@@ -165,18 +83,3 @@ scno .req r7 @ syscall number | |||
165 | tbl .req r8 @ syscall table pointer | 83 | tbl .req r8 @ syscall table pointer |
166 | why .req r8 @ Linux syscall (!= 0) | 84 | why .req r8 @ Linux syscall (!= 0) |
167 | tsk .req r9 @ current thread_info | 85 | tsk .req r9 @ current thread_info |
168 | |||
169 | /* | ||
170 | * Get the system call number. | ||
171 | */ | ||
172 | .macro get_scno | ||
173 | #ifdef CONFIG_ARM_THUMB | ||
174 | tst r8, #PSR_T_BIT @ this is SPSR from save_user_regs | ||
175 | addne scno, r7, #OS_NUMBER << 20 @ put OS number in | ||
176 | ldreq scno, [lr, #-4] | ||
177 | |||
178 | #else | ||
179 | mask_pc lr, lr | ||
180 | ldr scno, [lr, #-4] @ get SWI instruction | ||
181 | #endif | ||
182 | .endm | ||
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 6e31718f6008..0078aeb85737 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
@@ -578,9 +578,16 @@ EXPORT_SYMBOL(abort); | |||
578 | 578 | ||
579 | void __init trap_init(void) | 579 | void __init trap_init(void) |
580 | { | 580 | { |
581 | extern void __trap_init(void); | 581 | extern char __stubs_start[], __stubs_end[]; |
582 | extern char __vectors_start[], __vectors_end[]; | ||
582 | 583 | ||
583 | __trap_init(); | 584 | /* |
585 | * Copy the vectors and stubs (in entry-armv.S) into the | ||
586 | * vector page, mapped at 0xffff0000, and ensure these are | ||
587 | * visible to the instruction stream. | ||
588 | */ | ||
589 | memcpy((void *)0xffff0000, __vectors_start, __vectors_end - __vectors_start); | ||
590 | memcpy((void *)0xffff0200, __stubs_start, __stubs_end - __stubs_start); | ||
584 | flush_icache_range(0xffff0000, 0xffff0000 + PAGE_SIZE); | 591 | flush_icache_range(0xffff0000, 0xffff0000 + PAGE_SIZE); |
585 | modify_domain(DOMAIN_USER, DOMAIN_CLIENT); | 592 | modify_domain(DOMAIN_USER, DOMAIN_CLIENT); |
586 | } | 593 | } |
diff --git a/arch/arm/mach-pxa/sleep.S b/arch/arm/mach-pxa/sleep.S index 16cad2c2497c..5786ccad938c 100644 --- a/arch/arm/mach-pxa/sleep.S +++ b/arch/arm/mach-pxa/sleep.S | |||
@@ -18,6 +18,11 @@ | |||
18 | 18 | ||
19 | #include <asm/arch/pxa-regs.h> | 19 | #include <asm/arch/pxa-regs.h> |
20 | 20 | ||
21 | #ifdef CONFIG_PXA27x // workaround for Errata 50 | ||
22 | #define MDREFR_KDIV 0x200a4000 // all banks | ||
23 | #define CCCR_SLEEP 0x00000107 // L=7 2N=2 A=0 PPDIS=0 CPDIS=0 | ||
24 | #endif | ||
25 | |||
21 | .text | 26 | .text |
22 | 27 | ||
23 | /* | 28 | /* |
@@ -28,7 +33,9 @@ | |||
28 | 33 | ||
29 | ENTRY(pxa_cpu_suspend) | 34 | ENTRY(pxa_cpu_suspend) |
30 | 35 | ||
36 | #ifndef CONFIG_IWMMXT | ||
31 | mra r2, r3, acc0 | 37 | mra r2, r3, acc0 |
38 | #endif | ||
32 | stmfd sp!, {r2 - r12, lr} @ save registers on stack | 39 | stmfd sp!, {r2 - r12, lr} @ save registers on stack |
33 | 40 | ||
34 | @ get coprocessor registers | 41 | @ get coprocessor registers |
@@ -61,14 +68,23 @@ ENTRY(pxa_cpu_suspend) | |||
61 | @ prepare value for sleep mode | 68 | @ prepare value for sleep mode |
62 | mov r1, #3 @ sleep mode | 69 | mov r1, #3 @ sleep mode |
63 | 70 | ||
64 | @ prepare to put SDRAM into self-refresh manually | 71 | @ prepare pointer to physical address 0 (virtual mapping in generic.c) |
72 | mov r2, #UNCACHED_PHYS_0 | ||
73 | |||
74 | @ prepare SDRAM refresh settings | ||
65 | ldr r4, =MDREFR | 75 | ldr r4, =MDREFR |
66 | ldr r5, [r4] | 76 | ldr r5, [r4] |
77 | |||
78 | @ enable SDRAM self-refresh mode | ||
67 | orr r5, r5, #MDREFR_SLFRSH | 79 | orr r5, r5, #MDREFR_SLFRSH |
68 | 80 | ||
69 | @ prepare pointer to physical address 0 (virtual mapping in generic.c) | 81 | #ifdef CONFIG_PXA27x |
70 | mov r2, #UNCACHED_PHYS_0 | 82 | @ set SDCLKx divide-by-2 bits (this is part of a workaround for Errata 50) |
83 | ldr r6, =MDREFR_KDIV | ||
84 | orr r5, r5, r6 | ||
85 | #endif | ||
71 | 86 | ||
87 | #ifdef CONFIG_PXA25x | ||
72 | @ Intel PXA255 Specification Update notes problems | 88 | @ Intel PXA255 Specification Update notes problems |
73 | @ about suspending with PXBus operating above 133MHz | 89 | @ about suspending with PXBus operating above 133MHz |
74 | @ (see Errata 31, GPIO output signals, ... unpredictable in sleep | 90 | @ (see Errata 31, GPIO output signals, ... unpredictable in sleep |
@@ -100,6 +116,18 @@ ENTRY(pxa_cpu_suspend) | |||
100 | mov r0, #0 | 116 | mov r0, #0 |
101 | mcr p14, 0, r0, c6, c0, 0 | 117 | mcr p14, 0, r0, c6, c0, 0 |
102 | orr r0, r0, #2 @ initiate change bit | 118 | orr r0, r0, #2 @ initiate change bit |
119 | #endif | ||
120 | #ifdef CONFIG_PXA27x | ||
121 | @ Intel PXA270 Specification Update notes problems sleeping | ||
122 | @ with core operating above 91 MHz | ||
123 | @ (see Errata 50, ...processor does not exit from sleep...) | ||
124 | |||
125 | ldr r6, =CCCR | ||
126 | ldr r8, [r6] @ keep original value for resume | ||
127 | |||
128 | ldr r7, =CCCR_SLEEP @ prepare CCCR sleep value | ||
129 | mov r0, #0x2 @ prepare value for CLKCFG | ||
130 | #endif | ||
103 | 131 | ||
104 | @ align execution to a cache line | 132 | @ align execution to a cache line |
105 | b 1f | 133 | b 1f |
@@ -111,6 +139,7 @@ ENTRY(pxa_cpu_suspend) | |||
111 | @ All needed values are now in registers. | 139 | @ All needed values are now in registers. |
112 | @ These last instructions should be in cache | 140 | @ These last instructions should be in cache |
113 | 141 | ||
142 | #if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x) | ||
114 | @ initiate the frequency change... | 143 | @ initiate the frequency change... |
115 | str r7, [r6] | 144 | str r7, [r6] |
116 | mcr p14, 0, r0, c6, c0, 0 | 145 | mcr p14, 0, r0, c6, c0, 0 |
@@ -118,14 +147,27 @@ ENTRY(pxa_cpu_suspend) | |||
118 | @ restore the original cpu speed value for resume | 147 | @ restore the original cpu speed value for resume |
119 | str r8, [r6] | 148 | str r8, [r6] |
120 | 149 | ||
121 | @ put SDRAM into self-refresh | 150 | @ need 6 13-MHz cycles before changing PWRMODE |
122 | str r5, [r4] | 151 | @ just set frequency to 91-MHz... 6*91/13 = 42 |
152 | |||
153 | mov r0, #42 | ||
154 | 10: subs r0, r0, #1 | ||
155 | bne 10b | ||
156 | #endif | ||
157 | |||
158 | @ Do not reorder... | ||
159 | @ Intel PXA270 Specification Update notes problems performing | ||
160 | @ external accesses after SDRAM is put in self-refresh mode | ||
161 | @ (see Errata 39 ...hangs when entering self-refresh mode) | ||
123 | 162 | ||
124 | @ force address lines low by reading at physical address 0 | 163 | @ force address lines low by reading at physical address 0 |
125 | ldr r3, [r2] | 164 | ldr r3, [r2] |
126 | 165 | ||
166 | @ put SDRAM into self-refresh | ||
167 | str r5, [r4] | ||
168 | |||
127 | @ enter sleep mode | 169 | @ enter sleep mode |
128 | mcr p14, 0, r1, c7, c0, 0 | 170 | mcr p14, 0, r1, c7, c0, 0 @ PWRMODE |
129 | 171 | ||
130 | 20: b 20b @ loop waiting for sleep | 172 | 20: b 20b @ loop waiting for sleep |
131 | 173 | ||
@@ -188,7 +230,9 @@ resume_after_mmu: | |||
188 | bl cpu_xscale_proc_init | 230 | bl cpu_xscale_proc_init |
189 | #endif | 231 | #endif |
190 | ldmfd sp!, {r2, r3} | 232 | ldmfd sp!, {r2, r3} |
233 | #ifndef CONFIG_IWMMXT | ||
191 | mar acc0, r2, r3 | 234 | mar acc0, r2, r3 |
235 | #endif | ||
192 | ldmfd sp!, {r4 - r12, pc} @ return to caller | 236 | ldmfd sp!, {r4 - r12, pc} @ return to caller |
193 | 237 | ||
194 | 238 | ||
diff --git a/arch/ppc64/kernel/rtas_flash.c b/arch/ppc64/kernel/rtas_flash.c index 3213837282ca..923e2e201a70 100644 --- a/arch/ppc64/kernel/rtas_flash.c +++ b/arch/ppc64/kernel/rtas_flash.c | |||
@@ -218,7 +218,7 @@ static void get_flash_status_msg(int status, char *buf) | |||
218 | } | 218 | } |
219 | 219 | ||
220 | /* Reading the proc file will show status (not the firmware contents) */ | 220 | /* Reading the proc file will show status (not the firmware contents) */ |
221 | static ssize_t rtas_flash_read(struct file *file, char *buf, | 221 | static ssize_t rtas_flash_read(struct file *file, char __user *buf, |
222 | size_t count, loff_t *ppos) | 222 | size_t count, loff_t *ppos) |
223 | { | 223 | { |
224 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 224 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); |
@@ -256,7 +256,7 @@ static ssize_t rtas_flash_read(struct file *file, char *buf, | |||
256 | * count is. If the system is low on memory it will be just as well | 256 | * count is. If the system is low on memory it will be just as well |
257 | * that we fail.... | 257 | * that we fail.... |
258 | */ | 258 | */ |
259 | static ssize_t rtas_flash_write(struct file *file, const char *buffer, | 259 | static ssize_t rtas_flash_write(struct file *file, const char __user *buffer, |
260 | size_t count, loff_t *off) | 260 | size_t count, loff_t *off) |
261 | { | 261 | { |
262 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 262 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); |
@@ -356,7 +356,7 @@ static void manage_flash(struct rtas_manage_flash_t *args_buf) | |||
356 | args_buf->status = rc; | 356 | args_buf->status = rc; |
357 | } | 357 | } |
358 | 358 | ||
359 | static ssize_t manage_flash_read(struct file *file, char *buf, | 359 | static ssize_t manage_flash_read(struct file *file, char __user *buf, |
360 | size_t count, loff_t *ppos) | 360 | size_t count, loff_t *ppos) |
361 | { | 361 | { |
362 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 362 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); |
@@ -386,7 +386,7 @@ static ssize_t manage_flash_read(struct file *file, char *buf, | |||
386 | return msglen; | 386 | return msglen; |
387 | } | 387 | } |
388 | 388 | ||
389 | static ssize_t manage_flash_write(struct file *file, const char *buf, | 389 | static ssize_t manage_flash_write(struct file *file, const char __user *buf, |
390 | size_t count, loff_t *off) | 390 | size_t count, loff_t *off) |
391 | { | 391 | { |
392 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 392 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); |
@@ -466,7 +466,7 @@ static int get_validate_flash_msg(struct rtas_validate_flash_t *args_buf, | |||
466 | return n; | 466 | return n; |
467 | } | 467 | } |
468 | 468 | ||
469 | static ssize_t validate_flash_read(struct file *file, char *buf, | 469 | static ssize_t validate_flash_read(struct file *file, char __user *buf, |
470 | size_t count, loff_t *ppos) | 470 | size_t count, loff_t *ppos) |
471 | { | 471 | { |
472 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 472 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); |
@@ -494,7 +494,7 @@ static ssize_t validate_flash_read(struct file *file, char *buf, | |||
494 | return msglen; | 494 | return msglen; |
495 | } | 495 | } |
496 | 496 | ||
497 | static ssize_t validate_flash_write(struct file *file, const char *buf, | 497 | static ssize_t validate_flash_write(struct file *file, const char __user *buf, |
498 | size_t count, loff_t *off) | 498 | size_t count, loff_t *off) |
499 | { | 499 | { |
500 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); | 500 | struct proc_dir_entry *dp = PDE(file->f_dentry->d_inode); |
diff --git a/arch/ppc64/kernel/scanlog.c b/arch/ppc64/kernel/scanlog.c index 189b81a41987..4d70736619c7 100644 --- a/arch/ppc64/kernel/scanlog.c +++ b/arch/ppc64/kernel/scanlog.c | |||
@@ -43,7 +43,7 @@ static int scanlog_debug; | |||
43 | static unsigned int ibm_scan_log_dump; /* RTAS token */ | 43 | static unsigned int ibm_scan_log_dump; /* RTAS token */ |
44 | static struct proc_dir_entry *proc_ppc64_scan_log_dump; /* The proc file */ | 44 | static struct proc_dir_entry *proc_ppc64_scan_log_dump; /* The proc file */ |
45 | 45 | ||
46 | static ssize_t scanlog_read(struct file *file, char *buf, | 46 | static ssize_t scanlog_read(struct file *file, char __user *buf, |
47 | size_t count, loff_t *ppos) | 47 | size_t count, loff_t *ppos) |
48 | { | 48 | { |
49 | struct inode * inode = file->f_dentry->d_inode; | 49 | struct inode * inode = file->f_dentry->d_inode; |
@@ -129,7 +129,7 @@ static ssize_t scanlog_read(struct file *file, char *buf, | |||
129 | /*NOTREACHED*/ | 129 | /*NOTREACHED*/ |
130 | } | 130 | } |
131 | 131 | ||
132 | static ssize_t scanlog_write(struct file * file, const char * buf, | 132 | static ssize_t scanlog_write(struct file * file, const char __user * buf, |
133 | size_t count, loff_t *ppos) | 133 | size_t count, loff_t *ppos) |
134 | { | 134 | { |
135 | char stkbuf[20]; | 135 | char stkbuf[20]; |
diff --git a/arch/ppc64/xmon/ppc-opc.c b/arch/ppc64/xmon/ppc-opc.c index 1e4e7e319970..5ee8fc32f824 100644 --- a/arch/ppc64/xmon/ppc-opc.c +++ b/arch/ppc64/xmon/ppc-opc.c | |||
@@ -20,6 +20,7 @@ | |||
20 | Software Foundation, 59 Temple Place - Suite 330, Boston, MA | 20 | Software Foundation, 59 Temple Place - Suite 330, Boston, MA |
21 | 02111-1307, USA. */ | 21 | 02111-1307, USA. */ |
22 | 22 | ||
23 | #include <linux/stddef.h> | ||
23 | #include "nonstdio.h" | 24 | #include "nonstdio.h" |
24 | #include "ppc.h" | 25 | #include "ppc.h" |
25 | 26 | ||
@@ -110,12 +111,12 @@ const struct powerpc_operand powerpc_operands[] = | |||
110 | /* The zero index is used to indicate the end of the list of | 111 | /* The zero index is used to indicate the end of the list of |
111 | operands. */ | 112 | operands. */ |
112 | #define UNUSED 0 | 113 | #define UNUSED 0 |
113 | { 0, 0, 0, 0, 0 }, | 114 | { 0, 0, NULL, NULL, 0 }, |
114 | 115 | ||
115 | /* The BA field in an XL form instruction. */ | 116 | /* The BA field in an XL form instruction. */ |
116 | #define BA UNUSED + 1 | 117 | #define BA UNUSED + 1 |
117 | #define BA_MASK (0x1f << 16) | 118 | #define BA_MASK (0x1f << 16) |
118 | { 5, 16, 0, 0, PPC_OPERAND_CR }, | 119 | { 5, 16, NULL, NULL, PPC_OPERAND_CR }, |
119 | 120 | ||
120 | /* The BA field in an XL form instruction when it must be the same | 121 | /* The BA field in an XL form instruction when it must be the same |
121 | as the BT field in the same instruction. */ | 122 | as the BT field in the same instruction. */ |
@@ -125,7 +126,7 @@ const struct powerpc_operand powerpc_operands[] = | |||
125 | /* The BB field in an XL form instruction. */ | 126 | /* The BB field in an XL form instruction. */ |
126 | #define BB BAT + 1 | 127 | #define BB BAT + 1 |
127 | #define BB_MASK (0x1f << 11) | 128 | #define BB_MASK (0x1f << 11) |
128 | { 5, 11, 0, 0, PPC_OPERAND_CR }, | 129 | { 5, 11, NULL, NULL, PPC_OPERAND_CR }, |
129 | 130 | ||
130 | /* The BB field in an XL form instruction when it must be the same | 131 | /* The BB field in an XL form instruction when it must be the same |
131 | as the BA field in the same instruction. */ | 132 | as the BA field in the same instruction. */ |
@@ -168,21 +169,21 @@ const struct powerpc_operand powerpc_operands[] = | |||
168 | 169 | ||
169 | /* The BF field in an X or XL form instruction. */ | 170 | /* The BF field in an X or XL form instruction. */ |
170 | #define BF BDPA + 1 | 171 | #define BF BDPA + 1 |
171 | { 3, 23, 0, 0, PPC_OPERAND_CR }, | 172 | { 3, 23, NULL, NULL, PPC_OPERAND_CR }, |
172 | 173 | ||
173 | /* An optional BF field. This is used for comparison instructions, | 174 | /* An optional BF field. This is used for comparison instructions, |
174 | in which an omitted BF field is taken as zero. */ | 175 | in which an omitted BF field is taken as zero. */ |
175 | #define OBF BF + 1 | 176 | #define OBF BF + 1 |
176 | { 3, 23, 0, 0, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL }, | 177 | { 3, 23, NULL, NULL, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL }, |
177 | 178 | ||
178 | /* The BFA field in an X or XL form instruction. */ | 179 | /* The BFA field in an X or XL form instruction. */ |
179 | #define BFA OBF + 1 | 180 | #define BFA OBF + 1 |
180 | { 3, 18, 0, 0, PPC_OPERAND_CR }, | 181 | { 3, 18, NULL, NULL, PPC_OPERAND_CR }, |
181 | 182 | ||
182 | /* The BI field in a B form or XL form instruction. */ | 183 | /* The BI field in a B form or XL form instruction. */ |
183 | #define BI BFA + 1 | 184 | #define BI BFA + 1 |
184 | #define BI_MASK (0x1f << 16) | 185 | #define BI_MASK (0x1f << 16) |
185 | { 5, 16, 0, 0, PPC_OPERAND_CR }, | 186 | { 5, 16, NULL, NULL, PPC_OPERAND_CR }, |
186 | 187 | ||
187 | /* The BO field in a B form instruction. Certain values are | 188 | /* The BO field in a B form instruction. Certain values are |
188 | illegal. */ | 189 | illegal. */ |
@@ -197,36 +198,36 @@ const struct powerpc_operand powerpc_operands[] = | |||
197 | 198 | ||
198 | /* The BT field in an X or XL form instruction. */ | 199 | /* The BT field in an X or XL form instruction. */ |
199 | #define BT BOE + 1 | 200 | #define BT BOE + 1 |
200 | { 5, 21, 0, 0, PPC_OPERAND_CR }, | 201 | { 5, 21, NULL, NULL, PPC_OPERAND_CR }, |
201 | 202 | ||
202 | /* The condition register number portion of the BI field in a B form | 203 | /* The condition register number portion of the BI field in a B form |
203 | or XL form instruction. This is used for the extended | 204 | or XL form instruction. This is used for the extended |
204 | conditional branch mnemonics, which set the lower two bits of the | 205 | conditional branch mnemonics, which set the lower two bits of the |
205 | BI field. This field is optional. */ | 206 | BI field. This field is optional. */ |
206 | #define CR BT + 1 | 207 | #define CR BT + 1 |
207 | { 3, 18, 0, 0, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL }, | 208 | { 3, 18, NULL, NULL, PPC_OPERAND_CR | PPC_OPERAND_OPTIONAL }, |
208 | 209 | ||
209 | /* The CRB field in an X form instruction. */ | 210 | /* The CRB field in an X form instruction. */ |
210 | #define CRB CR + 1 | 211 | #define CRB CR + 1 |
211 | { 5, 6, 0, 0, 0 }, | 212 | { 5, 6, NULL, NULL, 0 }, |
212 | 213 | ||
213 | /* The CRFD field in an X form instruction. */ | 214 | /* The CRFD field in an X form instruction. */ |
214 | #define CRFD CRB + 1 | 215 | #define CRFD CRB + 1 |
215 | { 3, 23, 0, 0, PPC_OPERAND_CR }, | 216 | { 3, 23, NULL, NULL, PPC_OPERAND_CR }, |
216 | 217 | ||
217 | /* The CRFS field in an X form instruction. */ | 218 | /* The CRFS field in an X form instruction. */ |
218 | #define CRFS CRFD + 1 | 219 | #define CRFS CRFD + 1 |
219 | { 3, 0, 0, 0, PPC_OPERAND_CR }, | 220 | { 3, 0, NULL, NULL, PPC_OPERAND_CR }, |
220 | 221 | ||
221 | /* The CT field in an X form instruction. */ | 222 | /* The CT field in an X form instruction. */ |
222 | #define CT CRFS + 1 | 223 | #define CT CRFS + 1 |
223 | { 5, 21, 0, 0, PPC_OPERAND_OPTIONAL }, | 224 | { 5, 21, NULL, NULL, PPC_OPERAND_OPTIONAL }, |
224 | 225 | ||
225 | /* The D field in a D form instruction. This is a displacement off | 226 | /* The D field in a D form instruction. This is a displacement off |
226 | a register, and implies that the next operand is a register in | 227 | a register, and implies that the next operand is a register in |
227 | parentheses. */ | 228 | parentheses. */ |
228 | #define D CT + 1 | 229 | #define D CT + 1 |
229 | { 16, 0, 0, 0, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED }, | 230 | { 16, 0, NULL, NULL, PPC_OPERAND_PARENS | PPC_OPERAND_SIGNED }, |
230 | 231 | ||
231 | /* The DE field in a DE form instruction. This is like D, but is 12 | 232 | /* The DE field in a DE form instruction. This is like D, but is 12 |
232 | bits only. */ | 233 | bits only. */ |
@@ -252,40 +253,40 @@ const struct powerpc_operand powerpc_operands[] = | |||
252 | 253 | ||
253 | /* The E field in a wrteei instruction. */ | 254 | /* The E field in a wrteei instruction. */ |
254 | #define E DS + 1 | 255 | #define E DS + 1 |
255 | { 1, 15, 0, 0, 0 }, | 256 | { 1, 15, NULL, NULL, 0 }, |
256 | 257 | ||
257 | /* The FL1 field in a POWER SC form instruction. */ | 258 | /* The FL1 field in a POWER SC form instruction. */ |
258 | #define FL1 E + 1 | 259 | #define FL1 E + 1 |
259 | { 4, 12, 0, 0, 0 }, | 260 | { 4, 12, NULL, NULL, 0 }, |
260 | 261 | ||
261 | /* The FL2 field in a POWER SC form instruction. */ | 262 | /* The FL2 field in a POWER SC form instruction. */ |
262 | #define FL2 FL1 + 1 | 263 | #define FL2 FL1 + 1 |
263 | { 3, 2, 0, 0, 0 }, | 264 | { 3, 2, NULL, NULL, 0 }, |
264 | 265 | ||
265 | /* The FLM field in an XFL form instruction. */ | 266 | /* The FLM field in an XFL form instruction. */ |
266 | #define FLM FL2 + 1 | 267 | #define FLM FL2 + 1 |
267 | { 8, 17, 0, 0, 0 }, | 268 | { 8, 17, NULL, NULL, 0 }, |
268 | 269 | ||
269 | /* The FRA field in an X or A form instruction. */ | 270 | /* The FRA field in an X or A form instruction. */ |
270 | #define FRA FLM + 1 | 271 | #define FRA FLM + 1 |
271 | #define FRA_MASK (0x1f << 16) | 272 | #define FRA_MASK (0x1f << 16) |
272 | { 5, 16, 0, 0, PPC_OPERAND_FPR }, | 273 | { 5, 16, NULL, NULL, PPC_OPERAND_FPR }, |
273 | 274 | ||
274 | /* The FRB field in an X or A form instruction. */ | 275 | /* The FRB field in an X or A form instruction. */ |
275 | #define FRB FRA + 1 | 276 | #define FRB FRA + 1 |
276 | #define FRB_MASK (0x1f << 11) | 277 | #define FRB_MASK (0x1f << 11) |
277 | { 5, 11, 0, 0, PPC_OPERAND_FPR }, | 278 | { 5, 11, NULL, NULL, PPC_OPERAND_FPR }, |
278 | 279 | ||
279 | /* The FRC field in an A form instruction. */ | 280 | /* The FRC field in an A form instruction. */ |
280 | #define FRC FRB + 1 | 281 | #define FRC FRB + 1 |
281 | #define FRC_MASK (0x1f << 6) | 282 | #define FRC_MASK (0x1f << 6) |
282 | { 5, 6, 0, 0, PPC_OPERAND_FPR }, | 283 | { 5, 6, NULL, NULL, PPC_OPERAND_FPR }, |
283 | 284 | ||
284 | /* The FRS field in an X form instruction or the FRT field in a D, X | 285 | /* The FRS field in an X form instruction or the FRT field in a D, X |
285 | or A form instruction. */ | 286 | or A form instruction. */ |
286 | #define FRS FRC + 1 | 287 | #define FRS FRC + 1 |
287 | #define FRT FRS | 288 | #define FRT FRS |
288 | { 5, 21, 0, 0, PPC_OPERAND_FPR }, | 289 | { 5, 21, NULL, NULL, PPC_OPERAND_FPR }, |
289 | 290 | ||
290 | /* The FXM field in an XFX instruction. */ | 291 | /* The FXM field in an XFX instruction. */ |
291 | #define FXM FRS + 1 | 292 | #define FXM FRS + 1 |
@@ -298,11 +299,11 @@ const struct powerpc_operand powerpc_operands[] = | |||
298 | 299 | ||
299 | /* The L field in a D or X form instruction. */ | 300 | /* The L field in a D or X form instruction. */ |
300 | #define L FXM4 + 1 | 301 | #define L FXM4 + 1 |
301 | { 1, 21, 0, 0, PPC_OPERAND_OPTIONAL }, | 302 | { 1, 21, NULL, NULL, PPC_OPERAND_OPTIONAL }, |
302 | 303 | ||
303 | /* The LEV field in a POWER SC form instruction. */ | 304 | /* The LEV field in a POWER SC form instruction. */ |
304 | #define LEV L + 1 | 305 | #define LEV L + 1 |
305 | { 7, 5, 0, 0, 0 }, | 306 | { 7, 5, NULL, NULL, 0 }, |
306 | 307 | ||
307 | /* The LI field in an I form instruction. The lower two bits are | 308 | /* The LI field in an I form instruction. The lower two bits are |
308 | forced to zero. */ | 309 | forced to zero. */ |
@@ -316,24 +317,24 @@ const struct powerpc_operand powerpc_operands[] = | |||
316 | 317 | ||
317 | /* The LS field in an X (sync) form instruction. */ | 318 | /* The LS field in an X (sync) form instruction. */ |
318 | #define LS LIA + 1 | 319 | #define LS LIA + 1 |
319 | { 2, 21, 0, 0, PPC_OPERAND_OPTIONAL }, | 320 | { 2, 21, NULL, NULL, PPC_OPERAND_OPTIONAL }, |
320 | 321 | ||
321 | /* The MB field in an M form instruction. */ | 322 | /* The MB field in an M form instruction. */ |
322 | #define MB LS + 1 | 323 | #define MB LS + 1 |
323 | #define MB_MASK (0x1f << 6) | 324 | #define MB_MASK (0x1f << 6) |
324 | { 5, 6, 0, 0, 0 }, | 325 | { 5, 6, NULL, NULL, 0 }, |
325 | 326 | ||
326 | /* The ME field in an M form instruction. */ | 327 | /* The ME field in an M form instruction. */ |
327 | #define ME MB + 1 | 328 | #define ME MB + 1 |
328 | #define ME_MASK (0x1f << 1) | 329 | #define ME_MASK (0x1f << 1) |
329 | { 5, 1, 0, 0, 0 }, | 330 | { 5, 1, NULL, NULL, 0 }, |
330 | 331 | ||
331 | /* The MB and ME fields in an M form instruction expressed a single | 332 | /* The MB and ME fields in an M form instruction expressed a single |
332 | operand which is a bitmask indicating which bits to select. This | 333 | operand which is a bitmask indicating which bits to select. This |
333 | is a two operand form using PPC_OPERAND_NEXT. See the | 334 | is a two operand form using PPC_OPERAND_NEXT. See the |
334 | description in opcode/ppc.h for what this means. */ | 335 | description in opcode/ppc.h for what this means. */ |
335 | #define MBE ME + 1 | 336 | #define MBE ME + 1 |
336 | { 5, 6, 0, 0, PPC_OPERAND_OPTIONAL | PPC_OPERAND_NEXT }, | 337 | { 5, 6, NULL, NULL, PPC_OPERAND_OPTIONAL | PPC_OPERAND_NEXT }, |
337 | { 32, 0, insert_mbe, extract_mbe, 0 }, | 338 | { 32, 0, insert_mbe, extract_mbe, 0 }, |
338 | 339 | ||
339 | /* The MB or ME field in an MD or MDS form instruction. The high | 340 | /* The MB or ME field in an MD or MDS form instruction. The high |
@@ -345,7 +346,7 @@ const struct powerpc_operand powerpc_operands[] = | |||
345 | 346 | ||
346 | /* The MO field in an mbar instruction. */ | 347 | /* The MO field in an mbar instruction. */ |
347 | #define MO MB6 + 1 | 348 | #define MO MB6 + 1 |
348 | { 5, 21, 0, 0, 0 }, | 349 | { 5, 21, NULL, NULL, 0 }, |
349 | 350 | ||
350 | /* The NB field in an X form instruction. The value 32 is stored as | 351 | /* The NB field in an X form instruction. The value 32 is stored as |
351 | 0. */ | 352 | 0. */ |
@@ -361,34 +362,34 @@ const struct powerpc_operand powerpc_operands[] = | |||
361 | /* The RA field in an D, DS, DQ, X, XO, M, or MDS form instruction. */ | 362 | /* The RA field in an D, DS, DQ, X, XO, M, or MDS form instruction. */ |
362 | #define RA NSI + 1 | 363 | #define RA NSI + 1 |
363 | #define RA_MASK (0x1f << 16) | 364 | #define RA_MASK (0x1f << 16) |
364 | { 5, 16, 0, 0, PPC_OPERAND_GPR }, | 365 | { 5, 16, NULL, NULL, PPC_OPERAND_GPR }, |
365 | 366 | ||
366 | /* The RA field in the DQ form lq instruction, which has special | 367 | /* The RA field in the DQ form lq instruction, which has special |
367 | value restrictions. */ | 368 | value restrictions. */ |
368 | #define RAQ RA + 1 | 369 | #define RAQ RA + 1 |
369 | { 5, 16, insert_raq, 0, PPC_OPERAND_GPR }, | 370 | { 5, 16, insert_raq, NULL, PPC_OPERAND_GPR }, |
370 | 371 | ||
371 | /* The RA field in a D or X form instruction which is an updating | 372 | /* The RA field in a D or X form instruction which is an updating |
372 | load, which means that the RA field may not be zero and may not | 373 | load, which means that the RA field may not be zero and may not |
373 | equal the RT field. */ | 374 | equal the RT field. */ |
374 | #define RAL RAQ + 1 | 375 | #define RAL RAQ + 1 |
375 | { 5, 16, insert_ral, 0, PPC_OPERAND_GPR }, | 376 | { 5, 16, insert_ral, NULL, PPC_OPERAND_GPR }, |
376 | 377 | ||
377 | /* The RA field in an lmw instruction, which has special value | 378 | /* The RA field in an lmw instruction, which has special value |
378 | restrictions. */ | 379 | restrictions. */ |
379 | #define RAM RAL + 1 | 380 | #define RAM RAL + 1 |
380 | { 5, 16, insert_ram, 0, PPC_OPERAND_GPR }, | 381 | { 5, 16, insert_ram, NULL, PPC_OPERAND_GPR }, |
381 | 382 | ||
382 | /* The RA field in a D or X form instruction which is an updating | 383 | /* The RA field in a D or X form instruction which is an updating |
383 | store or an updating floating point load, which means that the RA | 384 | store or an updating floating point load, which means that the RA |
384 | field may not be zero. */ | 385 | field may not be zero. */ |
385 | #define RAS RAM + 1 | 386 | #define RAS RAM + 1 |
386 | { 5, 16, insert_ras, 0, PPC_OPERAND_GPR }, | 387 | { 5, 16, insert_ras, NULL, PPC_OPERAND_GPR }, |
387 | 388 | ||
388 | /* The RB field in an X, XO, M, or MDS form instruction. */ | 389 | /* The RB field in an X, XO, M, or MDS form instruction. */ |
389 | #define RB RAS + 1 | 390 | #define RB RAS + 1 |
390 | #define RB_MASK (0x1f << 11) | 391 | #define RB_MASK (0x1f << 11) |
391 | { 5, 11, 0, 0, PPC_OPERAND_GPR }, | 392 | { 5, 11, NULL, NULL, PPC_OPERAND_GPR }, |
392 | 393 | ||
393 | /* The RB field in an X form instruction when it must be the same as | 394 | /* The RB field in an X form instruction when it must be the same as |
394 | the RS field in the instruction. This is used for extended | 395 | the RS field in the instruction. This is used for extended |
@@ -402,22 +403,22 @@ const struct powerpc_operand powerpc_operands[] = | |||
402 | #define RS RBS + 1 | 403 | #define RS RBS + 1 |
403 | #define RT RS | 404 | #define RT RS |
404 | #define RT_MASK (0x1f << 21) | 405 | #define RT_MASK (0x1f << 21) |
405 | { 5, 21, 0, 0, PPC_OPERAND_GPR }, | 406 | { 5, 21, NULL, NULL, PPC_OPERAND_GPR }, |
406 | 407 | ||
407 | /* The RS field of the DS form stq instruction, which has special | 408 | /* The RS field of the DS form stq instruction, which has special |
408 | value restrictions. */ | 409 | value restrictions. */ |
409 | #define RSQ RS + 1 | 410 | #define RSQ RS + 1 |
410 | { 5, 21, insert_rsq, 0, PPC_OPERAND_GPR }, | 411 | { 5, 21, insert_rsq, NULL, PPC_OPERAND_GPR }, |
411 | 412 | ||
412 | /* The RT field of the DQ form lq instruction, which has special | 413 | /* The RT field of the DQ form lq instruction, which has special |
413 | value restrictions. */ | 414 | value restrictions. */ |
414 | #define RTQ RSQ + 1 | 415 | #define RTQ RSQ + 1 |
415 | { 5, 21, insert_rtq, 0, PPC_OPERAND_GPR }, | 416 | { 5, 21, insert_rtq, NULL, PPC_OPERAND_GPR }, |
416 | 417 | ||
417 | /* The SH field in an X or M form instruction. */ | 418 | /* The SH field in an X or M form instruction. */ |
418 | #define SH RTQ + 1 | 419 | #define SH RTQ + 1 |
419 | #define SH_MASK (0x1f << 11) | 420 | #define SH_MASK (0x1f << 11) |
420 | { 5, 11, 0, 0, 0 }, | 421 | { 5, 11, NULL, NULL, 0 }, |
421 | 422 | ||
422 | /* The SH field in an MD form instruction. This is split. */ | 423 | /* The SH field in an MD form instruction. This is split. */ |
423 | #define SH6 SH + 1 | 424 | #define SH6 SH + 1 |
@@ -426,12 +427,12 @@ const struct powerpc_operand powerpc_operands[] = | |||
426 | 427 | ||
427 | /* The SI field in a D form instruction. */ | 428 | /* The SI field in a D form instruction. */ |
428 | #define SI SH6 + 1 | 429 | #define SI SH6 + 1 |
429 | { 16, 0, 0, 0, PPC_OPERAND_SIGNED }, | 430 | { 16, 0, NULL, NULL, PPC_OPERAND_SIGNED }, |
430 | 431 | ||
431 | /* The SI field in a D form instruction when we accept a wide range | 432 | /* The SI field in a D form instruction when we accept a wide range |
432 | of positive values. */ | 433 | of positive values. */ |
433 | #define SISIGNOPT SI + 1 | 434 | #define SISIGNOPT SI + 1 |
434 | { 16, 0, 0, 0, PPC_OPERAND_SIGNED | PPC_OPERAND_SIGNOPT }, | 435 | { 16, 0, NULL, NULL, PPC_OPERAND_SIGNED | PPC_OPERAND_SIGNOPT }, |
435 | 436 | ||
436 | /* The SPR field in an XFX form instruction. This is flipped--the | 437 | /* The SPR field in an XFX form instruction. This is flipped--the |
437 | lower 5 bits are stored in the upper 5 and vice- versa. */ | 438 | lower 5 bits are stored in the upper 5 and vice- versa. */ |
@@ -443,25 +444,25 @@ const struct powerpc_operand powerpc_operands[] = | |||
443 | /* The BAT index number in an XFX form m[ft]ibat[lu] instruction. */ | 444 | /* The BAT index number in an XFX form m[ft]ibat[lu] instruction. */ |
444 | #define SPRBAT SPR + 1 | 445 | #define SPRBAT SPR + 1 |
445 | #define SPRBAT_MASK (0x3 << 17) | 446 | #define SPRBAT_MASK (0x3 << 17) |
446 | { 2, 17, 0, 0, 0 }, | 447 | { 2, 17, NULL, NULL, 0 }, |
447 | 448 | ||
448 | /* The SPRG register number in an XFX form m[ft]sprg instruction. */ | 449 | /* The SPRG register number in an XFX form m[ft]sprg instruction. */ |
449 | #define SPRG SPRBAT + 1 | 450 | #define SPRG SPRBAT + 1 |
450 | #define SPRG_MASK (0x3 << 16) | 451 | #define SPRG_MASK (0x3 << 16) |
451 | { 2, 16, 0, 0, 0 }, | 452 | { 2, 16, NULL, NULL, 0 }, |
452 | 453 | ||
453 | /* The SR field in an X form instruction. */ | 454 | /* The SR field in an X form instruction. */ |
454 | #define SR SPRG + 1 | 455 | #define SR SPRG + 1 |
455 | { 4, 16, 0, 0, 0 }, | 456 | { 4, 16, NULL, NULL, 0 }, |
456 | 457 | ||
457 | /* The STRM field in an X AltiVec form instruction. */ | 458 | /* The STRM field in an X AltiVec form instruction. */ |
458 | #define STRM SR + 1 | 459 | #define STRM SR + 1 |
459 | #define STRM_MASK (0x3 << 21) | 460 | #define STRM_MASK (0x3 << 21) |
460 | { 2, 21, 0, 0, 0 }, | 461 | { 2, 21, NULL, NULL, 0 }, |
461 | 462 | ||
462 | /* The SV field in a POWER SC form instruction. */ | 463 | /* The SV field in a POWER SC form instruction. */ |
463 | #define SV STRM + 1 | 464 | #define SV STRM + 1 |
464 | { 14, 2, 0, 0, 0 }, | 465 | { 14, 2, NULL, NULL, 0 }, |
465 | 466 | ||
466 | /* The TBR field in an XFX form instruction. This is like the SPR | 467 | /* The TBR field in an XFX form instruction. This is like the SPR |
467 | field, but it is optional. */ | 468 | field, but it is optional. */ |
@@ -471,52 +472,52 @@ const struct powerpc_operand powerpc_operands[] = | |||
471 | /* The TO field in a D or X form instruction. */ | 472 | /* The TO field in a D or X form instruction. */ |
472 | #define TO TBR + 1 | 473 | #define TO TBR + 1 |
473 | #define TO_MASK (0x1f << 21) | 474 | #define TO_MASK (0x1f << 21) |
474 | { 5, 21, 0, 0, 0 }, | 475 | { 5, 21, NULL, NULL, 0 }, |
475 | 476 | ||
476 | /* The U field in an X form instruction. */ | 477 | /* The U field in an X form instruction. */ |
477 | #define U TO + 1 | 478 | #define U TO + 1 |
478 | { 4, 12, 0, 0, 0 }, | 479 | { 4, 12, NULL, NULL, 0 }, |
479 | 480 | ||
480 | /* The UI field in a D form instruction. */ | 481 | /* The UI field in a D form instruction. */ |
481 | #define UI U + 1 | 482 | #define UI U + 1 |
482 | { 16, 0, 0, 0, 0 }, | 483 | { 16, 0, NULL, NULL, 0 }, |
483 | 484 | ||
484 | /* The VA field in a VA, VX or VXR form instruction. */ | 485 | /* The VA field in a VA, VX or VXR form instruction. */ |
485 | #define VA UI + 1 | 486 | #define VA UI + 1 |
486 | #define VA_MASK (0x1f << 16) | 487 | #define VA_MASK (0x1f << 16) |
487 | { 5, 16, 0, 0, PPC_OPERAND_VR }, | 488 | { 5, 16, NULL, NULL, PPC_OPERAND_VR }, |
488 | 489 | ||
489 | /* The VB field in a VA, VX or VXR form instruction. */ | 490 | /* The VB field in a VA, VX or VXR form instruction. */ |
490 | #define VB VA + 1 | 491 | #define VB VA + 1 |
491 | #define VB_MASK (0x1f << 11) | 492 | #define VB_MASK (0x1f << 11) |
492 | { 5, 11, 0, 0, PPC_OPERAND_VR }, | 493 | { 5, 11, NULL, NULL, PPC_OPERAND_VR }, |
493 | 494 | ||
494 | /* The VC field in a VA form instruction. */ | 495 | /* The VC field in a VA form instruction. */ |
495 | #define VC VB + 1 | 496 | #define VC VB + 1 |
496 | #define VC_MASK (0x1f << 6) | 497 | #define VC_MASK (0x1f << 6) |
497 | { 5, 6, 0, 0, PPC_OPERAND_VR }, | 498 | { 5, 6, NULL, NULL, PPC_OPERAND_VR }, |
498 | 499 | ||
499 | /* The VD or VS field in a VA, VX, VXR or X form instruction. */ | 500 | /* The VD or VS field in a VA, VX, VXR or X form instruction. */ |
500 | #define VD VC + 1 | 501 | #define VD VC + 1 |
501 | #define VS VD | 502 | #define VS VD |
502 | #define VD_MASK (0x1f << 21) | 503 | #define VD_MASK (0x1f << 21) |
503 | { 5, 21, 0, 0, PPC_OPERAND_VR }, | 504 | { 5, 21, NULL, NULL, PPC_OPERAND_VR }, |
504 | 505 | ||
505 | /* The SIMM field in a VX form instruction. */ | 506 | /* The SIMM field in a VX form instruction. */ |
506 | #define SIMM VD + 1 | 507 | #define SIMM VD + 1 |
507 | { 5, 16, 0, 0, PPC_OPERAND_SIGNED}, | 508 | { 5, 16, NULL, NULL, PPC_OPERAND_SIGNED}, |
508 | 509 | ||
509 | /* The UIMM field in a VX form instruction. */ | 510 | /* The UIMM field in a VX form instruction. */ |
510 | #define UIMM SIMM + 1 | 511 | #define UIMM SIMM + 1 |
511 | { 5, 16, 0, 0, 0 }, | 512 | { 5, 16, NULL, NULL, 0 }, |
512 | 513 | ||
513 | /* The SHB field in a VA form instruction. */ | 514 | /* The SHB field in a VA form instruction. */ |
514 | #define SHB UIMM + 1 | 515 | #define SHB UIMM + 1 |
515 | { 4, 6, 0, 0, 0 }, | 516 | { 4, 6, NULL, NULL, 0 }, |
516 | 517 | ||
517 | /* The other UIMM field in a EVX form instruction. */ | 518 | /* The other UIMM field in a EVX form instruction. */ |
518 | #define EVUIMM SHB + 1 | 519 | #define EVUIMM SHB + 1 |
519 | { 5, 11, 0, 0, 0 }, | 520 | { 5, 11, NULL, NULL, 0 }, |
520 | 521 | ||
521 | /* The other UIMM field in a half word EVX form instruction. */ | 522 | /* The other UIMM field in a half word EVX form instruction. */ |
522 | #define EVUIMM_2 EVUIMM + 1 | 523 | #define EVUIMM_2 EVUIMM + 1 |
@@ -533,11 +534,11 @@ const struct powerpc_operand powerpc_operands[] = | |||
533 | /* The WS field. */ | 534 | /* The WS field. */ |
534 | #define WS EVUIMM_8 + 1 | 535 | #define WS EVUIMM_8 + 1 |
535 | #define WS_MASK (0x7 << 11) | 536 | #define WS_MASK (0x7 << 11) |
536 | { 3, 11, 0, 0, 0 }, | 537 | { 3, 11, NULL, NULL, 0 }, |
537 | 538 | ||
538 | /* The L field in an mtmsrd instruction */ | 539 | /* The L field in an mtmsrd instruction */ |
539 | #define MTMSRD_L WS + 1 | 540 | #define MTMSRD_L WS + 1 |
540 | { 1, 16, 0, 0, PPC_OPERAND_OPTIONAL }, | 541 | { 1, 16, NULL, NULL, PPC_OPERAND_OPTIONAL }, |
541 | 542 | ||
542 | }; | 543 | }; |
543 | 544 | ||
diff --git a/arch/x86_64/kernel/signal.c b/arch/x86_64/kernel/signal.c index 7760224cdfe3..d439ced150c6 100644 --- a/arch/x86_64/kernel/signal.c +++ b/arch/x86_64/kernel/signal.c | |||
@@ -83,7 +83,7 @@ sys_sigaltstack(const stack_t __user *uss, stack_t __user *uoss, | |||
83 | 83 | ||
84 | struct rt_sigframe | 84 | struct rt_sigframe |
85 | { | 85 | { |
86 | char *pretcode; | 86 | char __user *pretcode; |
87 | struct ucontext uc; | 87 | struct ucontext uc; |
88 | struct siginfo info; | 88 | struct siginfo info; |
89 | }; | 89 | }; |