aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include/uapi/asm/ptrace.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/s390/include/uapi/asm/ptrace.h')
-rw-r--r--arch/s390/include/uapi/asm/ptrace.h125
1 files changed, 61 insertions, 64 deletions
diff --git a/arch/s390/include/uapi/asm/ptrace.h b/arch/s390/include/uapi/asm/ptrace.h
index 0d23c8ff2900..543dd70e12c8 100644
--- a/arch/s390/include/uapi/asm/ptrace.h
+++ b/arch/s390/include/uapi/asm/ptrace.h
@@ -162,7 +162,7 @@
162#define GPR_SIZE 8 162#define GPR_SIZE 8
163#define CR_SIZE 8 163#define CR_SIZE 8
164 164
165#define STACK_FRAME_OVERHEAD 160 /* size of minimum stack frame */ 165#define STACK_FRAME_OVERHEAD 160 /* size of minimum stack frame */
166 166
167#endif /* __s390x__ */ 167#endif /* __s390x__ */
168 168
@@ -179,17 +179,16 @@
179#define ACR_SIZE 4 179#define ACR_SIZE 4
180 180
181 181
182#define PTRACE_OLDSETOPTIONS 21 182#define PTRACE_OLDSETOPTIONS 21
183 183
184#ifndef __ASSEMBLY__ 184#ifndef __ASSEMBLY__
185#include <linux/stddef.h> 185#include <linux/stddef.h>
186#include <linux/types.h> 186#include <linux/types.h>
187 187
188typedef union 188typedef union {
189{ 189 float f;
190 float f; 190 double d;
191 double d; 191 __u64 ui;
192 __u64 ui;
193 struct 192 struct
194 { 193 {
195 __u32 hi; 194 __u32 hi;
@@ -197,23 +196,21 @@ typedef union
197 } fp; 196 } fp;
198} freg_t; 197} freg_t;
199 198
200typedef struct 199typedef struct {
201{ 200 __u32 fpc;
202 __u32 fpc;
203 __u32 pad; 201 __u32 pad;
204 freg_t fprs[NUM_FPRS]; 202 freg_t fprs[NUM_FPRS];
205} s390_fp_regs; 203} s390_fp_regs;
206 204
207#define FPC_EXCEPTION_MASK 0xF8000000 205#define FPC_EXCEPTION_MASK 0xF8000000
208#define FPC_FLAGS_MASK 0x00F80000 206#define FPC_FLAGS_MASK 0x00F80000
209#define FPC_DXC_MASK 0x0000FF00 207#define FPC_DXC_MASK 0x0000FF00
210#define FPC_RM_MASK 0x00000003 208#define FPC_RM_MASK 0x00000003
211 209
212/* this typedef defines how a Program Status Word looks like */ 210/* this typedef defines how a Program Status Word looks like */
213typedef struct 211typedef struct {
214{ 212 unsigned long mask;
215 unsigned long mask; 213 unsigned long addr;
216 unsigned long addr;
217} __attribute__ ((aligned(8))) psw_t; 214} __attribute__ ((aligned(8))) psw_t;
218 215
219#ifndef __s390x__ 216#ifndef __s390x__
@@ -282,8 +279,7 @@ typedef struct
282/* 279/*
283 * The s390_regs structure is used to define the elf_gregset_t. 280 * The s390_regs structure is used to define the elf_gregset_t.
284 */ 281 */
285typedef struct 282typedef struct {
286{
287 psw_t psw; 283 psw_t psw;
288 unsigned long gprs[NUM_GPRS]; 284 unsigned long gprs[NUM_GPRS];
289 unsigned int acrs[NUM_ACRS]; 285 unsigned int acrs[NUM_ACRS];
@@ -291,24 +287,32 @@ typedef struct
291} s390_regs; 287} s390_regs;
292 288
293/* 289/*
290 * The user_pt_regs structure exports the beginning of
291 * the in-kernel pt_regs structure to user space.
292 */
293typedef struct {
294 unsigned long args[1];
295 psw_t psw;
296 unsigned long gprs[NUM_GPRS];
297} user_pt_regs;
298
299/*
294 * Now for the user space program event recording (trace) definitions. 300 * Now for the user space program event recording (trace) definitions.
295 * The following structures are used only for the ptrace interface, don't 301 * The following structures are used only for the ptrace interface, don't
296 * touch or even look at it if you don't want to modify the user-space 302 * touch or even look at it if you don't want to modify the user-space
297 * ptrace interface. In particular stay away from it for in-kernel PER. 303 * ptrace interface. In particular stay away from it for in-kernel PER.
298 */ 304 */
299typedef struct 305typedef struct {
300{
301 unsigned long cr[NUM_CR_WORDS]; 306 unsigned long cr[NUM_CR_WORDS];
302} per_cr_words; 307} per_cr_words;
303 308
304#define PER_EM_MASK 0xE8000000UL 309#define PER_EM_MASK 0xE8000000UL
305 310
306typedef struct 311typedef struct {
307{
308#ifdef __s390x__ 312#ifdef __s390x__
309 unsigned : 32; 313 unsigned : 32;
310#endif /* __s390x__ */ 314#endif /* __s390x__ */
311 unsigned em_branching : 1; 315 unsigned em_branching : 1;
312 unsigned em_instruction_fetch : 1; 316 unsigned em_instruction_fetch : 1;
313 /* 317 /*
314 * Switching on storage alteration automatically fixes 318 * Switching on storage alteration automatically fixes
@@ -317,44 +321,41 @@ typedef struct
317 unsigned em_storage_alteration : 1; 321 unsigned em_storage_alteration : 1;
318 unsigned em_gpr_alt_unused : 1; 322 unsigned em_gpr_alt_unused : 1;
319 unsigned em_store_real_address : 1; 323 unsigned em_store_real_address : 1;
320 unsigned : 3; 324 unsigned : 3;
321 unsigned branch_addr_ctl : 1; 325 unsigned branch_addr_ctl : 1;
322 unsigned : 1; 326 unsigned : 1;
323 unsigned storage_alt_space_ctl : 1; 327 unsigned storage_alt_space_ctl : 1;
324 unsigned : 21; 328 unsigned : 21;
325 unsigned long starting_addr; 329 unsigned long starting_addr;
326 unsigned long ending_addr; 330 unsigned long ending_addr;
327} per_cr_bits; 331} per_cr_bits;
328 332
329typedef struct 333typedef struct {
330{
331 unsigned short perc_atmid; 334 unsigned short perc_atmid;
332 unsigned long address; 335 unsigned long address;
333 unsigned char access_id; 336 unsigned char access_id;
334} per_lowcore_words; 337} per_lowcore_words;
335 338
336typedef struct 339typedef struct {
337{ 340 unsigned perc_branching : 1;
338 unsigned perc_branching : 1;
339 unsigned perc_instruction_fetch : 1; 341 unsigned perc_instruction_fetch : 1;
340 unsigned perc_storage_alteration : 1; 342 unsigned perc_storage_alteration : 1;
341 unsigned perc_gpr_alt_unused : 1; 343 unsigned perc_gpr_alt_unused : 1;
342 unsigned perc_store_real_address : 1; 344 unsigned perc_store_real_address : 1;
343 unsigned : 3; 345 unsigned : 3;
344 unsigned atmid_psw_bit_31 : 1; 346 unsigned atmid_psw_bit_31 : 1;
345 unsigned atmid_validity_bit : 1; 347 unsigned atmid_validity_bit : 1;
346 unsigned atmid_psw_bit_32 : 1; 348 unsigned atmid_psw_bit_32 : 1;
347 unsigned atmid_psw_bit_5 : 1; 349 unsigned atmid_psw_bit_5 : 1;
348 unsigned atmid_psw_bit_16 : 1; 350 unsigned atmid_psw_bit_16 : 1;
349 unsigned atmid_psw_bit_17 : 1; 351 unsigned atmid_psw_bit_17 : 1;
350 unsigned si : 2; 352 unsigned si : 2;
351 unsigned long address; 353 unsigned long address;
352 unsigned : 4; 354 unsigned : 4;
353 unsigned access_id : 4; 355 unsigned access_id : 4;
354} per_lowcore_bits; 356} per_lowcore_bits;
355 357
356typedef struct 358typedef struct {
357{
358 union { 359 union {
359 per_cr_words words; 360 per_cr_words words;
360 per_cr_bits bits; 361 per_cr_bits bits;
@@ -364,9 +365,9 @@ typedef struct
364 * the kernel always sets them to zero. To enable single 365 * the kernel always sets them to zero. To enable single
365 * stepping use ptrace(PTRACE_SINGLESTEP) instead. 366 * stepping use ptrace(PTRACE_SINGLESTEP) instead.
366 */ 367 */
367 unsigned single_step : 1; 368 unsigned single_step : 1;
368 unsigned instruction_fetch : 1; 369 unsigned instruction_fetch : 1;
369 unsigned : 30; 370 unsigned : 30;
370 /* 371 /*
371 * These addresses are copied into cr10 & cr11 if single 372 * These addresses are copied into cr10 & cr11 if single
372 * stepping is switched off 373 * stepping is switched off
@@ -376,11 +377,10 @@ typedef struct
376 union { 377 union {
377 per_lowcore_words words; 378 per_lowcore_words words;
378 per_lowcore_bits bits; 379 per_lowcore_bits bits;
379 } lowcore; 380 } lowcore;
380} per_struct; 381} per_struct;
381 382
382typedef struct 383typedef struct {
383{
384 unsigned int len; 384 unsigned int len;
385 unsigned long kernel_addr; 385 unsigned long kernel_addr;
386 unsigned long process_addr; 386 unsigned long process_addr;
@@ -390,12 +390,12 @@ typedef struct
390 * S/390 specific non posix ptrace requests. I chose unusual values so 390 * S/390 specific non posix ptrace requests. I chose unusual values so
391 * they are unlikely to clash with future ptrace definitions. 391 * they are unlikely to clash with future ptrace definitions.
392 */ 392 */
393#define PTRACE_PEEKUSR_AREA 0x5000 393#define PTRACE_PEEKUSR_AREA 0x5000
394#define PTRACE_POKEUSR_AREA 0x5001 394#define PTRACE_POKEUSR_AREA 0x5001
395#define PTRACE_PEEKTEXT_AREA 0x5002 395#define PTRACE_PEEKTEXT_AREA 0x5002
396#define PTRACE_PEEKDATA_AREA 0x5003 396#define PTRACE_PEEKDATA_AREA 0x5003
397#define PTRACE_POKETEXT_AREA 0x5004 397#define PTRACE_POKETEXT_AREA 0x5004
398#define PTRACE_POKEDATA_AREA 0x5005 398#define PTRACE_POKEDATA_AREA 0x5005
399#define PTRACE_GET_LAST_BREAK 0x5006 399#define PTRACE_GET_LAST_BREAK 0x5006
400#define PTRACE_PEEK_SYSTEM_CALL 0x5007 400#define PTRACE_PEEK_SYSTEM_CALL 0x5007
401#define PTRACE_POKE_SYSTEM_CALL 0x5008 401#define PTRACE_POKE_SYSTEM_CALL 0x5008
@@ -413,21 +413,19 @@ typedef struct
413 * PT_PROT definition is loosely based on hppa bsd definition in 413 * PT_PROT definition is loosely based on hppa bsd definition in
414 * gdb/hppab-nat.c 414 * gdb/hppab-nat.c
415 */ 415 */
416#define PTRACE_PROT 21 416#define PTRACE_PROT 21
417 417
418typedef enum 418typedef enum {
419{
420 ptprot_set_access_watchpoint, 419 ptprot_set_access_watchpoint,
421 ptprot_set_write_watchpoint, 420 ptprot_set_write_watchpoint,
422 ptprot_disable_watchpoint 421 ptprot_disable_watchpoint
423} ptprot_flags; 422} ptprot_flags;
424 423
425typedef struct 424typedef struct {
426{
427 unsigned long lowaddr; 425 unsigned long lowaddr;
428 unsigned long hiaddr; 426 unsigned long hiaddr;
429 ptprot_flags prot; 427 ptprot_flags prot;
430} ptprot_area; 428} ptprot_area;
431 429
432/* Sequence of bytes for breakpoint illegal instruction. */ 430/* Sequence of bytes for breakpoint illegal instruction. */
433#define S390_BREAKPOINT {0x0,0x1} 431#define S390_BREAKPOINT {0x0,0x1}
@@ -439,8 +437,7 @@ typedef struct
439 * The user_regs_struct defines the way the user registers are 437 * The user_regs_struct defines the way the user registers are
440 * store on the stack for signal handling. 438 * store on the stack for signal handling.
441 */ 439 */
442struct user_regs_struct 440struct user_regs_struct {
443{
444 psw_t psw; 441 psw_t psw;
445 unsigned long gprs[NUM_GPRS]; 442 unsigned long gprs[NUM_GPRS];
446 unsigned int acrs[NUM_ACRS]; 443 unsigned int acrs[NUM_ACRS];