Commit Graph

440 Commits

Author SHA1 Message Date
dholland
c76c804434 Regen after -r1.82 of compat_sunos syscalls.master last September.
(Apparently forgotten.)

"Treat valsize as unsigned"
2020-06-11 03:47:05 +00:00
pgoyette
8a031a1d1e Rather than keeping a separate mutex, condvar, and pserialize for each
module hook, we can share a common set of synchronization structures.
This cuts the amount of cacheline_aligned data for these structures by
50%.

Note that we still have a per-hook localcount, since we need to count
individual references.

As discussed with riastradh@

Welcome to 9.99.22 !
2019-12-12 02:15:42 +00:00
christos
e4c1bc56d0 use strlcpy() for the uts conversion, makes the code simpler and more readable. 2019-10-26 11:34:48 +00:00
mrg
35c06cd861 replace memcpy() with src bounds overflow with single char write. 2019-10-04 12:24:12 +00:00
christos
b62989c976 make this compile again. 2019-09-23 21:07:50 +00:00
christos
1950b329f4 Treat valsize as unsigned 2019-09-23 20:42:29 +00:00
christos
4640ae90fa Add missing break 2019-09-23 20:38:27 +00:00
dholland
51c5c5e8ad Stack buffers mustn't escape their scope. PR 54326 from David Binderman 2019-07-03 18:24:50 +00:00
msaitoh
e19818fbdb KNF. No functional change. 2019-04-23 07:45:06 +00:00
pgoyette
8c2f80f160 Rename the MODULE_*_HOOK() macros to MODULE_HOOK_*() as briefly
discussed on irc.

NFCI intended.

Ride the earlier kernel bump - it;s getting crowded.
2019-03-01 11:06:55 +00:00
mrg
db4c90ad36 compat_sunos depends upon compat_09. fixes:
[   1.8785495] WARNING: module error: built-in module compat_sunos can't find builtin dependency `compat_09'
[   1.8785495] WARNING: module error: built-in module compat_sunos prerequisite compat_09 failed, error 2
2019-02-12 07:16:55 +00:00
pgoyette
ffe8188160 The sunos and sunos32 modules require compat_09, not compat (the
latter no longer exists).

Should fix "missing prerequisite" errors seen during qemu boot
of sparc64's MODULAR kernel.
2019-02-05 00:32:18 +00:00
pgoyette
d91f98a871 Merge the [pgoyette-compat] branch 2019-01-27 02:08:33 +00:00
maxv
43c9320743 Remove compat_svr4 and compat_svr4_32, as discussed on tech-kern@ recently,
but also as discussed several times in the past.
2018-12-19 13:57:44 +00:00
riastradh
d1579b2d70 Rename min/max -> uimin/uimax for better honesty.
These functions are defined on unsigned int.  The generic name
min/max should not silently truncate to 32 bits on 64-bit systems.
This is purely a name change -- no functional change intended.

HOWEVER!  Some subsystems have

	#define min(a, b)	((a) < (b) ? (a) : (b))
	#define max(a, b)	((a) > (b) ? (a) : (b))

even though our standard name for that is MIN/MAX.  Although these
may invite multiple evaluation bugs, these do _not_ cause integer
truncation.

