user.h
001:
002:
003:
004:
005:
006:
007:
008:
009:
010:
011:
012:
013:
014:
015:
016:
017:
018:
019: #ifndef _SYS_USER_H
020: #define _SYS_USER_H 1
021:
022:
023:
024:
025:
026: #include <bits/wordsize.h>
027: #include <unistd.h>
028:
029: #if __WORDSIZE == 64
030:
031: struct user_fpregs_struct
032: {
033: unsigned short int cwd;
034: unsigned short int swd;
035: unsigned short int ftw;
036: unsigned short int fop;
037: unsigned long int rip;
038: unsigned long int rdp;
039: unsigned int mxcsr;
040: unsigned int mxcr_mask;
041: unsigned int st_space[32];
042: unsigned int xmm_space[64];
043: unsigned int padding[24];
044: };
045:
046: struct user_regs_struct
047: {
048: unsigned long int r15;
049: unsigned long int r14;
050: unsigned long int r13;
051: unsigned long int r12;
052: unsigned long int rbp;
053: unsigned long int rbx;
054: unsigned long int r11;
055: unsigned long int r10;
056: unsigned long int r9;
057: unsigned long int r8;
058: unsigned long int rax;
059: unsigned long int rcx;
060: unsigned long int rdx;
061: unsigned long int rsi;
062: unsigned long int rdi;
063: unsigned long int orig_rax;
064: unsigned long int rip;
065: unsigned long int cs;
066: unsigned long int eflags;
067: unsigned long int rsp;
068: unsigned long int ss;
069: unsigned long int fs_base;
070: unsigned long int gs_base;
071: unsigned long int ds;
072: unsigned long int es;
073: unsigned long int fs;
074: unsigned long int gs;
075: };
076:
077: struct user
078: {
079: struct user_regs_struct regs;
080: int u_fpvalid;
081: struct user_fpregs_struct i387;
082: unsigned long int u_tsize;
083: unsigned long int u_dsize;
084: unsigned long int u_ssize;
085: unsigned long int start_code;
086: unsigned long int start_stack;
087: long int signal;
088: int reserved;
089: struct user_regs_struct* u_ar0;
090: struct user_fpregs_struct* u_fpstate;
091: unsigned long int magic;
092: char u_comm [32];
093: unsigned long int u_debugreg [8];
094: };
095:
096: #else
097:
098: struct user_fpregs_struct
099: {
100: long int cwd;
101: long int swd;
102: long int twd;
103: long int fip;
104: long int fcs;
105: long int foo;
106: long int fos;
107: long int st_space [20];
108: };
109:
110: struct user_fpxregs_struct
111: {
112: unsigned short int cwd;
113: unsigned short int swd;
114: unsigned short int twd;
115: unsigned short int fop;
116: long int fip;
117: long int fcs;
118: long int foo;
119: long int fos;
120: long int mxcsr;
121: long int reserved;
122: long int st_space[32];
123: long int xmm_space[32];
124: long int padding[56];
125: };
126:
127: struct user_regs_struct
128: {
129: long int ebx;
130: long int ecx;
131: long int edx;
132: long int esi;
133: long int edi;
134: long int ebp;
135: long int eax;
136: long int xds;
137: long int xes;
138: long int xfs;
139: long int xgs;
140: long int orig_eax;
141: long int eip;
142: long int xcs;
143: long int eflags;
144: long int esp;
145: long int xss;
146: };
147:
148: struct user
149: {
150: struct user_regs_struct regs;
151: int u_fpvalid;
152: struct user_fpregs_struct i387;
153: unsigned long int u_tsize;
154: unsigned long int u_dsize;
155: unsigned long int u_ssize;
156: unsigned long int start_code;
157: unsigned long int start_stack;
158: long int signal;
159: int reserved;
160: struct user_regs_struct* u_ar0;
161: struct user_fpregs_struct* u_fpstate;
162: unsigned long int magic;
163: char u_comm [32];
164: int u_debugreg [8];
165: };
166: #endif
167:
168: #define PAGE_SIZE (sysconf(_SC_PAGESIZE))
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
176:
for client
18.223.107.149
© Andrew Scott 2006 -
2024,
All Rights Reserved