On 8/7/21 11:42 AM, Warner Losh wrote:
From: Warner Losh <i...@freebsd.org>

Rewrite target definnitions to interface with the FreeBSD system calls.
This covers basic types (time_t, iovec, umtx_time, timespec, timeval,
rusage, rwusage) and basic defines (mmap, rusage). Also included are
FreeBSD version-specific variations.

Signed-off-by: Stacey Son <s...@freebsd.org>
Signed-off-by: Warner Losh <i...@bsdimp.com>
---
  bsd-user/bsd-mman.h     | 121 --------------------
  bsd-user/mmap.c         |   2 -
  bsd-user/syscall_defs.h | 247 ++++++++++++++++++++++++++--------------
  3 files changed, 162 insertions(+), 208 deletions(-)
  delete mode 100644 bsd-user/bsd-mman.h

Oof.  Well, I guess it's progress, but it's hard to read.

+struct target_freebsd_timeval {
+    target_freebsd_time_t       tv_sec; /* seconds */
+    target_freebsd_suseconds_t  tv_usec;/* and microseconds */
+#if !defined(TARGET_I386) && TARGET_ABI_BITS == 32
+    abi_long _pad;
+#endif
+} __packed;

I question the use of packed here. You do realize that removes all alignment requirements? This is probably not what you want. It's certainly not present in the real freebsd _timeval.h.

Similarly with _timespec.h.

r~

Reply via email to