diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2014-01-01 10:08:06 -0500 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2014-04-22 07:24:36 -0400 |
commit | 1365632bdeb42e5e252566bb08c0d7d68640edd3 (patch) | |
tree | ebeeb423dfe921afdcae02aa5f93bb6328d32aa9 /arch/s390/include | |
parent | 280ef0f1f982e4bd9a22ee3627ca06dccde59a64 (diff) |
s390/ptrace: add struct psw and accessor function
Introduce a 'struct psw' which makes it easier to decode and test if
certain bits in a psw are set or are not set.
In addition also add a 'psw_bits()' helper define which allows to
directly modify and test a psw_t structure. E.g.
psw_t psw;
psw_bits(psw).t = 1; /* set dat bit */
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/include')
-rw-r--r-- | arch/s390/include/asm/ptrace.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/arch/s390/include/asm/ptrace.h b/arch/s390/include/asm/ptrace.h index f4783c0b7b43..6e7708f3d866 100644 --- a/arch/s390/include/asm/ptrace.h +++ b/arch/s390/include/asm/ptrace.h | |||
@@ -16,6 +16,50 @@ | |||
16 | PSW_DEFAULT_KEY | PSW_MASK_BASE | PSW_MASK_MCHECK | \ | 16 | PSW_DEFAULT_KEY | PSW_MASK_BASE | PSW_MASK_MCHECK | \ |
17 | PSW_MASK_PSTATE | PSW_ASC_PRIMARY) | 17 | PSW_MASK_PSTATE | PSW_ASC_PRIMARY) |
18 | 18 | ||
19 | struct psw_bits { | ||
20 | unsigned long long : 1; | ||
21 | unsigned long long r : 1; /* PER-Mask */ | ||
22 | unsigned long long : 3; | ||
23 | unsigned long long t : 1; /* DAT Mode */ | ||
24 | unsigned long long i : 1; /* Input/Output Mask */ | ||
25 | unsigned long long e : 1; /* External Mask */ | ||
26 | unsigned long long key : 4; /* PSW Key */ | ||
27 | unsigned long long : 1; | ||
28 | unsigned long long m : 1; /* Machine-Check Mask */ | ||
29 | unsigned long long w : 1; /* Wait State */ | ||
30 | unsigned long long p : 1; /* Problem State */ | ||
31 | unsigned long long as : 2; /* Address Space Control */ | ||
32 | unsigned long long cc : 2; /* Condition Code */ | ||
33 | unsigned long long pm : 4; /* Program Mask */ | ||
34 | unsigned long long ri : 1; /* Runtime Instrumentation */ | ||
35 | unsigned long long : 6; | ||
36 | unsigned long long eaba : 2; /* Addressing Mode */ | ||
37 | #ifdef CONFIG_64BIT | ||
38 | unsigned long long : 31; | ||
39 | unsigned long long ia : 64;/* Instruction Address */ | ||
40 | #else | ||
41 | unsigned long long ia : 31;/* Instruction Address */ | ||
42 | #endif | ||
43 | }; | ||
44 | |||
45 | enum { | ||
46 | PSW_AMODE_24BIT = 0, | ||
47 | PSW_AMODE_31BIT = 1, | ||
48 | PSW_AMODE_64BIT = 3 | ||
49 | }; | ||
50 | |||
51 | enum { | ||
52 | PSW_AS_PRIMARY = 0, | ||
53 | PSW_AS_ACCREG = 1, | ||
54 | PSW_AS_SECONDARY = 2, | ||
55 | PSW_AS_HOME = 3 | ||
56 | }; | ||
57 | |||
58 | #define psw_bits(__psw) (*({ \ | ||
59 | typecheck(psw_t, __psw); \ | ||
60 | &(*(struct psw_bits *)(&(__psw))); \ | ||
61 | })) | ||
62 | |||
19 | /* | 63 | /* |
20 | * The pt_regs struct defines the way the registers are stored on | 64 | * The pt_regs struct defines the way the registers are stored on |
21 | * the stack during a system call. | 65 | * the stack during a system call. |