aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-ppc64
diff options
context:
space:
mode:
authorBecky Bruce <bgill@freescale.com>2005-09-19 18:01:54 -0400
committerPaul Mackerras <paulus@samba.org>2005-09-21 05:21:09 -0400
commit25433b123ce1a3da78ddd9b848484bca91cbb7a1 (patch)
tree259ee758b3770894160dd8a732fddd4067ea8699 /include/asm-ppc64
parent3e57615bb5a8b6208627049884ee441f6d05905e (diff)
[PATCH] powerpc: Merge bug.h
ppc32/ppc64: Merge bug.h into include/asm-powerpc This patch merges bug.h into include/asm-powerpc. Changed the data structure for bug_entry such that line is always an int on both 32 and 64-bit platforms; removed casts to int from the 64-bit trap code to reflect this. Signed-off-by: Kumar Gala <kumar.gala@freescale.com> Signed-off-by: Becky Bruce <Becky.Bruce@freescale.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-ppc64')
-rw-r--r--include/asm-ppc64/bug.h69
1 files changed, 0 insertions, 69 deletions
diff --git a/include/asm-ppc64/bug.h b/include/asm-ppc64/bug.h
deleted file mode 100644
index 160178278861..000000000000
--- a/include/asm-ppc64/bug.h
+++ /dev/null
@@ -1,69 +0,0 @@
1#ifndef _PPC64_BUG_H
2#define _PPC64_BUG_H
3
4/*
5 * Define an illegal instr to trap on the bug.
6 * We don't use 0 because that marks the end of a function
7 * in the ELF ABI. That's "Boo Boo" in case you wonder...
8 */
9#define BUG_OPCODE .long 0x00b00b00 /* For asm */
10#define BUG_ILLEGAL_INSTR "0x00b00b00" /* For BUG macro */
11
12#ifndef __ASSEMBLY__
13
14struct bug_entry {
15 unsigned long bug_addr;
16 long line;
17 const char *file;
18 const char *function;
19};
20
21struct bug_entry *find_bug(unsigned long bugaddr);
22
23/*
24 * If this bit is set in the line number it means that the trap
25 * is for WARN_ON rather than BUG or BUG_ON.
26 */
27#define BUG_WARNING_TRAP 0x1000000
28
29#ifdef CONFIG_BUG
30
31#define BUG() do { \
32 __asm__ __volatile__( \
33 "1: twi 31,0,0\n" \
34 ".section __bug_table,\"a\"\n\t" \
35 " .llong 1b,%0,%1,%2\n" \
36 ".previous" \
37 : : "i" (__LINE__), "i" (__FILE__), "i" (__FUNCTION__)); \
38} while (0)
39
40#define BUG_ON(x) do { \
41 __asm__ __volatile__( \
42 "1: tdnei %0,0\n" \
43 ".section __bug_table,\"a\"\n\t" \
44 " .llong 1b,%1,%2,%3\n" \
45 ".previous" \
46 : : "r" ((long long)(x)), "i" (__LINE__), \
47 "i" (__FILE__), "i" (__FUNCTION__)); \
48} while (0)
49
50#define WARN_ON(x) do { \
51 __asm__ __volatile__( \
52 "1: tdnei %0,0\n" \
53 ".section __bug_table,\"a\"\n\t" \
54 " .llong 1b,%1,%2,%3\n" \
55 ".previous" \
56 : : "r" ((long long)(x)), \
57 "i" (__LINE__ + BUG_WARNING_TRAP), \
58 "i" (__FILE__), "i" (__FUNCTION__)); \
59} while (0)
60
61#define HAVE_ARCH_BUG
62#define HAVE_ARCH_BUG_ON
63#define HAVE_ARCH_WARN_ON
64#endif
65#endif
66
67#include <asm-generic/bug.h>
68
69#endif