diff options
author | Marcelo Tosatti <marcelo.tosatti@cyclades.com> | 2005-11-05 11:06:24 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2005-11-06 20:37:12 -0500 |
commit | 55b6332ec89a5fc65d1287708cfd9f06f7a88b90 (patch) | |
tree | 12dc1f0a94e222c0577f439e06e49d80cd969f21 /include/asm-ppc | |
parent | c6d95044a2e124b606b78896a3a2d512e90ef65c (diff) |
[PATCH] ppc32: handle access to non-present IO ports on 8xx
This adds exception table entries for I/O instructions on and
changes MachineCheckException() slightly to cover 8xx specifics (on
8xx the MCE can be generated while executing the IO access instruction
itself, which is not the case on PowerMac's, as the comment on traps.c
details).
Signed-off-by: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-ppc')
-rw-r--r-- | include/asm-ppc/io.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/include/asm-ppc/io.h b/include/asm-ppc/io.h index f7f614dfc648..2bfdf9c98459 100644 --- a/include/asm-ppc/io.h +++ b/include/asm-ppc/io.h | |||
@@ -237,9 +237,9 @@ static inline void __raw_writel(__u32 b, volatile void __iomem *addr) | |||
237 | #define outsl(port, buf, nl) _outsl_ns((port)+___IO_BASE, (buf), (nl)) | 237 | #define outsl(port, buf, nl) _outsl_ns((port)+___IO_BASE, (buf), (nl)) |
238 | 238 | ||
239 | /* | 239 | /* |
240 | * On powermacs, we will get a machine check exception if we | 240 | * On powermacs and 8xx we will get a machine check exception |
241 | * try to read data from a non-existent I/O port. Because the | 241 | * if we try to read data from a non-existent I/O port. Because |
242 | * machine check is an asynchronous exception, it isn't | 242 | * the machine check is an asynchronous exception, it isn't |
243 | * well-defined which instruction SRR0 will point to when the | 243 | * well-defined which instruction SRR0 will point to when the |
244 | * exception occurs. | 244 | * exception occurs. |
245 | * With the sequence below (twi; isync; nop), we have found that | 245 | * With the sequence below (twi; isync; nop), we have found that |
@@ -258,7 +258,7 @@ extern __inline__ unsigned int name(unsigned int port) \ | |||
258 | { \ | 258 | { \ |
259 | unsigned int x; \ | 259 | unsigned int x; \ |
260 | __asm__ __volatile__( \ | 260 | __asm__ __volatile__( \ |
261 | op " %0,0,%1\n" \ | 261 | "0:" op " %0,0,%1\n" \ |
262 | "1: twi 0,%0,0\n" \ | 262 | "1: twi 0,%0,0\n" \ |
263 | "2: isync\n" \ | 263 | "2: isync\n" \ |
264 | "3: nop\n" \ | 264 | "3: nop\n" \ |
@@ -269,6 +269,7 @@ extern __inline__ unsigned int name(unsigned int port) \ | |||
269 | ".previous\n" \ | 269 | ".previous\n" \ |
270 | ".section __ex_table,\"a\"\n" \ | 270 | ".section __ex_table,\"a\"\n" \ |
271 | " .align 2\n" \ | 271 | " .align 2\n" \ |
272 | " .long 0b,5b\n" \ | ||
272 | " .long 1b,5b\n" \ | 273 | " .long 1b,5b\n" \ |
273 | " .long 2b,5b\n" \ | 274 | " .long 2b,5b\n" \ |
274 | " .long 3b,5b\n" \ | 275 | " .long 3b,5b\n" \ |
@@ -282,11 +283,12 @@ extern __inline__ unsigned int name(unsigned int port) \ | |||
282 | extern __inline__ void name(unsigned int val, unsigned int port) \ | 283 | extern __inline__ void name(unsigned int val, unsigned int port) \ |
283 | { \ | 284 | { \ |
284 | __asm__ __volatile__( \ | 285 | __asm__ __volatile__( \ |
285 | op " %0,0,%1\n" \ | 286 | "0:" op " %0,0,%1\n" \ |
286 | "1: sync\n" \ | 287 | "1: sync\n" \ |
287 | "2:\n" \ | 288 | "2:\n" \ |
288 | ".section __ex_table,\"a\"\n" \ | 289 | ".section __ex_table,\"a\"\n" \ |
289 | " .align 2\n" \ | 290 | " .align 2\n" \ |
291 | " .long 0b,2b\n" \ | ||
290 | " .long 1b,2b\n" \ | 292 | " .long 1b,2b\n" \ |
291 | ".previous" \ | 293 | ".previous" \ |
292 | : : "r" (val), "r" (port + ___IO_BASE)); \ | 294 | : : "r" (val), "r" (port + ___IO_BASE)); \ |