Skip to contentSkip to conversation

FreeBSD-user: breakout the BSDs

PATCH Superseded Sean Bruno 3 participants 23 messages Jun 6, 2014 – Jun 8, 2014 Kbuild

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Sean Bruno

author
#0 lore raw

v3 cover FreeBSD-user: breakout the BSDs

v3:
Fixup subject strings for easier reading (Eric Blake)

v2:
At the advice of Peter Maydell, break out these patches to inplement new syscalls into substantially smaller, bite sized chunks for review. These patches are based off a tree that Peter has kindly setup at:
git://git.linaro.org/people/peter.maydell/qemu-arm.git bsd-user.next

I've made clear breaks in what is cleanup and what is new functionality in this changeset.

My changes are directly taken from Stacey Son's work on the bsd-user fork of the FreeBSD port of emulators/qemu-devel. My patches are a refactor of his code contained in the commit entititled:
bsd-user: move strace OS/arch dependent code to host/arch dirs

Sean Bruno (8):
No functional changes. GPL v2 attribution update. Cleanup some while
space and style fixes. Move struct syscallname into qemu.h
Add print_sysctl() to out table of syscalls that are supported. Add print_ioctl() to out table of syscalls that are supported. Add print_sysarch() to out table of syscalls that are supported and
support them on all architectures for freebsd. netbsd and openbsd are not implemented but stubbed out.
Add __acl_* to the table of syscalls that are supported on FreeBSD Add extattr_* to the table of syscalls that are supported on FreeBSD Add thr_* to the table of syscalls that are supported on FreeBSD Fix socket, fstat, fstatfs, chown syscalls. Add support for missing
syscalls to the table on FreeBSD

Stacey Son (1):
bsd-user: add HOST_VARIANT_DIR for various *BSD dependent code

 Makefile.target                        |   3 +-
 bsd-user/arm/syscall.h                 |  36 +++++++
 bsd-user/arm/syscall.h.orig            |   0
 bsd-user/arm/target_arch_sysarch.h     |  78 +++++++++++++++
 bsd-user/freebsd/os-strace.h           |  29 ++++++
 bsd-user/freebsd/strace.list           |  77 +++++++++++++--
 bsd-user/i386/syscall.h                |  23 +++++
 bsd-user/i386/target_arch_sysarch.h    |  78 +++++++++++++++
 bsd-user/mips/syscall.h                |  52 ++++++++++
 bsd-user/mips/syscall.h.orig           |   0
 bsd-user/mips/target_arch_sysarch.h    |  69 +++++++++++++
 bsd-user/mips64/syscall.h              |  53 ++++++++++
 bsd-user/mips64/syscall.h.orig         |   0
 bsd-user/mips64/target_arch_sysarch.h  |  69 +++++++++++++
 bsd-user/netbsd/os-strace.h            |   1 +
 bsd-user/openbsd/os-strace.h           |   1 +
 bsd-user/qemu.h                        |  26 +++++
 bsd-user/sparc/syscall.h               |  29 +++++-
 bsd-user/sparc/target_arch_sysarch.h   |  52 ++++++++++
 bsd-user/sparc64/syscall.h             |  28 +++++-
 bsd-user/sparc64/target_arch_sysarch.h |  52 ++++++++++
 bsd-user/strace.c                      | 175 ++++++++++++++++++++++-----------
 bsd-user/x86_64/syscall.h              |  26 ++++-
 bsd-user/x86_64/target_arch_sysarch.h  |  76 ++++++++++++++
 configure                              |  11 +++
 25 files changed, 975 insertions(+), 69 deletions(-)
 create mode 100644 bsd-user/arm/syscall.h
 create mode 100644 bsd-user/arm/syscall.h.orig
 create mode 100644 bsd-user/arm/target_arch_sysarch.h
 create mode 100644 bsd-user/freebsd/os-strace.h
 create mode 100644 bsd-user/i386/target_arch_sysarch.h
 create mode 100644 bsd-user/mips/syscall.h
 create mode 100644 bsd-user/mips/syscall.h.orig
 create mode 100644 bsd-user/mips/target_arch_sysarch.h
 create mode 100644 bsd-user/mips64/syscall.h
 create mode 100644 bsd-user/mips64/syscall.h.orig
 create mode 100644 bsd-user/mips64/target_arch_sysarch.h
 create mode 100644 bsd-user/netbsd/os-strace.h
 create mode 100644 bsd-user/openbsd/os-strace.h
 create mode 100644 bsd-user/sparc/target_arch_sysarch.h
 create mode 100644 bsd-user/sparc64/target_arch_sysarch.h
 create mode 100644 bsd-user/x86_64/target_arch_sysarch.h
Signature · 1 line
1.9.3
author
#1 lore raw

PATCH v3 1/9 FreeBSD-user: add HOST_VARIANT_DIR for various *BSD dependent code

From: Stacey Son <[email protected]>

This change adds HOST_VARIANT_DIR so the various BSD OS dependent code can be seperated into its own directories rather than
using #ifdef's. This may also allow an BSD variant OS to host
another BSD variant's executible as a target.

---
 Makefile.target |  3 ++-
 configure       | 11 +++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)
Makefile.target +2 -1
index 9986047..60c1ca6 100644
@@ -102,7 +102,8 @@ endif #CONFIG_LINUX_USER
 
 ifdef CONFIG_BSD_USER
 
-QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ABI_DIR)
+QEMU_CFLAGS+=-I$(SRC_PATH)/bsd-user -I$(SRC_PATH)/bsd-user/$(TARGET_ABI_DIR) \
+			 -I$(SRC_PATH)/bsd-user/$(HOST_VARIANT_DIR)
 
 obj-y += bsd-user/
 obj-y += gdbstub.o user-exec.o
configure +11 -0
index 0e516f9..3db9726 100755
@@ -537,6 +537,9 @@ fi
 
 # OS specific
 
+# host *BSD for user mode
+HOST_VARIANT_DIR=""
+
 case $targetos in
 CYGWIN*)
   mingw32="yes"
@@ -562,12 +565,14 @@ FreeBSD)
   # needed for kinfo_getvmmap(3) in libutil.h
   LIBS="-lutil $LIBS"
   netmap=""  # enable netmap autodetect
