| @@ -1,15 +1,15 @@ | | | @@ -1,15 +1,15 @@ |
1 | /* $OpenBSD: db_machdep.h,v 1.2 1997/03/21 00:48:48 niklas Exp $ */ | | 1 | /* $OpenBSD: db_machdep.h,v 1.2 1997/03/21 00:48:48 niklas Exp $ */ |
2 | /* $NetBSD: db_machdep.h,v 1.28 2020/07/06 09:34:17 rin Exp $ */ | | 2 | /* $NetBSD: db_machdep.h,v 1.29 2021/01/06 08:14:34 rin Exp $ */ |
3 | | | 3 | |
4 | /* | | 4 | /* |
5 | * Mach Operating System | | 5 | * Mach Operating System |
6 | * Copyright (c) 1992 Carnegie Mellon University | | 6 | * Copyright (c) 1992 Carnegie Mellon University |
7 | * All Rights Reserved. | | 7 | * All Rights Reserved. |
8 | * | | 8 | * |
9 | * Permission to use, copy, modify and distribute this software and its | | 9 | * Permission to use, copy, modify and distribute this software and its |
10 | * documentation is hereby granted, provided that both the copyright | | 10 | * documentation is hereby granted, provided that both the copyright |
11 | * notice and this permission notice appear in all copies of the | | 11 | * notice and this permission notice appear in all copies of the |
12 | * software, derivative works or modified versions, and any portions | | 12 | * software, derivative works or modified versions, and any portions |
13 | * thereof, and that both notices appear in supporting documentation. | | 13 | * thereof, and that both notices appear in supporting documentation. |
14 | * | | 14 | * |
15 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" | | 15 | * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" |
| @@ -61,28 +61,28 @@ struct powerpc_saved_state { | | | @@ -61,28 +61,28 @@ struct powerpc_saved_state { |
61 | }; | | 61 | }; |
62 | typedef struct powerpc_saved_state db_regs_t; | | 62 | typedef struct powerpc_saved_state db_regs_t; |
63 | extern db_regs_t ddb_regs; /* register state */ | | 63 | extern db_regs_t ddb_regs; /* register state */ |
64 | #define DDB_REGS (&ddb_regs) | | 64 | #define DDB_REGS (&ddb_regs) |
65 | | | 65 | |
66 | #define PC_REGS(regs) (*(db_addr_t *)&(regs)->iar) | | 66 | #define PC_REGS(regs) (*(db_addr_t *)&(regs)->iar) |
67 | | | 67 | |
68 | #define BKPT_ADDR(addr) (addr) /* breakpoint address */ | | 68 | #define BKPT_ADDR(addr) (addr) /* breakpoint address */ |
69 | #define BKPT_ASM "trap" /* should match BKPT_INST */ | | 69 | #define BKPT_ASM "trap" /* should match BKPT_INST */ |
70 | #define BKPT_INST 0x7fe00008 /* breakpoint instruction */ | | 70 | #define BKPT_INST 0x7fe00008 /* breakpoint instruction */ |
71 | #define BKPT_SIZE (4) /* size of breakpoint inst */ | | 71 | #define BKPT_SIZE (4) /* size of breakpoint inst */ |
72 | #define BKPT_SET(inst, addr) (BKPT_INST) | | 72 | #define BKPT_SET(inst, addr) (BKPT_INST) |
73 | | | 73 | |
74 | #ifndef PPC_IBM4XX | | 74 | #if !defined(PPC_BOOKE) && !defined(PPC_IBM4XX) |
75 | #define SR_SINGLESTEP 0x400 | | 75 | #define SR_SINGLESTEP 0x400 /* PSL_SE, available only for oea */ |
76 | #define db_clear_single_step(regs) ((regs)->msr &= ~SR_SINGLESTEP) | | 76 | #define db_clear_single_step(regs) ((regs)->msr &= ~SR_SINGLESTEP) |
77 | #define db_set_single_step(regs) ((regs)->msr |= SR_SINGLESTEP) | | 77 | #define db_set_single_step(regs) ((regs)->msr |= SR_SINGLESTEP) |
78 | #else | | 78 | #else |
79 | #define SOFTWARE_SSTEP | | 79 | #define SOFTWARE_SSTEP |
80 | #endif | | 80 | #endif |
81 | | | 81 | |
82 | #define T_BREAKPOINT 0xffff | | 82 | #define T_BREAKPOINT 0xffff |
83 | #define IS_BREAKPOINT_TRAP(type, code) ((type) == T_BREAKPOINT) | | 83 | #define IS_BREAKPOINT_TRAP(type, code) ((type) == T_BREAKPOINT) |
84 | | | 84 | |
85 | #define T_WATCHPOINT 0xeeee | | 85 | #define T_WATCHPOINT 0xeeee |
86 | #ifdef T_WATCHPOINT | | 86 | #ifdef T_WATCHPOINT |
87 | #define IS_WATCHPOINT_TRAP(type, code) ((type) == T_WATCHPOINT) | | 87 | #define IS_WATCHPOINT_TRAP(type, code) ((type) == T_WATCHPOINT) |
88 | #else | | 88 | #else |