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

Annotation of sys/arch/m68k/include/db_machdep.h, Revision 1.1

1.1     ! nbrk        1: /*     $OpenBSD: db_machdep.h,v 1.10 2005/11/13 17:50:44 fgsch Exp $   */
        !             2: /*     $NetBSD: db_machdep.h,v 1.20 1997/06/26 01:26:58 thorpej Exp $  */
        !             3:
        !             4: /*
        !             5:  * Mach Operating System
        !             6:  * Copyright (c) 1992 Carnegie Mellon University
        !             7:  * All Rights Reserved.
        !             8:  *
        !             9:  * Permission to use, copy, modify and distribute this software and its
        !            10:  * documentation is hereby granted, provided that both the copyright
        !            11:  * notice and this permission notice appear in all copies of the
        !            12:  * software, derivative works or modified versions, and any portions
        !            13:  * thereof, and that both notices appear in supporting documentation.
        !            14:  *
        !            15:  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
        !            16:  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
        !            17:  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
        !            18:  *
        !            19:  * Carnegie Mellon requests users of this software to return to
        !            20:  *
        !            21:  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
        !            22:  *  School of Computer Science
        !            23:  *  Carnegie Mellon University
        !            24:  *  Pittsburgh PA 15213-3890
        !            25:  *
        !            26:  * any improvements or extensions that they make and grant Carnegie Mellon
        !            27:  * the rights to redistribute these changes.
        !            28:  */
        !            29:
        !            30: /*
        !            31:  * Machine-dependent defines for new kernel debugger.
        !            32:  */
        !            33: #ifndef        _M68K_DB_MACHDEP_H_
        !            34: #define        _M68K_DB_MACHDEP_H_
        !            35:
        !            36: #include <sys/types.h>
        !            37:
        !            38: /*
        !            39:  * XXX - Would rather not pull in vm headers, but need boolean_t,
        !            40:  * at least until boolean_t moves to <sys/types.h> or someplace.
        !            41:  */
        !            42: #include <uvm/uvm_param.h>
        !            43:
        !            44: #include <machine/frame.h>
        !            45: #include <machine/psl.h>
        !            46: #include <machine/trap.h>
        !            47:
        !            48: typedef        vaddr_t         db_addr_t;      /* address - unsigned */
        !            49: typedef        long            db_expr_t;      /* expression - signed */
        !            50: typedef struct trapframe db_regs_t;
        !            51:
        !            52: extern db_regs_t       ddb_regs;       /* register state */
        !            53: #define DDB_REGS       (&ddb_regs)
        !            54:
        !            55: #define        PC_REGS(regs)   ((db_addr_t)(regs)->tf_pc)
        !            56: #define        SET_PC_REGS(regs, value)        (regs)->tf_pc = (unsigned int)(value)
        !            57:
        !            58: #define        BKPT_INST       0x4e4f          /* breakpoint instruction */
        !            59: #define        BKPT_SIZE       (2)             /* size of breakpoint inst */
        !            60: #define        BKPT_SET(inst)  (BKPT_INST)
        !            61:
        !            62: #define        FIXUP_PC_AFTER_BREAK(regs)      ((regs)->tf_pc -= BKPT_SIZE)
        !            63:
        !            64: #define        db_clear_single_step(regs)      ((regs)->tf_sr &= ~PSL_T)
        !            65: #define        db_set_single_step(regs)        ((regs)->tf_sr |=  PSL_T)
        !            66:
        !            67: #define        IS_BREAKPOINT_TRAP(type, code)  ((type) == T_BREAKPOINT)
        !            68: #ifdef T_WATCHPOINT
        !            69: #define        IS_WATCHPOINT_TRAP(type, code)  ((type) == T_WATCHPOINT)
        !            70: #else
        !            71: #define        IS_WATCHPOINT_TRAP(type, code)  0
        !            72: #endif
        !            73:
        !            74: #define        M_RTS           0xffff0000
        !            75: #define I_RTS          0x4e750000
        !            76: #define M_JSR          0xffc00000
        !            77: #define I_JSR          0x4e800000
        !            78: #define M_BSR          0xff000000
        !            79: #define I_BSR          0x61000000
        !            80: #define        M_RTE           0xffff0000
        !            81: #define        I_RTE           0x4e730000
        !            82:
        !            83: #define        inst_trap_return(ins)   (((ins)&M_RTE) == I_RTE)
        !            84: #define        inst_return(ins)        (((ins)&M_RTS) == I_RTS)
        !            85: #define        inst_call(ins)          (((ins)&M_JSR) == I_JSR || \
        !            86:                                 ((ins)&M_BSR) == I_BSR)
        !            87: #define inst_load(ins)         0
        !            88: #define inst_store(ins)                0
        !            89:
        !            90: /*
        !            91:  * Things needed by kgdb:
        !            92:  */
        !            93: typedef long kgdb_reg_t;
        !            94: #define KGDB_NUMREGS   (16+2)
        !            95: #define KGDB_BUFLEN    512
        !            96:
        !            97: #ifdef _KERNEL
        !            98:
        !            99: #define KGDB_ENTER     __asm __volatile("trap  #15")
        !           100:
        !           101: void   Debugger(void); /* XXX */
        !           102: void   kdb_kintr(db_regs_t *);
        !           103: int    kdb_trap(int, db_regs_t *);
        !           104:
        !           105: #endif /* _KERNEL */
        !           106:
        !           107: /*
        !           108:  * We use a.out symbols in DDB.
        !           109:  */
        !           110: #define        DB_AOUT_SYMBOLS
        !           111:
        !           112: #endif /* _M68K_DB_MACHDEP_H_ */

CVSweb