1 #ifndef __ASM_CRIS_USER_H
2 #define __ASM_CRIS_USER_H
4 #include <linux/types.h>
5 #include <asm/ptrace.h>
9 * Core file format: The core file is written in such a way that gdb
10 * can understand it and provide useful information to the user (under
11 * linux we use the `trad-core' bfd). The file contents are as follows:
13 * upage: 1 page consisting of a user struct that tells gdb
14 * what is present in the file. Directly after this is a
15 * copy of the task_struct, which is currently not used by gdb,
16 * but it may come in handy at some point. All of the registers
17 * are stored as part of the upage. The upage should always be
19 * data: The data segment follows next. We use current->end_text to
20 * current->brk to pick up all of the user variables, plus any memory
21 * that may have been sbrk'ed. No attempt is made to determine if a
22 * page is demand-zero or if a page is totally unused, we just cover
23 * the entire range. All of the addresses are rounded in such a way
24 * that an integral number of pages is written.
25 * stack: We need the stack information in order to get a meaningful
26 * backtrace. We need to write the data from usp to
27 * current->start_stack, so we round each of these in order to be able
28 * to write an integer number of pages.
31 /* User mode registers, used for core dumps. In order to keep ELF_NGREG
32 sensible we let all registers be 32 bits. The csr registers are included
34 struct user_regs_struct {
35 unsigned long r0; /* General registers. */
49 unsigned long sp; /* Stack pointer. */
50 unsigned long pc; /* Program counter. */
51 unsigned long p0; /* Constant zero (only 8 bits). */
52 unsigned long vr; /* Version register (only 8 bits). */
53 unsigned long p2; /* Reserved. */
54 unsigned long p3; /* Reserved. */
55 unsigned long p4; /* Constant zero (only 16 bits). */
56 unsigned long ccr; /* Condition code register (only 16 bits). */
57 unsigned long p6; /* Reserved. */
58 unsigned long mof; /* Multiply overflow register. */
59 unsigned long p8; /* Constant zero. */
60 unsigned long ibr; /* Not accessible. */
61 unsigned long irp; /* Not accessible. */
62 unsigned long srp; /* Subroutine return pointer. */
63 unsigned long bar; /* Not accessible. */
64 unsigned long dccr; /* Dword condition code register. */
65 unsigned long brp; /* Not accessible. */
66 unsigned long usp; /* User-mode stack pointer. Same as sp when
68 unsigned long csrinstr; /* Internal status registers. */
69 unsigned long csraddr;
70 unsigned long csrdata;
75 struct user_regs_struct regs; /* entire machine state */
76 size_t u_tsize; /* text size (pages) */
77 size_t u_dsize; /* data size (pages) */
78 size_t u_ssize; /* stack size (pages) */
79 unsigned long start_code; /* text starting address */
80 unsigned long start_data; /* data starting address */
81 unsigned long start_stack; /* stack starting address */
82 long int signal; /* signal causing core dump */
83 struct regs * u_ar0; /* help gdb find registers */
84 unsigned long magic; /* identifies a core file */
85 char u_comm[32]; /* user command name */
88 #define NBPG PAGE_SIZE
90 #define HOST_TEXT_START_ADDR (u.start_code)
91 #define HOST_DATA_START_ADDR (u.start_data)
92 #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
94 #endif /* __ASM_CRIS_USER_H */