summaryrefslogtreecommitdiff
path: root/sys/compat/netbsd32
AgeCommit message (Collapse)Author
2023-02-12s/strucure/structure/ and s/structues/structures/ in comments.andvar
2022-12-19Create compat_100 module infrastructure now that we have branchedpgoyette
for NetBSD-10
2022-10-26sys: Put externs for time_adjtime and time_adjusted in .h files.riastradh
time_adjtime: sys/timex.h (defined in ntp code) time_adjusted: sys/timevar.h (defined in non-ntp code) (Not really sure this is a valuable distinction to maintain; there's non-ntp code that uses time_adjtime too.)
2022-05-24s/build-in/built-in/ in comments.andvar
2022-04-23Implement support for mounting UDF in compat32reinoud
Fixes PR#56801
2021-12-22Handle the SIOCGNBRINFO ioctl for compat32.roy
arp -a works with compat32 now. Credit to simonb@ for the ndp fix from which this is cribbed.
2021-12-11remove clause 3 from all my licenses that aren't conflicting withmrg
another copyright claim line. again. (i did this in 2008 and then did not update all of my personal templates.)
2021-12-05s/sytle/style/ in comment.msaitoh
2021-11-26Fix anonymous memory object leak for sigcode.ryo
- Repeating "modload compat_linux && /emul/linux/bin/ls && modunload compat_linux" will reproduce this problem. - It cause in exec_sigcode_map(), anon-object for sigcode was created at first exec, but it remained even after exec_remove. - Fixed that the anon-object for sigcode is created at exec_add(), and the anon-object reference is removed at exec_remove(). - sigobject_lock is no longer needed since it is locked by exec_lock. - The compat_16 module rewrites the e_sigcode entry in emul_netbsd directly and does not use exec_add()/exec_remove(), so it needs to call sigcode_alloc()/sigcode_free() on its own.
2021-11-11Adapt to recent posix_spawn extensions.martin
2021-11-06COMPAT_NETBSD32 is all about running the 32-bit flavor of nativethorpej
binaries on a 64-bit platform[*], as such: - Make the logic about which "sendsig" flavor to call MI (as it is in the native 64-bit environment) and follow the same rules as the native 32-bit environment. - Make COMPAT_NETBSD32 x COMPAT_16 work the same as it would in the native 32-bit environment by providing a netbsd32_sendsig_sigcontext_16_hook, rather than overriding the entire sendsig logic with a netbsd32_sendsig_hook. - In netbsd32___sigaction_sigtramp(), make sure the compat_netbsd32_16 module is loaded if the trampoline version specifies a sigcontext style handler, otherwise return EINVAL so that libc can try again with siginfo style. [*] ...except for arm32, which uses it to mean "run 32-bit OABI binaries from the 32-bit EABI environment". Doing it this way was arguably a mistake, but we are stuck with it for now, so support it by providing a machine- dependent override for netbsd32_sendsig() that also disables the corresponding logic in netbsd32___sigaction_sigtramp(). Fixes PR kern/56487.
2021-11-01Use "stack_t" instead of "struct sigaltstack", as the former is thethorpej
newer standardized name. NFC.
2021-09-20Regen for eventfd(2).thorpej
2021-09-20Add the eventfd(2) system call to COMPAT_NETBSD32.thorpej
2021-09-20Regen for timerfd.thorpej
2021-09-20Add timerfd system calls to COMPAT_NETBSD32.thorpej
2021-09-11sys/kern: Allow custom fileops to specify fo_seek method.riastradh
Previously only vnodes allowed lseek/pread[v]/pwrite[v], which meant converting a regular device to a cloning device doesn't always work. Semantics is: (*fp->f_ops->fo_seek)(fp, delta, whence, newoffp, flags) 1. Compute a new offset according to whence + delta -- that is, if whence is SEEK_CUR, add delta to fp->f_offset; if whence is SEEK_END, add delta to end of file; if whence is SEEK_CUR, use delta as is. 2. If newoffp is nonnull, return the new offset in *newoffp. 3. If flags & FOF_UPDATE_OFFSET, set fp->f_offset to the new offset. Access to fp->f_offset, and *newoffp if newoffp = &fp->f_offset, must happen under the object lock (e.g., vnode lock), in order to synchronize fp->f_offset reads and writes. This change has the side effect that every call to VOP_SEEK happens under the vnode lock now, when previously it didn't. However, from a review of all the VOP_SEEK implementations, it does not appear that any file system even examines the vnode, let alone locks it. So I think this is safe -- and essentially the only reasonable way to do things, given that it is used to validate a change from oldoff to newoff, and oldoff becomes stale the moment we unlock the vnode. No kernel bump because this reuses a spare entry in struct fileops, and it is safe for the entry to be null, so all existing fileops will continue to work as before (rejecting seek).
2021-09-07sys/compat: Memset zero before copyout.riastradh
Just in case of uninitialized padding which would lead to kernel stack disclosure. If the compiler can prove the memset redundant then it can optimize it away; otherwise better safe than sorry.
2021-08-30compat_netbsd32: Copy out 32-bit version in nfssvc32_nsd_out.riastradh
2021-04-25All mips64 has compat_netbsd32christos
2021-04-17Compile in compat32 syscall names all the time, as we do for nativesimonb
syscall names. Needed for dtrace.
2021-04-14Add DIOCGDISKINFO compat.mlelstv
2021-04-14regenchristos
2021-04-13regenchristos
2021-04-13GCC 10 does not like casting from one identical anonymous enummrg
to another enum. supply some quietening cast.
2021-02-18In the compat setitimer(2) calls, don't validate which timer is beingsimonb
used since dosetitimer() does this anyway. The compat functions hadn't been updated since ITIMER_MONOTONIC was introduced, so they reported that that ITIMER_MONOTONIC timer was invalid.
2021-02-16In netbsd32___mount50() zero out the native fs_args union before use sosimonb
we don't pass stack garbage to the lower layers in the MNT_GETARGS case. Fixes random errors like "Bad address" from "mount -vv" with nfs mounts.
2021-01-19Fix syntax errorwiz
2021-01-19The read/write/send/recv system calls return ssize_t because -1 issimonb
returned on error. Therefore we must restrict the lengths of any buffers to NETBSD32_SSIZE_MAX with compat32 to avoid garbage return values. Fixes ATF lib/libc/sys/t_write:write_err.
2021-01-19KNF consistency: No parentheses are needed around the return value.simonb
2021-01-19Whitespace nits.simonb
2021-01-19Also print mmap return value and error code #ifdef DEBUG_MMAP.simonb
2021-01-18s/u_intN_t/uintN_t/simonb
2021-01-17Handle the SIOCGNBRINFO_IN6 ioctl for compat32. ndp -a works withsimonb
compat32 now.
2021-01-15Remove unused LIMITCHECK() macro (now contained in netbsd32_rlimit.c).simonb
2021-01-14Remove some blank lines to group the VND and FSS ioctls together.simonb
2021-01-14Handle the KFILTER_BYFILTER and KFILTER_BYNAME ioctls for compat32.simonb
Passes "atf kernel/kqueue/t_ioctl".
2021-01-14Handle FSSIOCSET and FSSIOCGET; vndconfig(8) works with compat32 now.simonb
XXX: FSSIOCSET50 and FSSIOCGET50 are not (yet) handled.
2021-01-14Handle rev 1.62 of kern/sys_lwp.csimonb
make _lwp_park return the remaining time to sleep in the "ts" argument if it is a relative timestamp, as discussed in tech-kern. for compat32. Thanks skrll@ for some cleanup tips.
2021-01-14Use netbsd32_* types instead of relying on __packed in the vnd ioctlsimonb
structures. __packed didn't work on archs where 64-bit types were 64-bit aligned with a 32-bit ABI (eg MIPS n32). OK mrg@
2020-11-08Fix typo; s/__LP64/_LP64/rin
2020-11-04Use opt_execfmt.h to get build options.pgoyette
Only include elf32 hooks if we have elf32 defined and elf32 is not the "native" emulation. This allows for having compat_netbsd32 without elf32 (although it's probably not too useful), and also enables arm's old-ABI usage of compat_netbsd32.
2020-11-01Separate the compat_netbsd32_coredump from the compat_netbsd32 andpgoyette
coredump modules, into its own module. Welcome to 7.99.75 !!!
2020-10-15wait4(2): make error paths match with that of native wait4(2):rin
https://nxr.netbsd.org/xref/src/sys/kern/kern_exit.c#720
2020-10-10regen for getrandom(2)rin
2020-10-10Teach about getrandom(2) to COMPAT_NETBSD32.rin
2020-09-07remove __packed from struct netbsd32_lsdisable. the structuremrg
is already properly aligned (the embedded int64 already has align(4) marker applied where needed.) same size structure generated.
2020-09-05Round of uvm.h cleanup.riastradh
The poorly named uvm.h is generally supposed to be for uvm-internal users only. - Narrow it to files that actually need it -- mostly files that need to query whether curlwp is the pagedaemon, which should maybe be exposed by an external header. - Use uvm_extern.h where feasible and uvm_*.h for things not exposed by it. We should split up uvm_extern.h but this will serve for now to reduce the uvm.h dependencies. - Use uvm_stat.h and #ifdef UVMHIST uvm.h for files that use UVMHIST(ubchist), since ubchist is declared in uvm.h but the reference evaporates if UVMHIST is not defined, so we reduce header file dependencies. - Make uvm_device.h and uvm_swap.h independently includable while here. ok chs@
2020-08-08PR/55547: Dan Plassche: Fix BSD/OS binary emulation.christos
Centralize lcall sniffer and recognize the BSD/OS flavor.
2020-07-21Add lockstat(1) ioctl handling.simonb
mrg@: "looks ok."