2 /*--------------------------------------------------------------------*/
3 /*--- ARM64/Linux-specific kernel interface. vki-arm64-linux.h ---*/
4 /*--------------------------------------------------------------------*/
7 This file is part of Valgrind, a dynamic binary instrumentation
10 Copyright (C) 2013-2017 OpenWorks
13 This program is free software; you can redistribute it and/or
14 modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation; either version 2 of the
16 License, or (at your option) any later version.
18 This program is distributed in the hope that it will be useful, but
19 WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21 General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with this program; if not, see <http://www.gnu.org/licenses/>.
26 The GNU General Public License is contained in the file COPYING.
29 #ifndef __VKI_ARM64_LINUX_H
30 #define __VKI_ARM64_LINUX_H
32 // ARM64 is little-endian.
33 #define VKI_LITTLE_ENDIAN 1
35 //----------------------------------------------------------------------
36 // From linux-3.9.9/include/uapi/asm-generic/int-ll64.h
37 //----------------------------------------------------------------------
39 typedef unsigned char __vki_u8
;
41 typedef __signed__
short __vki_s16
;
42 typedef unsigned short __vki_u16
;
44 typedef __signed__
int __vki_s32
;
45 typedef unsigned int __vki_u32
;
47 typedef __signed__
long long __vki_s64
;
48 typedef unsigned long long __vki_u64
;
50 typedef unsigned short vki_u16
;
52 typedef unsigned int vki_u32
;
54 //----------------------------------------------------------------------
55 // From linux-3.9.9/arch/arm64/include/asm/page.h
56 //----------------------------------------------------------------------
58 /* Looks like arm64 can do both 4k and 64k pages, so we
59 use the at-startup detection scheme that ppc32/64 do. */
60 extern UWord VKI_PAGE_SHIFT
;
61 extern UWord VKI_PAGE_SIZE
;
62 #define VKI_MAX_PAGE_SHIFT 16
63 #define VKI_MAX_PAGE_SIZE (1UL << VKI_MAX_PAGE_SHIFT)
65 //----------------------------------------------------------------------
66 // From linux-3.10.5/arch/arm64/include/asm/shmparam.h
67 //----------------------------------------------------------------------
69 // Trying to make sense of this .. it seems as if, for doing
70 // shared memory with 64 bit processes, VKI_PAGE_SIZE is good
71 // enough. But if sharing with a 32 bit process then we need
72 // the old-style 16k value (4 * VKI_PAGE_SIZE) to be safe.
73 // (From reading between the lines of arch/arm64/include/asm/shmparam.h)
74 #define VKI_SHMLBA (4 * VKI_PAGE_SIZE)
76 //----------------------------------------------------------------------
77 // From linux-3.10.5/include/uapi/asm-generic/signal.h
78 //----------------------------------------------------------------------
81 #define _VKI_NSIG_BPW 64
82 #define _VKI_NSIG_WORDS (_VKI_NSIG / _VKI_NSIG_BPW)
84 typedef unsigned long vki_old_sigset_t
;
87 unsigned long sig
[_VKI_NSIG_WORDS
];
99 #define VKI_SIGUSR1 10
100 #define VKI_SIGSEGV 11
101 #define VKI_SIGUSR2 12
102 #define VKI_SIGPIPE 13
103 #define VKI_SIGALRM 14
104 #define VKI_SIGTERM 15
105 #define VKI_SIGSTKFLT 16
106 #define VKI_SIGCHLD 17
107 #define VKI_SIGCONT 18
108 #define VKI_SIGSTOP 19
109 #define VKI_SIGTSTP 20
110 #define VKI_SIGTTIN 21
111 #define VKI_SIGTTOU 22
112 #define VKI_SIGURG 23
113 #define VKI_SIGXCPU 24
114 #define VKI_SIGXFSZ 25
115 #define VKI_SIGVTALRM 26
116 #define VKI_SIGPROF 27
117 #define VKI_SIGWINCH 28
119 #define VKI_SIGPWR 30
120 #define VKI_SIGSYS 31
121 #define VKI_SIGUNUSED 31
123 #define VKI_SIGRTMIN 32
124 #define VKI_SIGRTMAX _VKI_NSIG
126 #define VKI_SA_NOCLDSTOP 0x00000001
127 #define VKI_SA_NOCLDWAIT 0x00000002
128 #define VKI_SA_SIGINFO 0x00000004
129 #define VKI_SA_ONSTACK 0x08000000
130 #define VKI_SA_RESTART 0x10000000
131 #define VKI_SA_NODEFER 0x40000000
132 #define VKI_SA_RESETHAND 0x80000000
134 #define VKI_SA_NOMASK VKI_SA_NODEFER
135 #define VKI_SA_ONESHOT VKI_SA_RESETHAND
137 // This is obsolete and should not be defined for new archs
138 #define VKI_SA_RESTORER 0x04000000
140 #define VKI_SS_ONSTACK 1
141 #define VKI_SS_DISABLE 2
143 #define VKI_MINSIGSTKSZ 2048
145 #define VKI_SIG_BLOCK 0 /* for blocking signals */
146 #define VKI_SIG_UNBLOCK 1 /* for unblocking signals */
147 #define VKI_SIG_SETMASK 2 /* for setting the signal mask */
149 typedef void __vki_signalfn_t(int);
150 typedef __vki_signalfn_t __user
*__vki_sighandler_t
;
152 typedef void __vki_restorefn_t(void);
153 typedef __vki_restorefn_t __user
*__vki_sigrestore_t
;
155 #define VKI_SIG_DFL ((__vki_sighandler_t)0) /* default signal handling */
156 #define VKI_SIG_IGN ((__vki_sighandler_t)1) /* ignore signal */
158 struct vki_sigaction_base
{
159 // [[Nb: a 'k' prefix is added to "sa_handler" because
160 // bits/sigaction.h (which gets dragged in somehow via signal.h)
161 // #defines it as something else. Since that is done for glibc's
162 // purposes, which we don't care about here, we use our own name.]]
163 __vki_sighandler_t ksa_handler
;
164 unsigned long sa_flags
;
165 __vki_sigrestore_t sa_restorer
; // I don't think arm64 has this
166 vki_sigset_t sa_mask
; /* mask last for extensibility */
169 /* On Linux we use the same type for passing sigactions to
170 and from the kernel. Hence: */
171 typedef struct vki_sigaction_base vki_sigaction_toK_t
;
172 typedef struct vki_sigaction_base vki_sigaction_fromK_t
;
175 typedef struct vki_sigaltstack
{
181 //----------------------------------------------------------------------
182 // From linux-3.10.5/arch/arm64/include/uapi/asm/sigcontext.h
183 //----------------------------------------------------------------------
185 struct vki_sigcontext
{
186 __vki_u64 fault_address
;
187 /* AArch64 registers */
192 /* 4K reserved for FP/SIMD state and future expansion */
193 __vki_u8 __reserved
[4096] __attribute__((__aligned__(16)));
196 //----------------------------------------------------------------------
197 // From linux-5.0.0/arch/arm64/include/uapi/asm/siginfo.h
198 //----------------------------------------------------------------------
200 #define __VKI_ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int))
202 //----------------------------------------------------------------------
203 // From linux-3.10.5/uapi/include/asm-generic/mman-common.h
204 //----------------------------------------------------------------------
206 #define VKI_PROT_READ 0x1 /* page can be read */
207 #define VKI_PROT_WRITE 0x2 /* page can be written */
208 #define VKI_PROT_EXEC 0x4 /* page can be executed */
209 #define VKI_PROT_NONE 0x0 /* page can not be accessed */
210 #define VKI_PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */
211 #define VKI_PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */
213 #define VKI_MAP_SHARED 0x01 /* Share changes */
214 #define VKI_MAP_PRIVATE 0x02 /* Changes are private */
215 #define VKI_MAP_FIXED 0x10 /* Interpret addr exactly */
216 #define VKI_MAP_ANONYMOUS 0x20 /* don't use a file */
217 #define VKI_MAP_NORESERVE 0x4000 /* don't check for reservations */
219 //----------------------------------------------------------------------
220 // From linux-3.10.5/uapi/include/asm-generic/fcntl.h
221 //----------------------------------------------------------------------
223 #define VKI_O_ACCMODE 03
224 #define VKI_O_RDONLY 00
225 #define VKI_O_WRONLY 01
226 #define VKI_O_RDWR 02
227 #define VKI_O_CREAT 0100 /* not fcntl */
228 #define VKI_O_EXCL 0200 /* not fcntl */
229 #define VKI_O_TRUNC 01000 /* not fcntl */
230 #define VKI_O_APPEND 02000
231 #define VKI_O_NONBLOCK 04000
232 #define VKI_O_LARGEFILE 0100000
233 #define VKI_O_DIRECT 0200000
235 #define VKI_AT_FDCWD -100
237 #define VKI_F_DUPFD 0 /* dup */
238 #define VKI_F_GETFD 1 /* get close_on_exec */
239 #define VKI_F_SETFD 2 /* set/clear close_on_exec */
240 #define VKI_F_GETFL 3 /* get file->f_flags */
241 #define VKI_F_SETFL 4 /* set file->f_flags */
242 #define VKI_F_GETLK 5
243 #define VKI_F_SETLK 6
244 #define VKI_F_SETLKW 7
246 #define VKI_F_SETOWN 8 /* for sockets. */
247 #define VKI_F_GETOWN 9 /* for sockets. */
248 #define VKI_F_SETSIG 10 /* for sockets. */
249 #define VKI_F_GETSIG 11 /* for sockets. */
251 #define VKI_F_SETOWN_EX 15
252 #define VKI_F_GETOWN_EX 16
254 #define VKI_F_OFD_GETLK 36
255 #define VKI_F_OFD_SETLK 37
256 #define VKI_F_OFD_SETLKW 38
258 #define VKI_F_OWNER_TID 0
259 #define VKI_F_OWNER_PID 1
260 #define VKI_F_OWNER_PGRP 2
262 struct vki_f_owner_ex
{
264 __vki_kernel_pid_t pid
;
267 #define VKI_FD_CLOEXEC 1 /* actually anything with low bit set goes */
269 #define VKI_F_LINUX_SPECIFIC_BASE 1024
271 //----------------------------------------------------------------------
272 // From linux-3.10.5/include/uapi/asm-generic/resource.h
273 //----------------------------------------------------------------------
275 #define VKI_RLIMIT_DATA 2 /* max data size */
276 #define VKI_RLIMIT_STACK 3 /* max stack size */
277 #define VKI_RLIMIT_CORE 4 /* max core file size */
278 #define VKI_RLIMIT_NOFILE 7 /* max number of open files */
280 //----------------------------------------------------------------------
281 // From linux-3.10.5/include/uapi/asm-generic/socket.h
282 //----------------------------------------------------------------------
284 #define VKI_SOL_SOCKET 1
286 #define VKI_SO_TYPE 3
288 #define VKI_SO_ATTACH_FILTER 26
290 //----------------------------------------------------------------------
291 // From linux-3.10.5/include/uapi/asm-generic/sockios.h
292 //----------------------------------------------------------------------
294 #define VKI_SIOCSPGRP 0x8902
295 #define VKI_SIOCGPGRP 0x8904
296 #define VKI_SIOCATMARK 0x8905
297 #define VKI_SIOCGSTAMP 0x8906 /* Get stamp (timeval) */
298 #define VKI_SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */
300 //----------------------------------------------------------------------
301 // From linux-3.10.5/include/uapi/asm-generic/stat.h
302 //----------------------------------------------------------------------
305 unsigned long st_dev
;
306 unsigned long st_ino
;
307 unsigned int st_mode
;
308 unsigned int st_nlink
;
311 unsigned long st_rdev
;
312 unsigned long __pad1
;
318 unsigned long st_atime_nsec
;
320 unsigned long st_mtime_nsec
;
322 unsigned long st_ctime_nsec
;
323 unsigned int __unused4
;
324 unsigned int __unused5
;
327 //----------------------------------------------------------------------
328 // From linux-3.10.5/include/uapi/asm-generic/statfs.h
329 //----------------------------------------------------------------------
339 __vki_kernel_fsid_t f_fsid
;
346 //----------------------------------------------------------------------
347 // From linux-3.10.5/include/uapi/asm-generic/termios.h
348 //----------------------------------------------------------------------
351 unsigned short ws_row
;
352 unsigned short ws_col
;
353 unsigned short ws_xpixel
;
354 unsigned short ws_ypixel
;
359 unsigned short c_iflag
; /* input mode flags */
360 unsigned short c_oflag
; /* output mode flags */
361 unsigned short c_cflag
; /* control mode flags */
362 unsigned short c_lflag
; /* local mode flags */
363 unsigned char c_line
; /* line discipline */
364 unsigned char c_cc
[VKI_NCC
]; /* control characters */
367 //----------------------------------------------------------------------
368 // From linux-3.10.5/include/uapi/asm-generic/termbits.h
369 //----------------------------------------------------------------------
371 typedef unsigned char vki_cc_t
;
372 typedef unsigned int vki_tcflag_t
;
376 vki_tcflag_t c_iflag
; /* input mode flags */
377 vki_tcflag_t c_oflag
; /* output mode flags */
378 vki_tcflag_t c_cflag
; /* control mode flags */
379 vki_tcflag_t c_lflag
; /* local mode flags */
380 vki_cc_t c_line
; /* line discipline */
381 vki_cc_t c_cc
[VKI_NCCS
]; /* control characters */
384 //----------------------------------------------------------------------
385 // From linux-3.9.9/include/uapi/asm-generic/ioctl.h
386 //----------------------------------------------------------------------
388 #define _VKI_IOC_NRBITS 8
389 #define _VKI_IOC_TYPEBITS 8
390 #define _VKI_IOC_SIZEBITS 14
391 #define _VKI_IOC_DIRBITS 2
393 #define _VKI_IOC_SIZEMASK ((1 << _VKI_IOC_SIZEBITS)-1)
394 #define _VKI_IOC_DIRMASK ((1 << _VKI_IOC_DIRBITS)-1)
396 #define _VKI_IOC_NRSHIFT 0
397 #define _VKI_IOC_TYPESHIFT (_VKI_IOC_NRSHIFT+_VKI_IOC_NRBITS)
398 #define _VKI_IOC_SIZESHIFT (_VKI_IOC_TYPESHIFT+_VKI_IOC_TYPEBITS)
399 #define _VKI_IOC_DIRSHIFT (_VKI_IOC_SIZESHIFT+_VKI_IOC_SIZEBITS)
401 #define _VKI_IOC_NONE 0U
402 #define _VKI_IOC_WRITE 1U
403 #define _VKI_IOC_READ 2U
405 #define _VKI_IOC(dir,type,nr,size) \
406 (((dir) << _VKI_IOC_DIRSHIFT) | \
407 ((type) << _VKI_IOC_TYPESHIFT) | \
408 ((nr) << _VKI_IOC_NRSHIFT) | \
409 ((size) << _VKI_IOC_SIZESHIFT))
411 #define _VKI_IO(type,nr) _VKI_IOC(_VKI_IOC_NONE,(type),(nr),0)
412 #define _VKI_IOR(type,nr,size) _VKI_IOC(_VKI_IOC_READ,(type),(nr),sizeof(size))
413 #define _VKI_IOW(type,nr,size) _VKI_IOC(_VKI_IOC_WRITE,(type),(nr),sizeof(size))
414 #define _VKI_IOWR(type,nr,size) _VKI_IOC(_VKI_IOC_READ|_VKI_IOC_WRITE,(type),(nr),sizeof(size))
416 #define _VKI_IOC_DIR(nr) (((nr) >> _VKI_IOC_DIRSHIFT) & _VKI_IOC_DIRMASK)
417 #define _VKI_IOC_SIZE(nr) (((nr) >> _VKI_IOC_SIZESHIFT) & _VKI_IOC_SIZEMASK)
419 //----------------------------------------------------------------------
420 // From linux-3.10.5/include/uapi/asm-generic/ioctls.h
421 //----------------------------------------------------------------------
423 #define VKI_TCGETS 0x5401
424 #define VKI_TCSETS 0x5402
425 #define VKI_TCSETSW 0x5403
426 #define VKI_TCSETSF 0x5404
427 #define VKI_TCGETA 0x5405
428 #define VKI_TCSETA 0x5406
429 #define VKI_TCSETAW 0x5407
430 #define VKI_TCSETAF 0x5408
431 #define VKI_TCSBRK 0x5409
432 #define VKI_TCXONC 0x540A
433 #define VKI_TCFLSH 0x540B
434 #define VKI_TIOCSCTTY 0x540E
435 #define VKI_TIOCGPGRP 0x540F
436 #define VKI_TIOCSPGRP 0x5410
437 #define VKI_TIOCOUTQ 0x5411
438 #define VKI_TIOCGWINSZ 0x5413
439 #define VKI_TIOCSWINSZ 0x5414
440 #define VKI_TIOCMGET 0x5415
441 #define VKI_TIOCMBIS 0x5416
442 #define VKI_TIOCMBIC 0x5417
443 #define VKI_TIOCMSET 0x5418
444 #define VKI_FIONREAD 0x541B
445 #define VKI_TIOCLINUX 0x541C
446 #define VKI_FIONBIO 0x5421
447 #define VKI_TIOCNOTTY 0x5422
448 #define VKI_TCSBRKP 0x5425
449 #define VKI_TIOCGPTN _VKI_IOR('T',0x30, unsigned int)
450 #define VKI_TIOCSPTLCK _VKI_IOW('T',0x31, int)
452 #define VKI_FIONCLEX 0x5450
453 #define VKI_FIOCLEX 0x5451
454 #define VKI_FIOASYNC 0x5452
455 #define VKI_TIOCSERGETLSR 0x5459
457 #define VKI_TIOCGICOUNT 0x545D
459 //----------------------------------------------------------------------
460 // From linux-3.9.9/include/uapi/asm-generic/poll.h
461 //----------------------------------------------------------------------
463 #define VKI_POLLIN 0x0001
471 //----------------------------------------------------------------------
472 // From linux-3.10.5/arch/arm64/include/uapi/asm/ptrace.h
473 //----------------------------------------------------------------------
475 //ZZ struct vki_user_i387_struct {
476 //ZZ unsigned short cwd;
477 //ZZ unsigned short swd;
478 //ZZ unsigned short twd; /* Note this is not the same as the 32bit/x87/FSAVE twd */
479 //ZZ unsigned short fop;
482 //ZZ __vki_u32 mxcsr;
483 //ZZ __vki_u32 mxcsr_mask;
484 //ZZ __vki_u32 st_space[32]; /* 8*16 bytes for each FP-reg = 128 bytes */
485 //ZZ __vki_u32 xmm_space[64]; /* 16*16 bytes for each XMM-reg = 256 bytes */
486 //ZZ __vki_u32 padding[24];
489 //ZZ struct vki_user_regs_struct {
490 //ZZ unsigned long r15,r14,r13,r12,rbp,rbx,r11,r10;
491 //ZZ unsigned long r9,r8,rax,rcx,rdx,rsi,rdi,orig_rax;
492 //ZZ unsigned long rip,cs,eflags;
493 //ZZ unsigned long rsp,ss;
494 //ZZ unsigned long fs_base, gs_base;
495 //ZZ unsigned long ds,es,fs,gs;
498 struct vki_user_pt_regs
{
505 /* I think that the new name in the kernel for these is "user_pt_regs"
506 and the old name is "user_regs_struct". Unfortunately can't clone
507 a 'struct' type using 'typedef' and still have a 'struct' type, so
508 use a blunter instrument instead. */
509 #define vki_user_regs_struct vki_user_pt_regs
511 struct vki_user_fpsimd_state
{
512 __uint128_t vregs
[32];
517 //----------------------------------------------------------------------
518 // From linux-3.9.9/arch/arm64/include/asm/elf.h
519 //----------------------------------------------------------------------
521 typedef unsigned long vki_elf_greg_t
;
523 #define VKI_ELF_NGREG (sizeof (struct vki_user_pt_regs) / sizeof(vki_elf_greg_t))
524 typedef vki_elf_greg_t vki_elf_gregset_t
[VKI_ELF_NGREG
];
526 typedef struct vki_user_fpsimd_state vki_elf_fpregset_t
;
528 //----------------------------------------------------------------------
529 // From linux-3.10.5/arch/arm64/include/asm/ucontext.h
530 //----------------------------------------------------------------------
532 struct vki_ucontext
{
533 unsigned long uc_flags
;
534 struct vki_ucontext
*uc_link
;
535 vki_stack_t uc_stack
;
536 vki_sigset_t uc_sigmask
;
537 /* glibc uses a 1024-bit sigset_t */
538 __vki_u8 __unused0
[1024 / 8 - sizeof(vki_sigset_t
)];
539 /* last for future expansion */
540 struct vki_sigcontext uc_mcontext
;
543 //ZZ //----------------------------------------------------------------------
544 //ZZ // From linux-2.6.9/include/asm-x86_64/segment.h
545 //ZZ //----------------------------------------------------------------------
547 //ZZ #define VKI_GDT_ENTRY_TLS_ENTRIES 3
549 //ZZ #define VKI_GDT_ENTRY_TLS_MIN 11
550 //ZZ #define VKI_GDT_ENTRY_TLS_MAX 13
552 //ZZ //----------------------------------------------------------------------
553 //ZZ // From linux-2.6.11.9/include/asm-x86_64/prctl.h
554 //ZZ //----------------------------------------------------------------------
556 //ZZ #define VKI_ARCH_SET_GS 0x1001
557 //ZZ #define VKI_ARCH_SET_FS 0x1002
558 //ZZ #define VKI_ARCH_GET_FS 0x1003
559 //ZZ #define VKI_ARCH_GET_GS 0x1004
561 //ZZ //----------------------------------------------------------------------
562 //ZZ // From linux-2.6.9/include/asm-x86_64/ldt.h
563 //ZZ //----------------------------------------------------------------------
565 //ZZ // I think this LDT stuff will have to be reinstated for amd64, but I'm not
566 //ZZ // certain. (Nb: The sys_arch_prctl seems to have replaced
567 //ZZ // [gs]et_thread_area syscalls.)
569 //ZZ // Note that the type here is very slightly different to the
570 //ZZ // type for x86 (the final 'lm' field is added); I'm not sure about the
571 //ZZ // significance of that... --njn
573 //ZZ /* [[Nb: This is the structure passed to the modify_ldt syscall. Just so as
574 //ZZ to confuse and annoy everyone, this is _not_ the same as an
575 //ZZ VgLdtEntry and has to be translated into such. The logic for doing
576 //ZZ so, in vg_ldt.c, is copied from the kernel sources.]] */
577 //ZZ /* Note also that a comment in ldt.h indicates that the below
578 //ZZ contains several fields ignored on 64bit, and that modify_ldt
579 //ZZ is rather for 32bit. */
580 //ZZ struct vki_user_desc {
581 //ZZ unsigned int entry_number;
582 //ZZ unsigned long base_addr;
583 //ZZ unsigned int limit;
584 //ZZ unsigned int seg_32bit:1;
585 //ZZ unsigned int contents:2;
586 //ZZ unsigned int read_exec_only:1;
587 //ZZ unsigned int limit_in_pages:1;
588 //ZZ unsigned int seg_not_present:1;
589 //ZZ unsigned int useable:1;
590 //ZZ unsigned int lm:1;
593 //ZZ // [[Nb: for our convenience within Valgrind, use a more specific name]]
595 typedef char vki_modify_ldt_t
;
597 //----------------------------------------------------------------------
598 // From linux-3.10.5/include/asm-generic/ipcbuf.h
599 //----------------------------------------------------------------------
601 struct vki_ipc64_perm
603 __vki_kernel_key_t key
;
604 __vki_kernel_uid32_t uid
;
605 __vki_kernel_gid32_t gid
;
606 __vki_kernel_uid32_t cuid
;
607 __vki_kernel_gid32_t cgid
;
608 __vki_kernel_mode_t mode
;
609 unsigned char __pad1
[4 - sizeof(__vki_kernel_mode_t
)];
611 unsigned short __pad2
;
612 unsigned long __unused1
;
613 unsigned long __unused2
;
616 //----------------------------------------------------------------------
617 // From linux-3.10.5/include/uapi/asm-generic/sembuf.h
618 //----------------------------------------------------------------------
620 struct vki_semid64_ds
{
621 struct vki_ipc64_perm sem_perm
; /* permissions .. see ipc.h */
622 __vki_kernel_time_t sem_otime
; /* last semop time */
623 __vki_kernel_time_t sem_ctime
; /* last change time */
624 unsigned long sem_nsems
; /* no. of semaphores in array */
625 unsigned long __unused3
;
626 unsigned long __unused4
;
629 //----------------------------------------------------------------------
630 // From linux-3.10.5/include/uapi/asm-generic/msgbuf.h
631 //----------------------------------------------------------------------
633 struct vki_msqid64_ds
{
634 struct vki_ipc64_perm msg_perm
;
635 __vki_kernel_time_t msg_stime
; /* last msgsnd time */
636 __vki_kernel_time_t msg_rtime
; /* last msgrcv time */
637 __vki_kernel_time_t msg_ctime
; /* last change time */
638 unsigned long msg_cbytes
; /* current number of bytes on queue */
639 unsigned long msg_qnum
; /* number of messages in queue */
640 unsigned long msg_qbytes
; /* max number of bytes on queue */
641 __vki_kernel_pid_t msg_lspid
; /* pid of last msgsnd */
642 __vki_kernel_pid_t msg_lrpid
; /* last receive pid */
643 unsigned long __unused4
;
644 unsigned long __unused5
;
647 //----------------------------------------------------------------------
648 // From linux-3.10.5/include/uapi/asm-generic/shmbuf.h
649 //----------------------------------------------------------------------
651 struct vki_shmid64_ds
{
652 struct vki_ipc64_perm shm_perm
; /* operation perms */
653 vki_size_t shm_segsz
; /* size of segment (bytes) */
654 __vki_kernel_time_t shm_atime
; /* last attach time */
655 __vki_kernel_time_t shm_dtime
; /* last detach time */
656 __vki_kernel_time_t shm_ctime
; /* last change time */
657 __vki_kernel_pid_t shm_cpid
; /* pid of creator */
658 __vki_kernel_pid_t shm_lpid
; /* pid of last operator */
659 unsigned long shm_nattch
; /* no. of current attaches */
660 unsigned long __unused4
;
661 unsigned long __unused5
;
664 struct vki_shminfo64
{
665 unsigned long shmmax
;
666 unsigned long shmmin
;
667 unsigned long shmmni
;
668 unsigned long shmseg
;
669 unsigned long shmall
;
670 unsigned long __unused1
;
671 unsigned long __unused2
;
672 unsigned long __unused3
;
673 unsigned long __unused4
;
676 //----------------------------------------------------------------------
677 // From linux-3.9.9/arch/arm64/include/asm/ptrace.h
678 //----------------------------------------------------------------------
680 #define VKI_PTRACE_GETREGS 12
681 #define VKI_PTRACE_SETREGS 13
682 //#define VKI_PTRACE_GETFPREGS 14
683 //#define VKI_PTRACE_SETFPREGS 15
685 //----------------------------------------------------------------------
686 // From linux-2.6.8.1/include/asm-generic/errno.h
687 //----------------------------------------------------------------------
689 #define VKI_ENOSYS 38 /* Function not implemented */
690 #define VKI_EOVERFLOW 75 /* Value too large for defined data type */
692 //----------------------------------------------------------------------
693 // From linux-3.19.0/include/uapi/asm-generic/ioctls.h
694 //----------------------------------------------------------------------
696 #define VKI_TIOCGSERIAL 0x541E
697 #define VKI_TIOCSSERIAL 0x541F
699 //----------------------------------------------------------------------
700 // From linux-4.17/include/uapi/asm-generic/ioctls.h
701 //----------------------------------------------------------------------
703 #define VKI_HWCAP_FP (1 << 0)
704 #define VKI_HWCAP_ASIMD (1 << 1)
705 #define VKI_HWCAP_EVTSTRM (1 << 2)
706 #define VKI_HWCAP_AES (1 << 3)
707 #define VKI_HWCAP_PMULL (1 << 4)
708 #define VKI_HWCAP_SHA1 (1 << 5)
709 #define VKI_HWCAP_SHA2 (1 << 6)
710 #define VKI_HWCAP_CRC32 (1 << 7)
711 #define VKI_HWCAP_ATOMICS (1 << 8)
712 #define VKI_HWCAP_FPHP (1 << 9)
713 #define VKI_HWCAP_ASIMDHP (1 << 10)
714 #define VKI_HWCAP_CPUID (1 << 11)
715 #define VKI_HWCAP_ASIMDRDM (1 << 12)
716 #define VKI_HWCAP_JSCVT (1 << 13)
717 #define VKI_HWCAP_FCMA (1 << 14)
718 #define VKI_HWCAP_LRCPC (1 << 15)
719 #define VKI_HWCAP_DCPOP (1 << 16)
720 #define VKI_HWCAP_SHA3 (1 << 17)
721 #define VKI_HWCAP_SM3 (1 << 18)
722 #define VKI_HWCAP_SM4 (1 << 19)
723 #define VKI_HWCAP_ASIMDDP (1 << 20)
724 #define VKI_HWCAP_SHA512 (1 << 21)
725 #define VKI_HWCAP_SVE (1 << 22)
726 #define VKI_HWCAP_ASIMDFHM (1 << 23)
727 #define VKI_HWCAP_DIT (1 << 24)
728 #define VKI_HWCAP_USCAT (1 << 25)
729 #define VKI_HWCAP_ILRCPC (1 << 26)
730 #define VKI_HWCAP_FLAGM (1 << 27)
732 //----------------------------------------------------------------------
734 //----------------------------------------------------------------------
736 #endif // __VKI_ARM64_LINUX_H
738 /*--------------------------------------------------------------------*/
740 /*--------------------------------------------------------------------*/