mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/rth/tags/pull-hppa-20170123' into staging
hppa-linux target support # gpg: Signature made Mon 23 Jan 2017 17:54:09 GMT # gpg: using RSA key 0xAD1270CC4DD0279B # gpg: Good signature from "Richard Henderson <rth7680@gmail.com>" # gpg: aka "Richard Henderson <rth@redhat.com>" # gpg: aka "Richard Henderson <rth@twiddle.net>" # Primary key fingerprint: 9CB1 8DDA F8E8 49AD 2AFC 16A4 AD12 70CC 4DD0 279B * remotes/rth/tags/pull-hppa-20170123: (25 commits) target-hppa: Implement floating-point insns target-hppa: Implement system and memory-management insns target-hppa: Implement loads and stores target-hppa: Implement shifts and deposits target-hppa: Implement linux-user gateway page target-hppa: Implement branches target-hppa: Implement basic arithmetic target-hppa: Add nullification framework target-hppa: Add framework and enable compilation target-hppa: Add softfloat specializations linux-user: Add HPPA startup and main loop linux-user: Add HPPA signal handling linux-user: Add HPPA target_signal.h and target_cpu.h linux-user: Add HPPA target_structs.h linux-user: Add HPPA definitions to syscall_defs.h linux-user: Add HPPA target_syscall.h linux-user: Add HPPA termbits.h linux-user: Add HPPA syscall numbers linux-user: Add HPPA socket.h definitions linux-user: Add some hppa ioctls ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -132,6 +132,12 @@ F: include/hw/cris/
|
||||
F: tests/tcg/cris/
|
||||
F: disas/cris.c
|
||||
|
||||
HPPA (PA-RISC)
|
||||
M: Richard Henderson <rth@twiddle.net>
|
||||
S: Maintained
|
||||
F: target/hppa/
|
||||
F: disas/hppa.c
|
||||
|
||||
LM32
|
||||
M: Michael Walle <michael@walle.cc>
|
||||
S: Maintained
|
||||
|
||||
@@ -5843,7 +5843,7 @@ target_name=$(echo $target | cut -d '-' -f 1)
|
||||
target_bigendian="no"
|
||||
|
||||
case "$target_name" in
|
||||
armeb|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or32|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb)
|
||||
armeb|hppa|lm32|m68k|microblaze|mips|mipsn32|mips64|moxie|or32|ppc|ppcemb|ppc64|ppc64abi32|s390x|sh4eb|sparc|sparc64|sparc32plus|xtensaeb)
|
||||
target_bigendian=yes
|
||||
;;
|
||||
esac
|
||||
@@ -5906,6 +5906,8 @@ case "$target_name" in
|
||||
;;
|
||||
cris)
|
||||
;;
|
||||
hppa)
|
||||
;;
|
||||
lm32)
|
||||
;;
|
||||
m68k)
|
||||
@@ -6114,6 +6116,9 @@ for i in $ARCH $TARGET_BASE_ARCH ; do
|
||||
cris)
|
||||
disas_config "CRIS"
|
||||
;;
|
||||
hppa)
|
||||
disas_config "HPPA"
|
||||
;;
|
||||
i386|x86_64|x32)
|
||||
disas_config "I386"
|
||||
;;
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
# Default configuration for hppa-linux-user
|
||||
@@ -310,6 +310,8 @@ void disas(FILE *out, void *code, unsigned long size)
|
||||
print_insn = print_insn_m68k;
|
||||
#elif defined(__s390__)
|
||||
print_insn = print_insn_s390;
|
||||
#elif defined(__hppa__)
|
||||
print_insn = print_insn_hppa;
|
||||
#elif defined(__ia64__)
|
||||
print_insn = print_insn_ia64;
|
||||
#endif
|
||||
|
||||
@@ -9,6 +9,7 @@ libvixldir = $(SRC_PATH)/disas/libvixl
|
||||
# versions do not.
|
||||
arm-a64.o-cflags := -I$(libvixldir) -Wno-sign-compare
|
||||
common-obj-$(CONFIG_CRIS_DIS) += cris.o
|
||||
common-obj-$(CONFIG_HPPA_DIS) += hppa.o
|
||||
common-obj-$(CONFIG_I386_DIS) += i386.o
|
||||
common-obj-$(CONFIG_IA64_DIS) += ia64.o
|
||||
common-obj-$(CONFIG_M68K_DIS) += m68k.o
|
||||
|
||||
+2832
File diff suppressed because it is too large
Load Diff
@@ -116,6 +116,8 @@ float32 float32_default_nan(float_status *status)
|
||||
#elif defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_ALPHA) || \
|
||||
defined(TARGET_XTENSA) || defined(TARGET_S390X) || defined(TARGET_TRICORE)
|
||||
return const_float32(0x7FC00000);
|
||||
#elif defined(TARGET_HPPA)
|
||||
return const_float32(0x7FA00000);
|
||||
#else
|
||||
if (status->snan_bit_is_one) {
|
||||
return const_float32(0x7FBFFFFF);
|
||||
@@ -139,6 +141,8 @@ float64 float64_default_nan(float_status *status)
|
||||
#elif defined(TARGET_PPC) || defined(TARGET_ARM) || defined(TARGET_ALPHA) || \
|
||||
defined(TARGET_S390X)
|
||||
return const_float64(LIT64(0x7FF8000000000000));
|
||||
#elif defined(TARGET_HPPA)
|
||||
return const_float64(LIT64(0x7FF4000000000000));
|
||||
#else
|
||||
if (status->snan_bit_is_one) {
|
||||
return const_float64(LIT64(0x7FF7FFFFFFFFFFFF));
|
||||
@@ -361,7 +365,14 @@ float32 float32_maybe_silence_nan(float32 a_, float_status *status)
|
||||
{
|
||||
if (float32_is_signaling_nan(a_, status)) {
|
||||
if (status->snan_bit_is_one) {
|
||||
#ifdef TARGET_HPPA
|
||||
uint32_t a = float32_val(a_);
|
||||
a &= ~0x00400000;
|
||||
a |= 0x00200000;
|
||||
return make_float32(a);
|
||||
#else
|
||||
return float32_default_nan(status);
|
||||
#endif
|
||||
} else {
|
||||
uint32_t a = float32_val(a_);
|
||||
a |= (1 << 22);
|
||||
@@ -449,7 +460,7 @@ static int pickNaN(flag aIsQNaN, flag aIsSNaN, flag bIsQNaN, flag bIsSNaN,
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
#elif defined(TARGET_MIPS)
|
||||
#elif defined(TARGET_MIPS) || defined(TARGET_HPPA)
|
||||
static int pickNaN(flag aIsQNaN, flag aIsSNaN, flag bIsQNaN, flag bIsSNaN,
|
||||
flag aIsLargerSignificand)
|
||||
{
|
||||
@@ -794,7 +805,14 @@ float64 float64_maybe_silence_nan(float64 a_, float_status *status)
|
||||
{
|
||||
if (float64_is_signaling_nan(a_, status)) {
|
||||
if (status->snan_bit_is_one) {
|
||||
#ifdef TARGET_HPPA
|
||||
uint64_t a = float64_val(a_);
|
||||
a &= ~0x0008000000000000ULL;
|
||||
a |= 0x0004000000000000ULL;
|
||||
return make_float64(a);
|
||||
#else
|
||||
return float64_default_nan(status);
|
||||
#endif
|
||||
} else {
|
||||
uint64_t a = float64_val(a_);
|
||||
a |= LIT64(0x0008000000000000);
|
||||
|
||||
@@ -235,6 +235,8 @@ struct target_pt_regs {
|
||||
#define TARGET_ENOTRECOVERABLE 137
|
||||
#undef TARGET_ERFKILL
|
||||
#define TARGET_ERFKILL 138
|
||||
#undef TARGET_EHWPOISON
|
||||
#define TARGET_EHWPOISON 139
|
||||
|
||||
// For sys_osf_getsysinfo
|
||||
#define TARGET_GSI_UACPROC 8
|
||||
|
||||
+194
-65
@@ -1215,6 +1215,30 @@ static inline void init_thread(struct target_pt_regs *regs,
|
||||
|
||||
#endif /* TARGET_TILEGX */
|
||||
|
||||
#ifdef TARGET_HPPA
|
||||
|
||||
#define ELF_START_MMAP 0x80000000
|
||||
#define ELF_CLASS ELFCLASS32
|
||||
#define ELF_ARCH EM_PARISC
|
||||
#define ELF_PLATFORM "PARISC"
|
||||
#define STACK_GROWS_DOWN 0
|
||||
#define STACK_ALIGNMENT 64
|
||||
|
||||
static inline void init_thread(struct target_pt_regs *regs,
|
||||
struct image_info *infop)
|
||||
{
|
||||
regs->iaoq[0] = infop->entry;
|
||||
regs->iaoq[1] = infop->entry + 4;
|
||||
regs->gr[23] = 0;
|
||||
regs->gr[24] = infop->arg_start;
|
||||
regs->gr[25] = (infop->arg_end - infop->arg_start) / sizeof(abi_ulong);
|
||||
/* The top-of-stack contains a linkage buffer. */
|
||||
regs->gr[30] = infop->start_stack + 64;
|
||||
regs->gr[31] = infop->entry;
|
||||
}
|
||||
|
||||
#endif /* TARGET_HPPA */
|
||||
|
||||
#ifndef ELF_PLATFORM
|
||||
#define ELF_PLATFORM (NULL)
|
||||
#endif
|
||||
@@ -1231,6 +1255,14 @@ static inline void init_thread(struct target_pt_regs *regs,
|
||||
#define ELF_HWCAP 0
|
||||
#endif
|
||||
|
||||
#ifndef STACK_GROWS_DOWN
|
||||
#define STACK_GROWS_DOWN 1
|
||||
#endif
|
||||
|
||||
#ifndef STACK_ALIGNMENT
|
||||
#define STACK_ALIGNMENT 16
|
||||
#endif
|
||||
|
||||
#ifdef TARGET_ABI32
|
||||
#undef ELF_CLASS
|
||||
#define ELF_CLASS ELFCLASS32
|
||||
@@ -1374,45 +1406,78 @@ static abi_ulong copy_elf_strings(int argc, char **argv, char *scratch,
|
||||
abi_ulong p, abi_ulong stack_limit)
|
||||
{
|
||||
char *tmp;
|
||||
int len, offset;
|
||||
int len, i;
|
||||
abi_ulong top = p;
|
||||
|
||||
if (!p) {
|
||||
return 0; /* bullet-proofing */
|
||||
}
|
||||
|
||||
offset = ((p - 1) % TARGET_PAGE_SIZE) + 1;
|
||||
if (STACK_GROWS_DOWN) {
|
||||
int offset = ((p - 1) % TARGET_PAGE_SIZE) + 1;
|
||||
for (i = argc - 1; i >= 0; --i) {
|
||||
tmp = argv[i];
|
||||
if (!tmp) {
|
||||
fprintf(stderr, "VFS: argc is wrong");
|
||||
exit(-1);
|
||||
}
|
||||
len = strlen(tmp) + 1;
|
||||
tmp += len;
|
||||
|
||||
while (argc-- > 0) {
|
||||
tmp = argv[argc];
|
||||
if (!tmp) {
|
||||
fprintf(stderr, "VFS: argc is wrong");
|
||||
exit(-1);
|
||||
}
|
||||
len = strlen(tmp) + 1;
|
||||
tmp += len;
|
||||
if (len > (p - stack_limit)) {
|
||||
return 0;
|
||||
}
|
||||
while (len) {
|
||||
int bytes_to_copy = (len > offset) ? offset : len;
|
||||
tmp -= bytes_to_copy;
|
||||
p -= bytes_to_copy;
|
||||
offset -= bytes_to_copy;
|
||||
len -= bytes_to_copy;
|
||||
|
||||
if (len > (p - stack_limit)) {
|
||||
return 0;
|
||||
}
|
||||
while (len) {
|
||||
int bytes_to_copy = (len > offset) ? offset : len;
|
||||
tmp -= bytes_to_copy;
|
||||
p -= bytes_to_copy;
|
||||
offset -= bytes_to_copy;
|
||||
len -= bytes_to_copy;
|
||||
memcpy_fromfs(scratch + offset, tmp, bytes_to_copy);
|
||||
|
||||
memcpy_fromfs(scratch + offset, tmp, bytes_to_copy);
|
||||
|
||||
if (offset == 0) {
|
||||
memcpy_to_target(p, scratch, top - p);
|
||||
top = p;
|
||||
offset = TARGET_PAGE_SIZE;
|
||||
if (offset == 0) {
|
||||
memcpy_to_target(p, scratch, top - p);
|
||||
top = p;
|
||||
offset = TARGET_PAGE_SIZE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (offset) {
|
||||
memcpy_to_target(p, scratch + offset, top - p);
|
||||
if (p != top) {
|
||||
memcpy_to_target(p, scratch + offset, top - p);
|
||||
}
|
||||
} else {
|
||||
int remaining = TARGET_PAGE_SIZE - (p % TARGET_PAGE_SIZE);
|
||||
for (i = 0; i < argc; ++i) {
|
||||
tmp = argv[i];
|
||||
if (!tmp) {
|
||||
fprintf(stderr, "VFS: argc is wrong");
|
||||
exit(-1);
|
||||
}
|
||||
len = strlen(tmp) + 1;
|
||||
if (len > (stack_limit - p)) {
|
||||
return 0;
|
||||
}
|
||||
while (len) {
|
||||
int bytes_to_copy = (len > remaining) ? remaining : len;
|
||||
|
||||
memcpy_fromfs(scratch + (p - top), tmp, bytes_to_copy);
|
||||
|
||||
tmp += bytes_to_copy;
|
||||
remaining -= bytes_to_copy;
|
||||
p += bytes_to_copy;
|
||||
len -= bytes_to_copy;
|
||||
|
||||
if (remaining == 0) {
|
||||
memcpy_to_target(top, scratch, p - top);
|
||||
top = p;
|
||||
remaining = TARGET_PAGE_SIZE;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (p != top) {
|
||||
memcpy_to_target(top, scratch, p - top);
|
||||
}
|
||||
}
|
||||
|
||||
return p;
|
||||
@@ -1447,11 +1512,15 @@ static abi_ulong setup_arg_pages(struct linux_binprm *bprm,
|
||||
}
|
||||
|
||||
/* We reserve one extra page at the top of the stack as guard. */
|
||||
target_mprotect(error, guard, PROT_NONE);
|
||||
|
||||
info->stack_limit = error + guard;
|
||||
|
||||
return info->stack_limit + size - sizeof(void *);
|
||||
if (STACK_GROWS_DOWN) {
|
||||
target_mprotect(error, guard, PROT_NONE);
|
||||
info->stack_limit = error + guard;
|
||||
return info->stack_limit + size - sizeof(void *);
|
||||
} else {
|
||||
target_mprotect(error + size, guard, PROT_NONE);
|
||||
info->stack_limit = error + size;
|
||||
return error;
|
||||
}
|
||||
}
|
||||
|
||||
/* Map and zero the bss. We need to explicitly zero any fractional pages
|
||||
@@ -1529,7 +1598,7 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc,
|
||||
struct image_info *interp_info)
|
||||
{
|
||||
abi_ulong sp;
|
||||
abi_ulong sp_auxv;
|
||||
abi_ulong u_argc, u_argv, u_envp, u_auxv;
|
||||
int size;
|
||||
int i;
|
||||
abi_ulong u_rand_bytes;
|
||||
@@ -1558,10 +1627,25 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc,
|
||||
k_platform = ELF_PLATFORM;
|
||||
if (k_platform) {
|
||||
size_t len = strlen(k_platform) + 1;
|
||||
sp -= (len + n - 1) & ~(n - 1);
|
||||
u_platform = sp;
|
||||
/* FIXME - check return value of memcpy_to_target() for failure */
|
||||
memcpy_to_target(sp, k_platform, len);
|
||||
if (STACK_GROWS_DOWN) {
|
||||
sp -= (len + n - 1) & ~(n - 1);
|
||||
u_platform = sp;
|
||||
/* FIXME - check return value of memcpy_to_target() for failure */
|
||||
memcpy_to_target(sp, k_platform, len);
|
||||
} else {
|
||||
memcpy_to_target(sp, k_platform, len);
|
||||
u_platform = sp;
|
||||
sp += len + 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Provide 16 byte alignment for the PRNG, and basic alignment for
|
||||
* the argv and envp pointers.
|
||||
*/
|
||||
if (STACK_GROWS_DOWN) {
|
||||
sp = QEMU_ALIGN_DOWN(sp, 16);
|
||||
} else {
|
||||
sp = QEMU_ALIGN_UP(sp, 16);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -1571,15 +1655,17 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc,
|
||||
for (i = 0; i < 16; i++) {
|
||||
k_rand_bytes[i] = rand();
|
||||
}
|
||||
sp -= 16;
|
||||
u_rand_bytes = sp;
|
||||
/* FIXME - check return value of memcpy_to_target() for failure */
|
||||
memcpy_to_target(sp, k_rand_bytes, 16);
|
||||
if (STACK_GROWS_DOWN) {
|
||||
sp -= 16;
|
||||
u_rand_bytes = sp;
|
||||
/* FIXME - check return value of memcpy_to_target() for failure */
|
||||
memcpy_to_target(sp, k_rand_bytes, 16);
|
||||
} else {
|
||||
memcpy_to_target(sp, k_rand_bytes, 16);
|
||||
u_rand_bytes = sp;
|
||||
sp += 16;
|
||||
}
|
||||
|
||||
/*
|
||||
* Force 16 byte _final_ alignment here for generality.
|
||||
*/
|
||||
sp = sp &~ (abi_ulong)15;
|
||||
size = (DLINFO_ITEMS + 1) * 2;
|
||||
if (k_platform)
|
||||
size += 2;
|
||||
@@ -1592,20 +1678,31 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc,
|
||||
size += envc + argc + 2;
|
||||
size += 1; /* argc itself */
|
||||
size *= n;
|
||||
if (size & 15)
|
||||
sp -= 16 - (size & 15);
|
||||
|
||||
/* Allocate space and finalize stack alignment for entry now. */
|
||||
if (STACK_GROWS_DOWN) {
|
||||
u_argc = QEMU_ALIGN_DOWN(sp - size, STACK_ALIGNMENT);
|
||||
sp = u_argc;
|
||||
} else {
|
||||
u_argc = sp;
|
||||
sp = QEMU_ALIGN_UP(sp + size, STACK_ALIGNMENT);
|
||||
}
|
||||
|
||||
u_argv = u_argc + n;
|
||||
u_envp = u_argv + (argc + 1) * n;
|
||||
u_auxv = u_envp + (envc + 1) * n;
|
||||
info->saved_auxv = u_auxv;
|
||||
info->arg_start = u_argv;
|
||||
info->arg_end = u_argv + argc * n;
|
||||
|
||||
/* This is correct because Linux defines
|
||||
* elf_addr_t as Elf32_Off / Elf64_Off
|
||||
*/
|
||||
#define NEW_AUX_ENT(id, val) do { \
|
||||
sp -= n; put_user_ual(val, sp); \
|
||||
sp -= n; put_user_ual(id, sp); \
|
||||
put_user_ual(id, u_auxv); u_auxv += n; \
|
||||
put_user_ual(val, u_auxv); u_auxv += n; \
|
||||
} while(0)
|
||||
|
||||
sp_auxv = sp;
|
||||
NEW_AUX_ENT (AT_NULL, 0);
|
||||
|
||||
/* There must be exactly DLINFO_ITEMS entries here. */
|
||||
NEW_AUX_ENT(AT_PHDR, (abi_ulong)(info->load_addr + exec->e_phoff));
|
||||
NEW_AUX_ENT(AT_PHENT, (abi_ulong)(sizeof (struct elf_phdr)));
|
||||
@@ -1626,8 +1723,9 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc,
|
||||
NEW_AUX_ENT(AT_HWCAP2, (abi_ulong) ELF_HWCAP2);
|
||||
#endif
|
||||
|
||||
if (k_platform)
|
||||
if (u_platform) {
|
||||
NEW_AUX_ENT(AT_PLATFORM, u_platform);
|
||||
}
|
||||
#ifdef ARCH_DLINFO
|
||||
/*
|
||||
* ARCH_DLINFO must come last so platform specific code can enforce
|
||||
@@ -1635,14 +1733,29 @@ static abi_ulong create_elf_tables(abi_ulong p, int argc, int envc,
|
||||
*/
|
||||
ARCH_DLINFO;
|
||||
#endif
|
||||
NEW_AUX_ENT (AT_NULL, 0);
|
||||
#undef NEW_AUX_ENT
|
||||
|
||||
info->saved_auxv = sp;
|
||||
info->auxv_len = sp_auxv - sp;
|
||||
info->auxv_len = u_argv - info->saved_auxv;
|
||||
|
||||
put_user_ual(argc, u_argc);
|
||||
|
||||
p = info->arg_strings;
|
||||
for (i = 0; i < argc; ++i) {
|
||||
put_user_ual(p, u_argv);
|
||||
u_argv += n;
|
||||
p += target_strlen(p) + 1;
|
||||
}
|
||||
put_user_ual(0, u_argv);
|
||||
|
||||
p = info->env_strings;
|
||||
for (i = 0; i < envc; ++i) {
|
||||
put_user_ual(p, u_envp);
|
||||
u_envp += n;
|
||||
p += target_strlen(p) + 1;
|
||||
}
|
||||
put_user_ual(0, u_envp);
|
||||
|
||||
sp = loader_build_argptr(envc, argc, sp, p, 0);
|
||||
/* Check the right amount of stack was allocated for auxvec, envp & argv. */
|
||||
assert(sp_auxv - sp == size);
|
||||
return sp;
|
||||
}
|
||||
|
||||
@@ -2213,12 +2326,28 @@ int load_elf_binary(struct linux_binprm *bprm, struct image_info *info)
|
||||
bprm->p = setup_arg_pages(bprm, info);
|
||||
|
||||
scratch = g_new0(char, TARGET_PAGE_SIZE);
|
||||
bprm->p = copy_elf_strings(1, &bprm->filename, scratch,
|
||||
bprm->p, info->stack_limit);
|
||||
bprm->p = copy_elf_strings(bprm->envc, bprm->envp, scratch,
|
||||
bprm->p, info->stack_limit);
|
||||
bprm->p = copy_elf_strings(bprm->argc, bprm->argv, scratch,
|
||||
bprm->p, info->stack_limit);
|
||||
if (STACK_GROWS_DOWN) {
|
||||
bprm->p = copy_elf_strings(1, &bprm->filename, scratch,
|
||||
bprm->p, info->stack_limit);
|
||||
info->file_string = bprm->p;
|
||||
bprm->p = copy_elf_strings(bprm->envc, bprm->envp, scratch,
|
||||
bprm->p, info->stack_limit);
|
||||
info->env_strings = bprm->p;
|
||||
bprm->p = copy_elf_strings(bprm->argc, bprm->argv, scratch,
|
||||
bprm->p, info->stack_limit);
|
||||
info->arg_strings = bprm->p;
|
||||
} else {
|
||||
info->arg_strings = bprm->p;
|
||||
bprm->p = copy_elf_strings(bprm->argc, bprm->argv, scratch,
|
||||
bprm->p, info->stack_limit);
|
||||
info->env_strings = bprm->p;
|
||||
bprm->p = copy_elf_strings(bprm->envc, bprm->envp, scratch,
|
||||
bprm->p, info->stack_limit);
|
||||
info->file_string = bprm->p;
|
||||
bprm->p = copy_elf_strings(1, &bprm->filename, scratch,
|
||||
bprm->p, info->stack_limit);
|
||||
}
|
||||
|
||||
g_free(scratch);
|
||||
|
||||
if (!bprm->p) {
|
||||
|
||||
@@ -140,6 +140,9 @@
|
||||
#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 */
|
||||
|
||||
/* QEMU internal, not visible to the guest. This is returned when a
|
||||
* system call should be restarted, to tell the main loop that it
|
||||
* should wind the guest PC backwards so it will re-execute the syscall
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
#define TARGET_SOL_SOCKET 0xffff
|
||||
|
||||
#define TARGET_SO_DEBUG 0x0001
|
||||
#define TARGET_SO_REUSEADDR 0x0004
|
||||
#define TARGET_SO_KEEPALIVE 0x0008
|
||||
#define TARGET_SO_DONTROUTE 0x0010
|
||||
#define TARGET_SO_BROADCAST 0x0020
|
||||
#define TARGET_SO_LINGER 0x0080
|
||||
#define TARGET_SO_OOBINLINE 0x0100
|
||||
#define TARGET_SO_REUSEPORT 0x0200
|
||||
#define TARGET_SO_SNDBUF 0x1001
|
||||
#define TARGET_SO_RCVBUF 0x1002
|
||||
#define TARGET_SO_SNDBUFFORCE 0x100a
|
||||
#define TARGET_SO_RCVBUFFORCE 0x100b
|
||||
#define TARGET_SO_SNDLOWAT 0x1003
|
||||
#define TARGET_SO_RCVLOWAT 0x1004
|
||||
#define TARGET_SO_SNDTIMEO 0x1005
|
||||
#define TARGET_SO_RCVTIMEO 0x1006
|
||||
#define TARGET_SO_ERROR 0x1007
|
||||
#define TARGET_SO_TYPE 0x1008
|
||||
#define TARGET_SO_PROTOCOL 0x1028
|
||||
#define TARGET_SO_DOMAIN 0x1029
|
||||
#define TARGET_SO_PEERNAME 0x2000
|
||||
#define TARGET_SO_NO_CHECK 0x400b
|
||||
#define TARGET_SO_PRIORITY 0x400c
|
||||
#define TARGET_SO_BSDCOMPAT 0x400e
|
||||
#define TARGET_SO_PASSCRED 0x4010
|
||||
#define TARGET_SO_PEERCRED 0x4011
|
||||
#define TARGET_SO_TIMESTAMP 0x4012
|
||||
#define TARGET_SCM_TIMESTAMP TARGET_SO_TIMESTAMP
|
||||
#define TARGET_SO_TIMESTAMPNS 0x4013
|
||||
#define TARGET_SCM_TIMESTAMPNS TARGET_SO_TIMESTAMPNS
|
||||
|
||||
#define TARGET_SO_SECURITY_AUTHENTICATION 0x4016
|
||||
#define TARGET_SO_SECURITY_ENCRYPTION_TRANSPORT 0x4017
|
||||
#define TARGET_SO_SECURITY_ENCRYPTION_NETWORK 0x4018
|
||||
|
||||
#define TARGET_SO_BINDTODEVICE 0x4019
|
||||
#define TARGET_SO_ATTACH_FILTER 0x401a
|
||||
#define TARGET_SO_DETACH_FILTER 0x401b
|
||||
#define TARGET_SO_GET_FILTER TARGET_SO_ATTACH_FILTER
|
||||
#define TARGET_SO_ACCEPTCONN 0x401c
|
||||
#define TARGET_SO_PEERSEC 0x401d
|
||||
#define TARGET_SO_PASSSEC 0x401e
|
||||
#define TARGET_SO_MARK 0x401f
|
||||
#define TARGET_SO_TIMESTAMPING 0x4020
|
||||
#define TARGET_SCM_TIMESTAMPING TARGET_SO_TIMESTAMPING
|
||||
#define TARGET_SO_RXQ_OVFL 0x4021
|
||||
#define TARGET_SO_WIFI_STATUS 0x4022
|
||||
#define TARGET_SCM_WIFI_STATUS TARGET_SO_WIFI_STATUS
|
||||
#define TARGET_SO_PEEK_OFF 0x4023
|
||||
#define TARGET_SO_NOFCS 0x4024
|
||||
#define TARGET_SO_LOCK_FILTER 0x4025
|
||||
#define TARGET_SO_SELECT_ERR_QUEUE 0x4026
|
||||
#define TARGET_SO_BUSY_POLL 0x4027
|
||||
#define TARGET_SO_MAX_PACING_RATE 0x4028
|
||||
#define TARGET_SO_BPF_EXTENSIONS 0x4029
|
||||
#define TARGET_SO_INCOMING_CPU 0x402A
|
||||
#define TARGET_SO_ATTACH_BPF 0x402B
|
||||
#define TARGET_SO_DETACH_BPF TARGET_SO_DETACH_FILTER
|
||||
|
||||
#define TARGET_SO_ATTACH_REUSEPORT_CBPF 0x402C
|
||||
#define TARGET_SO_ATTACH_REUSEPORT_EBPF 0x402D
|
||||
|
||||
#define TARGET_SO_CNX_ADVICE 0x402E
|
||||
|
||||
/** sock_type - Socket types - default values
|
||||
*
|
||||
*
|
||||
* @SOCK_STREAM - stream (connection) socket
|
||||
* @SOCK_DGRAM - datagram (conn.less) socket
|
||||
* @SOCK_RAW - raw socket
|
||||
* @SOCK_RDM - reliably-delivered message
|
||||
* @SOCK_SEQPACKET - sequential packet socket
|
||||
* @SOCK_DCCP - Datagram Congestion Control Protocol socket
|
||||
* @SOCK_PACKET - linux specific way of getting packets at the dev level.
|
||||
* For writing rarp and other similar things on the user
|
||||
* level.
|
||||
* @SOCK_CLOEXEC - sets the close-on-exec (FD_CLOEXEC) flag.
|
||||
* @SOCK_NONBLOCK - sets the O_NONBLOCK file status flag.
|
||||
*/
|
||||
enum sock_type {
|
||||
TARGET_SOCK_STREAM = 1,
|
||||
TARGET_SOCK_DGRAM = 2,
|
||||
TARGET_SOCK_RAW = 3,
|
||||
TARGET_SOCK_RDM = 4,
|
||||
TARGET_SOCK_SEQPACKET = 5,
|
||||
TARGET_SOCK_DCCP = 6,
|
||||
TARGET_SOCK_PACKET = 10,
|
||||
TARGET_SOCK_CLOEXEC = 010000000,
|
||||
TARGET_SOCK_NONBLOCK = 0x40000000,
|
||||
};
|
||||
|
||||
#define TARGET_SOCK_MAX (TARGET_SOCK_PACKET + 1)
|
||||
#define TARGET_SOCK_TYPE_MASK 0xf /* Covers up to TARGET_SOCK_MAX-1. */
|
||||
|
||||
#define ARCH_HAS_SOCKET_TYPES 1
|
||||
@@ -0,0 +1,353 @@
|
||||
/*
|
||||
* This file contains the system call numbers.
|
||||
*/
|
||||
|
||||
#define TARGET_NR_restart_syscall 0
|
||||
#define TARGET_NR_exit 1
|
||||
#define TARGET_NR_fork 2
|
||||
#define TARGET_NR_read 3
|
||||
#define TARGET_NR_write 4
|
||||
#define TARGET_NR_open 5
|
||||
#define TARGET_NR_close 6
|
||||
#define TARGET_NR_waitpid 7
|
||||
#define TARGET_NR_creat 8
|
||||
#define TARGET_NR_link 9
|
||||
#define TARGET_NR_unlink 10
|
||||
#define TARGET_NR_execve 11
|
||||
#define TARGET_NR_chdir 12
|
||||
#define TARGET_NR_time 13
|
||||
#define TARGET_NR_mknod 14
|
||||
#define TARGET_NR_chmod 15
|
||||
#define TARGET_NR_lchown 16
|
||||
#define TARGET_NR_socket 17
|
||||
#define TARGET_NR_stat 18
|
||||
#define TARGET_NR_lseek 19
|
||||
#define TARGET_NR_getpid 20
|
||||
#define TARGET_NR_mount 21
|
||||
#define TARGET_NR_bind 22
|
||||
#define TARGET_NR_setuid 23
|
||||
#define TARGET_NR_getuid 24
|
||||
#define TARGET_NR_stime 25
|
||||
#define TARGET_NR_ptrace 26
|
||||
#define TARGET_NR_alarm 27
|
||||
#define TARGET_NR_fstat 28
|
||||
#define TARGET_NR_pause 29
|
||||
#define TARGET_NR_utime 30
|
||||
#define TARGET_NR_connect 31
|
||||
#define TARGET_NR_listen 32
|
||||
#define TARGET_NR_access 33
|
||||
#define TARGET_NR_nice 34
|
||||
#define TARGET_NR_accept 35
|
||||
#define TARGET_NR_sync 36
|
||||
#define TARGET_NR_kill 37
|
||||
#define TARGET_NR_rename 38
|
||||
#define TARGET_NR_mkdir 39
|
||||
#define TARGET_NR_rmdir 40
|
||||
#define TARGET_NR_dup 41
|
||||
#define TARGET_NR_pipe 42
|
||||
#define TARGET_NR_times 43
|
||||
#define TARGET_NR_getsockname 44
|
||||
#define TARGET_NR_brk 45
|
||||
#define TARGET_NR_setgid 46
|
||||
#define TARGET_NR_getgid 47
|
||||
#define TARGET_NR_signal 48
|
||||
#define TARGET_NR_geteuid 49
|
||||
#define TARGET_NR_getegid 50
|
||||
#define TARGET_NR_acct 51
|
||||
#define TARGET_NR_umount2 52
|
||||
#define TARGET_NR_getpeername 53
|
||||
#define TARGET_NR_ioctl 54
|
||||
#define TARGET_NR_fcntl 55
|
||||
#define TARGET_NR_socketpair 56
|
||||
#define TARGET_NR_setpgid 57
|
||||
#define TARGET_NR_send 58
|
||||
#define TARGET_NR_uname 59
|
||||
#define TARGET_NR_umask 60
|
||||
#define TARGET_NR_chroot 61
|
||||
#define TARGET_NR_ustat 62
|
||||
#define TARGET_NR_dup2 63
|
||||
#define TARGET_NR_getppid 64
|
||||
#define TARGET_NR_getpgrp 65
|
||||
#define TARGET_NR_setsid 66
|
||||
#define TARGET_NR_pivot_root 67
|
||||
#define TARGET_NR_sgetmask 68
|
||||
#define TARGET_NR_ssetmask 69
|
||||
#define TARGET_NR_setreuid 70
|
||||
#define TARGET_NR_setregid 71
|
||||
#define TARGET_NR_mincore 72
|
||||
#define TARGET_NR_sigpending 73
|
||||
#define TARGET_NR_sethostname 74
|
||||
#define TARGET_NR_setrlimit 75
|
||||
#define TARGET_NR_getrlimit 76
|
||||
#define TARGET_NR_getrusage 77
|
||||
#define TARGET_NR_gettimeofday 78
|
||||
#define TARGET_NR_settimeofday 79
|
||||
#define TARGET_NR_getgroups 80
|
||||
#define TARGET_NR_setgroups 81
|
||||
#define TARGET_NR_sendto 82
|
||||
#define TARGET_NR_symlink 83
|
||||
#define TARGET_NR_lstat 84
|
||||
#define TARGET_NR_readlink 85
|
||||
#define TARGET_NR_uselib 86
|
||||
#define TARGET_NR_swapon 87
|
||||
#define TARGET_NR_reboot 88
|
||||
#define TARGET_NR_mmap2 89
|
||||
#define TARGET_NR_mmap 90
|
||||
#define TARGET_NR_munmap 91
|
||||
#define TARGET_NR_truncate 92
|
||||
#define TARGET_NR_ftruncate 93
|
||||
#define TARGET_NR_fchmod 94
|
||||
#define TARGET_NR_fchown 95
|
||||
#define TARGET_NR_getpriority 96
|
||||
#define TARGET_NR_setpriority 97
|
||||
#define TARGET_NR_recv 98
|
||||
#define TARGET_NR_statfs 99
|
||||
#define TARGET_NR_fstatfs 100
|
||||
#define TARGET_NR_stat64 101
|
||||
#define TARGET_NR_socketcall 102
|
||||
#define TARGET_NR_syslog 103
|
||||
#define TARGET_NR_setitimer 104
|
||||
#define TARGET_NR_getitimer 105
|
||||
#define TARGET_NR_capget 106
|
||||
#define TARGET_NR_capset 107
|
||||
#define TARGET_NR_pread64 108
|
||||
#define TARGET_NR_pwrite64 109
|
||||
#define TARGET_NR_getcwd 110
|
||||
#define TARGET_NR_vhangup 111
|
||||
#define TARGET_NR_fstat64 112
|
||||
#define TARGET_NR_vfork 113
|
||||
#define TARGET_NR_wait4 114
|
||||
#define TARGET_NR_swapoff 115
|
||||
#define TARGET_NR_sysinfo 116
|
||||
#define TARGET_NR_shutdown 117
|
||||
#define TARGET_NR_fsync 118
|
||||
#define TARGET_NR_madvise 119
|
||||
#define TARGET_NR_clone 120
|
||||
#define TARGET_NR_setdomainname 121
|
||||
#define TARGET_NR_sendfile 122
|
||||
#define TARGET_NR_recvfrom 123
|
||||
#define TARGET_NR_adjtimex 124
|
||||
#define TARGET_NR_mprotect 125
|
||||
#define TARGET_NR_sigprocmask 126
|
||||
#define TARGET_NR_create_module 127
|
||||
#define TARGET_NR_init_module 128
|
||||
#define TARGET_NR_delete_module 129
|
||||
#define TARGET_NR_get_kernel_syms 130
|
||||
#define TARGET_NR_quotactl 131
|
||||
#define TARGET_NR_getpgid 132
|
||||
#define TARGET_NR_fchdir 133
|
||||
#define TARGET_NR_bdflush 134
|
||||
#define TARGET_NR_sysfs 135
|
||||
#define TARGET_NR_personality 136
|
||||
#define TARGET_NR_afs_syscall 137 /* Syscall for Andrew File System */
|
||||
#define TARGET_NR_setfsuid 138
|
||||
#define TARGET_NR_setfsgid 139
|
||||
#define TARGET_NR__llseek 140
|
||||
#define TARGET_NR_getdents 141
|
||||
#define TARGET_NR__newselect 142
|
||||
#define TARGET_NR_flock 143
|
||||
#define TARGET_NR_msync 144
|
||||
#define TARGET_NR_readv 145
|
||||
#define TARGET_NR_writev 146
|
||||
#define TARGET_NR_getsid 147
|
||||
#define TARGET_NR_fdatasync 148
|
||||
#define TARGET_NR__sysctl 149
|
||||
#define TARGET_NR_mlock 150
|
||||
#define TARGET_NR_munlock 151
|
||||
#define TARGET_NR_mlockall 152
|
||||
#define TARGET_NR_munlockall 153
|
||||
#define TARGET_NR_sched_setparam 154
|
||||
#define TARGET_NR_sched_getparam 155
|
||||
#define TARGET_NR_sched_setscheduler 156
|
||||
#define TARGET_NR_sched_getscheduler 157
|
||||
#define TARGET_NR_sched_yield 158
|
||||
#define TARGET_NR_sched_get_priority_max 159
|
||||
#define TARGET_NR_sched_get_priority_min 160
|
||||
#define TARGET_NR_sched_rr_get_interval 161
|
||||
#define TARGET_NR_nanosleep 162
|
||||
#define TARGET_NR_mremap 163
|
||||
#define TARGET_NR_setresuid 164
|
||||
#define TARGET_NR_getresuid 165
|
||||
#define TARGET_NR_sigaltstack 166
|
||||
#define TARGET_NR_query_module 167
|
||||
#define TARGET_NR_poll 168
|
||||
#define TARGET_NR_nfsservctl 169
|
||||
#define TARGET_NR_setresgid 170
|
||||
#define TARGET_NR_getresgid 171
|
||||
#define TARGET_NR_prctl 172
|
||||
#define TARGET_NR_rt_sigreturn 173
|
||||
#define TARGET_NR_rt_sigaction 174
|
||||
#define TARGET_NR_rt_sigprocmask 175
|
||||
#define TARGET_NR_rt_sigpending 176
|
||||
#define TARGET_NR_rt_sigtimedwait 177
|
||||
#define TARGET_NR_rt_sigqueueinfo 178
|
||||
#define TARGET_NR_rt_sigsuspend 179
|
||||
#define TARGET_NR_chown 180
|
||||
#define TARGET_NR_setsockopt 181
|
||||
#define TARGET_NR_getsockopt 182
|
||||
#define TARGET_NR_sendmsg 183
|
||||
#define TARGET_NR_recvmsg 184
|
||||
#define TARGET_NR_semop 185
|
||||
#define TARGET_NR_semget 186
|
||||
#define TARGET_NR_semctl 187
|
||||
#define TARGET_NR_msgsnd 188
|
||||
#define TARGET_NR_msgrcv 189
|
||||
#define TARGET_NR_msgget 190
|
||||
#define TARGET_NR_msgctl 191
|
||||
#define TARGET_NR_shmat 192
|
||||
#define TARGET_NR_shmdt 193
|
||||
#define TARGET_NR_shmget 194
|
||||
#define TARGET_NR_shmctl 195
|
||||
#define TARGET_NR_getpmsg 196
|
||||
#define TARGET_NR_putpmsg 197
|
||||
#define TARGET_NR_lstat64 198
|
||||
#define TARGET_NR_truncate64 199
|
||||
#define TARGET_NR_ftruncate64 200
|
||||
#define TARGET_NR_getdents64 201
|
||||
#define TARGET_NR_fcntl64 202
|
||||
#define TARGET_NR_attrctl 203
|
||||
#define TARGET_NR_acl_get 204
|
||||
#define TARGET_NR_acl_set 205
|
||||
#define TARGET_NR_gettid 206
|
||||
#define TARGET_NR_readahead 207
|
||||
#define TARGET_NR_tkill 208
|
||||
#define TARGET_NR_sendfile64 209
|
||||
#define TARGET_NR_futex 210
|
||||
#define TARGET_NR_sched_setaffinity 211
|
||||
#define TARGET_NR_sched_getaffinity 212
|
||||
#define TARGET_NR_set_thread_area 213
|
||||
#define TARGET_NR_get_thread_area 214
|
||||
#define TARGET_NR_io_setup 215
|
||||
#define TARGET_NR_io_destroy 216
|
||||
#define TARGET_NR_io_getevents 217
|
||||
#define TARGET_NR_io_submit 218
|
||||
#define TARGET_NR_io_cancel 219
|
||||
#define TARGET_NR_alloc_hugepages 220
|
||||
#define TARGET_NR_free_hugepages 221
|
||||
#define TARGET_NR_exit_group 222
|
||||
#define TARGET_NR_lookup_dcookie 223
|
||||
#define TARGET_NR_epoll_create 224
|
||||
#define TARGET_NR_epoll_ctl 225
|
||||
#define TARGET_NR_epill_wait 226
|
||||
#define TARGET_NR_remap_file_pages 227
|
||||
#define TARGET_NR_semtimedop 228
|
||||
#define TARGET_NR_mq_open 229
|
||||
#define TARGET_NR_mq_unlink 230
|
||||
#define TARGET_NR_mq_timedsend 231
|
||||
#define TARGET_NR_mq_timedreceive 232
|
||||
#define TARGET_NR_mq_notify 233
|
||||
#define TARGET_NR_mq_getsetattr 234
|
||||
#define TARGET_NR_waitid 235
|
||||
#define TARGET_NR_fadvise64_64 236
|
||||
#define TARGET_NR_set_tid_address 237
|
||||
#define TARGET_NR_setxattr 238
|
||||
#define TARGET_NR_lsetxattr 239
|
||||
#define TARGET_NR_fsetxattr 240
|
||||
#define TARGET_NR_getxattr 241
|
||||
#define TARGET_NR_lgetxattr 242
|
||||
#define TARGET_NR_fgetxattr 243
|
||||
#define TARGET_NR_listxattr 244
|
||||
#define TARGET_NR_llistxattr 245
|
||||
#define TARGET_NR_flistxattr 246
|
||||
#define TARGET_NR_removexattr 247
|
||||
#define TARGET_NR_lremovexattr 248
|
||||
#define TARGET_NR_fremovexattr 249
|
||||
#define TARGET_NR_timer_create 250
|
||||
#define TARGET_NR_timer_settime 251
|
||||
#define TARGET_NR_timer_gettime 252
|
||||
#define TARGET_NR_timer_getoverrun 253
|
||||
#define TARGET_NR_timer_delete 254
|
||||
#define TARGET_NR_clock_settime 255
|
||||
#define TARGET_NR_clock_gettime 256
|
||||
#define TARGET_NR_clock_getres 257
|
||||
#define TARGET_NR_clock_nanosleep 258
|
||||
#define TARGET_NR_tgkill 259
|
||||
#define TARGET_NR_mbind 260
|
||||
#define TARGET_NR_get_mempolicy 261
|
||||
#define TARGET_NR_set_mempolicy 262
|
||||
#define TARGET_NR_vserver 263
|
||||
#define TARGET_NR_add_key 264
|
||||
#define TARGET_NR_request_key 265
|
||||
#define TARGET_NR_keyctl 266
|
||||
#define TARGET_NR_ioprio_set 267
|
||||
#define TARGET_NR_ioprio_get 268
|
||||
#define TARGET_NR_inotify_init 269
|
||||
#define TARGET_NR_inotify_add_watch 270
|
||||
#define TARGET_NR_inotify_rm_watch 271
|
||||
#define TARGET_NR_migrate_pages 272
|
||||
#define TARGET_NR_pselect6 273
|
||||
#define TARGET_NR_ppoll 274
|
||||
#define TARGET_NR_openat 275
|
||||
#define TARGET_NR_mkdirat 276
|
||||
#define TARGET_NR_mknotat 277
|
||||
#define TARGET_NR_fchownat 278
|
||||
#define TARGET_NR_futimesat 279
|
||||
#define TARGET_NR_fstatat64 280
|
||||
#define TARGET_NR_unlinkat 281
|
||||
#define TARGET_NR_renameat 282
|
||||
#define TARGET_NR_linkat 283
|
||||
#define TARGET_NR_symlinkat 284
|
||||
#define TARGET_NR_readlinkat 285
|
||||
#define TARGET_NR_fchmodat 286
|
||||
#define TARGET_NR_faccessat 287
|
||||
#define TARGET_NR_unshare 288
|
||||
#define TARGET_NR_set_robust_list 289
|
||||
#define TARGET_NR_get_robust_list 290
|
||||
#define TARGET_NR_splice 291
|
||||
#define TARGET_NR_sync_file_range 292
|
||||
#define TARGET_NR_tee 293
|
||||
#define TARGET_NR_vmsplice 294
|
||||
#define TARGET_NR_move_pages 295
|
||||
#define TARGET_NR_getcpu 296
|
||||
#define TARGET_NR_epoll_pwait 297
|
||||
#define TARGET_NR_statfs64 298
|
||||
#define TARGET_NR_fstatfs64 299
|
||||
#define TARGET_NR_kexec_load 300
|
||||
#define TARGET_NR_utimensat 301
|
||||
#define TARGET_NR_signalfd 302
|
||||
#define TARGET_NR_timerfd 303
|
||||
#define TARGET_NR_eventfd 304
|
||||
#define TARGET_NR_fallocate 305
|
||||
#define TARGET_NR_timerfd_create 306
|
||||
#define TARGET_NR_timerfd_settime 307
|
||||
#define TARGET_NR_timerfd_gettime 308
|
||||
#define TARGET_NR_signalfd4 309
|
||||
#define TARGET_NR_eventfd2 310
|
||||
#define TARGET_NR_epoll_create1 311
|
||||
#define TARGET_NR_dup3 312
|
||||
#define TARGET_NR_pipe2 313
|
||||
#define TARGET_NR_inotify_init1 314
|
||||
#define TARGET_NR_preadv 315
|
||||
#define TARGET_NR_pwritev 316
|
||||
#define TARGET_NR_rt_tgsigqueueinfo 317
|
||||
#define TARGET_NR_perf_event_open 318
|
||||
#define TARGET_NR_recvmmsg 319
|
||||
#define TARGET_NR_accept4 320
|
||||
#define TARGET_NR_prlimit64 321
|
||||
#define TARGET_NR_fanotify_init 322
|
||||
#define TARGET_NR_fanotify_mark 323
|
||||
#define TARGET_NR_clock_adjtime 324
|
||||
#define TARGET_NR_name_to_handle_at 325
|
||||
#define TARGET_NR_open_by_handle_at 326
|
||||
#define TARGET_NR_syncfs 327
|
||||
#define TARGET_NR_setns 328
|
||||
#define TARGET_NR_sendmmsg 329
|
||||
#define TARGET_NR_process_vm_readv 330
|
||||
#define TARGET_NR_process_vm_writev 331
|
||||
#define TARGET_NR_kcmp 332
|
||||
#define TARGET_NR_finit_module 333
|
||||
#define TARGET_NR_sched_setattr 334
|
||||
#define TARGET_NR_sched_getattr 335
|
||||
#define TARGET_NR_utimes 336
|
||||
#define TARGET_NR_renameat2 337
|
||||
#define TARGET_NR_seccomp 338
|
||||
#define TARGET_NR_getrandom 339
|
||||
#define TARGET_NR_memfd_create 340
|
||||
#define TARGET_NR_bpf 341
|
||||
#define TARGET_NR_execveat 342
|
||||
#define TARGET_NR_membarrier 343
|
||||
#define TARGET_NR_userfaultfd 344
|
||||
#define TARGET_NR_mlock2 345
|
||||
#define TARGET_NR_copy_file_range 346
|
||||
#define TARGET_NR_preadv2 347
|
||||
#define TARGET_NR_pwritev2 348
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* HPPA specific CPU ABI and functions for linux-user
|
||||
*
|
||||
* Copyright (c) 2016 Richard Henderson
|
||||
*
|
||||
* 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 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 ALPHA_TARGET_CPU_H
|
||||
#define ALPHA_TARGET_CPU_H
|
||||
|
||||
static inline void cpu_clone_regs(CPUHPPAState *env, target_ulong newsp)
|
||||
{
|
||||
if (newsp) {
|
||||
env->gr[30] = newsp;
|
||||
}
|
||||
env->gr[28] = 0;
|
||||
}
|
||||
|
||||
static inline void cpu_set_tls(CPUHPPAState *env, target_ulong newtls)
|
||||
{
|
||||
env->cr27 = newtls;
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,29 @@
|
||||
#ifndef HPPA_TARGET_SIGNAL_H
|
||||
#define HPPA_TARGET_SIGNAL_H
|
||||
|
||||
#include "cpu.h"
|
||||
|
||||
/* this struct defines a stack used during syscall handling */
|
||||
|
||||
typedef struct target_sigaltstack {
|
||||
abi_ulong ss_sp;
|
||||
int32_t 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
|
||||
#define TARGET_SIGSTKSZ 8192
|
||||
|
||||
static inline abi_ulong get_sp_from_cpustate(CPUHPPAState *state)
|
||||
{
|
||||
return state->gr[30];
|
||||
}
|
||||
|
||||
#endif /* HPPA_TARGET_SIGNAL_H */
|
||||
@@ -0,0 +1,54 @@
|
||||
/*
|
||||
* HPPA specific structures for linux-user
|
||||
*
|
||||
* Copyright (c) 2016 Richard Henderson
|
||||
*
|
||||
* 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 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 HPPA_TARGET_STRUCTS_H
|
||||
#define HPPA_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 __pad1;
|
||||
abi_ushort mode; /* Read/write permission. */
|
||||
abi_ushort __pad2;
|
||||
abi_ushort __seq; /* Sequence number. */
|
||||
abi_uint __pad3;
|
||||
uint64_t __unused1;
|
||||
uint64_t __unused2;
|
||||
};
|
||||
|
||||
struct target_shmid_ds {
|
||||
struct target_ipc_perm shm_perm; /* operation permission struct */
|
||||
abi_uint __pad1;
|
||||
abi_ulong shm_atime; /* time of last shmat() */
|
||||
abi_uint __pad2;
|
||||
abi_ulong shm_dtime; /* time of last shmdt() */
|
||||
abi_uint __pad3;
|
||||
abi_ulong shm_ctime; /* time of last change by shmctl() */
|
||||
abi_uint __pad4;
|
||||
abi_long shm_segsz; /* size of segment in bytes */
|
||||
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 __unused1;
|
||||
abi_ulong __unused2;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,237 @@
|
||||
#ifndef HPPA_TARGET_SYSCALL_H
|
||||
#define HPPA_TARGET_SYSCALL_H
|
||||
|
||||
struct target_pt_regs {
|
||||
target_ulong gr[32];
|
||||
uint64_t fr[32];
|
||||
target_ulong sr[8];
|
||||
target_ulong iasq[2];
|
||||
target_ulong iaoq[2];
|
||||
target_ulong cr27;
|
||||
target_ulong __pad0;
|
||||
target_ulong orig_r28;
|
||||
target_ulong ksp;
|
||||
target_ulong kpc;
|
||||
target_ulong sar;
|
||||
target_ulong iir;
|
||||
target_ulong isr;
|
||||
target_ulong ior;
|
||||
target_ulong ipsw;
|
||||
};
|
||||
|
||||
#define UNAME_MACHINE "hppa"
|
||||
#define UNAME_MINIMUM_RELEASE "2.6.32"
|
||||
#define TARGET_CLONE_BACKWARDS
|
||||
#define TARGET_MINSIGSTKSZ 2048
|
||||
#define TARGET_MLOCKALL_MCL_CURRENT 1
|
||||
#define TARGET_MLOCKALL_MCL_FUTURE 2
|
||||
|
||||
#undef TARGET_ENOMSG
|
||||
#define TARGET_ENOMSG 35
|
||||
#undef TARGET_EIDRM
|
||||
#define TARGET_EIDRM 36
|
||||
#undef TARGET_ECHRNG
|
||||
#define TARGET_ECHRNG 37
|
||||
#undef TARGET_EL2NSYNC
|
||||
#define TARGET_EL2NSYNC 38
|
||||
#undef TARGET_EL3HLT
|
||||
#define TARGET_EL3HLT 39
|
||||
#undef TARGET_EL3RST
|
||||
#define TARGET_EL3RST 40
|
||||
#undef TARGET_ELNRNG
|
||||
#define TARGET_ELNRNG 41
|
||||
#undef TARGET_EUNATCH
|
||||
#define TARGET_EUNATCH 42
|
||||
#undef TARGET_ENOCSI
|
||||
#define TARGET_ENOCSI 43
|
||||
#undef TARGET_EL2HLT
|
||||
#define TARGET_EL2HLT 44
|
||||
#undef TARGET_EDEADLK
|
||||
#define TARGET_EDEADLK 45
|
||||
#undef TARGET_ENOLCK
|
||||
#define TARGET_ENOLCK 46
|
||||
#undef TARGET_EILSEQ
|
||||
#define TARGET_EILSEQ 47
|
||||
|
||||
#undef TARGET_ENONET
|
||||
#define TARGET_ENONET 50
|
||||
#undef TARGET_ENODATA
|
||||
#define TARGET_ENODATA 51
|
||||
#undef TARGET_ETIME
|
||||
#define TARGET_ETIME 52
|
||||
#undef TARGET_ENOSR
|
||||
#define TARGET_ENOSR 53
|
||||
#undef TARGET_ENOSTR
|
||||
#define TARGET_ENOSTR 54
|
||||
#undef TARGET_ENOPKG
|
||||
#define TARGET_ENOPKG 55
|
||||
|
||||
#undef TARGET_ENOLINK
|
||||
#define TARGET_ENOLINK 57
|
||||
#undef TARGET_EADV
|
||||
#define TARGET_EADV 58
|
||||
#undef TARGET_ESRMNT
|
||||
#define TARGET_ESRMNT 59
|
||||
#undef TARGET_ECOMM
|
||||
#define TARGET_ECOMM 60
|
||||
#undef TARGET_EPROTO
|
||||
#define TARGET_EPROTO 61
|
||||
|
||||
#undef TARGET_EMULTIHOP
|
||||
#define TARGET_EMULTIHOP 64
|
||||
|
||||
#undef TARGET_EDOTDOT
|
||||
#define TARGET_EDOTDOT 66
|
||||
#undef TARGET_EBADMSG
|
||||
#define TARGET_EBADMSG 67
|
||||
#undef TARGET_EUSERS
|
||||
#define TARGET_EUSERS 68
|
||||
#undef TARGET_EDQUOT
|
||||
#define TARGET_EDQUOT 69
|
||||
#undef TARGET_ESTALE
|
||||
#define TARGET_ESTALE 70
|
||||
#undef TARGET_EREMOTE
|
||||
#define TARGET_EREMOTE 71
|
||||
#undef TARGET_EOVERFLOW
|
||||
#define TARGET_EOVERFLOW 72
|
||||
|
||||
#undef TARGET_EBADE
|
||||
#define TARGET_EBADE 160
|
||||
#undef TARGET_EBADR
|
||||
#define TARGET_EBADR 161
|
||||
#undef TARGET_EXFULL
|
||||
#define TARGET_EXFULL 162
|
||||
#undef TARGET_ENOANO
|
||||
#define TARGET_ENOANO 163
|
||||
#undef TARGET_EBADRQC
|
||||
#define TARGET_EBADRQC 164
|
||||
#undef TARGET_EBADSLT
|
||||
#define TARGET_EBADSLT 165
|
||||
#undef TARGET_EBFONT
|
||||
#define TARGET_EBFONT 166
|
||||
#undef TARGET_ENOTUNIQ
|
||||
#define TARGET_ENOTUNIQ 167
|
||||
#undef TARGET_EBADFD
|
||||
#define TARGET_EBADFD 168
|
||||
#undef TARGET_EREMCHG
|
||||
#define TARGET_EREMCHG 169
|
||||
#undef TARGET_ELIBACC
|
||||
#define TARGET_ELIBACC 170
|
||||
#undef TARGET_ELIBBAD
|
||||
#define TARGET_ELIBBAD 171
|
||||
#undef TARGET_ELIBSCN
|
||||
#define TARGET_ELIBSCN 172
|
||||
#undef TARGET_ELIBMAX
|
||||
#define TARGET_ELIBMAX 173
|
||||
#undef TARGET_ELIBEXEC
|
||||
#define TARGET_ELIBEXEC 174
|
||||
#undef TARGET_ERESTART
|
||||
#define TARGET_ERESTART 175
|
||||
#undef TARGET_ESTRPIPE
|
||||
#define TARGET_ESTRPIPE 176
|
||||
#undef TARGET_EUCLEAN
|
||||
#define TARGET_EUCLEAN 177
|
||||
#undef TARGET_ENOTNAM
|
||||
#define TARGET_ENOTNAM 178
|
||||
#undef TARGET_ENAVAIL
|
||||
#define TARGET_ENAVAIL 179
|
||||
#undef TARGET_EISNAM
|
||||
#define TARGET_EISNAM 180
|
||||
#undef TARGET_EREMOTEIO
|
||||
#define TARGET_EREMOTEIO 181
|
||||
#undef TARGET_ENOMEDIUM
|
||||
#define TARGET_ENOMEDIUM 182
|
||||
#undef TARGET_EMEDIUMTYPE
|
||||
#define TARGET_EMEDIUMTYPE 183
|
||||
#undef TARGET_ENOKEY
|
||||
#define TARGET_ENOKEY 184
|
||||
#undef TARGET_EKEYEXPIRED
|
||||
#define TARGET_EKEYEXPIRED 185
|
||||
#undef TARGET_EKEYREVOKED
|
||||
#define TARGET_EKEYREVOKED 186
|
||||
#undef TARGET_EKEYREJECTED
|
||||
#define TARGET_EKEYREJECTED 187
|
||||
|
||||
/* Never used in linux. */
|
||||
/* #define TARGET_ENOSYM 215 */
|
||||
#undef TARGET_ENOTSOCK
|
||||
#define TARGET_ENOTSOCK 216
|
||||
#undef TARGET_EDESTADDRREQ
|
||||
#define TARGET_EDESTADDRREQ 217
|
||||
#undef TARGET_EMSGSIZE
|
||||
#define TARGET_EMSGSIZE 218
|
||||
#undef TARGET_EPROTOTYPE
|
||||
#define TARGET_EPROTOTYPE 219
|
||||
#undef TARGET_ENOPROTOOPT
|
||||
#define TARGET_ENOPROTOOPT 220
|
||||
#undef TARGET_EPROTONOSUPPORT
|
||||
#define TARGET_EPROTONOSUPPORT 221
|
||||
#undef TARGET_ESOCKTNOSUPPORT
|
||||
#define TARGET_ESOCKTNOSUPPORT 222
|
||||
#undef TARGET_EOPNOTSUPP
|
||||
#define TARGET_EOPNOTSUPP 223
|
||||
#undef TARGET_EPFNOSUPPORT
|
||||
#define TARGET_EPFNOSUPPORT 224
|
||||
#undef TARGET_EAFNOSUPPORT
|
||||
#define TARGET_EAFNOSUPPORT 225
|
||||
#undef TARGET_EADDRINUSE
|
||||
#define TARGET_EADDRINUSE 226
|
||||
#undef TARGET_EADDRNOTAVAIL
|
||||
#define TARGET_EADDRNOTAVAIL 227
|
||||
#undef TARGET_ENETDOWN
|
||||
#define TARGET_ENETDOWN 228
|
||||
#undef TARGET_ENETUNREACH
|
||||
#define TARGET_ENETUNREACH 229
|
||||
#undef TARGET_ENETRESET
|
||||
#define TARGET_ENETRESET 230
|
||||
#undef TARGET_ECONNABORTED
|
||||
#define TARGET_ECONNABORTED 231
|
||||
#undef TARGET_ECONNRESET
|
||||
#define TARGET_ECONNRESET 232
|
||||
#undef TARGET_ENOBUFS
|
||||
#define TARGET_ENOBUFS 233
|
||||
#undef TARGET_EISCONN
|
||||
#define TARGET_EISCONN 234
|
||||
#undef TARGET_ENOTCONN
|
||||
#define TARGET_ENOTCONN 235
|
||||
#undef TARGET_ESHUTDOWN
|
||||
#define TARGET_ESHUTDOWN 236
|
||||
#undef TARGET_ETOOMANYREFS
|
||||
#define TARGET_ETOOMANYREFS 237
|
||||
#undef TARGET_ETIMEDOUT
|
||||
#define TARGET_ETIMEDOUT 238
|
||||
#undef TARGET_ECONNREFUSED
|
||||
#define TARGET_ECONNREFUSED 239
|
||||
#define TARGET_EREMOTERELEASE 240
|
||||
#undef TARGET_EHOSTDOWN
|
||||
#define TARGET_EHOSTDOWN 241
|
||||
#undef TARGET_EHOSTUNREACH
|
||||
#define TARGET_EHOSTUNREACH 242
|
||||
|
||||
#undef TARGET_EALREADY
|
||||
#define TARGET_EALREADY 244
|
||||
#undef TARGET_EINPROGRESS
|
||||
#define TARGET_EINPROGRESS 245
|
||||
#undef TARGET_ENOTEMPTY
|
||||
#define TARGET_ENOTEMPTY 247
|
||||
#undef TARGET_ENAMETOOLONG
|
||||
#define TARGET_ENAMETOOLONG 248
|
||||
#undef TARGET_ELOOP
|
||||
#define TARGET_ELOOP 249
|
||||
#undef TARGET_ENOSYS
|
||||
#define TARGET_ENOSYS 251
|
||||
|
||||
#undef TARGET_ECANCELED
|
||||
#define TARGET_ECANCELED 253
|
||||
|
||||
#undef TARGET_EOWNERDEAD
|
||||
#define TARGET_EOWNERDEAD 254
|
||||
#undef TARGET_ENOTRECOVERABLE
|
||||
#define TARGET_ENOTRECOVERABLE 255
|
||||
|
||||
#undef TARGET_ERFKILL
|
||||
#define TARGET_ERFKILL 256
|
||||
#undef TARGET_EHWPOISON
|
||||
#define TARGET_EHWPOISON 257
|
||||
|
||||
#endif /* HPPA_TARGET_SYSCALL_H */
|
||||
@@ -0,0 +1,219 @@
|
||||
/* from asm/termbits.h */
|
||||
|
||||
#define TARGET_NCCS 19
|
||||
|
||||
struct target_termios {
|
||||
unsigned int c_iflag; /* input mode flags */
|
||||
unsigned int c_oflag; /* output mode flags */
|
||||
unsigned int c_cflag; /* control mode flags */
|
||||
unsigned int c_lflag; /* local mode flags */
|
||||
unsigned char c_line; /* line discipline */
|
||||
unsigned char c_cc[TARGET_NCCS]; /* control characters */
|
||||
};
|
||||
|
||||
/* 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 0040000
|
||||
#define TARGET_IUTF8 0100000
|
||||
|
||||
/* 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 B19200
|
||||
#define TARGET_EXTB 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_B57600 0010001
|
||||
#define TARGET_B115200 0010002
|
||||
#define TARGET_B230400 0010003
|
||||
#define TARGET_B460800 0010004
|
||||
#define TARGET_CIBAUD 002003600000 /* input baud rate (not used) */
|
||||
#define TARGET_CMSPAR 010000000000 /* mark or space (stick) parity */
|
||||
#define TARGET_CRTSCTS 020000000000 /* flow control */
|
||||
|
||||
/* 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
|
||||
|
||||
/* 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
|
||||
|
||||
/* ioctls */
|
||||
|
||||
#define TARGET_TCGETS TARGET_IOR('T', 16, struct target_termios)
|
||||
#define TARGET_TCSETS TARGET_IOW('T', 17, struct target_termios)
|
||||
#define TARGET_TCSETSW TARGET_IOW('T', 18, struct target_termios)
|
||||
#define TARGET_TCSETSF TARGET_IOW('T', 19, struct target_termios)
|
||||
#define TARGET_TCGETA TARGET_IOR('T', 1, struct target_termios)
|
||||
#define TARGET_TCSETA TARGET_IOW('T', 2, struct target_termios)
|
||||
#define TARGET_TCSETAW TARGET_IOW('T', 3, struct target_termios)
|
||||
#define TARGET_TCSETAF TARGET_IOW('T', 4, struct target_termios)
|
||||
#define TARGET_TCSBRK TARGET_IO('T', 5)
|
||||
#define TARGET_TCXONC TARGET_IO('T', 6)
|
||||
#define TARGET_TCFLSH TARGET_IO('T', 7)
|
||||
|
||||
#define TARGET_TIOCEXCL 0x540C
|
||||
#define TARGET_TIOCNXCL 0x540D
|
||||
#define TARGET_TIOCSCTTY 0x540E
|
||||
#define TARGET_TIOCGPGRP TARGET_IOR('T', 30, int)
|
||||
#define TARGET_TIOCSPGRP TARGET_IOW('T', 29, int)
|
||||
#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 TARGET_IOR('T', 20, int)
|
||||
#define TARGET_TIOCGPTN TARGET_IOR('T', 0x30, unsigned int)
|
||||
/* Get Pty Number (of pty-mux device) */
|
||||
#define TARGET_TIOCSPTLCK TARGET_IOW('T', 0x31, int)
|
||||
/* Lock/unlock Pty */
|
||||
|
||||
#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 */
|
||||
|
||||
#define TARGET_TIOCMIWAIT 0x545C /* wait for a change on serial */
|
||||
#define TARGET_TIOCGICOUNT 0x545D
|
||||
#define TARGET_FIOQSIZE 0x5460
|
||||
#define TARGET_TIOCSTART 0x5461
|
||||
#define TARGET_TIOCSTOP 0x5462
|
||||
#define TARGET_TIOCSLTC 0x5462
|
||||
|
||||
/* 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_TIOCSER_TEMT 0x01 /* Transmitter physically empty */
|
||||
@@ -164,6 +164,9 @@
|
||||
IOCTL(SIOCSRARP, IOC_W, MK_PTR(MK_STRUCT(STRUCT_arpreq)))
|
||||
IOCTL(SIOCGRARP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_arpreq)))
|
||||
IOCTL(SIOCGIWNAME, IOC_W | IOC_R, MK_PTR(MK_STRUCT(STRUCT_char_ifreq)))
|
||||
IOCTL(SIOCGPGRP, IOC_R, MK_PTR(TYPE_INT)) /* pid_t */
|
||||
IOCTL(SIOCGSTAMP, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timeval)))
|
||||
IOCTL(SIOCGSTAMPNS, IOC_R, MK_PTR(MK_STRUCT(STRUCT_timespec)))
|
||||
|
||||
IOCTL(CDROMPAUSE, 0, TYPE_NULL)
|
||||
IOCTL(CDROMSTART, 0, TYPE_NULL)
|
||||
@@ -422,3 +425,8 @@
|
||||
MK_PTR(MK_STRUCT(STRUCT_rtentry)))
|
||||
IOCTL_SPECIAL(SIOCDELRT, IOC_W, do_ioctl_rt,
|
||||
MK_PTR(MK_STRUCT(STRUCT_rtentry)))
|
||||
|
||||
#ifdef TARGET_TIOCSTART
|
||||
IOCTL_IGNORE(TIOCSTART)
|
||||
IOCTL_IGNORE(TIOCSTOP)
|
||||
#endif
|
||||
|
||||
+179
-6
@@ -3512,6 +3512,169 @@ void cpu_loop(CPUTLGState *env)
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef TARGET_HPPA
|
||||
|
||||
static abi_ulong hppa_lws(CPUHPPAState *env)
|
||||
{
|
||||
uint32_t which = env->gr[20];
|
||||
abi_ulong addr = env->gr[26];
|
||||
abi_ulong old = env->gr[25];
|
||||
abi_ulong new = env->gr[24];
|
||||
abi_ulong size, ret;
|
||||
|
||||
switch (which) {
|
||||
default:
|
||||
return -TARGET_ENOSYS;
|
||||
|
||||
case 0: /* elf32 atomic 32bit cmpxchg */
|
||||
if ((addr & 3) || !access_ok(VERIFY_WRITE, addr, 4)) {
|
||||
return -TARGET_EFAULT;
|
||||
}
|
||||
old = tswap32(old);
|
||||
new = tswap32(new);
|
||||
ret = atomic_cmpxchg((uint32_t *)g2h(addr), old, new);
|
||||
ret = tswap32(ret);
|
||||
break;
|
||||
|
||||
case 2: /* elf32 atomic "new" cmpxchg */
|
||||
size = env->gr[23];
|
||||
if (size >= 4) {
|
||||
return -TARGET_ENOSYS;
|
||||
}
|
||||
if (((addr | old | new) & ((1 << size) - 1))
|
||||
|| !access_ok(VERIFY_WRITE, addr, 1 << size)
|
||||
|| !access_ok(VERIFY_READ, old, 1 << size)
|
||||
|| !access_ok(VERIFY_READ, new, 1 << size)) {
|
||||
return -TARGET_EFAULT;
|
||||
}
|
||||
/* Note that below we use host-endian loads so that the cmpxchg
|
||||
can be host-endian as well. */
|
||||
switch (size) {
|
||||
case 0:
|
||||
old = *(uint8_t *)g2h(old);
|
||||
new = *(uint8_t *)g2h(new);
|
||||
ret = atomic_cmpxchg((uint8_t *)g2h(addr), old, new);
|
||||
ret = ret != old;
|
||||
break;
|
||||
case 1:
|
||||
old = *(uint16_t *)g2h(old);
|
||||
new = *(uint16_t *)g2h(new);
|
||||
ret = atomic_cmpxchg((uint16_t *)g2h(addr), old, new);
|
||||
ret = ret != old;
|
||||
break;
|
||||
case 2:
|
||||
old = *(uint32_t *)g2h(old);
|
||||
new = *(uint32_t *)g2h(new);
|
||||
ret = atomic_cmpxchg((uint32_t *)g2h(addr), old, new);
|
||||
ret = ret != old;
|
||||
break;
|
||||
case 3:
|
||||
{
|
||||
uint64_t o64, n64, r64;
|
||||
o64 = *(uint64_t *)g2h(old);
|
||||
n64 = *(uint64_t *)g2h(new);
|
||||
#ifdef CONFIG_ATOMIC64
|
||||
r64 = atomic_cmpxchg__nocheck((uint64_t *)g2h(addr), o64, n64);
|
||||
ret = r64 != o64;
|
||||
#else
|
||||
start_exclusive();
|
||||
r64 = *(uint64_t *)g2h(addr);
|
||||
ret = 1;
|
||||
if (r64 == o64) {
|
||||
*(uint64_t *)g2h(addr) = n64;
|
||||
ret = 0;
|
||||
}
|
||||
end_exclusive();
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
env->gr[28] = ret;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void cpu_loop(CPUHPPAState *env)
|
||||
{
|
||||
CPUState *cs = CPU(hppa_env_get_cpu(env));
|
||||
target_siginfo_t info;
|
||||
abi_ulong ret;
|
||||
int trapnr;
|
||||
|
||||
while (1) {
|
||||
cpu_exec_start(cs);
|
||||
trapnr = cpu_exec(cs);
|
||||
cpu_exec_end(cs);
|
||||
process_queued_cpu_work(cs);
|
||||
|
||||
switch (trapnr) {
|
||||
case EXCP_SYSCALL:
|
||||
ret = do_syscall(env, env->gr[20],
|
||||
env->gr[26], env->gr[25],
|
||||
env->gr[24], env->gr[23],
|
||||
env->gr[22], env->gr[21], 0, 0);
|
||||
switch (ret) {
|
||||
default:
|
||||
env->gr[28] = ret;
|
||||
/* We arrived here by faking the gateway page. Return. */
|
||||
env->iaoq_f = env->gr[31];
|
||||
env->iaoq_b = env->gr[31] + 4;
|
||||
break;
|
||||
case -TARGET_ERESTARTSYS:
|
||||
case -TARGET_QEMU_ESIGRETURN:
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EXCP_SYSCALL_LWS:
|
||||
env->gr[21] = hppa_lws(env);
|
||||
/* We arrived here by faking the gateway page. Return. */
|
||||
env->iaoq_f = env->gr[31];
|
||||
env->iaoq_b = env->gr[31] + 4;
|
||||
break;
|
||||
case EXCP_SIGSEGV:
|
||||
info.si_signo = TARGET_SIGSEGV;
|
||||
info.si_errno = 0;
|
||||
info.si_code = TARGET_SEGV_ACCERR;
|
||||
info._sifields._sigfault._addr = env->ior;
|
||||
queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
|
||||
break;
|
||||
case EXCP_SIGILL:
|
||||
info.si_signo = TARGET_SIGILL;
|
||||
info.si_errno = 0;
|
||||
info.si_code = TARGET_ILL_ILLOPN;
|
||||
info._sifields._sigfault._addr = env->iaoq_f;
|
||||
queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
|
||||
break;
|
||||
case EXCP_SIGFPE:
|
||||
info.si_signo = TARGET_SIGFPE;
|
||||
info.si_errno = 0;
|
||||
info.si_code = 0;
|
||||
info._sifields._sigfault._addr = env->iaoq_f;
|
||||
queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
|
||||
break;
|
||||
case EXCP_DEBUG:
|
||||
trapnr = gdb_handlesig(cs, TARGET_SIGTRAP);
|
||||
if (trapnr) {
|
||||
info.si_signo = trapnr;
|
||||
info.si_errno = 0;
|
||||
info.si_code = TARGET_TRAP_BRKPT;
|
||||
queue_signal(env, trapnr, QEMU_SI_FAULT, &info);
|
||||
}
|
||||
break;
|
||||
case EXCP_INTERRUPT:
|
||||
/* just indicate that signals should be handled asap */
|
||||
break;
|
||||
default:
|
||||
g_assert_not_reached();
|
||||
}
|
||||
process_pending_signals(env);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* TARGET_HPPA */
|
||||
|
||||
THREAD CPUState *thread_cpu;
|
||||
|
||||
bool qemu_cpu_is_self(CPUState *cpu)
|
||||
@@ -4179,15 +4342,16 @@ int main(int argc, char **argv, char **envp)
|
||||
|
||||
qemu_log("start_brk 0x" TARGET_ABI_FMT_lx "\n", info->start_brk);
|
||||
qemu_log("end_code 0x" TARGET_ABI_FMT_lx "\n", info->end_code);
|
||||
qemu_log("start_code 0x" TARGET_ABI_FMT_lx "\n",
|
||||
info->start_code);
|
||||
qemu_log("start_data 0x" TARGET_ABI_FMT_lx "\n",
|
||||
info->start_data);
|
||||
qemu_log("start_code 0x" TARGET_ABI_FMT_lx "\n", info->start_code);
|
||||
qemu_log("start_data 0x" TARGET_ABI_FMT_lx "\n", info->start_data);
|
||||
qemu_log("end_data 0x" TARGET_ABI_FMT_lx "\n", info->end_data);
|
||||
qemu_log("start_stack 0x" TARGET_ABI_FMT_lx "\n",
|
||||
info->start_stack);
|
||||
qemu_log("start_stack 0x" TARGET_ABI_FMT_lx "\n", info->start_stack);
|
||||
qemu_log("brk 0x" TARGET_ABI_FMT_lx "\n", info->brk);
|
||||
qemu_log("entry 0x" TARGET_ABI_FMT_lx "\n", info->entry);
|
||||
qemu_log("argv_start 0x" TARGET_ABI_FMT_lx "\n", info->arg_start);
|
||||
qemu_log("env_start 0x" TARGET_ABI_FMT_lx "\n",
|
||||
info->arg_end + (abi_ulong)sizeof(abi_ulong));
|
||||
qemu_log("auxv_start 0x" TARGET_ABI_FMT_lx "\n", info->saved_auxv);
|
||||
}
|
||||
|
||||
target_set_brk(info->brk);
|
||||
@@ -4538,6 +4702,15 @@ int main(int argc, char **argv, char **envp)
|
||||
}
|
||||
env->pc = regs->pc;
|
||||
}
|
||||
#elif defined(TARGET_HPPA)
|
||||
{
|
||||
int i;
|
||||
for (i = 1; i < 32; i++) {
|
||||
env->gr[i] = regs->gr[i];
|
||||
}
|
||||
env->iaoq_f = regs->iaoq[0];
|
||||
env->iaoq_b = regs->iaoq[1];
|
||||
}
|
||||
#else
|
||||
#error unsupported target CPU
|
||||
#endif
|
||||
|
||||
@@ -221,6 +221,11 @@ struct target_pt_regs {
|
||||
#undef TARGET_ENOTRECOVERABLE
|
||||
#define TARGET_ENOTRECOVERABLE 166 /* State not recoverable */
|
||||
|
||||
#undef TARGET_ERFKILL
|
||||
#define TARGET_ERFKILL 167
|
||||
#undef TARGET_EHWPOISON
|
||||
#define TARGET_EHWPOISON 168
|
||||
|
||||
#undef TARGET_EDQUOT
|
||||
#define TARGET_EDQUOT 1133 /* Quota exceeded */
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user