blob: 7934b3dab4f61b8e32649a36e20502420d40e246 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
/*
* include/asm-s390/s390-regs-common.h
*
* S390 version
* Copyright (C) 1999,2000 IBM Deutschland Entwicklung GmbH, IBM Corporation
* Author(s): Denis Joseph Barrow (djbarrow@de.ibm.com,barrow_dj@yahoo.com)
*
* this file is designed to keep as much compatibility between
* gdb's representation of registers & the kernels representation of registers
* as possible so as to minimise translation between gdb registers &
* kernel registers please keep this matched with gdb & strace
*/
#ifndef _S390_REGS_COMMON_H
#define _S390_REGS_COMMON_H
#ifndef __ASSEMBLY__
#include <asm/types.h>
#endif
#if defined(WANT_S390_TGT_DEFS) || defined(__KERNEL__)
#define REGISTER_SIZE 4
#endif
#define NUM_GPRS 16
#define GPR_SIZE 4
#define PSW_MASK_SIZE 4
#define PSW_ADDR_SIZE 4
#define NUM_FPRS 16
#define FPR_SIZE 8
#define FPC_SIZE 4
#define FPC_PAD_SIZE 4 /* gcc insists on aligning the fpregs */
#define NUM_CRS 16
#define CR_SIZE 4
#define NUM_ACRS 16
#define ACR_SIZE 4
#define STACK_FRAME_OVERHEAD 96 /* size of minimum stack frame */
#ifndef __ASSEMBLY__
/* this typedef defines how a Program Status Word looks like */
typedef struct
{
__u32 mask;
__u32 addr;
} psw_t __attribute__ ((aligned(8)));
/* 2 __u32's are used for floats instead to compile with a __STRICT_ANSI__ defined */
typedef union
{
#ifdef __KERNEL__
__u64 d; /* mathemu.h gets upset otherwise */
#else
double d; /* ansi c dosen't like long longs & make sure that */
/* alignments are identical for both compiles */
#endif
struct
{
__u32 hi;
__u32 lo;
} fp;
__u32 f;
} freg_t;
typedef struct
{
/*
The compiler appears to like aligning freg_t on an 8 byte boundary
so I always access fpregs, this was causing fun when I was doing
coersions.
*/
__u32 fpc;
freg_t fprs[NUM_FPRS];
} s390_fp_regs;
#define FPC_EXCEPTION_MASK 0xF8000000
#define FPC_FLAGS_MASK 0x00F80000
#define FPC_DXC_MASK 0x0000FF00
#define FPC_RM_MASK 0x00000003
#define FPC_VALID_MASK ((FPC_EXCEPTION_MASK|FPC_FLAGS_MASK| \
FPC_DXC_MASK|FPC_RM_MASK))
/*
gdb structures & the kernel have this much always in common
*/
#define S390_REGS_COMMON \
psw_t psw; \
__u32 gprs[NUM_GPRS]; \
__u32 acrs[NUM_ACRS]; \
typedef struct
{
S390_REGS_COMMON
} s390_regs_common;
/* Sequence of bytes for breakpoint illegal instruction. */
#define S390_BREAKPOINT {0x0,0x1}
#define S390_BREAKPOINT_U16 ((__u16)0x0001)
#define S390_SYSCALL_OPCODE ((__u16)0x0a00)
#define S390_SYSCALL_SIZE 2
#if defined(WANT_S390_TGT_DEFS) || defined(__KERNEL__)
#define ADDR_BITS_REMOVE(addr) ((addr)&0x7fffffff)
#endif
#endif
#endif
|