[BACK]Return to db_machdep.h CVS log [TXT][DIR] Up to [local] / sys / arch / alpha / include

Annotation of sys/arch/alpha/include/db_machdep.h, Revision 1.1.1.1

1.1       nbrk        1: /*     $OpenBSD: db_machdep.h,v 1.19 2005/12/17 07:31:23 miod Exp $    */
                      2:
                      3: /*
                      4:  * Copyright (c) 1997 Niklas Hallqvist.  All rights reserved.
                      5:  *
                      6:  * Redistribution and use in source and binary forms, with or without
                      7:  * modification, are permitted provided that the following conditions
                      8:  * are met:
                      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.
                     14:  *
                     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, INCIDENTAL,
                     19:  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
                     20:  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
                     21:  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
                     22:  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
                     23:  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
                     24:  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
                     25:  */
                     26:
                     27: #ifndef        _ALPHA_DB_MACHDEP_H_
                     28: #define        _ALPHA_DB_MACHDEP_H_
                     29:
                     30: /* XXX - Need to include vm.h for boolean_t */
                     31: #include <uvm/uvm_extern.h>
                     32:
                     33: /*
                     34:  * We use Elf64 symbols in DDB.
                     35:  */
                     36: #define        DB_ELF_SYMBOLS
                     37: #define        DB_ELFSIZE      64
                     38:
                     39: struct opcode {
                     40:        enum opc_fmt { OPC_PAL, OPC_RES, OPC_MEM, OPC_OP, OPC_BR } opc_fmt;
                     41:        char *opc_name;
                     42:        int opc_print;
                     43: };
                     44: extern struct opcode opcode[];
                     45:
                     46: /* types the generic ddb module needs */
                     47: typedef        vaddr_t db_addr_t;
                     48: typedef        long db_expr_t;
                     49: typedef struct trapframe db_regs_t;
                     50:
                     51: extern db_regs_t       ddb_regs;
                     52: #define        DDB_REGS        (&ddb_regs)
                     53:
                     54: #define        PC_REGS(regs)   ((db_addr_t)(regs)->tf_regs[FRAME_PC])
                     55: #define        SET_PC_REGS(regs, value) (regs)->tf_regs[FRAME_PC] = (unsigned long)(value)
                     56:
                     57: /* Breakpoint related definitions */
                     58: #define        BKPT_INST       0x00000080      /* call_pal bpt */
                     59: #define        BKPT_SIZE       sizeof(int)
                     60: #define        BKPT_SET(inst)  BKPT_INST
                     61:
                     62: #define        IS_BREAKPOINT_TRAP(type, code) \
                     63:     ((type) == ALPHA_KENTRY_IF && (code) == ALPHA_IF_CODE_BPT)
                     64: #ifdef notyet
                     65: #define        IS_WATCHPOINT_TRAP(type, code)  ((type) == ALPHA_KENTRY_MM)
                     66: #else
                     67: #define        IS_WATCHPOINT_TRAP(type, code)  0
                     68: #endif
                     69:
                     70: #define        FIXUP_PC_AFTER_BREAK(regs) ((regs)->tf_regs[FRAME_PC] -= sizeof(int))
                     71:
                     72: #define SOFTWARE_SSTEP
                     73: #define DB_VALID_BREAKPOINT(addr) db_valid_breakpoint(addr)
                     74:
                     75: /* Hack to skip GCC "unused" warnings. */
                     76: #define        inst_trap_return(ins)   ((ins) & 0)             /* XXX */
                     77: #define        inst_return(ins)        (((ins) & 0xfc000000) == 0x68000000)
                     78:
                     79: int    alpha_debug(unsigned long, unsigned long, unsigned long,
                     80:     unsigned long, struct trapframe *);
                     81: db_addr_t db_branch_taken(int, db_addr_t, db_regs_t *);
                     82: boolean_t db_inst_branch(int);
                     83: boolean_t db_inst_call(int);
                     84: boolean_t db_inst_load(int);
                     85: boolean_t db_inst_return(int);
                     86: boolean_t db_inst_store(int);
                     87: boolean_t db_inst_trap_return(int);
                     88: boolean_t db_inst_unconditional_flow_transfer(int);
                     89: u_long db_register_value(db_regs_t *, int);
                     90: int    db_valid_breakpoint(db_addr_t);
                     91: int    ddb_trap(unsigned long, unsigned long, unsigned long,
                     92:     unsigned long, struct trapframe *);
                     93: int    kdb_trap(int, int, db_regs_t *);
                     94: db_addr_t next_instr_address(db_addr_t, int);
                     95:
                     96: #if 1
                     97: /* Backwards compatibility until we switch all archs to use the db_ prefix */
                     98: #define branch_taken(ins, pc, fun, regs) db_branch_taken((ins), (pc), (regs))
                     99: #define inst_branch db_inst_branch
                    100: #define inst_call db_inst_call
                    101: #define inst_load db_inst_load
                    102: #define inst_store db_inst_store
                    103: #endif
                    104:
                    105: #endif /* _ALPHA_DB_MACHDEP_H_ */

CVSweb