diff options
author | Peter Oberparleiter <peter.oberparleiter@de.ibm.com> | 2005-05-01 11:58:58 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-01 11:58:58 -0400 |
commit | 0b642ede47969d4180b0922d982777fe64379228 (patch) | |
tree | b54173402cfcd590976f639ef6c2f0490cc23c74 /include/asm-s390/ptrace.h | |
parent | c9e3735359ac2d74ee61c6f1e5724f4a6db570bf (diff) |
[PATCH] s390: default storage key
Provide an easy way to define a non-zero storage key at compile time. This is
useful for debugging purposes.
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-s390/ptrace.h')
-rw-r--r-- | include/asm-s390/ptrace.h | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/include/asm-s390/ptrace.h b/include/asm-s390/ptrace.h index 1dc80666e97e..4eff8f2e3bf1 100644 --- a/include/asm-s390/ptrace.h +++ b/include/asm-s390/ptrace.h | |||
@@ -185,6 +185,7 @@ | |||
185 | #include <linux/stddef.h> | 185 | #include <linux/stddef.h> |
186 | #include <linux/types.h> | 186 | #include <linux/types.h> |
187 | #include <asm/setup.h> | 187 | #include <asm/setup.h> |
188 | #include <asm/page.h> | ||
188 | 189 | ||
189 | typedef union | 190 | typedef union |
190 | { | 191 | { |
@@ -235,6 +236,7 @@ typedef struct | |||
235 | #define PSW_ADDR_INSN 0x7FFFFFFFUL | 236 | #define PSW_ADDR_INSN 0x7FFFFFFFUL |
236 | 237 | ||
237 | #define PSW_BASE_BITS 0x00080000UL | 238 | #define PSW_BASE_BITS 0x00080000UL |
239 | #define PSW_DEFAULT_KEY (((unsigned long) PAGE_DEFAULT_ACC) << 20) | ||
238 | 240 | ||
239 | #define PSW_ASC_PRIMARY 0x00000000UL | 241 | #define PSW_ASC_PRIMARY 0x00000000UL |
240 | #define PSW_ASC_ACCREG 0x00004000UL | 242 | #define PSW_ASC_ACCREG 0x00004000UL |
@@ -260,6 +262,7 @@ typedef struct | |||
260 | 262 | ||
261 | #define PSW_BASE_BITS 0x0000000180000000UL | 263 | #define PSW_BASE_BITS 0x0000000180000000UL |
262 | #define PSW_BASE32_BITS 0x0000000080000000UL | 264 | #define PSW_BASE32_BITS 0x0000000080000000UL |
265 | #define PSW_DEFAULT_KEY (((unsigned long) PAGE_DEFAULT_ACC) << 52) | ||
263 | 266 | ||
264 | #define PSW_ASC_PRIMARY 0x0000000000000000UL | 267 | #define PSW_ASC_PRIMARY 0x0000000000000000UL |
265 | #define PSW_ASC_ACCREG 0x0000400000000000UL | 268 | #define PSW_ASC_ACCREG 0x0000400000000000UL |
@@ -268,14 +271,15 @@ typedef struct | |||
268 | 271 | ||
269 | #define PSW_USER32_BITS (PSW_BASE32_BITS | PSW_MASK_DAT | PSW_ASC_HOME | \ | 272 | #define PSW_USER32_BITS (PSW_BASE32_BITS | PSW_MASK_DAT | PSW_ASC_HOME | \ |
270 | PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | \ | 273 | PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | \ |
271 | PSW_MASK_PSTATE) | 274 | PSW_MASK_PSTATE | PSW_DEFAULT_KEY) |
272 | 275 | ||
273 | #endif /* __s390x__ */ | 276 | #endif /* __s390x__ */ |
274 | 277 | ||
275 | #define PSW_KERNEL_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_PRIMARY) | 278 | #define PSW_KERNEL_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_PRIMARY | \ |
279 | PSW_DEFAULT_KEY) | ||
276 | #define PSW_USER_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_HOME | \ | 280 | #define PSW_USER_BITS (PSW_BASE_BITS | PSW_MASK_DAT | PSW_ASC_HOME | \ |
277 | PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | \ | 281 | PSW_MASK_IO | PSW_MASK_EXT | PSW_MASK_MCHECK | \ |
278 | PSW_MASK_PSTATE) | 282 | PSW_MASK_PSTATE | PSW_DEFAULT_KEY) |
279 | 283 | ||
280 | /* This macro merges a NEW PSW mask specified by the user into | 284 | /* This macro merges a NEW PSW mask specified by the user into |
281 | the currently active PSW mask CURRENT, modifying only those | 285 | the currently active PSW mask CURRENT, modifying only those |
@@ -470,6 +474,12 @@ struct user_regs_struct | |||
470 | extern void show_regs(struct pt_regs * regs); | 474 | extern void show_regs(struct pt_regs * regs); |
471 | #endif | 475 | #endif |
472 | 476 | ||
477 | static inline void | ||
478 | psw_set_key(unsigned int key) | ||
479 | { | ||
480 | asm volatile ( "spka 0(%0)" : : "d" (key) ); | ||
481 | } | ||
482 | |||
473 | #endif /* __ASSEMBLY__ */ | 483 | #endif /* __ASSEMBLY__ */ |
474 | 484 | ||
475 | #endif /* _S390_PTRACE_H */ | 485 | #endif /* _S390_PTRACE_H */ |