Import QEMU upstream snapshot d2e570c

Upstream: https://gitlab.com/qemu-project/qemu.git

Upstream-Commit: d2e570cc0f97b936902a5b1b86b73c0f5998b475
This commit is contained in:
Yaya48 committed 2026-08-31 02:15:30 +02:00
commit cf256aa081
11315 files changed
+3598369

No files matched your search

+152
View File
@@ -0,0 +1,152 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation, or (at your option) any
* later version. See the COPYING file in the top-level directory.
*/
#ifndef GENERIC_FCNTL_H
#define GENERIC_FCNTL_H
/* <asm-generic/fcntl.h> values follow. */
#define TARGET_O_ACCMODE 0003
#define TARGET_O_RDONLY 00
#define TARGET_O_WRONLY 01
#define TARGET_O_RDWR 02
#ifndef TARGET_O_CREAT
#define TARGET_O_CREAT 0100 /* not fcntl */
#endif
#ifndef TARGET_O_EXCL
#define TARGET_O_EXCL 0200 /* not fcntl */
#endif
#ifndef TARGET_O_NOCTTY
#define TARGET_O_NOCTTY 0400 /* not fcntl */
#endif
#ifndef TARGET_O_TRUNC
#define TARGET_O_TRUNC 01000 /* not fcntl */
#endif
#ifndef TARGET_O_APPEND
#define TARGET_O_APPEND 02000
#endif
#ifndef TARGET_O_NONBLOCK
#define TARGET_O_NONBLOCK 04000
#endif
#ifndef TARGET_O_DSYNC
#define TARGET_O_DSYNC 010000
#endif
#ifndef TARGET_FASYNC
#define TARGET_FASYNC 020000 /* fcntl, for BSD compatibility */
#endif
#ifndef TARGET_O_DIRECT
#define TARGET_O_DIRECT 040000 /* direct disk access hint */
#endif
#ifndef TARGET_O_LARGEFILE
#define TARGET_O_LARGEFILE 0100000
#endif
#ifndef TARGET_O_DIRECTORY
#define TARGET_O_DIRECTORY 0200000 /* must be a directory */
#endif
#ifndef TARGET_O_NOFOLLOW
#define TARGET_O_NOFOLLOW 0400000 /* don't follow links */
#endif
#ifndef TARGET_O_NOATIME
#define TARGET_O_NOATIME 01000000
#endif
#ifndef TARGET_O_CLOEXEC
#define TARGET_O_CLOEXEC 02000000
#endif
#ifndef TARGET___O_SYNC
#define TARGET___O_SYNC 04000000
#endif
#ifndef TARGET_O_PATH
#define TARGET_O_PATH 010000000
#endif
#ifndef TARGET___O_TMPFILE
#define TARGET___O_TMPFILE 020000000
#endif
#ifndef TARGET_O_TMPFILE
#define TARGET_O_TMPFILE (TARGET___O_TMPFILE | TARGET_O_DIRECTORY)
#endif
#ifndef TARGET_O_NDELAY
#define TARGET_O_NDELAY TARGET_O_NONBLOCK
#endif
#ifndef TARGET_O_SYNC
#define TARGET_O_SYNC (TARGET___O_SYNC | TARGET_O_DSYNC)
#endif
#define TARGET_F_DUPFD 0 /* dup */
#define TARGET_F_GETFD 1 /* get close_on_exec */
#define TARGET_F_SETFD 2 /* set/clear close_on_exec */
#define TARGET_F_GETFL 3 /* get file->f_flags */
#define TARGET_F_SETFL 4 /* set file->f_flags */
#ifndef TARGET_F_GETLK
#define TARGET_F_GETLK 5
#define TARGET_F_SETLK 6
#define TARGET_F_SETLKW 7
#endif
#ifndef TARGET_F_SETOWN
#define TARGET_F_SETOWN 8 /* for sockets. */
#define TARGET_F_GETOWN 9 /* for sockets. */
#endif
#ifndef TARGET_F_SETSIG
#define TARGET_F_SETSIG 10 /* for sockets. */
#define TARGET_F_GETSIG 11 /* for sockets. */
#endif
#ifndef TARGET_F_GETLK64
#define TARGET_F_GETLK64 12 /* using 'struct flock64' */
#define TARGET_F_SETLK64 13
#define TARGET_F_SETLKW64 14
#endif
#define TARGET_F_OFD_GETLK 36
#define TARGET_F_OFD_SETLK 37
#define TARGET_F_OFD_SETLKW 38
#ifndef TARGET_F_SETOWN_EX
#define TARGET_F_SETOWN_EX 15
#define TARGET_F_GETOWN_EX 16
#endif
struct target_f_owner_ex {
int type; /* Owner type of ID. */
int pid; /* ID of owner. */
};
#ifndef TARGET_F_RDLCK
#define TARGET_F_RDLCK 0
#define TARGET_F_WRLCK 1
#define TARGET_F_UNLCK 2
#endif
#ifndef TARGET_HAVE_ARCH_STRUCT_FLOCK
#ifndef TARGET_ARCH_FLOCK_PAD
#define TARGET_ARCH_FLOCK_PAD
#endif
struct target_flock {
short l_type;
short l_whence;
abi_long l_start;
abi_long l_len;
int l_pid;
TARGET_ARCH_FLOCK_PAD
};
#endif
#ifndef TARGET_HAVE_ARCH_STRUCT_FLOCK64
#ifndef TARGET_ARCH_FLOCK64_PAD
#define TARGET_ARCH_FLOCK64_PAD
#endif
struct target_flock64 {
abi_short l_type;
abi_short l_whence;
abi_llong l_start;
abi_llong l_len;
abi_int l_pid;
TARGET_ARCH_FLOCK64_PAD
};
#endif
#endif
+77
View File
@@ -0,0 +1,77 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation, or (at your option) any
* later version. See the COPYING file in the top-level directory.
*/
#ifndef GENERIC_SIGNAL_H
#define GENERIC_SIGNAL_H
#define TARGET_SA_NOCLDSTOP 0x00000001
#define TARGET_SA_NOCLDWAIT 0x00000002 /* not supported yet */
#define TARGET_SA_SIGINFO 0x00000004
#define TARGET_SA_ONSTACK 0x08000000
#define TARGET_SA_RESTART 0x10000000
#define TARGET_SA_NODEFER 0x40000000
#define TARGET_SA_RESETHAND 0x80000000
#define TARGET_SIGHUP 1
#define TARGET_SIGINT 2
#define TARGET_SIGQUIT 3
#define TARGET_SIGILL 4
#define TARGET_SIGTRAP 5
#define TARGET_SIGABRT 6
#define TARGET_SIGIOT 6
#define TARGET_SIGBUS 7
#define TARGET_SIGFPE 8
#define TARGET_SIGKILL 9
#define TARGET_SIGUSR1 10
#define TARGET_SIGSEGV 11
#define TARGET_SIGUSR2 12
#define TARGET_SIGPIPE 13
#define TARGET_SIGALRM 14
#define TARGET_SIGTERM 15
#define TARGET_SIGSTKFLT 16
#define TARGET_SIGCHLD 17
#define TARGET_SIGCONT 18
#define TARGET_SIGSTOP 19
#define TARGET_SIGTSTP 20
#define TARGET_SIGTTIN 21
#define TARGET_SIGTTOU 22
#define TARGET_SIGURG 23
#define TARGET_SIGXCPU 24
#define TARGET_SIGXFSZ 25
#define TARGET_SIGVTALRM 26
#define TARGET_SIGPROF 27
#define TARGET_SIGWINCH 28
#define TARGET_SIGIO 29
#define TARGET_SIGPWR 30
#define TARGET_SIGSYS 31
#define TARGET_SIGRTMIN 32
#define TARGET_SIG_BLOCK 0 /* for blocking signals */
#define TARGET_SIG_UNBLOCK 1 /* for unblocking signals */
#define TARGET_SIG_SETMASK 2 /* for setting the signal mask */
/* this struct defines a stack used during syscall handling */
typedef struct target_sigaltstack {
abi_ulong ss_sp;
abi_int ss_flags;
abi_ulong ss_size;
} target_stack_t;
/*
* sigaltstack controls
*/
#define TARGET_SS_ONSTACK 1
#define TARGET_SS_DISABLE 2
#define TARGET_MINSIGSTKSZ 2048
/* bit-flags */
#define TARGET_SS_AUTODISARM (1U << 31) /* disable sas during sighandling */
/* mask for all SS_xxx flags */
#define TARGET_SS_FLAG_BITS TARGET_SS_AUTODISARM
#endif
+69
View File
@@ -0,0 +1,69 @@
/*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation, or (at your option) any
* later version. See the COPYING file in the top-level directory.
*/
#ifndef GENERIC_SOCKBITS_H
#define GENERIC_SOCKBITS_H
#define TARGET_SO_PASSSEC 34
/* For setsockopt(2) */
#define TARGET_SOL_SOCKET 1
#define TARGET_SO_DEBUG 1
#define TARGET_SO_REUSEADDR 2
#define TARGET_SO_TYPE 3
#define TARGET_SO_ERROR 4
#define TARGET_SO_DONTROUTE 5
#define TARGET_SO_BROADCAST 6
#define TARGET_SO_SNDBUF 7
#define TARGET_SO_RCVBUF 8
#define TARGET_SO_SNDBUFFORCE 32
#define TARGET_SO_RCVBUFFORCE 33
#define TARGET_SO_KEEPALIVE 9
#define TARGET_SO_OOBINLINE 10
#define TARGET_SO_NO_CHECK 11
#define TARGET_SO_PRIORITY 12
#define TARGET_SO_LINGER 13
#define TARGET_SO_BSDCOMPAT 14
#define TARGET_SO_REUSEPORT 15
#define TARGET_SO_PASSCRED 16
#define TARGET_SO_PEERCRED 17
#define TARGET_SO_RCVLOWAT 18
#define TARGET_SO_SNDLOWAT 19
#define TARGET_SO_RCVTIMEO 20
#define TARGET_SO_SNDTIMEO 21
/* Security levels - as per NRL IPv6 - don't actually do anything */
#define TARGET_SO_SECURITY_AUTHENTICATION 22
#define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 23
#define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 24
#define TARGET_SO_BINDTODEVICE 25
/* Socket filtering */
#define TARGET_SO_ATTACH_FILTER 26
#define TARGET_SO_DETACH_FILTER 27
#define TARGET_SO_PEERNAME 28
#define TARGET_SO_TIMESTAMP 29
#define TARGET_SCM_TIMESTAMP TARGET_SO_TIMESTAMP
#define TARGET_SO_ACCEPTCONN 30
#define TARGET_SO_PEERSEC 31
#define TARGET_SO_PROTOCOL 38
#define TARGET_SO_DOMAIN 39
#define TARGET_SO_TIMESTAMP_NEW 63
#define TARGET_SO_TIMESTAMPNS_NEW 64
#define TARGET_SO_TIMESTAMPING_NEW 65
#define TARGET_SO_RCVTIMEO_NEW 66
#define TARGET_SO_SNDTIMEO_NEW 67
#endif
+150
View File
@@ -0,0 +1,150 @@
/*
* Target definitions of errnos. These may be overridden by an
* architecture specific header if needed.
*
* Taken from asm-generic/errno-base.h and asm-generic/errno.h
*/
#ifndef GENERIC_TARGET_ERRNO_DEFS_H
#define GENERIC_TARGET_ERRNO_DEFS_H
#define TARGET_EPERM 1 /* Operation not permitted */
#define TARGET_ENOENT 2 /* No such file or directory */
#define TARGET_ESRCH 3 /* No such process */
#define TARGET_EINTR 4 /* Interrupted system call */
#define TARGET_EIO 5 /* I/O error */
#define TARGET_ENXIO 6 /* No such device or address */
#define TARGET_E2BIG 7 /* Argument list too long */
#define TARGET_ENOEXEC 8 /* TARGET_Exec format error */
#define TARGET_EBADF 9 /* Bad file number */
#define TARGET_ECHILD 10 /* No child processes */
#define TARGET_EAGAIN 11 /* Try again */
#define TARGET_ENOMEM 12 /* Out of memory */
#define TARGET_EACCES 13 /* Permission denied */
#define TARGET_EFAULT 14 /* Bad address */
#define TARGET_ENOTBLK 15 /* Block device required */
#define TARGET_EBUSY 16 /* Device or resource busy */
#define TARGET_EEXIST 17 /* File exists */
#define TARGET_EXDEV 18 /* Cross-device link */
#define TARGET_ENODEV 19 /* No such device */
#define TARGET_ENOTDIR 20 /* Not a directory */
#define TARGET_EISDIR 21 /* Is a directory */
#define TARGET_EINVAL 22 /* Invalid argument */
#define TARGET_ENFILE 23 /* File table overflow */
#define TARGET_EMFILE 24 /* Too many open files */
#define TARGET_ENOTTY 25 /* Not a typewriter */
#define TARGET_ETXTBSY 26 /* Text file busy */
#define TARGET_EFBIG 27 /* File too large */
#define TARGET_ENOSPC 28 /* No space left on device */
#define TARGET_ESPIPE 29 /* Illegal seek */
#define TARGET_EROFS 30 /* Read-only file system */
#define TARGET_EMLINK 31 /* Too many links */
#define TARGET_EPIPE 32 /* Broken pipe */
#define TARGET_EDOM 33 /* Math argument out of domain of func */
#define TARGET_ERANGE 34 /* Math result not representable */
#define TARGET_EDEADLK 35 /* Resource deadlock would occur */
#define TARGET_ENAMETOOLONG 36 /* File name too long */
#define TARGET_ENOLCK 37 /* No record locks available */
#define TARGET_ENOSYS 38 /* Function not implemented */
#define TARGET_ENOTEMPTY 39 /* Directory not empty */
#define TARGET_ELOOP 40 /* Too many symbolic links encountered */
#define TARGET_ENOMSG 42 /* No message of desired type */
#define TARGET_EIDRM 43 /* Identifier removed */
#define TARGET_ECHRNG 44 /* Channel number out of range */
#define TARGET_EL2NSYNC 45 /* Level 2 not synchronized */
#define TARGET_EL3HLT 46 /* Level 3 halted */
#define TARGET_EL3RST 47 /* Level 3 reset */
#define TARGET_ELNRNG 48 /* Link number out of range */
#define TARGET_EUNATCH 49 /* Protocol driver not attached */
#define TARGET_ENOCSI 50 /* No CSI structure available */
#define TARGET_EL2HLT 51 /* Level 2 halted */
#define TARGET_EBADE 52 /* Invalid exchange */
#define TARGET_EBADR 53 /* Invalid request descriptor */
#define TARGET_EXFULL 54 /* TARGET_Exchange full */
#define TARGET_ENOANO 55 /* No anode */
#define TARGET_EBADRQC 56 /* Invalid request code */
#define TARGET_EBADSLT 57 /* Invalid slot */
#define TARGET_EBFONT 59 /* Bad font file format */
#define TARGET_ENOSTR 60 /* Device not a stream */
#define TARGET_ENODATA 61 /* No data available */
#define TARGET_ETIME 62 /* Timer expired */
#define TARGET_ENOSR 63 /* Out of streams resources */
#define TARGET_ENONET 64 /* Machine is not on the network */
#define TARGET_ENOPKG 65 /* Package not installed */
#define TARGET_EREMOTE 66 /* Object is remote */
#define TARGET_ENOLINK 67 /* Link has been severed */
#define TARGET_EADV 68 /* Advertise error */
#define TARGET_ESRMNT 69 /* Srmount error */
#define TARGET_ECOMM 70 /* Communication error on send */
#define TARGET_EPROTO 71 /* Protocol error */
#define TARGET_EMULTIHOP 72 /* Multihop attempted */
#define TARGET_EDOTDOT 73 /* RFS specific error */
#define TARGET_EBADMSG 74 /* Not a data message */
#define TARGET_EOVERFLOW 75 /* Value too large for defined data type */
#define TARGET_ENOTUNIQ 76 /* Name not unique on network */
#define TARGET_EBADFD 77 /* File descriptor in bad state */
#define TARGET_EREMCHG 78 /* Remote address changed */
#define TARGET_ELIBACC 79 /* Can not access a needed shared library */
#define TARGET_ELIBBAD 80 /* Accessing a corrupted shared library */
#define TARGET_ELIBSCN 81 /* .lib section in a.out corrupted */
#define TARGET_ELIBMAX 82 /* Attempting to link in too many shared libraries */
#define TARGET_ELIBEXEC 83 /* Cannot exec a shared library directly */
#define TARGET_EILSEQ 84 /* Illegal byte sequence */
#define TARGET_ERESTART 85 /* Interrupted system call should be restarted */
#define TARGET_ESTRPIPE 86 /* Streams pipe error */
#define TARGET_EUSERS 87 /* Too many users */
#define TARGET_ENOTSOCK 88 /* Socket operation on non-socket */
#define TARGET_EDESTADDRREQ 89 /* Destination address required */
#define TARGET_EMSGSIZE 90 /* Message too long */
#define TARGET_EPROTOTYPE 91 /* Protocol wrong type for socket */
#define TARGET_ENOPROTOOPT 92 /* Protocol not available */
#define TARGET_EPROTONOSUPPORT 93 /* Protocol not supported */
#define TARGET_ESOCKTNOSUPPORT 94 /* Socket type not supported */
#define TARGET_EOPNOTSUPP 95 /* Operation not supported on transport endpoint */
#define TARGET_EPFNOSUPPORT 96 /* Protocol family not supported */
#define TARGET_EAFNOSUPPORT 97 /* Address family not supported by protocol */
#define TARGET_EADDRINUSE 98 /* Address already in use */
#define TARGET_EADDRNOTAVAIL 99 /* Cannot assign requested address */
#define TARGET_ENETDOWN 100 /* Network is down */
#define TARGET_ENETUNREACH 101 /* Network is unreachable */
#define TARGET_ENETRESET 102 /* Network dropped connection because of reset */
#define TARGET_ECONNABORTED 103 /* Software caused connection abort */
#define TARGET_ECONNRESET 104 /* Connection reset by peer */
#define TARGET_ENOBUFS 105 /* No buffer space available */
#define TARGET_EISCONN 106 /* Transport endpoint is already connected */
#define TARGET_ENOTCONN 107 /* Transport endpoint is not connected */
#define TARGET_ESHUTDOWN 108 /* Cannot send after transport endpoint shutdown */
#define TARGET_ETOOMANYREFS 109 /* Too many references: cannot splice */
#define TARGET_ETIMEDOUT 110 /* Connection timed out */
#define TARGET_ECONNREFUSED 111 /* Connection refused */
#define TARGET_EHOSTDOWN 112 /* Host is down */
#define TARGET_EHOSTUNREACH 113 /* No route to host */
#define TARGET_EALREADY 114 /* Operation already in progress */
#define TARGET_EINPROGRESS 115 /* Operation now in progress */
#define TARGET_ESTALE 116 /* Stale NFS file handle */
#define TARGET_EUCLEAN 117 /* Structure needs cleaning */
#define TARGET_ENOTNAM 118 /* Not a XENIX named type file */
#define TARGET_ENAVAIL 119 /* No XENIX semaphores available */
#define TARGET_EISNAM 120 /* Is a named type file */
#define TARGET_EREMOTEIO 121 /* Remote I/O error */
#define TARGET_EDQUOT 122 /* Quota exceeded */
#define TARGET_ENOMEDIUM 123 /* No medium found */
#define TARGET_EMEDIUMTYPE 124 /* Wrong medium type */
#define TARGET_ECANCELED 125 /* Operation Canceled */
#define TARGET_ENOKEY 126 /* Required key not available */
#define TARGET_EKEYEXPIRED 127 /* Key has expired */
#define TARGET_EKEYREVOKED 128 /* Key has been revoked */
#define TARGET_EKEYREJECTED 129 /* Key was rejected by service */
/* for robust mutexes */
#define TARGET_EOWNERDEAD 130 /* Owner died */
#define TARGET_ENOTRECOVERABLE 131 /* State not recoverable */
#define TARGET_ERFKILL 132 /* Operation not possible due to RF-kill */
#define TARGET_EHWPOISON 133 /* Memory page has hardware error */
#endif
+16
View File
@@ -0,0 +1,16 @@
/* If your arch needs to do custom stuff, create your own target_flat.h
* header file in linux-user/<your arch>/
*/
#ifndef LINUX_USER_TARGET_FLAT_H
#define LINUX_USER_TARGET_FLAT_H
#define flat_argvp_envp_on_stack() 1
#define flat_reloc_valid(reloc, size) ((reloc) <= (size))
#define flat_old_ram_flag(flag) (flag)
#define flat_get_relocate_addr(relval) (relval)
#define flat_get_addr_from_rp(rp, relval, flags, persistent) (rp)
#define flat_set_persistent(relval, persistent) (*persistent)
#define flat_put_addr_at_rp(rp, addr, relval) put_user_ual(addr, rp)
#endif
+163
View File
@@ -0,0 +1,163 @@
#ifndef LINUX_USER_TARGET_MMAN_H
#define LINUX_USER_TARGET_MMAN_H
/* These are defined in linux/mmap.h */
#define TARGET_MAP_SHARED 0x01
#define TARGET_MAP_PRIVATE 0x02
#define TARGET_MAP_SHARED_VALIDATE 0x03
/* 0x0100 - 0x4000 flags are defined in asm-generic/mman.h */
#ifndef TARGET_MAP_GROWSDOWN
#define TARGET_MAP_GROWSDOWN 0x0100
#endif
#ifndef TARGET_MAP_DENYWRITE
#define TARGET_MAP_DENYWRITE 0x0800
#endif
#ifndef TARGET_MAP_EXECUTABLE
#define TARGET_MAP_EXECUTABLE 0x1000
#endif
#ifndef TARGET_MAP_LOCKED
#define TARGET_MAP_LOCKED 0x2000
#endif
#ifndef TARGET_MAP_NORESERVE
#define TARGET_MAP_NORESERVE 0x4000
#endif
/* Defined in asm-generic/mman-common.h */
#ifndef TARGET_PROT_SEM
#define TARGET_PROT_SEM 0x08
#endif
#ifndef TARGET_MAP_TYPE
#define TARGET_MAP_TYPE 0x0f
#endif
#ifndef TARGET_MAP_FIXED
#define TARGET_MAP_FIXED 0x10
#endif
#ifndef TARGET_MAP_ANONYMOUS
#define TARGET_MAP_ANONYMOUS 0x20
#endif
#ifndef TARGET_MAP_POPULATE
#define TARGET_MAP_POPULATE 0x008000
#endif
#ifndef TARGET_MAP_NONBLOCK
#define TARGET_MAP_NONBLOCK 0x010000
#endif
#ifndef TARGET_MAP_STACK
#define TARGET_MAP_STACK 0x020000
#endif
#ifndef TARGET_MAP_HUGETLB
#define TARGET_MAP_HUGETLB 0x040000
#endif
#ifndef TARGET_MAP_SYNC
#define TARGET_MAP_SYNC 0x080000
#endif
#ifndef TARGET_MAP_FIXED_NOREPLACE
#define TARGET_MAP_FIXED_NOREPLACE 0x100000
#endif
#ifndef TARGET_MAP_UNINITIALIZED
#define TARGET_MAP_UNINITIALIZED 0x4000000
#endif
#ifndef TARGET_MADV_NORMAL
#define TARGET_MADV_NORMAL 0
#endif
#ifndef TARGET_MADV_RANDOM
#define TARGET_MADV_RANDOM 1
#endif
#ifndef TARGET_MADV_SEQUENTIAL
#define TARGET_MADV_SEQUENTIAL 2
#endif
#ifndef TARGET_MADV_WILLNEED
#define TARGET_MADV_WILLNEED 3
#endif
#ifndef TARGET_MADV_DONTNEED
#define TARGET_MADV_DONTNEED 4
#endif
#ifndef TARGET_MADV_FREE
#define TARGET_MADV_FREE 8
#endif
#ifndef TARGET_MADV_REMOVE
#define TARGET_MADV_REMOVE 9
#endif
#ifndef TARGET_MADV_DONTFORK
#define TARGET_MADV_DONTFORK 10
#endif
#ifndef TARGET_MADV_DOFORK
#define TARGET_MADV_DOFORK 11
#endif
#ifndef TARGET_MADV_MERGEABLE
#define TARGET_MADV_MERGEABLE 12
#endif
#ifndef TARGET_MADV_UNMERGEABLE
#define TARGET_MADV_UNMERGEABLE 13
#endif
#ifndef TARGET_MADV_HUGEPAGE
#define TARGET_MADV_HUGEPAGE 14
#endif
#ifndef TARGET_MADV_NOHUGEPAGE
#define TARGET_MADV_NOHUGEPAGE 15
#endif
#ifndef TARGET_MADV_DONTDUMP
#define TARGET_MADV_DONTDUMP 16
#endif
#ifndef TARGET_MADV_DODUMP
#define TARGET_MADV_DODUMP 17
#endif
#ifndef TARGET_MADV_WIPEONFORK
#define TARGET_MADV_WIPEONFORK 18
#endif
#ifndef TARGET_MADV_KEEPONFORK
#define TARGET_MADV_KEEPONFORK 19
#endif
#ifndef TARGET_MADV_COLD
#define TARGET_MADV_COLD 20
#endif
#ifndef TARGET_MADV_PAGEOUT
#define TARGET_MADV_PAGEOUT 21
#endif
#ifndef TARGET_MADV_POPULATE_READ
#define TARGET_MADV_POPULATE_READ 22
#endif
#ifndef TARGET_MADV_POPULATE_WRITE
#define TARGET_MADV_POPULATE_WRITE 23
#endif
#ifndef TARGET_MADV_DONTNEED_LOCKED
#define TARGET_MADV_DONTNEED_LOCKED 24
#endif
#ifndef TARGET_MS_ASYNC
#define TARGET_MS_ASYNC 1
#endif
#ifndef TARGET_MS_INVALIDATE
#define TARGET_MS_INVALIDATE 2
#endif
#ifndef TARGET_MS_SYNC
#define TARGET_MS_SYNC 4
#endif
#endif
+27
View File
@@ -0,0 +1,27 @@
/*
* Generic prctl unalign functions for linux-user
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef GENERIC_TARGET_PRCTL_UNALIGN_H
#define GENERIC_TARGET_PRCTL_UNALIGN_H
static abi_long do_prctl_get_unalign(CPUArchState *env, target_long arg2)
{
CPUState *cs = env_cpu(env);
uint32_t res = PR_UNALIGN_NOPRINT;
if (cs->prctl_unalign_sigbus) {
res |= PR_UNALIGN_SIGBUS;
}
return put_user_u32(res, arg2);
}
#define do_prctl_get_unalign do_prctl_get_unalign
static abi_long do_prctl_set_unalign(CPUArchState *env, target_long arg2)
{
env_cpu(env)->prctl_unalign_sigbus = arg2 & PR_UNALIGN_SIGBUS;
return 0;
}
#define do_prctl_set_unalign do_prctl_set_unalign
#endif /* GENERIC_TARGET_PRCTL_UNALIGN_H */
+38
View File
@@ -0,0 +1,38 @@
/*
* Target definitions of RLIMIT_* constants. These may be overridden by an
* architecture specific header if needed.
*/
#ifndef GENERIC_TARGET_RESOURCE_H
#define GENERIC_TARGET_RESOURCE_H
struct target_rlimit {
abi_ulong rlim_cur;
abi_ulong rlim_max;
};
struct target_rlimit64 {
abi_ullong rlim_cur;
abi_ullong rlim_max;
};
#define TARGET_RLIM_INFINITY ((abi_ulong)-1)
#define TARGET_RLIMIT_CPU 0
#define TARGET_RLIMIT_FSIZE 1
#define TARGET_RLIMIT_DATA 2
#define TARGET_RLIMIT_STACK 3
#define TARGET_RLIMIT_CORE 4
#define TARGET_RLIMIT_RSS 5
#define TARGET_RLIMIT_NPROC 6
#define TARGET_RLIMIT_NOFILE 7
#define TARGET_RLIMIT_MEMLOCK 8
#define TARGET_RLIMIT_AS 9
#define TARGET_RLIMIT_LOCKS 10
#define TARGET_RLIMIT_SIGPENDING 11
#define TARGET_RLIMIT_MSGQUEUE 12
#define TARGET_RLIMIT_NICE 13
#define TARGET_RLIMIT_RTPRIO 14
#define TARGET_RLIMIT_RTTIME 15
#endif
+58
View File
@@ -0,0 +1,58 @@
/*
* Generic structures for linux-user
*
* Copyright (c) 2013 Fabrice Bellard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef GENERIC_TARGET_STRUCTS_H
#define GENERIC_TARGET_STRUCTS_H
struct target_ipc_perm {
abi_int __key; /* Key. */
abi_uint uid; /* Owner's user ID. */
abi_uint gid; /* Owner's group ID. */
abi_uint cuid; /* Creator's user ID. */
abi_uint cgid; /* Creator's group ID. */
abi_ushort mode; /* Read/write permission. */
abi_ushort __pad1;
abi_ushort __seq; /* Sequence number. */
abi_ushort __pad2;
abi_ulong __unused1;
abi_ulong __unused2;
};
struct target_shmid_ds {
struct target_ipc_perm shm_perm; /* operation permission struct */
abi_long shm_segsz; /* size of segment in bytes */
abi_ulong shm_atime; /* time of last shmat() */
#if TARGET_ABI_BITS == 32
abi_ulong __unused1;
#endif
abi_ulong shm_dtime; /* time of last shmdt() */
#if TARGET_ABI_BITS == 32
abi_ulong __unused2;
#endif
abi_ulong shm_ctime; /* time of last change by shmctl() */
#if TARGET_ABI_BITS == 32
abi_ulong __unused3;
#endif
abi_int shm_cpid; /* pid of creator */
abi_int shm_lpid; /* pid of last shmop */
abi_ulong shm_nattch; /* number of current attaches */
abi_ulong __unused4;
abi_ulong __unused5;
};
#endif
+318
View File
@@ -0,0 +1,318 @@
/* Derived from asm-generic/termbits.h */
#ifndef GENERIC_TERMBITS_H
#define GENERIC_TERMBITS_H
typedef unsigned char target_cc_t; /* cc_t */
typedef unsigned int target_speed_t; /* speed_t */
typedef unsigned int target_tcflag_t; /* tcflag_t */
#define TARGET_NCCS 19
struct target_termios {
target_tcflag_t c_iflag; /* input mode flags */
target_tcflag_t c_oflag; /* output mode flags */
target_tcflag_t c_cflag; /* control mode flags */
target_tcflag_t c_lflag; /* local mode flags */
target_cc_t c_line; /* line discipline */
target_cc_t c_cc[TARGET_NCCS]; /* control characters */
};
struct target_termios2 {
target_tcflag_t c_iflag; /* input mode flags */
target_tcflag_t c_oflag; /* output mode flags */
target_tcflag_t c_cflag; /* control mode flags */
target_tcflag_t c_lflag; /* local mode flags */
target_cc_t c_line; /* line discipline */
target_cc_t c_cc[TARGET_NCCS]; /* control characters */
target_speed_t c_ispeed; /* input speed */
target_speed_t c_ospeed; /* output speed */
};
struct target_ktermios {
target_tcflag_t c_iflag; /* input mode flags */
target_tcflag_t c_oflag; /* output mode flags */
target_tcflag_t c_cflag; /* control mode flags */
target_tcflag_t c_lflag; /* local mode flags */
target_cc_t c_line; /* line discipline */
target_cc_t c_cc[TARGET_NCCS]; /* control characters */
target_speed_t c_ispeed; /* input speed */
target_speed_t c_ospeed; /* output speed */
};
/* c_cc character offsets */
#define TARGET_VINTR 0
#define TARGET_VQUIT 1
#define TARGET_VERASE 2
#define TARGET_VKILL 3
#define TARGET_VEOF 4
#define TARGET_VTIME 5
#define TARGET_VMIN 6
#define TARGET_VSWTC 7
#define TARGET_VSTART 8
#define TARGET_VSTOP 9
#define TARGET_VSUSP 10
#define TARGET_VEOL 11
#define TARGET_VREPRINT 12
#define TARGET_VDISCARD 13
#define TARGET_VWERASE 14
#define TARGET_VLNEXT 15
#define TARGET_VEOL2 16
/* c_iflag bits */
#define TARGET_IGNBRK 0000001
#define TARGET_BRKINT 0000002
#define TARGET_IGNPAR 0000004
#define TARGET_PARMRK 0000010
#define TARGET_INPCK 0000020
#define TARGET_ISTRIP 0000040
#define TARGET_INLCR 0000100
#define TARGET_IGNCR 0000200
#define TARGET_ICRNL 0000400
#define TARGET_IUCLC 0001000
#define TARGET_IXON 0002000
#define TARGET_IXANY 0004000
#define TARGET_IXOFF 0010000
#define TARGET_IMAXBEL 0020000
#define TARGET_IUTF8 0040000
/* c_oflag bits */
#define TARGET_OPOST 0000001
#define TARGET_OLCUC 0000002
#define TARGET_ONLCR 0000004
#define TARGET_OCRNL 0000010
#define TARGET_ONOCR 0000020
#define TARGET_ONLRET 0000040
#define TARGET_OFILL 0000100
#define TARGET_OFDEL 0000200
#define TARGET_NLDLY 0000400
#define TARGET_NL0 0000000
#define TARGET_NL1 0000400
#define TARGET_CRDLY 0003000
#define TARGET_CR0 0000000
#define TARGET_CR1 0001000
#define TARGET_CR2 0002000
#define TARGET_CR3 0003000
#define TARGET_TABDLY 0014000
#define TARGET_TAB0 0000000
#define TARGET_TAB1 0004000
#define TARGET_TAB2 0010000
#define TARGET_TAB3 0014000
#define TARGET_XTABS 0014000
#define TARGET_BSDLY 0020000
#define TARGET_BS0 0000000
#define TARGET_BS1 0020000
#define TARGET_VTDLY 0040000
#define TARGET_VT0 0000000
#define TARGET_VT1 0040000
#define TARGET_FFDLY 0100000
#define TARGET_FF0 0000000
#define TARGET_FF1 0100000
/* c_cflag bit meaning */
#define TARGET_CBAUD 0010017
#define TARGET_B0 0000000 /* hang up */
#define TARGET_B50 0000001
#define TARGET_B75 0000002
#define TARGET_B110 0000003
#define TARGET_B134 0000004
#define TARGET_B150 0000005
#define TARGET_B200 0000006
#define TARGET_B300 0000007
#define TARGET_B600 0000010
#define TARGET_B1200 0000011
#define TARGET_B1800 0000012
#define TARGET_B2400 0000013
#define TARGET_B4800 0000014
#define TARGET_B9600 0000015
#define TARGET_B19200 0000016
#define TARGET_B38400 0000017
#define TARGET_EXTA TARGET_B19200
#define TARGET_EXTB TARGET_B38400
#define TARGET_CSIZE 0000060
#define TARGET_CS5 0000000
#define TARGET_CS6 0000020
#define TARGET_CS7 0000040
#define TARGET_CS8 0000060
#define TARGET_CSTOPB 0000100
#define TARGET_CREAD 0000200
#define TARGET_PARENB 0000400
#define TARGET_PARODD 0001000
#define TARGET_HUPCL 0002000
#define TARGET_CLOCAL 0004000
#define TARGET_CBAUDEX 0010000
#define TARGET_BOTHER 0010000
#define TARGET_B57600 0010001
#define TARGET_B115200 0010002
#define TARGET_B230400 0010003
#define TARGET_B460800 0010004
#define TARGET_B500000 0010005
#define TARGET_B576000 0010006
#define TARGET_B921600 0010007
#define TARGET_B1000000 0010010
#define TARGET_B1152000 0010011
#define TARGET_B1500000 0010012
#define TARGET_B2000000 0010013
#define TARGET_B2500000 0010014
#define TARGET_B3000000 0010015
#define TARGET_B3500000 0010016
#define TARGET_B4000000 0010017
#define TARGET_CIBAUD 002003600000 /* input baud rate */
#define TARGET_CMSPAR 010000000000 /* mark or space (stick) parity */
#define TARGET_CRTSCTS 020000000000 /* flow control */
#define TARGET_IBSHIFT 16 /* Shift from CBAUD to CIBAUD */
/* c_lflag bits */
#define TARGET_ISIG 0000001
#define TARGET_ICANON 0000002
#define TARGET_XCASE 0000004
#define TARGET_ECHO 0000010
#define TARGET_ECHOE 0000020
#define TARGET_ECHOK 0000040
#define TARGET_ECHONL 0000100
#define TARGET_NOFLSH 0000200
#define TARGET_TOSTOP 0000400
#define TARGET_ECHOCTL 0001000
#define TARGET_ECHOPRT 0002000
#define TARGET_ECHOKE 0004000
#define TARGET_FLUSHO 0010000
#define TARGET_PENDIN 0040000
#define TARGET_IEXTEN 0100000
#define TARGET_EXTPROC 0200000
/* tcflow() and TCXONC use these */
#define TARGET_TCOOFF 0
#define TARGET_TCOON 1
#define TARGET_TCIOFF 2
#define TARGET_TCION 3
/* tcflush() and TCFLSH use these */
#define TARGET_TCIFLUSH 0
#define TARGET_TCOFLUSH 1
#define TARGET_TCIOFLUSH 2
/* tcsetattr uses these */
#define TARGET_TCSANOW 0
#define TARGET_TCSADRAIN 1
#define TARGET_TCSAFLUSH 2
/* Derived from include/uapi/asm-generic/ioctls.h */
#define TARGET_TCGETS 0x5401
#define TARGET_TCSETS 0x5402
#define TARGET_TCSETSW 0x5403
#define TARGET_TCSETSF 0x5404
#define TARGET_TCGETA 0x5405
#define TARGET_TCSETA 0x5406
#define TARGET_TCSETAW 0x5407
#define TARGET_TCSETAF 0x5408
#define TARGET_TCSBRK 0x5409
#define TARGET_TCXONC 0x540A
#define TARGET_TCFLSH 0x540B
#define TARGET_TIOCEXCL 0x540C
#define TARGET_TIOCNXCL 0x540D
#define TARGET_TIOCSCTTY 0x540E
#define TARGET_TIOCGPGRP 0x540F
#define TARGET_TIOCSPGRP 0x5410
#define TARGET_TIOCOUTQ 0x5411
#define TARGET_TIOCSTI 0x5412
#define TARGET_TIOCGWINSZ 0x5413
#define TARGET_TIOCSWINSZ 0x5414
#define TARGET_TIOCMGET 0x5415
#define TARGET_TIOCMBIS 0x5416
#define TARGET_TIOCMBIC 0x5417
#define TARGET_TIOCMSET 0x5418
#define TARGET_TIOCGSOFTCAR 0x5419
#define TARGET_TIOCSSOFTCAR 0x541A
#define TARGET_FIONREAD 0x541B
#define TARGET_TIOCINQ TARGET_FIONREAD
#define TARGET_TIOCLINUX 0x541C
#define TARGET_TIOCCONS 0x541D
#define TARGET_TIOCGSERIAL 0x541E
#define TARGET_TIOCSSERIAL 0x541F
#define TARGET_TIOCPKT 0x5420
#define TARGET_FIONBIO 0x5421
#define TARGET_TIOCNOTTY 0x5422
#define TARGET_TIOCSETD 0x5423
#define TARGET_TIOCGETD 0x5424
#define TARGET_TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */
#define TARGET_TIOCTTYGSTRUCT 0x5426 /* For debugging only */
#define TARGET_TIOCSBRK 0x5427 /* BSD compatibility */
#define TARGET_TIOCCBRK 0x5428 /* BSD compatibility */
#define TARGET_TIOCGSID 0x5429 /* Return the session ID of FD */
#define TARGET_TCGETS2 TARGET_IOR('T', 0x2A, struct target_termios2)
#define TARGET_TCSETS2 TARGET_IOW('T', 0x2B, struct target_termios2)
#define TARGET_TCSETSW2 TARGET_IOW('T', 0x2C, struct target_termios2)
#define TARGET_TCSETSF2 TARGET_IOW('T', 0x2D, struct target_termios2)
#define TARGET_TIOCGRS485 0x542E
#ifndef TARGET_TIOCSRS485
#define TARGET_TIOCSRS485 0x542F
#endif
/* Get Pty Number (of pty-mux device) */
#define TARGET_TIOCGPTN TARGET_IOR('T', 0x30, unsigned int)
/* Lock/unlock Pty */
#define TARGET_TIOCSPTLCK TARGET_IOW('T', 0x31, int)
/* Get primary device node of /dev/console */
#define TARGET_TIOCGDEV TARGET_IOR('T', 0x32, unsigned int)
#define TARGET_TCGETX 0x5432 /* SYS5 TCGETX compatibility */
#define TARGET_TCSETX 0x5433
#define TARGET_TCSETXF 0x5434
#define TARGET_TCSETXW 0x5435
/* pty: generate signal */
#define TARGET_TIOCSIG TARGET_IOW('T', 0x36, int)
#define TARGET_TIOCVHANGUP 0x5437
/* Get packet mode state */
#define TARGET_TIOCGPKT TARGET_IOR('T', 0x38, int)
/* Get Pty lock state */
#define TARGET_TIOCGPTLCK TARGET_IOR('T', 0x39, int)
/* Get exclusive mode state */
#define TARGET_TIOCGEXCL TARGET_IOR('T', 0x40, int)
/* Safely open the slave */
#define TARGET_TIOCGPTPEER TARGET_IO('T', 0x41)
#define TARGET_TIOCGISO7816 TARGET_IOR('T', 0x42, struct serial_iso7816)
#define TARGET_TIOCSISO7816 TARGET_IOWR('T', 0x43, struct serial_iso7816)
#define TARGET_FIONCLEX 0x5450 /* these numbers need to be adjusted */
#define TARGET_FIOCLEX 0x5451
#define TARGET_FIOASYNC 0x5452
#define TARGET_TIOCSERCONFIG 0x5453
#define TARGET_TIOCSERGWILD 0x5454
#define TARGET_TIOCSERSWILD 0x5455
#define TARGET_TIOCGLCKTRMIOS 0x5456
#define TARGET_TIOCSLCKTRMIOS 0x5457
#define TARGET_TIOCSERGSTRUCT 0x5458 /* For debugging only */
#define TARGET_TIOCSERGETLSR 0x5459 /* Get line status register */
#define TARGET_TIOCSERGETMULTI 0x545A /* Get multiport config */
#define TARGET_TIOCSERSETMULTI 0x545B /* Set multiport config */
/* wait for a change on serial input line(s) */
#define TARGET_TIOCMIWAIT 0x545C
/* read serial port inline interrupt counts */
#define TARGET_TIOCGICOUNT 0x545D
#define TARGET_TIOCGHAYESESP 0x545E /* Get Hayes ESP configuration */
#define TARGET_TIOCSHAYESESP 0x545F /* Set Hayes ESP configuration */
/*
* Some arches already define TARGET_FIOQSIZE due to a historical
* conflict with a Hayes modem-specific ioctl value.
*/
#ifndef TARGET_FIOQSIZE
# define TARGET_FIOQSIZE 0x5460
#endif
/* Used for packet mode */
#define TARGET_TIOCPKT_DATA 0
#define TARGET_TIOCPKT_FLUSHREAD 1
#define TARGET_TIOCPKT_FLUSHWRITE 2
#define TARGET_TIOCPKT_STOP 4
#define TARGET_TIOCPKT_START 8
#define TARGET_TIOCPKT_NOSTOP 16
#define TARGET_TIOCPKT_DOSTOP 32
#define TARGET_TIOCPKT_IOCTL 64
#define TARGET_TIOCSER_TEMT 0x01 /* Transmitter physically empty */
#endif