GDB (API)
/home/stan/gdb/src/gdb/nios2-tdep.h
Go to the documentation of this file.
00001 /* Target-dependent header for the Nios II architecture, for GDB.
00002    Copyright (C) 2012-2013 Free Software Foundation, Inc.
00003    Contributed by Mentor Graphics, Inc.
00004 
00005    This file is part of GDB.
00006 
00007    This program is free software; you can redistribute it and/or modify
00008    it under the terms of the GNU General Public License as published by
00009    the Free Software Foundation; either version 3 of the License, or
00010    (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015    GNU General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
00019 
00020 #ifndef NIOS2_TDEP_H
00021 #define NIOS2_TDEP_H
00022 
00023 /* Registers.  */
00024 #define NIOS2_Z_REGNUM 0     /* Zero */
00025 #define NIOS2_R2_REGNUM 2    /* used for return value */
00026 #define NIOS2_R3_REGNUM 3    /* used for return value */
00027 /* Used for hidden zero argument to store ptr to struct return value.  */
00028 #define NIOS2_R4_REGNUM 4
00029 #define NIOS2_R7_REGNUM 7
00030 #define NIOS2_GP_REGNUM 26  /* Global Pointer */
00031 #define NIOS2_SP_REGNUM 27  /* Stack Pointer */
00032 #define NIOS2_FP_REGNUM 28  /* Frame Pointer */
00033 #define NIOS2_EA_REGNUM 29  /* Exception address */
00034 #define NIOS2_BA_REGNUM 30  /* Breakpoint return address */
00035 #define NIOS2_RA_REGNUM 31  /* Return address */
00036 #define NIOS2_PC_REGNUM 32
00037 
00038 /* Control registers.  */
00039 #define NIOS2_STATUS_REGNUM 33
00040 #define NIOS2_ESTATUS_REGNUM 34
00041 #define NIOS2_BSTATUS_REGNUM 35
00042 #define NIOS2_IENABLE_REGNUM 36
00043 #define NIOS2_IPENDING_REGNUM 37
00044 #define NIOS2_CPUID_REGNUM 38
00045 #define NIOS2_EXCEPTION_REGNUM 40
00046 #define NIOS2_PTEADDR_REGNUM 41
00047 #define NIOS2_TLBACC_REGNUM 42
00048 #define NIOS2_TLBMISC_REGNUM 43
00049 #define NIOS2_ECCINJ_REGNUM 44
00050 #define NIOS2_BADADDR_REGNUM 45
00051 #define NIOS2_CONFIG_REGNUM 46
00052 #define NIOS2_MPUBASE_REGNUM 47
00053 #define NIOS2_MPUACC_REGNUM 48
00054 
00055 /* R4-R7 are used for argument passing.  */
00056 #define NIOS2_FIRST_ARGREG NIOS2_R4_REGNUM
00057 #define NIOS2_LAST_ARGREG NIOS2_R7_REGNUM
00058 
00059 /* Number of all registers.  */
00060 #define NIOS2_NUM_REGS 49
00061 
00062 /* Size of an instruction, in bytes.  */
00063 #define NIOS2_OPCODE_SIZE 4
00064 
00065 /* Target-dependent structure in gdbarch.  */
00066 struct gdbarch_tdep
00067 {
00068   /* Assumes FRAME is stopped at a syscall (trap) instruction; returns
00069      the expected next PC.  */
00070   CORE_ADDR (*syscall_next_pc) (struct frame_info *frame);
00071 
00072   /* Offset to PC value in jump buffer.
00073      If this is negative, longjmp support will be disabled.  */
00074   int jb_pc;
00075 };
00076 
00077 extern struct target_desc *tdesc_nios2_linux;
00078 extern struct target_desc *tdesc_nios2;
00079 
00080 #endif /* NIOS2_TDEP_H */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines