File: /usr/src/linux/include/asm-s390x/s390-gdbregs.h

1     /*
2      *  include/asm-s390/s390-gdbregs.h
3      *
4      *  S390 version
5      *    Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
6      *    Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
7      *
8      *  used both by the linux kernel for remote debugging & gdb 
9      */
10     
11     #ifndef _S390_GDBREGS_H
12     #define _S390_GDBREGS_H
13     
14     #ifdef __KERNEL__
15     #include <asm/s390-regs-common.h>
16     #else
17     #include <s390x/s390-regs-common.h>
18     #endif
19     #define S390_MAX_INSTR_SIZE 6
20     #define NUM_REGS      (2+NUM_GPRS+NUM_ACRS+NUM_CRS+1+NUM_FPRS)
21     #define FIRST_ACR     (2+NUM_GPRS)
22     #define LAST_ACR      (FIRST_ACR+NUM_ACRS-1)
23     #define FIRST_CR      (FIRST_ACR+NUM_ACRS)
24     #define LAST_CR       (FIRST_CR+NUM_CRS-1)
25     
26     #define PSWM_REGNUM    0
27     #define PC_REGNUM      1
28     #define	GP0_REGNUM     2		    /* GPR register 0 */ 
29     #define GP_LAST_REGNUM (GP0_REGNUM+NUM_GPRS-1)
30     #define RETADDR_REGNUM (GP0_REGNUM+14)                   /* Usually return address */
31     #define SP_REGNUM      (GP0_REGNUM+15)	    /* Contains address of top of stack */
32     #define FP_REGNUM     SP_REGNUM /* needed in findvar.c still */
33     #define FRAME_REGNUM  (GP0_REGNUM+11)
34     #define FPC_REGNUM    (GP0_REGNUM+NUM_GPRS+NUM_ACRS+NUM_CRS)
35     #define FP0_REGNUM    (FPC_REGNUM+1) /* FPR (Floating point) register 0 */
36     #define FPLAST_REGNUM (FP0_REGNUM+NUM_FPRS-1)	/* Last floating point register */
37     
38     /* The top of this structure is as similar as possible to a pt_regs structure to */
39     /* simplify code */
40     typedef struct
41     {
42     	S390_REGS_COMMON
43     	__u32         crs[NUM_CRS];
44     	s390_fp_regs  fp_regs;
45     } s390_gdb_regs __attribute__((packed));
46     
47     #define REGISTER_NAMES                                           \
48     {                                                                \
49     "pswm","pswa",                                                   \
50     "gpr0","gpr1","gpr2","gpr3","gpr4","gpr5","gpr6","gpr7",         \
51     "gpr8","gpr9","gpr10","gpr11","gpr12","gpr13","gpr14","gpr15",   \
52     "acr0","acr1","acr2","acr3","acr4","acr5","acr6","acr7",         \
53     "acr8","acr9","acr10","acr11","acr12","acr13","acr14","acr15",   \
54     "cr0","cr1","cr2","cr3","cr4","cr5","cr6","cr7",                 \
55     "cr8","cr9","cr10","cr11","cr12","cr13","cr14","cr15",           \
56     "fpc",                                                           \
57     "fpr0","fpr1","fpr2","fpr3","fpr4","fpr5","fpr6","fpr7",         \
58     "fpr8","fpr9","fpr10","fpr11","fpr12","fpr13","fpr14","fpr15"    \
59     }
60     
61     /* Index within `registers' of the first byte of the space for
62        register N.  */
63     
64     #define ACR0_OFFSET ((PSW_MASK_SIZE+PSW_ADDR_SIZE)+(GPR_SIZE*NUM_GPRS))
65     #define CR0_OFFSET (ACR0_OFFSET+(ACR_SIZE+NUM_ACRS))
66     #define FPC_OFFSET (CR0_OFFSET+(CR_SIZE*NUM_CRS))
67     #define FP0_OFFSET (FPC_OFFSET+(FPC_SIZE+FPC_PAD_SIZE))
68     
69     #define REGISTER_BYTES    \
70     ((FP0_OFFSET)+(FPR_SIZE*NUM_FPRS))
71     
72     #define REGISTER_BYTE(N)  ((N)<=GP_LAST_REGNUM ? (N)*8: \
73     (N) <= LAST_ACR ? (ACR0_OFFSET+(((N)-FIRST_ACR)*ACR_SIZE)): \
74     (N) <= LAST_CR ? (CR0_OFFSET+(((N)-FIRST_CR)*CR_SIZE)): \
75     (N) == FPC_REGNUM ? FPC_OFFSET:(FP0_OFFSET+(((N)-FP0_REGNUM)*FPR_SIZE)))
76     
77     #endif
78     
79     
80     
81     
82     
83     
84     
85     
86     
87     
88     
89     
90