1 /* Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. 2 This file is part of the GNU C Library. 3 4 The GNU C Library is free software; you can redistribute it and/or 5 modify it under the terms of the GNU Lesser General Public 6 License as published by the Free Software Foundation; either 7 version 2.1 of the License, or (at your option) any later version. 8 9 The GNU C Library is distributed in the hope that it will be useful, 10 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 Lesser General Public License for more details. 13 14 You should have received a copy of the GNU Lesser General Public 15 License along with the GNU C Library; if not, see 16 <http://www.gnu.org/licenses/>. */ 17 18 #ifndef _SYS_USER_H 19 #define _SYS_USER_H 1 20 21 /* The whole purpose of this file is for GDB and GDB only. Don't read 22 too much into it. Don't use it for anything other than GDB unless 23 you know what you are doing. */ 24 25 #include <bits/wordsize.h> 26 27 #if __WORDSIZE == 64 28 29 struct user_fpregs_struct 30 { 31 __uint16_t cwd; 32 __uint16_t swd; 33 __uint16_t ftw; 34 __uint16_t fop; 35 __uint64_t rip; 36 __uint64_t rdp; 37 __uint32_t mxcsr; 38 __uint32_t mxcr_mask; 39 __uint32_t st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */ 40 __uint32_t xmm_space[64]; /* 16*16 bytes for each XMM-reg = 256 bytes */ 41 __uint32_t padding[24]; 42 }; 43 44 struct user_regs_struct 45 { 46 unsigned long r15; 47 unsigned long r14; 48 unsigned long r13; 49 unsigned long r12; 50 unsigned long rbp; 51 unsigned long rbx; 52 unsigned long r11; 53 unsigned long r10; 54 unsigned long r9; 55 unsigned long r8; 56 unsigned long rax; 57 unsigned long rcx; 58 unsigned long rdx; 59 unsigned long rsi; 60 unsigned long rdi; 61 unsigned long orig_rax; 62 unsigned long rip; 63 unsigned long cs; 64 unsigned long eflags; 65 unsigned long rsp; 66 unsigned long ss; 67 unsigned long fs_base; 68 unsigned long gs_base; 69 unsigned long ds; 70 unsigned long es; 71 unsigned long fs; 72 unsigned long gs; 73 }; 74 75 struct user 76 { 77 struct user_regs_struct regs; 78 int u_fpvalid; 79 struct user_fpregs_struct i387; 80 unsigned long int u_tsize; 81 unsigned long int u_dsize; 82 unsigned long int u_ssize; 83 unsigned long start_code; 84 unsigned long start_stack; 85 long int signal; 86 int reserved; 87 struct user_regs_struct* u_ar0; 88 struct user_fpregs_struct* u_fpstate; 89 unsigned long int magic; 90 char u_comm [32]; 91 unsigned long int u_debugreg [8]; 92 }; 93 94 #else 95 /* These are the 32-bit x86 structures. */ 96 struct user_fpregs_struct 97 { 98 long int cwd; 99 long int swd; 100 long int twd; 101 long int fip; 102 long int fcs; 103 long int foo; 104 long int fos; 105 long int st_space [20]; 106 }; 107 108 struct user_fpxregs_struct 109 { 110 unsigned short int cwd; 111 unsigned short int swd; 112 unsigned short int twd; 113 unsigned short int fop; 114 long int fip; 115 long int fcs; 116 long int foo; 117 long int fos; 118 long int mxcsr; 119 long int reserved; 120 long int st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */ 121 long int xmm_space[32]; /* 8*16 bytes for each XMM-reg = 128 bytes */ 122 long int padding[56]; 123 }; 124 125 struct user_regs_struct 126 { 127 long int ebx; 128 long int ecx; 129 long int edx; 130 long int esi; 131 long int edi; 132 long int ebp; 133 long int eax; 134 long int xds; 135 long int xes; 136 long int xfs; 137 long int xgs; 138 long int orig_eax; 139 long int eip; 140 long int xcs; 141 long int eflags; 142 long int esp; 143 long int xss; 144 }; 145 146 struct user 147 { 148 struct user_regs_struct regs; 149 int u_fpvalid; 150 struct user_fpregs_struct i387; 151 unsigned long int u_tsize; 152 unsigned long int u_dsize; 153 unsigned long int u_ssize; 154 unsigned long start_code; 155 unsigned long start_stack; 156 long int signal; 157 int reserved; 158 struct user_regs_struct* u_ar0; 159 struct user_fpregs_struct* u_fpstate; 160 unsigned long int magic; 161 char u_comm [32]; 162 int u_debugreg [8]; 163 }; 164 #endif /* __WORDSIZE */ 165 166 #include <bits/uClibc_page.h> 167 #define PAGE_SHIFT 12 168 #define PAGE_SIZE (1UL << PAGE_SHIFT) 169 #define PAGE_MASK (~(PAGE_SIZE-1)) 170 #define NBPG PAGE_SIZE 171 #define UPAGES 1 172 #define HOST_TEXT_START_ADDR (u.start_code) 173 #define HOST_STACK_END_ADDR (u.start_stack + u.u_ssize * NBPG) 174 175 #endif /* _SYS_USER_H */ 176