Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  *  S390 version
0004  *
0005  *  Derived from "include/asm-i386/usr.h"
0006  */
0007 
0008 #ifndef _S390_USER_H
0009 #define _S390_USER_H
0010 
0011 #include <asm/page.h>
0012 #include <asm/ptrace.h>
0013 /* Core file format: The core file is written in such a way that gdb
0014    can understand it and provide useful information to the user (under
0015    linux we use the 'trad-core' bfd).  There are quite a number of
0016    obstacles to being able to view the contents of the floating point
0017    registers, and until these are solved you will not be able to view the
0018    contents of them.  Actually, you can read in the core file and look at
0019    the contents of the user struct to find out what the floating point
0020    registers contain.
0021    The actual file contents are as follows:
0022    UPAGE: 1 page consisting of a user struct that tells gdb what is present
0023    in the file.  Directly after this is a copy of the task_struct, which
0024    is currently not used by gdb, but it may come in useful at some point.
0025    All of the registers are stored as part of the upage.  The upage should
0026    always be only one page.
0027    DATA: The data area is stored.  We use current->end_text to
0028    current->brk to pick up all of the user variables, plus any memory
0029    that may have been malloced.  No attempt is made to determine if a page
0030    is demand-zero or if a page is totally unused, we just cover the entire
0031    range.  All of the addresses are rounded in such a way that an integral
0032    number of pages is written.
0033    STACK: We need the stack information in order to get a meaningful
0034    backtrace.  We need to write the data from (esp) to
0035    current->start_stack, so we round each of these off in order to be able
0036    to write an integer number of pages.
0037    The minimum core file size is 3 pages, or 12288 bytes.
0038 */
0039 
0040 
0041 /*
0042  * This is the old layout of "struct pt_regs", and
0043  * is still the layout used by user mode (the new
0044  * pt_regs doesn't have all registers as the kernel
0045  * doesn't use the extra segment registers)
0046  */
0047 
0048 /* When the kernel dumps core, it starts by dumping the user struct -
0049    this will be used by gdb to figure out where the data and stack segments
0050    are within the file, and what virtual addresses to use. */
0051 struct user {
0052 /* We start with the registers, to mimic the way that "memory" is returned
0053    from the ptrace(3,...) function.  */
0054   struct user_regs_struct regs;     /* Where the registers are actually stored */
0055 /* The rest of this junk is to help gdb figure out what goes where */
0056   unsigned long int u_tsize;    /* Text segment size (pages). */
0057   unsigned long int u_dsize;    /* Data segment size (pages). */
0058   unsigned long int u_ssize;    /* Stack segment size (pages). */
0059   unsigned long start_code;     /* Starting virtual address of text. */
0060   unsigned long start_stack;    /* Starting virtual address of stack area.
0061                    This is actually the bottom of the stack,
0062                    the top of the stack is always found in the
0063                    esp register.  */
0064   long int signal;          /* Signal that caused the core dump. */
0065   unsigned long u_ar0;      /* Used by gdb to help find the values for */
0066                 /* the registers. */
0067   unsigned long magic;      /* To uniquely identify a core file */
0068   char u_comm[32];      /* User command that was responsible */
0069 };
0070 
0071 #endif /* _S390_USER_H */