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