aboutsummaryrefslogtreecommitdiff
path: root/bsd-user/qemu.h
diff options
context:
space:
mode:
authorRichard Henderson <richard.henderson@linaro.org>2021-10-18 12:17:24 -0700
committerRichard Henderson <richard.henderson@linaro.org>2021-10-18 12:17:24 -0700
commit362534a643b4a34bcb223996538ce9de5cdab946 (patch)
treee9b99724357be6d9fba14ac69f732a0eb2862a9f /bsd-user/qemu.h
parent9c050b661d3a43dfe2fd44106e559b39706d1296 (diff)
parent5abfac277d25feb5f12332422c03ea1cb21c6aa1 (diff)
Merge remote-tracking branch 'remotes/bsdimp/tags/pull-bsd-user-20211018-pull-request' into staging
bsd-user pull request: merge dependencies for next architectures Merge the dependencies for arm, aarch64, and riscv64 architectures. This joins together two patch series: [PATCH v2 00/15] bsd-user: misc cleanup for aarch64 import Prepare for aarch64 support (the next architecture to be upstreamed). As the aarch64 emulation is more complete, it relies on a number of different items. In some cases, I've pulled in the full support from bsd-user fork. In other cases I've created a simple stub (as is the case for signals, which have independent changes pending, so I wanted to be as minimal as possible. Since all pre-12.2 support was purged from the bsd-user fork, go ahead and remove it here. FreeBSD 11.x goes ouft of support at the end of the month. Remove what little multi-version support that's in upstream. and [PATCH v3 0/9] bsd-user mmap fixes This series synchronizes mmap.c with the bsd-user fork. This is a mix of old bug fixes pulled in from linux-user, as well as some newer fixes to adress bugs found in check-tcg and recent FreeBSD developments. There are also a couple of style commits. Updated to migrate debugging to qemu_log. as well as a couple of minor rebase tweaks. In addition, the next two architectures I plan on upstreaming (arm and riscv64) also have their prereqs satisfied with this request. v2: Remove accidental module regression in patch 7 and try again. # gpg: Signature made Mon 18 Oct 2021 12:00:28 PM PDT # gpg: using RSA key 2035F894B00AA3CF7CCDE1B76C1CD1287DB01100 # gpg: Good signature from "Warner Losh <wlosh@netflix.com>" [unknown] # gpg: aka "Warner Losh <imp@bsdimp.com>" [unknown] # gpg: aka "Warner Losh <imp@freebsd.org>" [unknown] # gpg: aka "Warner Losh <imp@village.org>" [unknown] # gpg: aka "Warner Losh <wlosh@bsdimp.com>" [unknown] # gpg: WARNING: This key is not certified with a trusted signature! # gpg: There is no indication that the signature belongs to the owner. # Primary key fingerprint: 2035 F894 B00A A3CF 7CCD E1B7 6C1C D128 7DB0 1100 * remotes/bsdimp/tags/pull-bsd-user-20211018-pull-request: (23 commits) bsd-user/signal: Create a dummy signal queueing function bsd-user: Rename sigqueue to qemu_sigqueue bsd-user/sysarch: Move to using do_freebsd_arch_sysarch interface bsd-user: Add stop_all_tasks bsd-user: Remove used from TaskState bsd-user/target_os_elf: If ELF_HWCAP2 is defined, publish it bsd-user/target_os_elf.h: Remove fallback ELF_HWCAP and reorder bsd-user: move TARGET_MC_GET_CLEAR_RET to target_os_signal.h bsd-user/errno_defs.h: Add internal error numbers bsd-user: export get_errno and is_error from syscall.c bsd-user: TARGET_RESET define is unused, remove it bsd-user/strace.list: Remove support for FreeBSD versions older than 12.0 bsd-user/target_os-user.h: Remove support for FreeBSD older than 12.0 meson: *-user: only descend into *-user when configured bsd-user/mmap.c: assert that target_mprotect cannot fail bsd-user/mmap.c: Implement MAP_EXCL, required by jemalloc in head bsd-user/mmap.c: Don't mmap fd == -1 independently from MAP_ANON flag bsd-user/mmap.c: Convert to qemu_log logging for mmap debugging bsd-user/mmap.c: mmap prefer MAP_ANON for BSD bsd-user/mmap.c: mmap return ENOMEM on overflow ... Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'bsd-user/qemu.h')
-rw-r--r--bsd-user/qemu.h25
1 files changed, 16 insertions, 9 deletions
diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
index 522d6c4031..1b3b974afe 100644
--- a/bsd-user/qemu.h
+++ b/bsd-user/qemu.h
@@ -17,7 +17,6 @@
#ifndef QEMU_H
#define QEMU_H
-
#include "qemu/osdep.h"
#include "cpu.h"
#include "qemu/units.h"
@@ -73,15 +72,15 @@ struct image_info {
#define MAX_SIGQUEUE_SIZE 1024
-struct sigqueue {
- struct sigqueue *next;
+struct qemu_sigqueue {
+ struct qemu_sigqueue *next;
+ target_siginfo_t info;
};
struct emulated_sigtable {
int pending; /* true if signal is pending */
- struct sigqueue *first;
- /* in order to always have memory for the first signal, we put it here */
- struct sigqueue info;
+ struct qemu_sigqueue *first;
+ struct qemu_sigqueue info; /* Put first signal info here */
};
/*
@@ -92,18 +91,18 @@ typedef struct TaskState {
struct TaskState *next;
struct bsd_binprm *bprm;
- int used; /* non zero if used */
struct image_info *info;
struct emulated_sigtable sigtab[TARGET_NSIG];
- struct sigqueue sigqueue_table[MAX_SIGQUEUE_SIZE]; /* siginfo queue */
- struct sigqueue *first_free; /* first free siginfo queue entry */
+ struct qemu_sigqueue sigqueue_table[MAX_SIGQUEUE_SIZE]; /* siginfo queue */
+ struct qemu_sigqueue *first_free; /* first free siginfo queue entry */
int signal_pending; /* non zero if a signal may be pending */
uint8_t stack[];
} __attribute__((aligned(16))) TaskState;
void init_task_state(TaskState *ts);
+void stop_all_tasks(void);
extern const char *qemu_uname_release;
/*
@@ -209,6 +208,7 @@ void process_pending_signals(CPUArchState *cpu_env);
void signal_init(void);
long do_sigreturn(CPUArchState *env);
long do_rt_sigreturn(CPUArchState *env);
+void queue_signal(CPUArchState *env, int sig, target_siginfo_t *info);
abi_long do_sigaltstack(abi_ulong uss_addr, abi_ulong uoss_addr, abi_ulong sp);
/* mmap.c */
@@ -235,6 +235,13 @@ extern unsigned long target_dflssiz;
extern unsigned long target_maxssiz;
extern unsigned long target_sgrowsiz;
+/* syscall.c */
+abi_long get_errno(abi_long ret);
+bool is_error(abi_long ret);
+
+/* os-sys.c */
+abi_long do_freebsd_sysarch(void *cpu_env, abi_long arg1, abi_long arg2);
+
/* user access */
#define VERIFY_READ PAGE_READ