MOXA linux-2.6.x / linux-2.6.19-uc1 from UC-7110-LX-BOOTLOADER-1.9_VERSION-4.2.tgz
[linux-2.6.19-moxart.git] / include / asm-nios2nommu / user.h
blob3cdc2ba5ebaf385665734e0fcd6631980ce20252
1 #ifndef _NIOS2NOMMU_USER_H
2 #define _NIOS2NOMMU_USER_H
4 /*--------------------------------------------------------------------
6 * include/asm-nios2nommu/user.h
8 * Derived from M68knommu
10 * Copyright (C) 2004 Microtronix Datacom Ltd
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
23 * Jan/20/2004 dgt NiosII
25 ---------------------------------------------------------------------*/
28 #include <asm/page.h>
30 /* Core file format: The core file is written in such a way that gdb
31 can understand it and provide useful information to the user (under
32 linux we use the 'trad-core' bfd). There are quite a number of
33 obstacles to being able to view the contents of the floating point
34 registers, and until these are solved you will not be able to view the
35 contents of them. Actually, you can read in the core file and look at
36 the contents of the user struct to find out what the floating point
37 registers contain.
38 The actual file contents are as follows:
39 UPAGE: 1 page consisting of a user struct that tells gdb what is present
40 in the file. Directly after this is a copy of the task_struct, which
41 is currently not used by gdb, but it may come in useful at some point.
42 All of the registers are stored as part of the upage. The upage should
43 always be only one page.
44 DATA: The data area is stored. We use current->end_text to
45 current->brk to pick up all of the user variables, plus any memory
46 that may have been malloced. No attempt is made to determine if a page
47 is demand-zero or if a page is totally unused, we just cover the entire
48 range. All of the addresses are rounded in such a way that an integral
49 number of pages is written.
50 STACK: We need the stack information in order to get a meaningful
51 backtrace. We need to write the data from (esp) to
52 current->start_stack, so we round each of these off in order to be able
53 to write an integer number of pages.
54 The minimum core file size is 3 pages, or 12288 bytes.
57 struct user_m68kfp_struct {
58 unsigned long fpregs[8*3]; /* fp0-fp7 registers */
59 unsigned long fpcntl[3]; /* fp control regs */
62 /* This is needs more work, probably should look like gdb useage */
63 struct user_regs_struct {
64 long r1,r2,r3,r4,r5,r6,r7,r8;
65 long r9,r10,r11,r12,r13,r14,r15;
66 long r16,r17,r18,r19,r20,r21,r22,r23;
67 long gp;
68 long sp;
69 long ra;
70 long fp;
71 long orig_r2;
72 long estatus;
73 long status_extension;
74 long ea;
78 /* When the kernel dumps core, it starts by dumping the user struct -
79 this will be used by gdb to figure out where the data and stack segments
80 are within the file, and what virtual addresses to use. */
81 struct user{
82 /* We start with the registers, to mimic the way that "memory" is returned
83 from the ptrace(3,...) function. */
84 struct user_regs_struct regs; /* Where the registers are actually stored */
85 /* ptrace does not yet supply these. Someday.... */
86 int u_fpvalid; /* True if math co-processor being used. */
87 /* for this mess. Not yet used. */
88 struct user_m68kfp_struct m68kfp; /* Math Co-processor registers. */
89 /* The rest of this junk is to help gdb figure out what goes where */
90 unsigned long int u_tsize; /* Text segment size (pages). */
91 unsigned long int u_dsize; /* Data segment size (pages). */
92 unsigned long int u_ssize; /* Stack segment size (pages). */
93 unsigned long start_code; /* Starting virtual address of text. */
94 unsigned long start_stack; /* Starting virtual address of stack area.
95 This is actually the bottom of the stack,
96 the top of the stack is always found in the
97 esp register. */
98 long int signal; /* Signal that caused the core dump. */
99 int reserved; /* No longer used */
100 struct user_regs_struct *u_ar0;
101 /* Used by gdb to help find the values for */
102 /* the registers. */
103 struct user_m68kfp_struct* u_fpstate; /* Math Co-processor pointer. */
104 unsigned long magic; /* To uniquely identify a core file */
105 char u_comm[32]; /* User command that was responsible */
107 #define NBPG PAGE_SIZE
108 #define UPAGES 1
109 #define HOST_TEXT_START_ADDR (u.start_code)
110 #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG)
112 #endif