> On Aug 10, 2021, at 9:18 AM, Richard Henderson <[email protected]> > wrote: > > On 8/7/21 11:42 AM, Warner Losh wrote: >> From: Warner Losh <[email protected]> >> 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 <[email protected]> >> Signed-off-by: Warner Losh <[email protected]> >> --- >> 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.
I too find it… tricky… Once we have it all integrated and upstream matches our
fork, I’d be happy to do some cleanup in this area if you have good suggestions.
>> +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.
Yea, these are wrong. they used to be a thing, but as you point out, __packed
doesn’t do what people think it does… I’ll remove.
Warner
signature.asc
Description: Message signed with OpenPGP