+  HOST_VARIANT_DIR="freebsd"
 ;;
 DragonFly)
   bsd="yes"
   make="${MAKE-gmake}"
   audio_drv_list="oss"
   audio_possible_drivers="oss sdl esd pa"
+  HOST_VARIANT_DIR="dragonfly"
 ;;
 NetBSD)
   bsd="yes"
@@ -575,12 +580,14 @@ NetBSD)
   audio_drv_list="oss"
   audio_possible_drivers="oss sdl esd"
   oss_lib="-lossaudio"
+  HOST_VARIANT_DIR="netbsd"
 ;;
 OpenBSD)
   bsd="yes"
   make="${MAKE-gmake}"
   audio_drv_list="sdl"
   audio_possible_drivers="sdl esd"
+  HOST_VARIANT_DIR="openbsd"
 ;;
 Darwin)
   bsd="yes"
@@ -598,6 +605,7 @@ Darwin)
   # Disable attempts to use ObjectiveC features in os/object.h since they
   # won't work when we're compiling with gcc as a C compiler.
   QEMU_CFLAGS="-DOS_OBJECT_USE_OBJC=0 $QEMU_CFLAGS"
+  HOST_VARIANT_DIR="darwin"
 ;;
 SunOS)
   solaris="yes"
@@ -4982,6 +4990,9 @@ if [ "$TARGET_ABI_DIR" = "" ]; then
   TARGET_ABI_DIR=$TARGET_ARCH
 fi
 echo "TARGET_ABI_DIR=$TARGET_ABI_DIR" >> $config_target_mak
+if [ "$HOST_VARIANT_DIR" != "" ]; then
+    echo "HOST_VARIANT_DIR=$HOST_VARIANT_DIR" >> $config_target_mak
+fi
 case "$target_name" in
   i386|x86_64)
     if test "$xen" = "yes" -a "$target_softmmu" = "yes" ; then
Signature · 1 line
1.9.3
Reviewed-by on v3 1/9
#2 lore raw

Re: [Qemu-devel] [PATCH 1/9 v3] FreeBSD-user: add HOST_VARIANT_DIR for various *BSD dependent code

Quoted 4 lines · Sean Bruno

From: Stacey Son <[email protected]>

This change adds HOST_VARIANT_DIR so the various BSD OS dependent code can be seperated into its own directories rather than

"separated"

Quoted 2 lines

using #ifdef's. This may also allow an BSD variant OS to host
another BSD variant's executible as a target.

"executable"

Otherwise