To avoid `fixing' these cases, I first changed the name in libkern,
and then compile-tested every file where min/max occurred in order to
confirm that it failed -- and thus confirm that nothing shadowed
min/max -- before changing it.

I have left a handful of bootloaders that are too annoying to
compile-test, and some dead code:

cobalt ews4800mips hp300 hppa ia64 luna68k vax
acorn32/if_ie.c (not included in any kernels)
macppc/if_gm.c (superseded by gem(4))

It should be easy to fix the fallout once identified -- this way of
doing things fails safe, and the goal here, after all, is to _avoid_
silent integer truncations, not introduce them.

Maybe one day we can reintroduce min/max as type-generic things that
never silently truncate.  But we should avoid doing that for a while,
so that existing code has a chance to be detected by the compiler for
conversion to uimin/uimax without changing the semantics until we can
properly audit it all.  (Who knows, maybe in some cases integer
truncation is actually intended!)
2018-09-03 16:29:22 +00:00
pgoyette
fb243de875 Regen 2018-08-10 21:47:14 +00:00
pgoyette
3cd7406ad8 Allow syscall_establish() to install new syscalls when the existing
entry-point is either sys_nomodule or sys_nosys.  Update the
makesyscalls.sh script to create a const array of bits to allow
syscall_disestablish() to properly restore the original entry-point.
Update all the initializers of struct emul to initialize the pointer
to the bit array struct emul.

XXX Regen of all files created by makesyscalls.sh will come soon,
XXX followed by a kernel version bump (since struct emul is being
XXX modified).

This commit should address PR kern/45781 and also removes the need
for the work-around for that PR in file

	sys/arch/usermode/modules/syscallemu/syscallemu.c
2018-08-10 21:44:58 +00:00
kamil
2f1d1558aa Remove an element from struct emul: e_tracesig
e_tracesig used to be implemented for Darwin compat. Nowadays the Darwin
compatiblity layer is gone and there are no other users.

This functionality isn't used where it shall be used in the existing
codebase.

If we want to emulate debugging interfaces in compat layers we would need
to implement that from scratch anyway. We would need to be bug compatible
with other OSes too.

Proposed on tech-kern@.

Welcome to NetBSD 8.99.16!

Sponsored by <The NetBSD Foundation>
2018-05-06 13:40:50 +00:00
maya
45b55008a4 remove struct emul's e_fault.
It used to be used by COMPAT_IRIX for the purpose of overriding
uvm_fault (only implemented in MIPS), now removed.

Ride 8.99.12 version bump.
2018-01-09 20:55:42 +00:00
kamil
f98f70a745 Revert vadvise(2) removal
This system call was used in legacy Lisp code, that was inherited to modern
age and still compiled against supported compat layers (e.g. in clisp,
oaklisp, Franz Lisp).

It used to instruct the kernel about paging policy (G/C aware, flush etc).

Newly compiled code (assuming that it will detect vadvise()) will use the
libc stub for vadvise(). The headers for this interface are gone.

vadvise(2) could be marked as COMPAT_80, but as long as we support ultrix,
sunos or aout68k ABI, don't bother with this.

Requested by <mrg>
2018-01-06 16:41:23 +00:00
kamil
7c821851a7 compat/sunos: Drop SYS_vadvise
The (o)vadvise syscall is dummy since the beginning of NetBSD.

Sponsored by <The NetBSD Foundation>
2017-12-19 19:19:16 +00:00
kamil
93b13730c3 compat/sunos: Drop SYS_sbrk
sbrk - change data segment size

This syscall is dummy since the inception of the project.

Sponsored by <The NetBSD Foundation>
2017-12-19 18:24:21 +00:00
kamil
688d12a3d7 compat sunos: Drop the sstk(2) syscall
sstk(2) has never been implemented by the NetBSD kernel.

Sponsored by <The NetBSD Foundation>
2017-12-19 08:25:37 +00:00
riastradh
39f1e86852 Fail, don't panic, on bad dirents from file system.
Controllable via puffs from userland.

From Ilja Van Sprundel.
2017-07-28 15:34:06 +00:00
riastradh
9c32900485 regen 2017-05-10 06:19:47 +00:00
christos
410aba1317 regen 2017-01-16 17:43:04 +00:00
christos
d8dfcd6c2a regen 2017-01-13 06:18:31 +00:00
maxv
5107c4e24d Uninitialized var, found by mootja; not tested, but obvious enough 2016-10-08 15:48:07 +00:00
nakayama
a5e9d486c8 Redo previous. zero check before modulo. 2015-12-12 17:48:18 +00:00
mlelstv
8470efeba1 d_secpercyl is gone and we use the value from disklabel anyway. 2015-12-11 08:19:07 +00:00
mlelstv
05c35a4ea2 PR 50518 bad switch 2015-12-11 08:10:28 +00:00
christos
8d10f96266 Replace DIOCGPART -> DIOCGPARTINFO which returns the data needed instead of
pointers.
2015-12-08 20:36:14 +00:00
maxv
ea498aca7e Change do_sys_mount() so that it only takes as argument the type of the
drive instead of its associated vfsops. Makes it more friendly, and allows
compat binaries to autoload VFS modules if needed.

sent on tech-kern@, ok christos@
2015-10-23 19:40:10 +00:00
maxv
6ad8aacf8e Make sure we have space for the aout header. 2015-10-18 16:59:19 +00:00
christos
ec9d924643 rename sun ioctls 2015-09-26 04:13:39 +00:00
christos
9451a2b98d regen 2015-09-24 14:42:44 +00:00
dholland
1fbab01a93 More on PR 41200: headers that declare ioctls should include sys/ioccom.h.
This covers (I think) all the MI headers outside of external/ (and dist/).
2015-09-06 06:00:59 +00:00
christos
d1ef60ebe3 regen 2015-03-07 16:38:49 +00:00
christos
28396fde9f fix typo 2015-03-07 15:15:24 +00:00
uebayasi
25e1f6dab9 Define compat modules (but without dependencies yet). 2014-11-17 01:01:57 +00:00
matt
45b1ec740d Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.
2014-09-05 09:20:59 +00:00
christos
54b7adb159 c99 initializers for struct execsw 2014-03-07 01:33:43 +00:00
christos
3b438d6a5c use new bsd.syscall.mk 2014-01-14 18:51:24 +00:00
njoly
c0dc7e32cd Regen for dup/dup2/dup3 argument types fix. 2013-11-07 19:39:57 +00:00
njoly
dffea6ad6b Fix dup/dup2/dup3 argument types (u_int -> int). 2013-11-07 19:37:18 +00:00
christos
721e82b55a exec modules need to be of the exec kind 2013-09-19 18:50:35 +00:00
rmind
ad12c77015 Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
2012-02-19 21:05:51 +00:00
chs
33fa5ccbbf many changes for COMPAT_LINUX:
- update the linux syscall table for each platform.
 - support new-style (NPTL) linux pthreads on all platforms.
   clone() with CLONE_THREAD uses 1 process with many LWPs
   instead of separate processes.
 - move the contents of sys__lwp_setprivate() into a new
   lwp_setprivate() and use that everywhere.
 - update linux_release[] and linux32_release[] to "2.6.18".
 - adjust placement of emul fork/exec/exit hooks as needed
   and adjust other emul code to match.
 - convert all struct emul definitions to use named initializers.
 - change the pid allocator to allow multiple pids to refer to the same proc.
 - remove a few fields from struct proc that are no longer needed.
 - disable the non-functional "vdso" code in linux32/amd64,
   glibc works fine without it.
 - fix a race in the futex code where we could miss a wakeup after
   a requeue operation.
 - redo futex locking to be a little more efficient.
2010-07-07 01:30:32 +00:00
hannken
1423e65b26 Clean up vnode lock operations pass 2:
VOP_UNLOCK(vp, flags) -> VOP_UNLOCK(vp): Remove the unneeded flags argument.

Welcome to 5.99.32.

Discussed on tech-kern.
2010-06-24 12:58:48 +00:00
pooka
ec6664576e regen: ENOSYS nfssvc honestly 2010-03-03 11:08:00 +00:00