| 1 | --- /dev/null |
| 2 | +++ b/libc/sysdeps/linux/cris/sys/user.h |
| 3 | @@ -0,0 +1,81 @@ |
| 4 | +#ifndef __ASM_CRIS_USER_H |
| 5 | +#define __ASM_CRIS_USER_H |
| 6 | + |
| 7 | +/* User-mode register used for core dumps. */ |
| 8 | + |
| 9 | +struct user_fpregs { |
| 10 | +}; |
| 11 | + |
| 12 | +struct user_regs_struct { |
| 13 | + unsigned long r0; /* General registers. */ |
| 14 | + unsigned long r1; |
| 15 | + unsigned long r2; |
| 16 | + unsigned long r3; |
| 17 | + unsigned long r4; |
| 18 | + unsigned long r5; |
| 19 | + unsigned long r6; |
| 20 | + unsigned long r7; |
| 21 | + unsigned long r8; |
| 22 | + unsigned long r9; |
| 23 | + unsigned long r10; |
| 24 | + unsigned long r11; |
| 25 | + unsigned long r12; |
| 26 | + unsigned long r13; |
| 27 | + unsigned long sp; /* R14, Stack pointer. */ |
| 28 | + unsigned long acr; /* R15, Address calculation register. */ |
| 29 | + unsigned long bz; /* P0, Constant zero (8-bits). */ |
| 30 | + unsigned long vr; /* P1, Version register (8-bits). */ |
| 31 | + unsigned long pid; /* P2, Process ID (8-bits). */ |
| 32 | + unsigned long srs; /* P3, Support register select (8-bits). */ |
| 33 | + unsigned long wz; /* P4, Constant zero (16-bits). */ |
| 34 | + unsigned long exs; /* P5, Exception status. */ |
| 35 | + unsigned long eda; /* P6, Exception data address. */ |
| 36 | + unsigned long mof; /* P7, Multiply overflow regiter. */ |
| 37 | + unsigned long dz; /* P8, Constant zero (32-bits). */ |
| 38 | + unsigned long ebp; /* P9, Exception base pointer. */ |
| 39 | + unsigned long erp; /* P10, Exception return pointer. */ |
| 40 | + unsigned long srp; /* P11, Subroutine return pointer. */ |
| 41 | + unsigned long nrp; /* P12, NMI return pointer. */ |
| 42 | + unsigned long ccs; /* P13, Condition code stack. */ |
| 43 | + unsigned long usp; /* P14, User mode stack pointer. */ |
| 44 | + unsigned long spc; /* P15, Single step PC. */ |
| 45 | +}; |
| 46 | + |
| 47 | +/* |
| 48 | + * Core file format: The core file is written in such a way that gdb |
| 49 | + * can understand it and provide useful information to the user (under |
| 50 | + * linux we use the `trad-core' bfd). The file contents are as follows: |
| 51 | + * |
| 52 | + * upage: 1 page consisting of a user struct that tells gdb |
| 53 | + * what is present in the file. Directly after this is a |
| 54 | + * copy of the task_struct, which is currently not used by gdb, |
| 55 | + * but it may come in handy at some point. All of the registers |
| 56 | + * are stored as part of the upage. The upage should always be |
| 57 | + * only one page long. |
| 58 | + * data: The data segment follows next. We use current->end_text to |
| 59 | + * current->brk to pick up all of the user variables, plus any memory |
| 60 | + * that may have been sbrk'ed. No attempt is made to determine if a |
| 61 | + * page is demand-zero or if a page is totally unused, we just cover |
| 62 | + * the entire range. All of the addresses are rounded in such a way |
| 63 | + * that an integral number of pages is written. |
| 64 | + * stack: We need the stack information in order to get a meaningful |
| 65 | + * backtrace. We need to write the data from usp to |
| 66 | + * current->start_stack, so we round each of these in order to be able |
| 67 | + * to write an integer number of pages. |
| 68 | + */ |
| 69 | + |
| 70 | +struct user { |
| 71 | + struct user_regs_struct regs; /* entire machine state */ |
| 72 | + size_t u_tsize; /* text size (pages) */ |
| 73 | + size_t u_dsize; /* data size (pages) */ |
| 74 | + size_t u_ssize; /* stack size (pages) */ |
| 75 | + unsigned long start_code; /* text starting address */ |
| 76 | + unsigned long start_data; /* data starting address */ |
| 77 | + unsigned long start_stack; /* stack starting address */ |
| 78 | + long int signal; /* signal causing core dump */ |
| 79 | + unsigned long u_ar0; /* help gdb find registers */ |
| 80 | + unsigned long magic; /* identifies a core file */ |
| 81 | + char u_comm[32]; /* user command name */ |
| 82 | +}; |
| 83 | + |
| 84 | +#endif /* __ASM_CRIS_USER_H */ |
| 85 | |