(Incidentally, if I say "otherwise reviewed-by" I mean "please fix the minor things I list, and then you can add my reviewed-by:
line to the patch when you post the next version of the series".)

thanks
-- PMM

author
#3 lore raw

PATCH v3 2/9 FreeBSD-user: GPL v2 update and sylte/whitespace

In reply to Sean Bruno

Cleanup some while space and style fixes. Move struct syscallname into qemu.h

---
 bsd-user/qemu.h   |  26 +++++++++++
 bsd-user/strace.c | 126 +++++++++++++++++++++++++++++-------------------------
 2 files changed, 94 insertions(+), 58 deletions(-)
bsd-user/qemu.h +26 -0
index ddc74ed..b8a34c7 100644
@@ -1,3 +1,19 @@
+/*
+ *  qemu bsd user mode definition
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
 #ifndef QEMU_H
 #define QEMU_H
 
@@ -149,6 +165,16 @@ void fork_end(int child);
 #include "qemu/log.h"
 
 /* strace.c */
+struct syscallname {
+    int nr;
+    const char *name;
+    const char *format;
+    void (*call)(const struct syscallname *,
+                 abi_long, abi_long, abi_long,
+                 abi_long, abi_long, abi_long);
+    void (*result)(const struct syscallname *, abi_long);
+};
+
 void
 print_freebsd_syscall(int num,
                       abi_long arg1, abi_long arg2, abi_long arg3,
bsd-user/strace.c +68 -58

231 lines not on this page · raw message

Signature · 1 line
1.9.3
Reviewed-by on v3 2/9
#4 lore raw

Re: [Qemu-devel] [PATCH 2/9 v3] FreeBSD-user: GPL v2 update and sylte/whitespace

Quoted 1 line · Sean Bruno

Cleanup some while space and style fixes. Move struct syscallname into

"whitespace"

Quoted 1 line

qemu.h

In the subject, "style".

Otherwise

-- PMM

author
#5 lore raw

PATCH v3 3/9 FreeBSD-user: Implement print_sysctl() syscall

In reply to Sean Bruno
---
 bsd-user/freebsd/strace.list | 21 +++++++++++++++++++--
 bsd-user/strace.c            | 22 ++++++++++++++++++++++
 2 files changed, 41 insertions(+), 2 deletions(-)
bsd-user/freebsd/strace.list +19 -2
index 1edf412..3235f16 100644
@@ -1,7 +1,24 @@
-{ TARGET_FREEBSD_NR___getcwd, "__getcwd", NULL, NULL, NULL },
+/*
+ *  FreeBSD strace list
+ *
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
 { TARGET_FREEBSD_NR___semctl, "__semctl", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR___syscall, "__syscall", NULL, NULL, NULL },
-{ TARGET_FREEBSD_NR___sysctl, "__sysctl", NULL, NULL, NULL },
+{ TARGET_FREEBSD_NR___sysctl, "__sysctl", NULL, print_sysctl, NULL },
 { TARGET_FREEBSD_NR_accept, "accept", "%s(%d,%#x,%#x)", NULL, NULL },
 { TARGET_FREEBSD_NR_access, "access", "%s(\"%s\",%#o)", NULL, NULL },
 { TARGET_FREEBSD_NR_acct, "acct", NULL, NULL, NULL },
bsd-user/strace.c +22 -0
index 47e5e76..b2633d0 100644
@@ -33,6 +33,28 @@ int do_strace;
  * Utility functions
  */
 
+static void print_sysctl(const struct syscallname *name, abi_long arg1,
+        abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5,
+        abi_long arg6)
+{
+    uint32_t i;
+    int32_t *namep;
+
+    gemu_log("%s({ ", name->name);
+    namep = lock_user(VERIFY_READ, arg1, sizeof(int32_t) * arg2, 1);
+    if (namep) {
+        int32_t *p = namep;
+
+        for (i = 0; i < (uint32_t)arg2; i++) {
+            gemu_log("%d ", tswap32(*p++));
+        }
+        unlock_user(namep, arg1, 0);
+    }
+    gemu_log("}, %u, 0x" TARGET_ABI_FMT_lx ", 0x" TARGET_ABI_FMT_lx ", 0x"
+        TARGET_ABI_FMT_lx ", 0x" TARGET_ABI_FMT_lx ")",
+        (uint32_t)arg2, arg3, arg4, arg5, arg6);
+}
+
 static void print_execve(const struct syscallname *name, abi_long arg1,
         abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5,
         abi_long arg6)
Signature · 1 line
1.9.3
Reviewed-by on v3 3/9
#6 lore raw

Re: [Qemu-devel] [PATCH 3/9 v3] FreeBSD-user: Implement print_sysctl() syscall

On 6 June 2014 14:49, Sean Bruno <[email protected]> wrote:

Your commit message is inaccurate -- this patch isn't implementing a syscall, it's just adding support to QEMU's strace code for it. Something like
"bsd-user: Implement strace support for 'syscall' syscall"

would be better.

If you fix that, then

(I notice you haven't put in a Copyright: line when you added the file header, but I'm a bit unconvinced that they're really useful for anything so I think that's ok.)

thanks
-- PMM

author
#7 lore raw

PATCH v3 4/9 FreeBSD-user: Implement print_ioctl() syscall

In reply to Sean Bruno
---
 bsd-user/freebsd/strace.list |  2 +-
 bsd-user/strace.c            | 19 +++++++++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)
bsd-user/freebsd/strace.list +1 -1
index 3235f16..718357b 100644
@@ -80,7 +80,7 @@
 { TARGET_FREEBSD_NR_getsockopt, "getsockopt", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_gettimeofday, "gettimeofday", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_getuid, "getuid", "%s()", NULL, NULL },
-{ TARGET_FREEBSD_NR_ioctl, "ioctl", NULL, NULL, NULL },
+{ TARGET_FREEBSD_NR_ioctl, "ioctl", NULL, print_ioctl, NULL },
 { TARGET_FREEBSD_NR_issetugid, "issetugid", "%s()", NULL, NULL },
 { TARGET_FREEBSD_NR_kevent, "kevent", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_kill, "kill", NULL, NULL, NULL },
bsd-user/strace.c +19 -0
index b2633d0..e33dd4d 100644
@@ -89,6 +89,25 @@ static void print_execve(const struct syscallname *name, abi_long arg1,
     gemu_log("NULL})");
 }
 
+static void print_ioctl(const struct syscallname *name,
+        abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4,
+        abi_long arg5, abi_long arg6)
+{
+    /* Decode the ioctl request */
+    gemu_log("%s(%d, 0x%0lx { IO%s%s GRP:0x%x('%c') CMD:%d LEN:%d }, 0x"
+            TARGET_ABI_FMT_lx ", ...)",
+            name->name,
+            (int)arg1,
+            (unsigned long)arg2,
+            arg2 & IOC_OUT ? "R" : "",
+            arg2 & IOC_IN ? "W" : "",
+            (unsigned)IOCGROUP(arg2),
+            isprint(IOCGROUP(arg2)) ? (char)IOCGROUP(arg2) : '?',
+            (int)arg2 & 0xFF,
+            (int)IOCPARM_LEN(arg2),
+            arg3);
+}
+
 /*
  * Variants for the return value output function
  */
Signature · 1 line
1.9.3
author
#9 lore raw

PATCH v3 5/9 FreeBSD-user: Implement print_sysarch() syscall

In reply to Sean Bruno

Add strace support for print_sysarch for all architectures for freebsd. NetBSD and OpenBSD are not implemented but stubbed out.

---
 bsd-user/arm/syscall.h                 | 36 ++++++++++++++++
 bsd-user/arm/syscall.h.orig            |  0
 bsd-user/arm/target_arch_sysarch.h     | 78 ++++++++++++++++++++++++++++++++++
 bsd-user/freebsd/os-strace.h           | 29 +++++++++++++
 bsd-user/freebsd/strace.list           |  2 +-
 bsd-user/i386/syscall.h                | 23 ++++++++++
 bsd-user/i386/target_arch_sysarch.h    | 78 ++++++++++++++++++++++++++++++++++
 bsd-user/mips/syscall.h                | 52 +++++++++++++++++++++++
 bsd-user/mips/syscall.h.orig           |  0
 bsd-user/mips/target_arch_sysarch.h    | 69 ++++++++++++++++++++++++++++++
 bsd-user/mips64/syscall.h              | 53 +++++++++++++++++++++++
 bsd-user/mips64/syscall.h.orig         |  0
 bsd-user/mips64/target_arch_sysarch.h  | 69 ++++++++++++++++++++++++++++++
 bsd-user/netbsd/os-strace.h            |  1 +
 bsd-user/openbsd/os-strace.h           |  1 +
 bsd-user/sparc/syscall.h               | 29 ++++++++++++-
 bsd-user/sparc/target_arch_sysarch.h   | 52 +++++++++++++++++++++++
 bsd-user/sparc64/syscall.h             | 28 +++++++++++-
 bsd-user/sparc64/target_arch_sysarch.h | 52 +++++++++++++++++++++++
 bsd-user/strace.c                      | 10 +++++
 bsd-user/x86_64/syscall.h              | 26 +++++++++++-
 bsd-user/x86_64/target_arch_sysarch.h  | 76 +++++++++++++++++++++++++++++++++
 22 files changed, 760 insertions(+), 4 deletions(-)
 create mode 100644 bsd-user/arm/syscall.h
 create mode 100644 bsd-user/arm/syscall.h.orig
 create mode 100644 bsd-user/arm/target_arch_sysarch.h
 create mode 100644 bsd-user/freebsd/os-strace.h
 create mode 100644 bsd-user/i386/target_arch_sysarch.h
 create mode 100644 bsd-user/mips/syscall.h
 create mode 100644 bsd-user/mips/syscall.h.orig
 create mode 100644 bsd-user/mips/target_arch_sysarch.h
 create mode 100644 bsd-user/mips64/syscall.h
 create mode 100644 bsd-user/mips64/syscall.h.orig
 create mode 100644 bsd-user/mips64/target_arch_sysarch.h
 create mode 100644 bsd-user/netbsd/os-strace.h
 create mode 100644 bsd-user/openbsd/os-strace.h
 create mode 100644 bsd-user/sparc/target_arch_sysarch.h
 create mode 100644 bsd-user/sparc64/target_arch_sysarch.h
 create mode 100644 bsd-user/x86_64/target_arch_sysarch.h
bsd-user/arm/syscall.h new file +36 -0
new file mode 100644
index 0000000..bc3d6e6
@@ -0,0 +1,36 @@
+#ifndef __ARCH_SYSCALL_H_
+#define __ARCH_SYSCALL_H_
+
+struct target_pt_regs {
+    abi_long uregs[17];
+};
+
+#define ARM_cpsr    uregs[16]
+#define ARM_pc      uregs[15]
+#define ARM_lr      uregs[14]
+#define ARM_sp      uregs[13]
+#define ARM_ip      uregs[12]
+#define ARM_fp      uregs[11]
+#define ARM_r10     uregs[10]
+#define ARM_r9      uregs[9]
+#define ARM_r8      uregs[8]
+#define ARM_r7      uregs[7]
+#define ARM_r6      uregs[6]
+#define ARM_r5      uregs[5]
+#define ARM_r4      uregs[4]
+#define ARM_r3      uregs[3]
+#define ARM_r2      uregs[2]
+#define ARM_r1      uregs[1]
+#define ARM_r0      uregs[0]
+
+#define ARM_SYSCALL_BASE    0 /* XXX: FreeBSD only */
+
+#define TARGET_FREEBSD_ARM_SYNC_ICACHE      0
+#define TARGET_FREEBSD_ARM_DRAIN_WRITEBUF   1
+#define TARGET_FREEBSD_ARM_SET_TP       2
+#define TARGET_FREEBSD_ARM_GET_TP       3
+
+#define TARGET_HW_MACHINE       "arm"
+#define TARGET_HW_MACHINE_ARCH  "armv6"
+
+#endif /* !__ARCH_SYSCALL_H_ */
bsd-user/arm/syscall.h.orig new file +0 -0
new file mode 100644
index 0000000..e69de29
bsd-user/arm/target_arch_sysarch.h new file +78 -0

78 lines not on this page · raw message

bsd-user/freebsd/os-strace.h new file +29 -0
new file mode 100644
index 0000000..a222f09
@@ -0,0 +1,29 @@
+/*
+ *  FreeBSD dependent strace print functions
+ *
+ *  Copyright (c) 2013 Stacey D. Son
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "target_arch_sysarch.h"    /* architecture dependent functions */
+
+
+static inline void do_os_print_sysarch(const struct syscallname *name,
+        abi_long arg1, abi_long arg2, abi_long arg3, abi_long arg4,
+        abi_long arg5, abi_long arg6)
+{
+    /* This is arch dependent */
+    do_freebsd_arch_print_sysarch(name, arg1, arg2, arg3, arg4, arg5, arg6);
+}
bsd-user/freebsd/strace.list +1 -1
index 718357b..32b3c55 100644
@@ -175,7 +175,7 @@
 { TARGET_FREEBSD_NR_statfs, "statfs", "%s(\"%s\",%p)", NULL, NULL },
 { TARGET_FREEBSD_NR_symlink, "symlink", "%s(\"%s\",\"%s\")", NULL, NULL },
 { TARGET_FREEBSD_NR_sync, "sync", NULL, NULL, NULL },
-{ TARGET_FREEBSD_NR_sysarch, "sysarch", NULL, NULL, NULL },
+{ TARGET_FREEBSD_NR_sysarch, "sysarch", NULL, print_sysarch, NULL },
 { TARGET_FREEBSD_NR_syscall, "syscall", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_truncate, "truncate", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_umask, "umask", "%s(%#o)", NULL, NULL },
bsd-user/i386/syscall.h +23 -0
index 9b34c61..52de302 100644
@@ -1,3 +1,23 @@
+/*
+ *  i386 system call definitions
+ *
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef _I386_SYSCALL_H_
+#define _I386_SYSCALL_H_
+
 /* default linux values for the selectors */
 #define __USER_CS	(0x23)
 #define __USER_DS	(0x2B)
@@ -158,4 +178,7 @@ struct target_vm86plus_struct {
 
 
 #define UNAME_MACHINE "i386"
+#define TARGET_HW_MACHINE UNAME_MACHINE
+#define TARGET_HW_MACHINE_ARCH UNAME_MACHINE
 
+#endif /* ! _I386_SYSCALL_H_ */
bsd-user/i386/target_arch_sysarch.h new file +78 -0

78 lines not on this page · raw message

bsd-user/mips/syscall.h new file +52 -0

52 lines not on this page · raw message

bsd-user/mips/syscall.h.orig new file +0 -0
new file mode 100644
index 0000000..e69de29
bsd-user/mips/target_arch_sysarch.h new file +69 -0

69 lines not on this page · raw message

bsd-user/mips64/syscall.h new file +53 -0

53 lines not on this page · raw message

bsd-user/mips64/syscall.h.orig new file +0 -0
new file mode 100644
index 0000000..e69de29
bsd-user/mips64/target_arch_sysarch.h new file +69 -0

69 lines not on this page · raw message

bsd-user/netbsd/os-strace.h new file +1 -0
new file mode 100644
index 0000000..70cf51d
@@ -0,0 +1 @@
+/* XXX NetBSD dependent strace print functions */
bsd-user/openbsd/os-strace.h new file +1 -0
new file mode 100644
index 0000000..9161390
@@ -0,0 +1 @@
+/* XXX OpenBSD dependent strace print functions */
bsd-user/sparc/syscall.h +28 -1
index 5a9bb7e..3a5b1e2 100644
@@ -1,3 +1,23 @@
+/*
+ *  sparc dependent system call definitions
+ *
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef _SPARC_SYSCALL_H_
+#define _SPARC_SYSCALL_H_
+
 struct target_pt_regs {
 	abi_ulong psr;
 	abi_ulong pc;
@@ -6,4 +26,11 @@ struct target_pt_regs {
 	abi_ulong u_regs[16];
 };
 
-#define UNAME_MACHINE "sun4"
+#define UNAME_MACHINE           "sun4"
+#define TARGET_HW_MACHINE       "sparc"
+#define TARGET_HW_MACHINE_ARCH  "sparc"
+
+#define TARGET_SPARC_UTRAP_INSTALL      1
+#define TARGET_SPARC_SIGTRAMP_INSTALL   2
+
+#endif /* ! _SPARC_SYSCALL_H_ */
bsd-user/sparc/target_arch_sysarch.h new file +52 -0

52 lines not on this page · raw message

bsd-user/sparc64/syscall.h +27 -1
index 81a816d..58cc38d 100644
@@ -1,3 +1,22 @@
+/*
+ *  sparc64 dependent system call definitions
+ *
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef _SPARC64_SYSCALL_H_
+#define _SPARC64_SYSCALL_H_
 struct target_pt_regs {
 	abi_ulong u_regs[16];
 	abi_ulong tstate;
@@ -7,4 +26,11 @@ struct target_pt_regs {
 	abi_ulong fprs;
 };
 
-#define UNAME_MACHINE "sun4u"
+#define UNAME_MACHINE           "sun4u"
+#define TARGET_HW_MACHINE       "sparc"
+#define TARGET_HW_MACHINE_ARCH  "sparc64"
+
+#define TARGET_SPARC_UTRAP_INSTALL      1
+#define TARGET_SPARC_SIGTRAMP_INSTALL   2
+
+#endif /* !_SPARC64_SYSCALL_H_ */
bsd-user/sparc64/target_arch_sysarch.h new file +52 -0

52 lines not on this page · raw message

bsd-user/strace.c +10 -0
index e33dd4d..60aabc3 100644
@@ -27,6 +27,8 @@
 
 #include "qemu.h"
 
+#include "os-strace.h"  /* OS dependent strace print functions */
+
 int do_strace;
 
 /*
@@ -108,6 +110,14 @@ static void print_ioctl(const struct syscallname *name,
             arg3);
 }
 
+static void print_sysarch(const struct syscallname *name, abi_long arg1,
+        abi_long arg2, abi_long arg3, abi_long arg4, abi_long arg5,
+        abi_long arg6)
+{
+    /* This is os dependent. */
+    do_os_print_sysarch(name, arg1, arg2, arg3, arg4, arg5, arg6);
+}
+
 /*
  * Variants for the return value output function
  */
bsd-user/x86_64/syscall.h +25 -1
index 630514a..4fff6a5 100644
@@ -1,3 +1,23 @@
+/*
+ *  x86_64 system call definitions
+ *
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program 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 General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program; if not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef _X86_64_SYSCALL_H_
+#define _X86_64_SYSCALL_H_
+
 #define __USER_CS	(0x33)
 #define __USER_DS	(0x2B)
 
@@ -108,9 +128,13 @@ struct target_msqid64_ds {
 #define TARGET_FREEBSD_AMD64_SET_GSBASE	131
 
 
-#define UNAME_MACHINE "x86_64"
+#define UNAME_MACHINE           "x86_64"
+#define TARGET_HW_MACHINE       "amd64"
+#define TARGET_HW_MACHINE_ARCH  "amd64"
 
 #define TARGET_ARCH_SET_GS 0x1001
 #define TARGET_ARCH_SET_FS 0x1002
 #define TARGET_ARCH_GET_FS 0x1003
 #define TARGET_ARCH_GET_GS 0x1004
+
+#endif /* ! _X86_64_SYSCALL_H_ */
bsd-user/x86_64/target_arch_sysarch.h new file +76 -0

76 lines not on this page · raw message

Signature · 1 line
1.9.3
#10 lore raw

Re: [Qemu-devel] [PATCH 5/9 v3] FreeBSD-user: Implement print_sysarch() syscall

Quoted 2 lines · Sean Bruno

Add strace support for print_sysarch for all architectures for freebsd. NetBSD and OpenBSD are not implemented but stubbed out.

In this case you really are implementing a new syscall ("sysarch") and the commit message says it's just strace support!

Quoted 3 lines
 bsd-user/arm/syscall.h                 | 36 ++++++++++++++++
 bsd-user/arm/syscall.h.orig            |  0
 bsd-user/arm/target_arch_sysarch.h     | 78 ++++++++++++++++++++++++++++++++++

Leave the parts of this that are for architectures we don't have in mainline out for now -- they should be added with the later patchseries which adds support for those archs.

Quoted 1 line
 create mode 100644 bsd-user/arm/syscall.h.orig

This looks like it's accidentally slipped into your git repo following a merge conflict. There were another couple of .orig files in the list too.

It's often a good idea to eyeball the diffstat before sending a patch.

bsd-user/i386/syscall.h struct target_vm86plus_struct { · line 182

Quoted 2 lines
bsd-user/i386/syscall.h +2 -0
+#define TARGET_HW_MACHINE UNAME_MACHINE
+#define TARGET_HW_MACHINE_ARCH UNAME_MACHINE

These look like they ought to be in a different patch.

thanks
-- PMM

author
#11 lore raw

PATCH v3 6/9 FreeBSD-user: Add __acl_* to the table of syscalls

In reply to Sean Bruno
---
 bsd-user/freebsd/strace.list | 12 ++++++++++++
 1 file changed, 12 insertions(+)
bsd-user/freebsd/strace.list +12 -0
index 32b3c55..b09b130 100644
@@ -16,6 +16,18 @@
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+{ TARGET_FREEBSD_NR___acl_aclcheck_fd, "__acl_get_fd", "%s(%d, %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_aclcheck_file, "__acl_get_file", "%s(\"%s\", %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_aclcheck_link, "__acl_get_link", "%s(\"%s\", %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_delete_fd, "__acl_delete_fd", "%s(%d, %d)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_delete_file, "__acl_delete_file", "%s(\"%s\", %d)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_delete_link, "__acl_delete_link", "%s(\"%s\", %d)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_get_fd, "__acl_get_fd", "%s(\"%s\", %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_get_file, "__acl_get_file", "%s(\"%s\", %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_get_link, "__acl_get_link", "%s(\"%s\", %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_set_fd, "__acl_get_fd", "%s(\"%s\", %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_set_file, "__acl_get_file", "%s(\"%s\", %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_set_link, "__acl_get_link", "%s(\"%s\", %d, %#x)", NULL, NULL },
 { TARGET_FREEBSD_NR___semctl, "__semctl", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR___syscall, "__syscall", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR___sysctl, "__sysctl", NULL, print_sysctl, NULL },
Signature · 1 line
1.9.3
#12 lore raw

Re: [Qemu-devel] [PATCH 6/9 v3] FreeBSD-user: Add __acl_* to the table of syscalls

Quoted 1 line · Sean Bruno

Commit message needs tweaking to be clearer that we're only adding strace support for syscalls here, not implementing new syscalls.

Quoted 9 lines
---
 bsd-user/freebsd/strace.list | 12 ++++++++++++
 1 file changed, 12 insertions(+)
bsd-user/freebsd/strace.list +0 -0
index 32b3c55..b09b130 100644

bsd-user/freebsd/strace.list line 21

Quoted 6 lines
bsd-user/freebsd/strace.list +3 -0
@@ -16,6 +16,18 @@
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+{ TARGET_FREEBSD_NR___acl_aclcheck_fd, "__acl_get_fd", "%s(%d, %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_aclcheck_file, "__acl_get_file", "%s(\"%s\", %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_aclcheck_link, "__acl_get_link", "%s(\"%s\", %d, %#x)", NULL, NULL },

Printed strings don't match syscall names -- cut and paste error? (You should probably also check the parameter format strings are correct, since the names are wrong.)

bsd-user/freebsd/strace.list line 30

Quoted 9 lines
bsd-user/freebsd/strace.list +9 -0
+{ TARGET_FREEBSD_NR___acl_delete_fd, "__acl_delete_fd", "%s(%d, %d)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_delete_file, "__acl_delete_file", "%s(\"%s\", %d)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_delete_link, "__acl_delete_link", "%s(\"%s\", %d)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_get_fd, "__acl_get_fd", "%s(\"%s\", %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_get_file, "__acl_get_file", "%s(\"%s\", %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_get_link, "__acl_get_link", "%s(\"%s\", %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_set_fd, "__acl_get_fd", "%s(\"%s\", %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_set_file, "__acl_get_file", "%s(\"%s\", %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_set_link, "__acl_get_link", "%s(\"%s\", %d, %#x)", NULL, NULL },

More cut-n-paste errors I think.

thanks
-- PMM

#13 lore raw

Re: [Qemu-devel] [PATCH 6/9 v3] FreeBSD-user: Add __acl_* to the table of syscalls

Quoted 19 lines · Peter Maydell
Quoted 1 line · Sean Bruno

Commit message needs tweaking to be clearer that we're only adding strace support for syscalls here, not implementing new syscalls.

Quoted 12 lines
---
 bsd-user/freebsd/strace.list | 12 ++++++++++++
 1 file changed, 12 insertions(+)
bsd-user/freebsd/strace.list +0 -0
index 32b3c55..b09b130 100644
@@ -16,6 +16,18 @@
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
Quoted 7 lines

bsd-user/freebsd/strace.list line 21

Quoted 3 lines
bsd-user/freebsd/strace.list +3 -0
+{ TARGET_FREEBSD_NR___acl_aclcheck_fd, "__acl_get_fd", "%s(%d, %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_aclcheck_file, "__acl_get_file", "%s(\"%s\", %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_aclcheck_link, "__acl_get_link", "%s(\"%s\", %d, %#x)", NULL, NULL },

Printed strings don't match syscall names -- cut and paste error? (You should probably also check the parameter format strings are correct, since the names are wrong.)

Indeed, this is totally a bug/typo in the code. Will fix.

Quoted 13 lines

bsd-user/freebsd/strace.list line 30

Quoted 10 lines
bsd-user/freebsd/strace.list +9 -0
+{ TARGET_FREEBSD_NR___acl_delete_fd, "__acl_delete_fd", "%s(%d, %d)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_delete_file, "__acl_delete_file", "%s(\"%s\", %d)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_delete_link, "__acl_delete_link", "%s(\"%s\", %d)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_get_fd, "__acl_get_fd", "%s(\"%s\", %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_get_file, "__acl_get_file", "%s(\"%s\", %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_get_link, "__acl_get_link", "%s(\"%s\", %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_set_fd, "__acl_get_fd", "%s(\"%s\", %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_set_file, "__acl_get_file", "%s(\"%s\", %d, %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR___acl_set_link, "__acl_get_link", "%s(\"%s\", %d, %#x)", NULL, NULL },

More cut-n-paste errors I think.

Quoted 2 lines

thanks
-- PMM

Same here, I'll need to retest and resubmit this one for sure.

sean

author
#14 lore raw

PATCH v3 7/9 FreeBSD-user: Add extattr_* to the table of syscalls

In reply to Sean Bruno
---
 bsd-user/freebsd/strace.list | 13 +++++++++++++
 1 file changed, 13 insertions(+)
bsd-user/freebsd/strace.list +13 -0
index b09b130..ab52ca8 100644
@@ -51,6 +51,19 @@
 { TARGET_FREEBSD_NR_dup2, "dup2", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_execve, "execve", NULL, print_execve, NULL },
 { TARGET_FREEBSD_NR_exit, "exit", "%s(%d)\n", NULL, NULL },
+{ TARGET_FREEBSD_NR_extattrctl, "extattrctl", "%s(\"%s\", %d, \"%s\", %d, \"%s\"", NULL, NULL },
+{ TARGET_FREEBSD_NR_extattr_delete_fd, "extattr_delete_fd", "%s(%d, %d, \"%s\")", NULL, NULL },
+{ TARGET_FREEBSD_NR_extattr_delete_file, "extattr_delete_file", "%s(\"%s\", %d, \"%s\")", NULL, NULL },
+{ TARGET_FREEBSD_NR_extattr_delete_link, "extattr_delete_link", "%s(\"%s\", %d, \"%s\")", NULL, NULL },
+{ TARGET_FREEBSD_NR_extattr_get_fd, "extattr_get_fd", "%s(%d, %d, \"%s\", %#x, %d)", NULL, NULL },
+{ TARGET_FREEBSD_NR_extattr_get_file, "extattr_get_file", "%s(\"%s\", %d, \"%s\", %#x, %d)", NULL, NULL },
+{ TARGET_FREEBSD_NR_extattr_get_file, "extattr_get_link", "%s(\"%s\", %d, \"%s\", %#x, %d)", NULL, NULL },
+{ TARGET_FREEBSD_NR_extattr_list_fd, "extattr_list_fd", "%s(%d, %d, %#x, %d)", NULL, NULL },
+{ TARGET_FREEBSD_NR_extattr_list_file, "extattr_list_file", "%s(\"%s\", %#x, %d)", NULL, NULL },
+{ TARGET_FREEBSD_NR_extattr_list_link, "extattr_list_link", "%s(\"%s\", %d, %#x, %d)", NULL, NULL },
+{ TARGET_FREEBSD_NR_extattr_set_fd, "extattr_set_fd", "%s(%d, %d, \"%s\", %#x, %d)", NULL, NULL },
+{ TARGET_FREEBSD_NR_extattr_set_file, "extattr_set_file", "%s(\"%s\", %d, \"%s\", %#x, %d)", NULL, NULL },
+{ TARGET_FREEBSD_NR_extattr_set_link, "extattr_set_link", "%s(\"%s\", %d, \"%s\", %#x, %d)", NULL, NULL },
 { TARGET_FREEBSD_NR_fchdir, "fchdir", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_fchflags, "fchflags", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_fchmod, "fchmod", "%s(%d,%#o)", NULL, NULL },
Signature · 1 line
1.9.3
#16 lore raw

Re: [Qemu-devel] [PATCH 7/9 v3] FreeBSD-user: Add extattr_* to the table of syscalls

Quoted 11 lines · Peter Maydell
Quoted 1 line · Sean Bruno

Commit message, strace not new implementations, etc etc.

Otherwise

thanks
-- PMM

I'm not tagging this patch with your Reviewed-by as I've modified the code in my v4 patchset after review.

sean

author
#17 lore raw

PATCH v3 8/9 FreeBSD-user: Add thr_* to the table of syscalls

In reply to Sean Bruno
---
 bsd-user/freebsd/strace.list | 9 +++++++++
 1 file changed, 9 insertions(+)
bsd-user/freebsd/strace.list +9 -0
index ab52ca8..b2a159e 100644
@@ -202,6 +202,15 @@
 { TARGET_FREEBSD_NR_sync, "sync", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_sysarch, "sysarch", NULL, print_sysarch, NULL },
 { TARGET_FREEBSD_NR_syscall, "syscall", NULL, NULL, NULL },
+{ TARGET_FREEBSD_NR_thr_create, "thr_create", NULL, NULL, NULL },
+{ TARGET_FREEBSD_NR_thr_exit, "thr_exit", NULL, NULL, NULL },
+{ TARGET_FREEBSD_NR_thr_kill, "thr_kill", NULL, NULL, NULL },
+{ TARGET_FREEBSD_NR_thr_kill2, "thr_kill2", NULL, NULL, NULL },
+{ TARGET_FREEBSD_NR_thr_new, "thr_new", NULL, NULL, NULL },
+{ TARGET_FREEBSD_NR_thr_self, "thr_self", NULL, NULL, NULL },
+{ TARGET_FREEBSD_NR_thr_set_name, "thr_set_name", NULL, NULL, NULL },
+{ TARGET_FREEBSD_NR_thr_suspend, "thr_suspend", NULL, NULL, NULL },
+{ TARGET_FREEBSD_NR_thr_wake, "thr_wake", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_truncate, "truncate", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_umask, "umask", "%s(%#o)", NULL, NULL },
 { TARGET_FREEBSD_NR_unlink, "unlink", "%s(\"%s\")", NULL, NULL },
Signature · 1 line
1.9.3
#19 lore raw

Re: [Qemu-devel] [PATCH 8/9 v3] FreeBSD-user: Add thr_* to the table of syscalls

Quoted 8 lines · Peter Maydell
Quoted 1 line · Sean Bruno

Other than the standard gripe about the commit message,

thanks
-- PMM

I'm not tagging this patch with your Reviewed-by as I've modified the code in my v4 patchset after review.

sean

author
#20 lore raw

PATCH v3 9/9 FreeBSD-user: Add support for missing syscalls

In reply to Sean Bruno

Fix syscall format for socket, fstat, fstatfs and chown.

Add additional syscalls that are missing.

---
 bsd-user/freebsd/strace.list | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)
bsd-user/freebsd/strace.list +14 -4
index b2a159e..61d11ca 100644
@@ -31,6 +31,7 @@
 { TARGET_FREEBSD_NR___semctl, "__semctl", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR___syscall, "__syscall", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR___sysctl, "__sysctl", NULL, print_sysctl, NULL },
+{ TARGET_FREEBSD_NR__umtx_op, "_umtx_op", "%s(%#x, %d, %d, %#x, %#x)", NULL, NULL },
 { TARGET_FREEBSD_NR_accept, "accept", "%s(%d,%#x,%#x)", NULL, NULL },
 { TARGET_FREEBSD_NR_access, "access", "%s(\"%s\",%#o)", NULL, NULL },
 { TARGET_FREEBSD_NR_acct, "acct", NULL, NULL, NULL },
@@ -49,6 +50,7 @@
 { TARGET_FREEBSD_NR_connect, "connect", "%s(%d,%#x,%d)", NULL, NULL },
 { TARGET_FREEBSD_NR_dup, "dup", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_dup2, "dup2", NULL, NULL, NULL },
+{ TARGET_FREEBSD_NR_eaccess, "eaccess", "%s(%s,%#x)", NULL, NULL },
 { TARGET_FREEBSD_NR_execve, "execve", NULL, print_execve, NULL },
 { TARGET_FREEBSD_NR_exit, "exit", "%s(%d)\n", NULL, NULL },
 { TARGET_FREEBSD_NR_extattrctl, "extattrctl", "%s(\"%s\", %d, \"%s\", %d, \"%s\"", NULL, NULL },
@@ -67,19 +69,22 @@
 { TARGET_FREEBSD_NR_fchdir, "fchdir", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_fchflags, "fchflags", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_fchmod, "fchmod", "%s(%d,%#o)", NULL, NULL },
-{ TARGET_FREEBSD_NR_fchown, "fchown", "%s(\"%s\",%d,%d)", NULL, NULL },
+{ TARGET_FREEBSD_NR_fchown, "fchown", "%s(%d,%d,%d)", NULL, NULL },
 { TARGET_FREEBSD_NR_fcntl, "fcntl", NULL, NULL, NULL },
+{ TARGET_FREEBSD_NR_fexecve, "fexecve", NULL, print_execve, NULL },
 { TARGET_FREEBSD_NR_fhopen, "fhopen", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_fhstat, "fhstat", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_fhstatfs, "fhstatfs", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_flock, "flock", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_fork, "fork", "%s()", NULL, NULL },
 { TARGET_FREEBSD_NR_fpathconf, "fpathconf", NULL, NULL, NULL },
-{ TARGET_FREEBSD_NR_fstat, "fstat", "%s(%d,%p)", NULL, NULL },
-{ TARGET_FREEBSD_NR_fstatfs, "fstatfs", "%s(%d,%p)", NULL, NULL },
+{ TARGET_FREEBSD_NR_fstat, "fstat", "%s(%d,%#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR_fstatat, "fstatat", "%s(%d,\"%s\", %#x)", NULL, NULL },
+{ TARGET_FREEBSD_NR_fstatfs, "fstatfs", "%s(%d,%#x)", NULL, NULL },
 { TARGET_FREEBSD_NR_fsync, "fsync", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_ftruncate, "ftruncate", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_futimes, "futimes", NULL, NULL, NULL },
+{ TARGET_FREEBSD_NR_getcontext, "getcontext", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_getdirentries, "getdirentries", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_freebsd6_mmap, "freebsd6_mmap", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_getegid, "getegid", "%s()", NULL, NULL },
@@ -114,6 +119,7 @@
 { TARGET_FREEBSD_NR_lchown, "lchown", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_link, "link", "%s(\"%s\",\"%s\")", NULL, NULL },
 { TARGET_FREEBSD_NR_listen, "listen", NULL, NULL, NULL },
+{ TARGET_FREEBSD_NR_lpathconf, "lpathconf", "%s(\"%s\", %d)", NULL, NULL },
 { TARGET_FREEBSD_NR_lseek, "lseek", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_lstat, "lstat", "%s(\"%s\",%p)", NULL, NULL },
 { TARGET_FREEBSD_NR_madvise, "madvise", NULL, NULL, NULL },
@@ -138,7 +144,9 @@
 { TARGET_FREEBSD_NR_nanosleep, "nanosleep", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_nfssvc, "nfssvc", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_open, "open", "%s(\"%s\",%#x,%#o)", NULL, NULL },
+{ TARGET_FREEBSD_NR_openat, "openat", "%s(%d, \"%s\",%#x,%#o)", NULL, NULL },
 { TARGET_FREEBSD_NR_pathconf, "pathconf", NULL, NULL, NULL },
+{ TARGET_FREEBSD_NR_pathconf, "pathconf", "%s(\"%s\", %d)", NULL, NULL },
 { TARGET_FREEBSD_NR_pipe, "pipe", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_poll, "poll", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_pread, "pread", NULL, NULL, NULL },
@@ -158,6 +166,7 @@
 { TARGET_FREEBSD_NR_revoke, "revoke", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_rfork, "rfork", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_rmdir, "rmdir", NULL, NULL, NULL },
+{ TARGET_FREEBSD_NR_rtprio_thread, "rtprio_thread", "%s(%d, %d, %p)", NULL, NULL },
 { TARGET_FREEBSD_NR_sbrk, "sbrk", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_sched_yield, "sched_yield", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_select, "select", NULL, NULL, NULL },
@@ -165,6 +174,7 @@
 { TARGET_FREEBSD_NR_semop, "semop", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_sendmsg, "sendmsg", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_sendto, "sendto", NULL, NULL, NULL },
+{ TARGET_FREEBSD_NR_setcontext, "setcontext", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_setegid, "setegid", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_seteuid, "seteuid", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_setgid, "setgid", NULL, NULL, NULL },
@@ -193,7 +203,7 @@
 { TARGET_FREEBSD_NR_sigprocmask, "sigprocmask", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_sigreturn, "sigreturn", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_sigsuspend, "sigsuspend", NULL, NULL, NULL },
-{ TARGET_FREEBSD_NR_socket, "socket", NULL, NULL, NULL },
+{ TARGET_FREEBSD_NR_socket, "socket", "%s(%d,%d,%d)", NULL, NULL },
 { TARGET_FREEBSD_NR_socketpair, "socketpair", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_sstk, "sstk", NULL, NULL, NULL },
 { TARGET_FREEBSD_NR_stat, "stat", "%s(\"%s\",%p)", NULL, NULL },
Signature · 1 line
1.9.3
Reviewed-by on v3 9/9
#21 lore raw

Re: [Qemu-devel] [PATCH 9/9 v3] FreeBSD-user: Add support for missing syscalls

Quoted 3 lines · Sean Bruno

Fix syscall format for socket, fstat, fstatfs and chown.

Add additional syscalls that are missing.

These aren't completely missing syscalls; please update the commit message.

Otherwise

thanks
-- PMM

#22 lore raw

Re: [Qemu-devel] [PATCH 9/9 v3] FreeBSD-user: Add support for missing syscalls

Quoted 5 lines · Peter Maydell
Quoted 3 lines · Sean Bruno

Fix syscall format for socket, fstat, fstatfs and chown.

Add additional syscalls that are missing.

Quoted 8 lines

These aren't completely missing syscalls; please update the commit message.

Otherwise

thanks
-- PMM

I'm not tagging this patch with your Reviewed-by as I've modified the code in my v4 patchset after review.

sean