File indexing completed on 2025-01-30 10:25:25
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #ifndef __VKI_AMD64_LINUX_H
0030 #define __VKI_AMD64_LINUX_H
0031
0032
0033 #define VKI_LITTLE_ENDIAN 1
0034
0035
0036
0037
0038
0039 typedef unsigned char __vki_u8;
0040
0041 typedef __signed__ short __vki_s16;
0042 typedef unsigned short __vki_u16;
0043
0044 typedef __signed__ int __vki_s32;
0045 typedef unsigned int __vki_u32;
0046
0047 typedef __signed__ long long __vki_s64;
0048 typedef unsigned long long __vki_u64;
0049
0050 typedef unsigned short vki_u16;
0051
0052 typedef unsigned int vki_u32;
0053
0054
0055
0056
0057
0058 #define VKI_PAGE_SHIFT 12
0059 #define VKI_PAGE_SIZE (1UL << VKI_PAGE_SHIFT)
0060 #define VKI_MAX_PAGE_SHIFT VKI_PAGE_SHIFT
0061 #define VKI_MAX_PAGE_SIZE VKI_PAGE_SIZE
0062
0063
0064
0065
0066
0067 #define VKI_SHMLBA VKI_PAGE_SIZE
0068
0069
0070
0071
0072
0073 #define _VKI_NSIG 64
0074 #define _VKI_NSIG_BPW 64
0075 #define _VKI_NSIG_WORDS (_VKI_NSIG / _VKI_NSIG_BPW)
0076
0077 typedef unsigned long vki_old_sigset_t;
0078
0079 typedef struct {
0080 unsigned long sig[_VKI_NSIG_WORDS];
0081 } vki_sigset_t;
0082
0083 #define VKI_SIGHUP 1
0084 #define VKI_SIGINT 2
0085 #define VKI_SIGQUIT 3
0086 #define VKI_SIGILL 4
0087 #define VKI_SIGTRAP 5
0088 #define VKI_SIGABRT 6
0089 #define VKI_SIGBUS 7
0090 #define VKI_SIGFPE 8
0091 #define VKI_SIGKILL 9
0092 #define VKI_SIGUSR1 10
0093 #define VKI_SIGSEGV 11
0094 #define VKI_SIGUSR2 12
0095 #define VKI_SIGPIPE 13
0096 #define VKI_SIGALRM 14
0097 #define VKI_SIGTERM 15
0098 #define VKI_SIGSTKFLT 16
0099 #define VKI_SIGCHLD 17
0100 #define VKI_SIGCONT 18
0101 #define VKI_SIGSTOP 19
0102 #define VKI_SIGTSTP 20
0103 #define VKI_SIGTTIN 21
0104 #define VKI_SIGTTOU 22
0105 #define VKI_SIGURG 23
0106 #define VKI_SIGXCPU 24
0107 #define VKI_SIGXFSZ 25
0108 #define VKI_SIGVTALRM 26
0109 #define VKI_SIGPROF 27
0110 #define VKI_SIGWINCH 28
0111 #define VKI_SIGIO 29
0112 #define VKI_SIGPWR 30
0113 #define VKI_SIGSYS 31
0114 #define VKI_SIGUNUSED 31
0115
0116 #define VKI_SIGRTMIN 32
0117 #define VKI_SIGRTMAX _VKI_NSIG
0118
0119 #define VKI_SA_NOCLDSTOP 0x00000001
0120 #define VKI_SA_NOCLDWAIT 0x00000002
0121 #define VKI_SA_SIGINFO 0x00000004
0122 #define VKI_SA_ONSTACK 0x08000000
0123 #define VKI_SA_RESTART 0x10000000
0124 #define VKI_SA_NODEFER 0x40000000
0125 #define VKI_SA_RESETHAND 0x80000000
0126
0127 #define VKI_SA_NOMASK VKI_SA_NODEFER
0128 #define VKI_SA_ONESHOT VKI_SA_RESETHAND
0129
0130 #define VKI_SA_RESTORER 0x04000000
0131
0132 #define VKI_SS_ONSTACK 1
0133 #define VKI_SS_DISABLE 2
0134
0135 #define VKI_MINSIGSTKSZ 2048
0136
0137 #define VKI_SIG_BLOCK 0
0138 #define VKI_SIG_UNBLOCK 1
0139 #define VKI_SIG_SETMASK 2
0140
0141 typedef void __vki_signalfn_t(int);
0142 typedef __vki_signalfn_t __user *__vki_sighandler_t;
0143
0144 typedef void __vki_restorefn_t(void);
0145 typedef __vki_restorefn_t __user *__vki_sigrestore_t;
0146
0147 #define VKI_SIG_DFL ((__vki_sighandler_t)0)
0148 #define VKI_SIG_IGN ((__vki_sighandler_t)1)
0149
0150 struct vki_sigaction_base {
0151
0152
0153
0154
0155 __vki_sighandler_t ksa_handler;
0156 unsigned long sa_flags;
0157 __vki_sigrestore_t sa_restorer;
0158 vki_sigset_t sa_mask;
0159 };
0160
0161
0162
0163 typedef struct vki_sigaction_base vki_sigaction_toK_t;
0164 typedef struct vki_sigaction_base vki_sigaction_fromK_t;
0165
0166
0167 typedef struct vki_sigaltstack {
0168 void __user *ss_sp;
0169 int ss_flags;
0170 vki_size_t ss_size;
0171 } vki_stack_t;
0172
0173
0174
0175
0176
0177 struct _vki_fpstate {
0178 __vki_u16 cwd;
0179 __vki_u16 swd;
0180 __vki_u16 twd;
0181 __vki_u16 fop;
0182 __vki_u64 rip;
0183 __vki_u64 rdp;
0184 __vki_u32 mxcsr;
0185 __vki_u32 mxcsr_mask;
0186 __vki_u32 st_space[32];
0187 __vki_u32 xmm_space[64];
0188 __vki_u32 reserved2[24];
0189 };
0190
0191 struct vki_sigcontext {
0192 unsigned long r8;
0193 unsigned long r9;
0194 unsigned long r10;
0195 unsigned long r11;
0196 unsigned long r12;
0197 unsigned long r13;
0198 unsigned long r14;
0199 unsigned long r15;
0200 unsigned long rdi;
0201 unsigned long rsi;
0202 unsigned long rbp;
0203 unsigned long rbx;
0204 unsigned long rdx;
0205 unsigned long rax;
0206 unsigned long rcx;
0207 unsigned long rsp;
0208 unsigned long rip;
0209 unsigned long eflags;
0210 unsigned short cs;
0211 unsigned short gs;
0212 unsigned short fs;
0213 unsigned short __pad0;
0214 unsigned long err;
0215 unsigned long trapno;
0216 unsigned long oldmask;
0217 unsigned long cr2;
0218 struct _vki_fpstate __user *fpstate;
0219 unsigned long reserved1[8];
0220 };
0221
0222
0223
0224
0225
0226 #define VKI_PROT_READ 0x1
0227 #define VKI_PROT_WRITE 0x2
0228 #define VKI_PROT_EXEC 0x4
0229 #define VKI_PROT_NONE 0x0
0230 #define VKI_PROT_GROWSDOWN 0x01000000
0231 #define VKI_PROT_GROWSUP 0x02000000
0232
0233 #define VKI_MAP_SHARED 0x01
0234 #define VKI_MAP_PRIVATE 0x02
0235 #define VKI_MAP_FIXED 0x10
0236 #define VKI_MAP_ANONYMOUS 0x20
0237 #define VKI_MAP_32BIT 0x40
0238 #define VKI_MAP_NORESERVE 0x4000
0239
0240
0241
0242
0243
0244 #define VKI_O_ACCMODE 03
0245 #define VKI_O_RDONLY 00
0246 #define VKI_O_WRONLY 01
0247 #define VKI_O_RDWR 02
0248 #define VKI_O_CREAT 0100
0249 #define VKI_O_EXCL 0200
0250 #define VKI_O_TRUNC 01000
0251 #define VKI_O_APPEND 02000
0252 #define VKI_O_NONBLOCK 04000
0253 #define VKI_O_LARGEFILE 0100000
0254
0255 #define VKI_AT_FDCWD -100
0256
0257 #define VKI_F_DUPFD 0
0258 #define VKI_F_GETFD 1
0259 #define VKI_F_SETFD 2
0260 #define VKI_F_GETFL 3
0261 #define VKI_F_SETFL 4
0262 #define VKI_F_GETLK 5
0263 #define VKI_F_SETLK 6
0264 #define VKI_F_SETLKW 7
0265
0266 #define VKI_F_SETOWN 8
0267 #define VKI_F_GETOWN 9
0268 #define VKI_F_SETSIG 10
0269 #define VKI_F_GETSIG 11
0270
0271 #define VKI_F_SETOWN_EX 15
0272 #define VKI_F_GETOWN_EX 16
0273
0274 #define VKI_F_OFD_GETLK 36
0275 #define VKI_F_OFD_SETLK 37
0276 #define VKI_F_OFD_SETLKW 38
0277
0278 #define VKI_F_OWNER_TID 0
0279 #define VKI_F_OWNER_PID 1
0280 #define VKI_F_OWNER_PGRP 2
0281
0282 struct vki_f_owner_ex {
0283 int type;
0284 __vki_kernel_pid_t pid;
0285 };
0286
0287 #define VKI_FD_CLOEXEC 1
0288
0289 #define VKI_F_LINUX_SPECIFIC_BASE 1024
0290
0291
0292
0293
0294
0295 #define VKI_RLIMIT_DATA 2
0296 #define VKI_RLIMIT_STACK 3
0297 #define VKI_RLIMIT_CORE 4
0298 #define VKI_RLIMIT_NOFILE 7
0299
0300
0301
0302
0303
0304
0305 #ifdef __x86_64__
0306 # ifdef __ILP32__
0307 typedef long long __vki_kernel_si_clock_t __attribute__((aligned(4)));
0308 # define __VKI_ARCH_SI_CLOCK_T __vki_kernel_si_clock_t
0309 # define __VKI_ARCH_SI_ATTRIBUTES __attribute__((aligned(8)))
0310 # else
0311 # define __VKI_ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
0312 # endif
0313 #endif
0314
0315
0316
0317
0318
0319 #define VKI_SOL_SOCKET 1
0320
0321 #define VKI_SO_TYPE 3
0322
0323 #define VKI_SO_ATTACH_FILTER 26
0324
0325
0326
0327
0328
0329 #define VKI_SIOCSPGRP 0x8902
0330 #define VKI_SIOCGPGRP 0x8904
0331 #define VKI_SIOCATMARK 0x8905
0332 #define VKI_SIOCGSTAMP 0x8906
0333 #define VKI_SIOCGSTAMPNS 0x8907
0334
0335
0336
0337
0338
0339 struct vki_stat {
0340 unsigned long st_dev;
0341 unsigned long st_ino;
0342 unsigned long st_nlink;
0343
0344 unsigned int st_mode;
0345 unsigned int st_uid;
0346 unsigned int st_gid;
0347 unsigned int __pad0;
0348 unsigned long st_rdev;
0349 long st_size;
0350 long st_blksize;
0351 long st_blocks;
0352
0353 unsigned long st_atime;
0354 unsigned long st_atime_nsec;
0355 unsigned long st_mtime;
0356 unsigned long st_mtime_nsec;
0357 unsigned long st_ctime;
0358 unsigned long st_ctime_nsec;
0359 long __unused0[3];
0360 };
0361
0362
0363
0364
0365
0366 struct vki_statfs {
0367 long f_type;
0368 long f_bsize;
0369 long f_blocks;
0370 long f_bfree;
0371 long f_bavail;
0372 long f_files;
0373 long f_ffree;
0374 __vki_kernel_fsid_t f_fsid;
0375 long f_namelen;
0376 long f_frsize;
0377 long f_spare[5];
0378 };
0379
0380
0381
0382
0383
0384 struct vki_winsize {
0385 unsigned short ws_row;
0386 unsigned short ws_col;
0387 unsigned short ws_xpixel;
0388 unsigned short ws_ypixel;
0389 };
0390
0391 #define VKI_NCC 8
0392 struct vki_termio {
0393 unsigned short c_iflag;
0394 unsigned short c_oflag;
0395 unsigned short c_cflag;
0396 unsigned short c_lflag;
0397 unsigned char c_line;
0398 unsigned char c_cc[VKI_NCC];
0399 };
0400
0401
0402
0403
0404
0405 typedef unsigned char vki_cc_t;
0406 typedef unsigned int vki_tcflag_t;
0407
0408 #define VKI_NCCS 19
0409 struct vki_termios {
0410 vki_tcflag_t c_iflag;
0411 vki_tcflag_t c_oflag;
0412 vki_tcflag_t c_cflag;
0413 vki_tcflag_t c_lflag;
0414 vki_cc_t c_line;
0415 vki_cc_t c_cc[VKI_NCCS];
0416 };
0417
0418
0419
0420
0421
0422
0423 #define _VKI_IOC_NRBITS 8
0424 #define _VKI_IOC_TYPEBITS 8
0425 #define _VKI_IOC_SIZEBITS 14
0426 #define _VKI_IOC_DIRBITS 2
0427
0428 #define _VKI_IOC_SIZEMASK ((1 << _VKI_IOC_SIZEBITS)-1)
0429 #define _VKI_IOC_DIRMASK ((1 << _VKI_IOC_DIRBITS)-1)
0430
0431 #define _VKI_IOC_NRSHIFT 0
0432 #define _VKI_IOC_TYPESHIFT (_VKI_IOC_NRSHIFT+_VKI_IOC_NRBITS)
0433 #define _VKI_IOC_SIZESHIFT (_VKI_IOC_TYPESHIFT+_VKI_IOC_TYPEBITS)
0434 #define _VKI_IOC_DIRSHIFT (_VKI_IOC_SIZESHIFT+_VKI_IOC_SIZEBITS)
0435
0436 #define _VKI_IOC_NONE 0U
0437 #define _VKI_IOC_WRITE 1U
0438 #define _VKI_IOC_READ 2U
0439
0440 #define _VKI_IOC(dir,type,nr,size) \
0441 (((dir) << _VKI_IOC_DIRSHIFT) | \
0442 ((type) << _VKI_IOC_TYPESHIFT) | \
0443 ((nr) << _VKI_IOC_NRSHIFT) | \
0444 ((size) << _VKI_IOC_SIZESHIFT))
0445
0446 #define _VKI_IO(type,nr) _VKI_IOC(_VKI_IOC_NONE,(type),(nr),0)
0447 #define _VKI_IOR(type,nr,size) _VKI_IOC(_VKI_IOC_READ,(type),(nr),sizeof(size))
0448 #define _VKI_IOW(type,nr,size) _VKI_IOC(_VKI_IOC_WRITE,(type),(nr),sizeof(size))
0449 #define _VKI_IOWR(type,nr,size) _VKI_IOC(_VKI_IOC_READ|_VKI_IOC_WRITE,(type),(nr),sizeof(size))
0450
0451 #define _VKI_IOC_DIR(nr) (((nr) >> _VKI_IOC_DIRSHIFT) & _VKI_IOC_DIRMASK)
0452 #define _VKI_IOC_SIZE(nr) (((nr) >> _VKI_IOC_SIZESHIFT) & _VKI_IOC_SIZEMASK)
0453
0454
0455
0456
0457
0458 #define VKI_TCGETS 0x5401
0459 #define VKI_TCSETS 0x5402
0460 #define VKI_TCSETSW 0x5403
0461 #define VKI_TCSETSF 0x5404
0462 #define VKI_TCGETA 0x5405
0463 #define VKI_TCSETA 0x5406
0464 #define VKI_TCSETAW 0x5407
0465 #define VKI_TCSETAF 0x5408
0466 #define VKI_TCSBRK 0x5409
0467 #define VKI_TCXONC 0x540A
0468 #define VKI_TCFLSH 0x540B
0469 #define VKI_TIOCSCTTY 0x540E
0470 #define VKI_TIOCGPGRP 0x540F
0471 #define VKI_TIOCSPGRP 0x5410
0472 #define VKI_TIOCOUTQ 0x5411
0473 #define VKI_TIOCGWINSZ 0x5413
0474 #define VKI_TIOCSWINSZ 0x5414
0475 #define VKI_TIOCMGET 0x5415
0476 #define VKI_TIOCMBIS 0x5416
0477 #define VKI_TIOCMBIC 0x5417
0478 #define VKI_TIOCMSET 0x5418
0479 #define VKI_FIONREAD 0x541B
0480 #define VKI_TIOCLINUX 0x541C
0481 #define VKI_FIONBIO 0x5421
0482 #define VKI_TIOCNOTTY 0x5422
0483 #define VKI_TCSBRKP 0x5425
0484 #define VKI_TIOCGPTN _VKI_IOR('T',0x30, unsigned int)
0485 #define VKI_TIOCSPTLCK _VKI_IOW('T',0x31, int)
0486
0487 #define VKI_FIONCLEX 0x5450
0488 #define VKI_FIOCLEX 0x5451
0489 #define VKI_FIOASYNC 0x5452
0490 #define VKI_TIOCSERGETLSR 0x5459
0491
0492 #define VKI_TIOCGICOUNT 0x545D
0493
0494
0495
0496
0497
0498 #define VKI_POLLIN 0x0001
0499
0500 struct vki_pollfd {
0501 int fd;
0502 short events;
0503 short revents;
0504 };
0505
0506
0507
0508
0509
0510 struct vki_user_i387_struct {
0511 unsigned short cwd;
0512 unsigned short swd;
0513 unsigned short twd;
0514 unsigned short fop;
0515 __vki_u64 rip;
0516 __vki_u64 rdp;
0517 __vki_u32 mxcsr;
0518 __vki_u32 mxcsr_mask;
0519 __vki_u32 st_space[32];
0520 __vki_u32 xmm_space[64];
0521 __vki_u32 padding[24];
0522 };
0523
0524 struct vki_user_regs_struct {
0525 unsigned long r15,r14,r13,r12,rbp,rbx,r11,r10;
0526 unsigned long r9,r8,rax,rcx,rdx,rsi,rdi,orig_rax;
0527 unsigned long rip,cs,eflags;
0528 unsigned long rsp,ss;
0529 unsigned long fs_base, gs_base;
0530 unsigned long ds,es,fs,gs;
0531 };
0532
0533
0534
0535
0536
0537 typedef unsigned long vki_elf_greg_t;
0538
0539 #define VKI_ELF_NGREG (sizeof (struct vki_user_regs_struct) / sizeof(vki_elf_greg_t))
0540 typedef vki_elf_greg_t vki_elf_gregset_t[VKI_ELF_NGREG];
0541
0542 typedef struct vki_user_i387_struct vki_elf_fpregset_t;
0543
0544
0545
0546
0547
0548 struct vki_ucontext {
0549 unsigned long uc_flags;
0550 struct vki_ucontext *uc_link;
0551 vki_stack_t uc_stack;
0552 struct vki_sigcontext uc_mcontext;
0553 vki_sigset_t uc_sigmask;
0554 };
0555
0556
0557
0558
0559
0560 #define VKI_GDT_ENTRY_TLS_ENTRIES 3
0561
0562 #define VKI_GDT_ENTRY_TLS_MIN 11
0563 #define VKI_GDT_ENTRY_TLS_MAX 13
0564
0565
0566
0567
0568
0569 #define VKI_ARCH_SET_GS 0x1001
0570 #define VKI_ARCH_SET_FS 0x1002
0571 #define VKI_ARCH_GET_FS 0x1003
0572 #define VKI_ARCH_GET_GS 0x1004
0573
0574
0575
0576
0577
0578
0579
0580
0581
0582
0583
0584
0585
0586
0587
0588
0589
0590
0591
0592 struct vki_user_desc {
0593 unsigned int entry_number;
0594 unsigned int base_addr;
0595 unsigned int limit;
0596 unsigned int seg_32bit:1;
0597 unsigned int contents:2;
0598 unsigned int read_exec_only:1;
0599 unsigned int limit_in_pages:1;
0600 unsigned int seg_not_present:1;
0601 unsigned int useable:1;
0602 unsigned int lm:1;
0603 };
0604
0605
0606 typedef struct vki_user_desc vki_modify_ldt_t;
0607
0608
0609
0610
0611
0612 struct vki_ipc64_perm
0613 {
0614 __vki_kernel_key_t key;
0615 __vki_kernel_uid32_t uid;
0616 __vki_kernel_gid32_t gid;
0617 __vki_kernel_uid32_t cuid;
0618 __vki_kernel_gid32_t cgid;
0619 __vki_kernel_mode_t mode;
0620 unsigned short __pad1;
0621 unsigned short seq;
0622 unsigned short __pad2;
0623 unsigned long __unused1;
0624 unsigned long __unused2;
0625 };
0626
0627
0628
0629
0630
0631 struct vki_semid64_ds {
0632 struct vki_ipc64_perm sem_perm;
0633 __vki_kernel_time_t sem_otime;
0634 unsigned long __unused1;
0635 __vki_kernel_time_t sem_ctime;
0636 unsigned long __unused2;
0637 unsigned long sem_nsems;
0638 unsigned long __unused3;
0639 unsigned long __unused4;
0640 };
0641
0642
0643
0644
0645
0646 struct vki_msqid64_ds {
0647 struct vki_ipc64_perm msg_perm;
0648 __vki_kernel_time_t msg_stime;
0649 __vki_kernel_time_t msg_rtime;
0650 __vki_kernel_time_t msg_ctime;
0651 unsigned long msg_cbytes;
0652 unsigned long msg_qnum;
0653 unsigned long msg_qbytes;
0654 __vki_kernel_pid_t msg_lspid;
0655 __vki_kernel_pid_t msg_lrpid;
0656 unsigned long __unused4;
0657 unsigned long __unused5;
0658 };
0659
0660
0661
0662
0663
0664 struct vki_shmid64_ds {
0665 struct vki_ipc64_perm shm_perm;
0666 vki_size_t shm_segsz;
0667 __vki_kernel_time_t shm_atime;
0668 __vki_kernel_time_t shm_dtime;
0669 __vki_kernel_time_t shm_ctime;
0670 __vki_kernel_pid_t shm_cpid;
0671 __vki_kernel_pid_t shm_lpid;
0672 unsigned long shm_nattch;
0673 unsigned long __unused4;
0674 unsigned long __unused5;
0675 };
0676
0677 struct vki_shminfo64 {
0678 unsigned long shmmax;
0679 unsigned long shmmin;
0680 unsigned long shmmni;
0681 unsigned long shmseg;
0682 unsigned long shmall;
0683 unsigned long __unused1;
0684 unsigned long __unused2;
0685 unsigned long __unused3;
0686 unsigned long __unused4;
0687 };
0688
0689
0690
0691
0692
0693 #define VKI_PTRACE_GETREGS 12
0694 #define VKI_PTRACE_SETREGS 13
0695 #define VKI_PTRACE_GETFPREGS 14
0696 #define VKI_PTRACE_SETFPREGS 15
0697
0698
0699
0700 #define VKI_PTRACE_GET_THREAD_AREA 25
0701 #define VKI_PTRACE_SET_THREAD_AREA 26
0702
0703
0704
0705
0706
0707 #define VKI_ENOSYS 38
0708 #define VKI_EOVERFLOW 75
0709
0710
0711
0712
0713
0714 #define VKI_TIOCGSERIAL 0x541E
0715 #define VKI_TIOCSSERIAL 0x541F
0716
0717
0718
0719
0720
0721 #endif
0722
0723
0724
0725