2 * Copyright (c) 2004 Marcel Moolenaar
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 #ifndef _MACHINE_DB_MACHDEP_H_
30 #define _MACHINE_DB_MACHDEP_H_
32 #include <machine/ia64_cpu.h>
34 /* We define some of our own commands. */
35 #define DB_MACHINE_COMMANDS
37 /* We use Elf64 symbols in DDB. */
40 /* Pretty arbitrary. */
41 #define DB_SMALL_VALUE_MAX 0x7fffffff
42 #define DB_SMALL_VALUE_MIN (-0x400001)
44 typedef vm_offset_t db_addr_t; /* address - unsigned */
45 typedef long db_expr_t; /* expression - signed */
47 #define PC_REGS() ((kdb_thrctx->pcb_special.__spare == 0) ? \
48 kdb_thrctx->pcb_special.rp : \
49 kdb_thrctx->pcb_special.iip + ((kdb_thrctx->pcb_special.psr>>41) & 3))
51 #define BKPT_WRITE(addr, storage) db_bkpt_write(addr, storage)
52 #define BKPT_CLEAR(addr, storage) db_bkpt_clear(addr, storage)
53 #define BKPT_SKIP db_bkpt_skip()
54 #define BKPT_INST_TYPE uint64_t
56 void db_bkpt_write(db_addr_t, BKPT_INST_TYPE *storage);
57 void db_bkpt_clear(db_addr_t, uint64_t *storage);
58 void db_bkpt_skip(void);
60 #define db_clear_single_step kdb_cpu_clear_singlestep
61 #define db_set_single_step kdb_cpu_set_singlestep
63 #define IS_BREAKPOINT_TRAP(type, code) (type == IA64_VEC_BREAK)
64 #define IS_WATCHPOINT_TRAP(type, code) 0
66 #define inst_trap_return(ins) (ins & 0)
67 #define inst_return(ins) (ins & 0)
68 #define inst_call(ins) (ins & 0)
69 #define inst_branch(ins) (ins & 0)
70 #define inst_load(ins) (ins & 0)
71 #define inst_store(ins) (ins & 0)
72 #define inst_unconditional_flow_transfer(ins) (ins & 0)
74 #define branch_taken(ins, pc, regs) pc
76 /* Function call support. */
77 #define DB_MAXARGS 8 /* Only support arguments in registers. */
78 #define DB_CALL db_fncall_ia64
80 #endif /* _MACHINE_DB_MACHDEP_H_ */