diff options
author | Paul Mackerras <paulus@samba.org> | 2006-09-13 17:07:18 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-09-13 17:07:18 -0400 |
commit | c547fc28ab3e8716076fdaf4bd0260c5d63a18f7 (patch) | |
tree | 34af1fa64a63618660187ae58ad182665a1861ef /arch/powerpc/kernel | |
parent | 3dd836a56de0d4f049438412959b905e1db4666e (diff) | |
parent | 63b98080daa35f0d682db04f4fb7ada010888752 (diff) |
Merge branch 'linux-2.6'
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/Makefile | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/audit.c | 66 | ||||
-rw-r--r-- | arch/powerpc/kernel/compat_audit.c | 38 | ||||
-rw-r--r-- | arch/powerpc/kernel/crash.c | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/misc.S | 49 |
5 files changed, 132 insertions, 25 deletions
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index d2ab2943d230..8b3f4faf5768 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile | |||
@@ -70,6 +70,8 @@ obj-$(CONFIG_PCI) += $(pci64-y) $(pci32-y) | |||
70 | kexec-$(CONFIG_PPC64) := machine_kexec_64.o | 70 | kexec-$(CONFIG_PPC64) := machine_kexec_64.o |
71 | kexec-$(CONFIG_PPC32) := machine_kexec_32.o | 71 | kexec-$(CONFIG_PPC32) := machine_kexec_32.o |
72 | obj-$(CONFIG_KEXEC) += machine_kexec.o crash.o $(kexec-y) | 72 | obj-$(CONFIG_KEXEC) += machine_kexec.o crash.o $(kexec-y) |
73 | obj-$(CONFIG_AUDIT) += audit.o | ||
74 | obj64-$(CONFIG_AUDIT) += compat_audit.o | ||
73 | 75 | ||
74 | ifeq ($(CONFIG_PPC_ISERIES),y) | 76 | ifeq ($(CONFIG_PPC_ISERIES),y) |
75 | $(obj)/head_64.o: $(obj)/lparmap.s | 77 | $(obj)/head_64.o: $(obj)/lparmap.s |
diff --git a/arch/powerpc/kernel/audit.c b/arch/powerpc/kernel/audit.c new file mode 100644 index 000000000000..7fe5e6300e9a --- /dev/null +++ b/arch/powerpc/kernel/audit.c | |||
@@ -0,0 +1,66 @@ | |||
1 | #include <linux/init.h> | ||
2 | #include <linux/types.h> | ||
3 | #include <linux/audit.h> | ||
4 | #include <asm/unistd.h> | ||
5 | |||
6 | static unsigned dir_class[] = { | ||
7 | #include <asm-generic/audit_dir_write.h> | ||
8 | ~0U | ||
9 | }; | ||
10 | |||
11 | static unsigned read_class[] = { | ||
12 | #include <asm-generic/audit_read.h> | ||
13 | ~0U | ||
14 | }; | ||
15 | |||
16 | static unsigned write_class[] = { | ||
17 | #include <asm-generic/audit_write.h> | ||
18 | ~0U | ||
19 | }; | ||
20 | |||
21 | static unsigned chattr_class[] = { | ||
22 | #include <asm-generic/audit_change_attr.h> | ||
23 | ~0U | ||
24 | }; | ||
25 | |||
26 | int audit_classify_syscall(int abi, unsigned syscall) | ||
27 | { | ||
28 | #ifdef CONFIG_PPC64 | ||
29 | extern int ppc32_classify_syscall(unsigned); | ||
30 | if (abi == AUDIT_ARCH_PPC) | ||
31 | return ppc32_classify_syscall(syscall); | ||
32 | #endif | ||
33 | switch(syscall) { | ||
34 | case __NR_open: | ||
35 | return 2; | ||
36 | case __NR_openat: | ||
37 | return 3; | ||
38 | case __NR_socketcall: | ||
39 | return 4; | ||
40 | case __NR_execve: | ||
41 | return 5; | ||
42 | default: | ||
43 | return 0; | ||
44 | } | ||
45 | } | ||
46 | |||
47 | static int __init audit_classes_init(void) | ||
48 | { | ||
49 | #ifdef CONFIG_PPC64 | ||
50 | extern __u32 ppc32_dir_class[]; | ||
51 | extern __u32 ppc32_write_class[]; | ||
52 | extern __u32 ppc32_read_class[]; | ||
53 | extern __u32 ppc32_chattr_class[]; | ||
54 | audit_register_class(AUDIT_CLASS_WRITE_32, ppc32_write_class); | ||
55 | audit_register_class(AUDIT_CLASS_READ_32, ppc32_read_class); | ||
56 | audit_register_class(AUDIT_CLASS_DIR_WRITE_32, ppc32_dir_class); | ||
57 | audit_register_class(AUDIT_CLASS_CHATTR_32, ppc32_chattr_class); | ||
58 | #endif | ||
59 | audit_register_class(AUDIT_CLASS_WRITE, write_class); | ||
60 | audit_register_class(AUDIT_CLASS_READ, read_class); | ||
61 | audit_register_class(AUDIT_CLASS_DIR_WRITE, dir_class); | ||
62 | audit_register_class(AUDIT_CLASS_CHATTR, chattr_class); | ||
63 | return 0; | ||
64 | } | ||
65 | |||
66 | __initcall(audit_classes_init); | ||
diff --git a/arch/powerpc/kernel/compat_audit.c b/arch/powerpc/kernel/compat_audit.c new file mode 100644 index 000000000000..640d4bb29321 --- /dev/null +++ b/arch/powerpc/kernel/compat_audit.c | |||
@@ -0,0 +1,38 @@ | |||
1 | #undef __powerpc64__ | ||
2 | #include <asm/unistd.h> | ||
3 | |||
4 | unsigned ppc32_dir_class[] = { | ||
5 | #include <asm-generic/audit_dir_write.h> | ||
6 | ~0U | ||
7 | }; | ||
8 | |||
9 | unsigned ppc32_chattr_class[] = { | ||
10 | #include <asm-generic/audit_change_attr.h> | ||
11 | ~0U | ||
12 | }; | ||
13 | |||
14 | unsigned ppc32_write_class[] = { | ||
15 | #include <asm-generic/audit_write.h> | ||
16 | ~0U | ||
17 | }; | ||
18 | |||
19 | unsigned ppc32_read_class[] = { | ||
20 | #include <asm-generic/audit_read.h> | ||
21 | ~0U | ||
22 | }; | ||
23 | |||
24 | int ppc32_classify_syscall(unsigned syscall) | ||
25 | { | ||
26 | switch(syscall) { | ||
27 | case __NR_open: | ||
28 | return 2; | ||
29 | case __NR_openat: | ||
30 | return 3; | ||
31 | case __NR_socketcall: | ||
32 | return 4; | ||
33 | case __NR_execve: | ||
34 | return 5; | ||
35 | default: | ||
36 | return 1; | ||
37 | } | ||
38 | } | ||
diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c index f04c18e08b8b..1af41f7616dc 100644 --- a/arch/powerpc/kernel/crash.c +++ b/arch/powerpc/kernel/crash.c | |||
@@ -295,7 +295,7 @@ void default_machine_crash_shutdown(struct pt_regs *regs) | |||
295 | struct irq_desc *desc = irq_desc + irq; | 295 | struct irq_desc *desc = irq_desc + irq; |
296 | 296 | ||
297 | if (desc->status & IRQ_INPROGRESS) | 297 | if (desc->status & IRQ_INPROGRESS) |
298 | desc->chip->end(irq); | 298 | desc->chip->eoi(irq); |
299 | 299 | ||
300 | if (!(desc->status & IRQ_DISABLED)) | 300 | if (!(desc->status & IRQ_DISABLED)) |
301 | desc->chip->disable(irq); | 301 | desc->chip->disable(irq); |
diff --git a/arch/powerpc/kernel/misc.S b/arch/powerpc/kernel/misc.S index fc23040d5a26..f770805f1215 100644 --- a/arch/powerpc/kernel/misc.S +++ b/arch/powerpc/kernel/misc.S | |||
@@ -17,15 +17,6 @@ | |||
17 | 17 | ||
18 | .text | 18 | .text |
19 | 19 | ||
20 | #ifdef CONFIG_PPC64 | ||
21 | #define IN_SYNC twi 0,r5,0; isync | ||
22 | #define EIEIO_32 | ||
23 | #define SYNC_64 sync | ||
24 | #else /* CONFIG_PPC32 */ | ||
25 | #define IN_SYNC | ||
26 | #define EIEIO_32 eieio | ||
27 | #define SYNC_64 | ||
28 | #endif | ||
29 | /* | 20 | /* |
30 | * Returns (address we are running at) - (address we were linked at) | 21 | * Returns (address we are running at) - (address we were linked at) |
31 | * for use before the text and data are mapped to KERNELBASE. | 22 | * for use before the text and data are mapped to KERNELBASE. |
@@ -70,6 +61,7 @@ _GLOBAL(add_reloc_offset) | |||
70 | * The *_ns versions don't do byte-swapping. | 61 | * The *_ns versions don't do byte-swapping. |
71 | */ | 62 | */ |
72 | _GLOBAL(_insb) | 63 | _GLOBAL(_insb) |
64 | sync | ||
73 | cmpwi 0,r5,0 | 65 | cmpwi 0,r5,0 |
74 | mtctr r5 | 66 | mtctr r5 |
75 | subi r4,r4,1 | 67 | subi r4,r4,1 |
@@ -78,7 +70,8 @@ _GLOBAL(_insb) | |||
78 | eieio | 70 | eieio |
79 | stbu r5,1(r4) | 71 | stbu r5,1(r4) |
80 | bdnz 00b | 72 | bdnz 00b |
81 | IN_SYNC | 73 | twi 0,r5,0 |
74 | isync | ||
82 | blr | 75 | blr |
83 | 76 | ||
84 | _GLOBAL(_outsb) | 77 | _GLOBAL(_outsb) |
@@ -86,14 +79,15 @@ _GLOBAL(_outsb) | |||
86 | mtctr r5 | 79 | mtctr r5 |
87 | subi r4,r4,1 | 80 | subi r4,r4,1 |
88 | blelr- | 81 | blelr- |
82 | sync | ||
89 | 00: lbzu r5,1(r4) | 83 | 00: lbzu r5,1(r4) |
90 | stb r5,0(r3) | 84 | stb r5,0(r3) |
91 | EIEIO_32 | ||
92 | bdnz 00b | 85 | bdnz 00b |
93 | SYNC_64 | 86 | sync |
94 | blr | 87 | blr |
95 | 88 | ||
96 | _GLOBAL(_insw) | 89 | _GLOBAL(_insw) |
90 | sync | ||
97 | cmpwi 0,r5,0 | 91 | cmpwi 0,r5,0 |
98 | mtctr r5 | 92 | mtctr r5 |
99 | subi r4,r4,2 | 93 | subi r4,r4,2 |
@@ -102,7 +96,8 @@ _GLOBAL(_insw) | |||
102 | eieio | 96 | eieio |
103 | sthu r5,2(r4) | 97 | sthu r5,2(r4) |
104 | bdnz 00b | 98 | bdnz 00b |
105 | IN_SYNC | 99 | twi 0,r5,0 |
100 | isync | ||
106 | blr | 101 | blr |
107 | 102 | ||
108 | _GLOBAL(_outsw) | 103 | _GLOBAL(_outsw) |
@@ -110,14 +105,15 @@ _GLOBAL(_outsw) | |||
110 | mtctr r5 | 105 | mtctr r5 |
111 | subi r4,r4,2 | 106 | subi r4,r4,2 |
112 | blelr- | 107 | blelr- |
108 | sync | ||
113 | 00: lhzu r5,2(r4) | 109 | 00: lhzu r5,2(r4) |
114 | EIEIO_32 | ||
115 | sthbrx r5,0,r3 | 110 | sthbrx r5,0,r3 |
116 | bdnz 00b | 111 | bdnz 00b |
117 | SYNC_64 | 112 | sync |
118 | blr | 113 | blr |
119 | 114 | ||
120 | _GLOBAL(_insl) | 115 | _GLOBAL(_insl) |
116 | sync | ||
121 | cmpwi 0,r5,0 | 117 | cmpwi 0,r5,0 |
122 | mtctr r5 | 118 | mtctr r5 |
123 | subi r4,r4,4 | 119 | subi r4,r4,4 |
@@ -126,7 +122,8 @@ _GLOBAL(_insl) | |||
126 | eieio | 122 | eieio |
127 | stwu r5,4(r4) | 123 | stwu r5,4(r4) |
128 | bdnz 00b | 124 | bdnz 00b |
129 | IN_SYNC | 125 | twi 0,r5,0 |
126 | isync | ||
130 | blr | 127 | blr |
131 | 128 | ||
132 | _GLOBAL(_outsl) | 129 | _GLOBAL(_outsl) |
@@ -134,17 +131,18 @@ _GLOBAL(_outsl) | |||
134 | mtctr r5 | 131 | mtctr r5 |
135 | subi r4,r4,4 | 132 | subi r4,r4,4 |
136 | blelr- | 133 | blelr- |
134 | sync | ||
137 | 00: lwzu r5,4(r4) | 135 | 00: lwzu r5,4(r4) |
138 | stwbrx r5,0,r3 | 136 | stwbrx r5,0,r3 |
139 | EIEIO_32 | ||
140 | bdnz 00b | 137 | bdnz 00b |
141 | SYNC_64 | 138 | sync |
142 | blr | 139 | blr |
143 | 140 | ||
144 | #ifdef CONFIG_PPC32 | 141 | #ifdef CONFIG_PPC32 |
145 | _GLOBAL(__ide_mm_insw) | 142 | _GLOBAL(__ide_mm_insw) |
146 | #endif | 143 | #endif |
147 | _GLOBAL(_insw_ns) | 144 | _GLOBAL(_insw_ns) |
145 | sync | ||
148 | cmpwi 0,r5,0 | 146 | cmpwi 0,r5,0 |
149 | mtctr r5 | 147 | mtctr r5 |
150 | subi r4,r4,2 | 148 | subi r4,r4,2 |
@@ -153,7 +151,8 @@ _GLOBAL(_insw_ns) | |||
153 | eieio | 151 | eieio |
154 | sthu r5,2(r4) | 152 | sthu r5,2(r4) |
155 | bdnz 00b | 153 | bdnz 00b |
156 | IN_SYNC | 154 | twi 0,r5,0 |
155 | isync | ||
157 | blr | 156 | blr |
158 | 157 | ||
159 | #ifdef CONFIG_PPC32 | 158 | #ifdef CONFIG_PPC32 |
@@ -164,17 +163,18 @@ _GLOBAL(_outsw_ns) | |||
164 | mtctr r5 | 163 | mtctr r5 |
165 | subi r4,r4,2 | 164 | subi r4,r4,2 |
166 | blelr- | 165 | blelr- |
166 | sync | ||
167 | 00: lhzu r5,2(r4) | 167 | 00: lhzu r5,2(r4) |
168 | sth r5,0(r3) | 168 | sth r5,0(r3) |
169 | EIEIO_32 | ||
170 | bdnz 00b | 169 | bdnz 00b |
171 | SYNC_64 | 170 | sync |
172 | blr | 171 | blr |
173 | 172 | ||
174 | #ifdef CONFIG_PPC32 | 173 | #ifdef CONFIG_PPC32 |
175 | _GLOBAL(__ide_mm_insl) | 174 | _GLOBAL(__ide_mm_insl) |
176 | #endif | 175 | #endif |
177 | _GLOBAL(_insl_ns) | 176 | _GLOBAL(_insl_ns) |
177 | sync | ||
178 | cmpwi 0,r5,0 | 178 | cmpwi 0,r5,0 |
179 | mtctr r5 | 179 | mtctr r5 |
180 | subi r4,r4,4 | 180 | subi r4,r4,4 |
@@ -183,7 +183,8 @@ _GLOBAL(_insl_ns) | |||
183 | eieio | 183 | eieio |
184 | stwu r5,4(r4) | 184 | stwu r5,4(r4) |
185 | bdnz 00b | 185 | bdnz 00b |
186 | IN_SYNC | 186 | twi 0,r5,0 |
187 | isync | ||
187 | blr | 188 | blr |
188 | 189 | ||
189 | #ifdef CONFIG_PPC32 | 190 | #ifdef CONFIG_PPC32 |
@@ -194,10 +195,10 @@ _GLOBAL(_outsl_ns) | |||
194 | mtctr r5 | 195 | mtctr r5 |
195 | subi r4,r4,4 | 196 | subi r4,r4,4 |
196 | blelr- | 197 | blelr- |
198 | sync | ||
197 | 00: lwzu r5,4(r4) | 199 | 00: lwzu r5,4(r4) |
198 | stw r5,0(r3) | 200 | stw r5,0(r3) |
199 | EIEIO_32 | ||
200 | bdnz 00b | 201 | bdnz 00b |
201 | SYNC_64 | 202 | sync |
202 | blr | 203 | blr |
203 | 204 | ||