tm-m88k.h

来自「模拟嵌入式硬件平台的软件源代码」· C头文件 代码 · 共 588 行 · 第 1/2 页

H
588
字号
// OBSOLETE /* Target machine description for generic Motorola 88000, for GDB.// OBSOLETE // OBSOLETE    Copyright 1986, 1987, 1988, 1989, 1990, 1991, 1993, 1994, 1996,// OBSOLETE    1998, 1999, 2000, 2002 Free Software Foundation, Inc.// OBSOLETE // OBSOLETE    This file is part of GDB.// OBSOLETE // OBSOLETE    This program is free software; you can redistribute it and/or modify// OBSOLETE    it under the terms of the GNU General Public License as published by// OBSOLETE    the Free Software Foundation; either version 2 of the License, or// OBSOLETE    (at your option) any later version.// OBSOLETE // OBSOLETE    This program is distributed in the hope that it will be useful,// OBSOLETE    but WITHOUT ANY WARRANTY; without even the implied warranty of// OBSOLETE    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the// OBSOLETE    GNU General Public License for more details.// OBSOLETE // OBSOLETE    You should have received a copy of the GNU General Public License// OBSOLETE    along with this program; if not, write to the Free Software// OBSOLETE    Foundation, Inc., 59 Temple Place - Suite 330,// OBSOLETE    Boston, MA 02111-1307, USA.  */// OBSOLETE // OBSOLETE #include "doublest.h"// OBSOLETE #include "regcache.h"// OBSOLETE // OBSOLETE /* g++ support is not yet included.  */// OBSOLETE // OBSOLETE /* We cache information about saved registers in the frame structure,// OBSOLETE    to save us from having to re-scan function prologues every time// OBSOLETE    a register in a non-current frame is accessed.  */// OBSOLETE // OBSOLETE #define EXTRA_FRAME_INFO 	\// OBSOLETE 	struct frame_saved_regs *fsr;	\// OBSOLETE 	CORE_ADDR locals_pointer;	\// OBSOLETE 	CORE_ADDR args_pointer;// OBSOLETE // OBSOLETE /* Zero the frame_saved_regs pointer when the frame is initialized,// OBSOLETE    so that FRAME_FIND_SAVED_REGS () will know to allocate and// OBSOLETE    initialize a frame_saved_regs struct the first time it is called.// OBSOLETE    Set the arg_pointer to -1, which is not valid; 0 and other values// OBSOLETE    indicate real, cached values.  */// OBSOLETE // OBSOLETE #define INIT_EXTRA_FRAME_INFO(fromleaf, fi) \// OBSOLETE 	init_extra_frame_info (fromleaf, fi)// OBSOLETE extern void init_extra_frame_info ();// OBSOLETE // OBSOLETE /* Offset from address of function to start of its code.// OBSOLETE    Zero on most machines.  */// OBSOLETE // OBSOLETE #define FUNCTION_START_OFFSET 0// OBSOLETE // OBSOLETE /* Advance PC across any function entry prologue instructions// OBSOLETE    to reach some "real" code.  */// OBSOLETE // OBSOLETE extern CORE_ADDR m88k_skip_prologue (CORE_ADDR);// OBSOLETE #define SKIP_PROLOGUE(frompc) (m88k_skip_prologue (frompc))// OBSOLETE // OBSOLETE /* The m88k kernel aligns all instructions on 4-byte boundaries.  The// OBSOLETE    kernel also uses the least significant two bits for its own hocus// OBSOLETE    pocus.  When gdb receives an address from the kernel, it needs to// OBSOLETE    preserve those right-most two bits, but gdb also needs to be careful// OBSOLETE    to realize that those two bits are not really a part of the address// OBSOLETE    of an instruction.  Shrug.  */// OBSOLETE // OBSOLETE extern CORE_ADDR m88k_addr_bits_remove (CORE_ADDR);// OBSOLETE #define ADDR_BITS_REMOVE(addr) m88k_addr_bits_remove (addr)// OBSOLETE // OBSOLETE /* Immediately after a function call, return the saved pc.// OBSOLETE    Can't always go through the frames for this because on some machines// OBSOLETE    the new frame is not set up until the new function executes// OBSOLETE    some instructions.  */// OBSOLETE // OBSOLETE #define SAVED_PC_AFTER_CALL(frame) \// OBSOLETE   (ADDR_BITS_REMOVE (read_register (SRP_REGNUM)))// OBSOLETE // OBSOLETE /* Stack grows downward.  */// OBSOLETE // OBSOLETE #define INNER_THAN(lhs,rhs) ((lhs) < (rhs))// OBSOLETE // OBSOLETE /* Sequence of bytes for breakpoint instruction.  */// OBSOLETE // OBSOLETE /* instruction 0xF000D1FF is 'tb0 0,r0,511'// OBSOLETE    If Bit bit 0 of r0 is clear (always true),// OBSOLETE    initiate exception processing (trap).// OBSOLETE  */// OBSOLETE #define BREAKPOINT {0xF0, 0x00, 0xD1, 0xFF}// OBSOLETE // OBSOLETE /* Amount PC must be decremented by after a breakpoint.// OBSOLETE    This is often the number of bytes in BREAKPOINT// OBSOLETE    but not always.  */// OBSOLETE // OBSOLETE #define DECR_PC_AFTER_BREAK 0// OBSOLETE // OBSOLETE /* Say how long (ordinary) registers are.  This is a piece of bogosity// OBSOLETE    used in push_word and a few other places; REGISTER_RAW_SIZE is the// OBSOLETE    real way to know how big a register is.  */// OBSOLETE // OBSOLETE #define REGISTER_SIZE 4// OBSOLETE // OBSOLETE /* Number of machine registers */// OBSOLETE // OBSOLETE #define GP_REGS (38)// OBSOLETE #define FP_REGS (32)// OBSOLETE #define NUM_REGS (GP_REGS + FP_REGS)// OBSOLETE // OBSOLETE /* Initializer for an array of names of registers.// OBSOLETE    There should be NUM_REGS strings in this initializer.  */// OBSOLETE // OBSOLETE #define REGISTER_NAMES {\// OBSOLETE 			  "r0",\// OBSOLETE 			  "r1",\// OBSOLETE 			  "r2",\// OBSOLETE 			  "r3",\// OBSOLETE 			  "r4",\// OBSOLETE 			  "r5",\// OBSOLETE 			  "r6",\// OBSOLETE 			  "r7",\// OBSOLETE 			  "r8",\// OBSOLETE 			  "r9",\// OBSOLETE 			  "r10",\// OBSOLETE 			  "r11",\// OBSOLETE 			  "r12",\// OBSOLETE 			  "r13",\// OBSOLETE 			  "r14",\// OBSOLETE 			  "r15",\// OBSOLETE 			  "r16",\// OBSOLETE 			  "r17",\// OBSOLETE 			  "r18",\// OBSOLETE 			  "r19",\// OBSOLETE 			  "r20",\// OBSOLETE 			  "r21",\// OBSOLETE 			  "r22",\// OBSOLETE 			  "r23",\// OBSOLETE 			  "r24",\// OBSOLETE 			  "r25",\// OBSOLETE 			  "r26",\// OBSOLETE 			  "r27",\// OBSOLETE 			  "r28",\// OBSOLETE 			  "r29",\// OBSOLETE 			  "r30",\// OBSOLETE 			  "r31",\// OBSOLETE 			  "psr",\// OBSOLETE 			  "fpsr",\// OBSOLETE 			  "fpcr",\// OBSOLETE 			  "sxip",\// OBSOLETE 			  "snip",\// OBSOLETE 			  "sfip",\// OBSOLETE 			  "x0",\// OBSOLETE 			  "x1",\// OBSOLETE 			  "x2",\// OBSOLETE 			  "x3",\// OBSOLETE 			  "x4",\// OBSOLETE 			  "x5",\// OBSOLETE 			  "x6",\// OBSOLETE 			  "x7",\// OBSOLETE 			  "x8",\// OBSOLETE 			  "x9",\// OBSOLETE 			  "x10",\// OBSOLETE 			  "x11",\// OBSOLETE 			  "x12",\// OBSOLETE 			  "x13",\// OBSOLETE 			  "x14",\// OBSOLETE 			  "x15",\// OBSOLETE 			  "x16",\// OBSOLETE 			  "x17",\// OBSOLETE 			  "x18",\// OBSOLETE 			  "x19",\// OBSOLETE 			  "x20",\// OBSOLETE 			  "x21",\// OBSOLETE 			  "x22",\// OBSOLETE 			  "x23",\// OBSOLETE 			  "x24",\// OBSOLETE 			  "x25",\// OBSOLETE 			  "x26",\// OBSOLETE 			  "x27",\// OBSOLETE 			  "x28",\// OBSOLETE 			  "x29",\// OBSOLETE 			  "x30",\// OBSOLETE 			  "x31",\// OBSOLETE 			  "vbr",\// OBSOLETE 			  "dmt0",\// OBSOLETE 			  "dmd0",\// OBSOLETE 			  "dma0",\// OBSOLETE 			  "dmt1",\// OBSOLETE 			  "dmd1",\// OBSOLETE 			  "dma1",\// OBSOLETE 			  "dmt2",\// OBSOLETE 			  "dmd2",\// OBSOLETE 			  "dma2",\// OBSOLETE 			  "sr0",\// OBSOLETE 			  "sr1",\// OBSOLETE 			  "sr2",\// OBSOLETE 			  "sr3",\// OBSOLETE 			  "fpecr",\// OBSOLETE 			  "fphs1",\// OBSOLETE 			  "fpls1",\// OBSOLETE 			  "fphs2",\// OBSOLETE 			  "fpls2",\// OBSOLETE 			  "fppt",\// OBSOLETE 			  "fprh",\// OBSOLETE 			  "fprl",\// OBSOLETE 			  "fpit",\// OBSOLETE 			  "fpsr",\// OBSOLETE 			  "fpcr",\// OBSOLETE 		      }// OBSOLETE // OBSOLETE // OBSOLETE /* Register numbers of various important registers.// OBSOLETE    Note that some of these values are "real" register numbers,// OBSOLETE    and correspond to the general registers of the machine,// OBSOLETE    and some are "phony" register numbers which are too large// OBSOLETE    to be actual register numbers as far as the user is concerned// OBSOLETE    but do serve to get the desired values when passed to read_register.  */// OBSOLETE // OBSOLETE #define R0_REGNUM 0		/* Contains the constant zero */// OBSOLETE #define SRP_REGNUM 1		/* Contains subroutine return pointer */// OBSOLETE #define RV_REGNUM 2		/* Contains simple return values */// OBSOLETE #define SRA_REGNUM 12		/* Contains address of struct return values */// OBSOLETE #define SP_REGNUM 31		/* Contains address of top of stack */// OBSOLETE // OBSOLETE /* Instruction pointer notes...// OBSOLETE // OBSOLETE    On the m88100:// OBSOLETE // OBSOLETE    * cr04 = sxip.  On exception, contains the excepting pc (probably).// OBSOLETE    On rte, is ignored.// OBSOLETE // OBSOLETE    * cr05 = snip.  On exception, contains the NPC (next pc).  On rte,// OBSOLETE    pc is loaded from here.// OBSOLETE // OBSOLETE    * cr06 = sfip.  On exception, contains the NNPC (next next pc).  On// OBSOLETE    rte, the NPC is loaded from here.// OBSOLETE // OBSOLETE    * lower two bits of each are flag bits.  Bit 1 is V means address// OBSOLETE    is valid.  If address is not valid, bit 0 is ignored.  Otherwise,// OBSOLETE    bit 0 is E and asks for an exception to be taken if this// OBSOLETE    instruction is executed.// OBSOLETE // OBSOLETE    On the m88110:// OBSOLETE // OBSOLETE    * cr04 = exip.  On exception, contains the address of the excepting// OBSOLETE    pc (always).  On rte, pc is loaded from here.  Bit 0, aka the D// OBSOLETE    bit, is a flag saying that the offending instruction was in a// OBSOLETE    branch delay slot.  If set, then cr05 contains the NPC.// OBSOLETE // OBSOLETE    * cr05 = enip.  On exception, if the instruction pointed to by cr04// OBSOLETE    was in a delay slot as indicated by the bit 0 of cr04, aka the D// OBSOLETE    bit, the cr05 contains the NPC.  Otherwise ignored.// OBSOLETE // OBSOLETE    * cr06 is invalid  */// OBSOLETE // OBSOLETE /* Note that the Harris Unix kernels emulate the m88100's behavior on// OBSOLETE    the m88110.  */// OBSOLETE // OBSOLETE #define SXIP_REGNUM 35		/* On m88100, Contains Shadow Execute// OBSOLETE 				   Instruction Pointer.  */// OBSOLETE #define SNIP_REGNUM 36		/* On m88100, Contains Shadow Next// OBSOLETE 				   Instruction Pointer.  */// OBSOLETE #define SFIP_REGNUM 37		/* On m88100, Contains Shadow Fetched// OBSOLETE 				   Intruction pointer.  */// OBSOLETE // OBSOLETE #define EXIP_REGNUM 35		/* On m88110, Contains Exception// OBSOLETE 				   Executing Instruction Pointer.  */// OBSOLETE #define ENIP_REGNUM 36		/* On m88110, Contains the Exception// OBSOLETE 				   Next Instruction Pointer.  */// OBSOLETE // OBSOLETE #define PC_REGNUM SXIP_REGNUM	/* Program Counter */// OBSOLETE #define NPC_REGNUM SNIP_REGNUM	/* Next Program Counter */// OBSOLETE #define M88K_NNPC_REGNUM SFIP_REGNUM        /* Next Next Program Counter */// OBSOLETE // OBSOLETE // OBSOLETE #define PSR_REGNUM 32		/* Processor Status Register */// OBSOLETE #define FPSR_REGNUM 33		/* Floating Point Status Register */// OBSOLETE #define FPCR_REGNUM 34		/* Floating Point Control Register */// OBSOLETE #define XFP_REGNUM 38		/* First Extended Float Register */// OBSOLETE #define X0_REGNUM XFP_REGNUM	/* Which also contains the constant zero */// OBSOLETE // OBSOLETE /* This is rather a confusing lie.  Our m88k port using a stack pointer value// OBSOLETE    for the frame address.  Hence, the frame address and the frame pointer are// OBSOLETE    only indirectly related.  The value of this macro is the register number// OBSOLETE    fetched by the machine "independent" portions of gdb when they want to know// OBSOLETE    about a frame address.  Thus, we lie here and claim that FP_REGNUM is// OBSOLETE    SP_REGNUM.  */// OBSOLETE #define FP_REGNUM SP_REGNUM	/* Reg fetched to locate frame when pgm stops */// OBSOLETE #define ACTUAL_FP_REGNUM 30// OBSOLETE // OBSOLETE /* PSR status bit definitions.  */// OBSOLETE // OBSOLETE #define PSR_MODE		0x80000000// OBSOLETE #define PSR_BYTE_ORDER		0x40000000// OBSOLETE #define PSR_SERIAL_MODE		0x20000000// OBSOLETE #define PSR_CARRY		0x10000000// OBSOLETE #define PSR_SFU_DISABLE		0x000003f0// OBSOLETE #define PSR_SFU1_DISABLE	0x00000008

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?