diff options
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 */ |