aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2005-11-01 23:19:47 -0500
committerPaul Mackerras <paulus@samba.org>2005-11-01 23:19:47 -0500
commit104dd65fef378773ec0510c788bd4b5ad6ea1121 (patch)
treee72d3f0c80d73366f8341f321c9fbb9e7f78ba6f /include
parentb5ca71a58bacb5f1d563a0fe51525b6006618e82 (diff)
powerpc: clean up bug.h further
This simplifies the macros which are different between 32-bit and 64-bit. It also fixes a couple of printks on the bug->line element, which is now a long. Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-powerpc/bug.h26
1 files changed, 12 insertions, 14 deletions
diff --git a/include/asm-powerpc/bug.h b/include/asm-powerpc/bug.h
index f49f46271ba..d625ee55f95 100644
--- a/include/asm-powerpc/bug.h
+++ b/include/asm-powerpc/bug.h
@@ -12,13 +12,11 @@
12#ifndef __ASSEMBLY__ 12#ifndef __ASSEMBLY__
13 13
14#ifdef __powerpc64__ 14#ifdef __powerpc64__
15#define BUG_TABLE_ENTRY(label, line, file, func) \ 15#define BUG_TABLE_ENTRY ".llong"
16 ".llong " #label ", " #line ", " #file ", " #func "\n" 16#define BUG_TRAP_OP "tdnei"
17#define TRAP_OP(ra, rb) "1: tdnei " #ra ", " #rb "\n"
18#else 17#else
19#define BUG_TABLE_ENTRY(label, line, file, func) \ 18#define BUG_TABLE_ENTRY ".long"
20 ".long " #label ", " #line ", " #file ", " #func "\n" 19#define BUG_TRAP_OP "twnei"
21#define TRAP_OP(ra, rb) "1: twnei " #ra ", " #rb "\n"
22#endif /* __powerpc64__ */ 20#endif /* __powerpc64__ */
23 21
24struct bug_entry { 22struct bug_entry {
@@ -41,17 +39,17 @@ struct bug_entry *find_bug(unsigned long bugaddr);
41#define BUG() do { \ 39#define BUG() do { \
42 __asm__ __volatile__( \ 40 __asm__ __volatile__( \
43 "1: twi 31,0,0\n" \ 41 "1: twi 31,0,0\n" \
44 ".section __bug_table,\"a\"\n\t" \ 42 ".section __bug_table,\"a\"\n" \
45 BUG_TABLE_ENTRY(1b,%0,%1,%2) \ 43 "\t"BUG_TABLE_ENTRY" 1b,%0,%1,%2\n" \
46 ".previous" \ 44 ".previous" \
47 : : "i" (__LINE__), "i" (__FILE__), "i" (__FUNCTION__)); \ 45 : : "i" (__LINE__), "i" (__FILE__), "i" (__FUNCTION__)); \
48} while (0) 46} while (0)
49 47
50#define BUG_ON(x) do { \ 48#define BUG_ON(x) do { \
51 __asm__ __volatile__( \ 49 __asm__ __volatile__( \
52 TRAP_OP(%0,0) \ 50 "1: "BUG_TRAP_OP" %0,0\n" \
53 ".section __bug_table,\"a\"\n\t" \ 51 ".section __bug_table,\"a\"\n" \
54 BUG_TABLE_ENTRY(1b,%1,%2,%3) \ 52 "\t"BUG_TABLE_ENTRY" 1b,%1,%2,%3\n" \
55 ".previous" \ 53 ".previous" \
56 : : "r" ((long)(x)), "i" (__LINE__), \ 54 : : "r" ((long)(x)), "i" (__LINE__), \
57 "i" (__FILE__), "i" (__FUNCTION__)); \ 55 "i" (__FILE__), "i" (__FUNCTION__)); \
@@ -59,9 +57,9 @@ struct bug_entry *find_bug(unsigned long bugaddr);
59 57
60#define WARN_ON(x) do { \ 58#define WARN_ON(x) do { \
61 __asm__ __volatile__( \ 59 __asm__ __volatile__( \
62 TRAP_OP(%0,0) \ 60 "1: "BUG_TRAP_OP" %0,0\n" \
63 ".section __bug_table,\"a\"\n\t" \ 61 ".section __bug_table,\"a\"\n" \
64 BUG_TABLE_ENTRY(1b,%1,%2,%3) \ 62 "\t"BUG_TABLE_ENTRY" 1b,%1,%2,%3\n" \
65 ".previous" \ 63 ".previous" \
66 : : "r" ((long)(x)), \ 64 : : "r" ((long)(x)), \
67 "i" (__LINE__ + BUG_WARNING_TRAP), \ 65 "i" (__LINE__ + BUG_WARNING_TRAP), \