Commit Graph

4253 Commits

Author SHA1 Message Date
elad 9798c4cd61 In svr4_32_sys_systeminfo(), remove two redundant kauth(9) calls for
SVR4_SI_SET_HOSTNAME and SVR4_SI_SET_SRPC_DOMAIN, as permission is already
checked by old_sysctl().

okay christos@.
2008-01-08 22:13:07 +00:00
elad 2395a8f2d2 In linux_sys_sysmips(), remove redundant kauth(9) call for LINUX_SETNAME
as the permission check is done by old_sysctl().

okay christos@.
2008-01-08 22:09:48 +00:00
elad 3d902dfb3e Make compat_43_sys_sethostid() use old_sysctl(), allowing for the removal
of a kauth(9) call.

okay christos@.
2008-01-08 22:08:45 +00:00
he 943b531346 Remove a no-longer-used local variable. 2008-01-08 07:59:23 +00:00
rittera c22be27a3d Added elad's changes to ndis_kthread_create. Setting the stack size in fork1 apparently has no effect in the kernel. Note: needs testing 2008-01-07 19:10:58 +00:00
ad 77e0b2120f Patch up sysctl locking:
- Lock processes, credentials, filehead etc correctly.
- Acquire a read hold on sysctl_treelock if only doing a query.
- Don't wire down the output buffer. It doesn't work correctly and the code
  regularly does long term sleeps with it held - it's not worth it.
- Don't hold locks other than sysctl_lock while doing copyout().
- Drop sysctl_lock while doing copyout / allocating memory in a few places.
- Don't take kernel_lock for sysctl.
- Fix a number of bugs spotted along the way
2008-01-07 16:12:52 +00:00
ad eb4920235a Don't drop vnode refs until we are done with the mount. 2008-01-07 16:08:46 +00:00
njoly e5e170b198 Regen. 2008-01-07 12:12:12 +00:00
njoly 0dbd478087 Remove wrong linux32_sys_mmap2_args define. 2008-01-07 12:11:52 +00:00
dsl f3df4c2289 include sys/simplock.h 2008-01-06 13:18:19 +00:00
ad e5942a85c1 Missing lock acquire. 2008-01-05 23:54:24 +00:00
dsl 95a195791a Use FILE_LOCK() and FILE_UNLOCK().
Attempt to fix all the code paths so that the 'fp' returned by fd_getfile()
isn't left locked, and is always unlocked (and ref-counted) before
doing anything that might sleep.
2008-01-05 19:14:07 +00:00
dsl 902612f1f5 Use the new names (_REG_RFLAGS and _REG_RSP) for the indexes of __gregs[]
which match the names of in the trapframe and .S code.
2008-01-05 19:11:53 +00:00
ad 0664a0459b Start detangling lock.h from intr.h. This is likely to cause short term
breakage, but the mess of dependencies has been regularly breaking the
build recently anyhow.
2008-01-04 21:17:40 +00:00
yamt 97436a1e88 fix malloc type mismatches. 2008-01-03 14:25:49 +00:00
ad 4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +00:00
njoly dfd4477d85 s/i386/__i386__/. 2008-01-01 17:40:22 +00:00
ad 2ecdf58c2c Remove systrace. Ok core@. 2007-12-31 15:31:24 +00:00
ad 9f6b8c4d04 Remove COMPAT_HPUX. 2007-12-31 13:38:47 +00:00
dsl 2fb0ada366 Fix build of macppc with COMPAT_MACH 2007-12-29 18:12:37 +00:00
hannken bdc290470e maxfiles is now an u_int. 2007-12-28 10:00:18 +00:00
christos c9a64311d7 make this compile again. 2007-12-27 17:18:11 +00:00
martin 6cc2e0f273 Remove now superflous (and wrong) extern declaration for maxfiles. 2007-12-27 17:05:28 +00:00
ad ea3f10f7e0 Merge more changes from vmlocking2, mainly:
- Locking improvements.
- Use pool_cache for more items.
2007-12-26 16:01:34 +00:00
njoly 890b62431b Regen for readdir syscall. 2007-12-26 13:51:53 +00:00
njoly 3a6c84afbc Add readdir syscall. 2007-12-26 13:50:48 +00:00
njoly a09fc3498a Fix readdir syscall retval to return 1 (instead of getdents number of
byte read) on success.
2007-12-26 13:48:53 +00:00
perry b6a2ef7569 Convert many of the uses of __attribute__ to equivalent
__packed, __unused and __dead macros from cdefs.h
2007-12-25 18:33:32 +00:00
njoly 1a1f7ef9de Regen for old_uname syscall. 2007-12-24 15:57:01 +00:00
njoly 1fe07a25dd Add old_uname syscall. 2007-12-24 15:56:20 +00:00
njoly 0cebe57b9c Regen for getpgid. 2007-12-24 14:26:50 +00:00
njoly 122287e6f0 Add getpgid syscall. 2007-12-24 14:25:30 +00:00
njoly 24eca5e1f1 Regen for linux_sys_getpgid removal. 2007-12-24 14:21:40 +00:00
njoly 47bf9f4b4d Kill unneeded linux_sys_getpgid and use native sys_getpgid instead. 2007-12-24 14:17:17 +00:00
hannken f20fe37f57 Fix include order: netbsd32_syscallargs.h needs svr4_32_types.h. 2007-12-23 10:18:48 +00:00
christos 18bf1f8006 someone forgot /g in the vi s command. 2007-12-22 17:49:32 +00:00
njoly 90dee75246 Regen for getfsuid/setfsgid syscall exchange. 2007-12-21 22:28:41 +00:00
njoly 035a2e040b - Fix setfsuid to return uid on success.
- Replace getfsuid, which never existed on Linux, by correct setfsgid
  syscall.

ok by christos and dsl.
2007-12-21 22:26:20 +00:00
dsl f00ef3a2d4 Fix prototypes used when NTP is not in use.
Pointed out by Robert Swindells.
2007-12-21 17:36:09 +00:00
matt 39a278be7e Make this compile again. 2007-12-21 02:27:57 +00:00
dsl 9b6e62c6a8 Reinstate some code I commented out. 2007-12-20 23:16:13 +00:00
dsl 6fb2884c3a regen 2007-12-20 23:07:25 +00:00
dsl 7e2790cf6f Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
    int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
2007-12-20 23:02:38 +00:00
dyoung 6f3852fab4 Constify struct ifnet->if_sadl and every use throughout the tree.
Add if_set_sadl() that both sets the link-layer address length and
replaces the current link-layer address with a new one, and use it
throughout the tree.
2007-12-20 21:08:17 +00:00
martin 3abe4cb17d Remove *64 versions identical to their 32 bit version and aliased differently
now.
2007-12-18 11:05:53 +00:00
dsl 5c3e6d0c07 Regen for 'const' killing. 2007-12-17 22:05:41 +00:00
dsl 06bce1608a Remove all the 'const', they end up applying to the structure members
themselves, not where the 32bit pointers reference.
2007-12-17 22:04:32 +00:00
dsl 4f69eadcae svr4_32_sys_creat64() and svr4_32_sys_creat() are equivalent, as are
open64 and open, so just have one set of entry points.
2007-12-17 21:58:34 +00:00
dsl 36fb6d9db7 Revert previous. 2007-12-17 21:48:23 +00:00
dsl a098759aae creat64 and open64 just called the creat/open function.
Change to do it here.
2007-12-17 21:39:17 +00:00
dsl 686e359d32 Regen without any 'const' members of the syscall argument structures. 2007-12-17 20:47:31 +00:00
dsl bf434e38c7 Remove all the 'const'. Although the fields might be 32bit pointers to
constant data, the 'const' applies to the field itself - which is stupid.
2007-12-17 20:45:29 +00:00
njoly c7d62a5250 Fix linux32_sys_wait4 by doing its own jobw instead off calling
linux_sys_wait4. It worked except when child resources were requested,
because 32/64 bits struct rusage differs in size ...

While here, update linux32_sys_waitpid to use linux32_sys_wait4 with a
NULL rusage.
2007-12-17 18:10:37 +00:00
njoly e78a322c4a s/netbsd32_void */netbsd32_caddr_t/ 2007-12-15 14:08:16 +00:00
dsl 63f7948f02 Call sys_open() not bsd_sys_open(). 2007-12-13 07:54:22 +00:00
uebayasi d9547ee3a0 Regen. 2007-12-13 05:19:08 +00:00
dsl fc10f67856 Remove the wrapper functions for file operations that do nothing now
that namei() checks the alternate path.
2007-12-12 22:07:58 +00:00
dsl ef3588e13f Regen, reformmatted, and without wrappers for file operations. 2007-12-12 22:06:19 +00:00
dsl 0f63820911 No need to wrap filename function to get the alt path stuff. 2007-12-12 22:04:30 +00:00
dsl f9ade37fe1 compat_file.[ch] are no longer used 2007-12-12 21:37:26 +00:00
dsl 9ae4eb70ff Regen 2007-12-12 21:29:43 +00:00
dsl e26d16aac3 No need for any of the bsd_sys_foo() calls since they only wrapped
CHECK_ALT_XXX() for filenames - which got killed earlier in the year.
Substitute the same functions as in compat_file.c
2007-12-12 21:24:36 +00:00
dsl 0f47845a4f Add a definition of compat_12_stat_conv() here so I can kill compat_file.h 2007-12-12 21:17:57 +00:00
lukem 4e1d22cc0b fix the __KERNEL_RCSID 2007-12-11 23:32:44 +00:00
lukem 2b8be6f723 use __KERNEL_RCSID() 2007-12-11 13:22:50 +00:00
cube d97f33f6eb Regen syscall tables for mach binary compatibility. Per request from dsl@. 2007-12-11 08:06:46 +00:00
dsl be33a1a204 Increase the maximum number of syscall args.
sys_mach_sys_msg_overwrite_trap() has been overwriting stack!
2007-12-10 22:32:15 +00:00
dogcow 9ad45b39e6 more NDINIT fallout. not completely compile-tested. 2007-12-09 13:34:23 +00:00
wiz 9c131e8d5c Remove last argument from NDINIT call, following
"Remove cn_lwp from struct componentname.  curlwp should be used
from on.  The NDINIT() macro no longer takes the lwp parameter and
associates the credentials of the calling thread with the namei
structure." from pooka.
2007-12-09 12:50:29 +00:00
pooka db06a930e6 Remove cn_lwp from struct componentname. curlwp should be used
from on.  The NDINIT() macro no longer takes the lwp parameter and
associates the credentials of the calling thread with the namei
structure.
2007-12-08 19:29:36 +00:00
dsl 28bae79b27 ANSIfy most of the function definitions in sys/compat (but not ndis).
All by the magic of sed ...
2007-12-08 18:35:53 +00:00
ad 9c8beda3c8 Reg... hang on, why don't we build this at compile time?!? 2007-12-07 22:42:11 +00:00
ad bca34dfe7a Add: _lwp_setname, _lwp_getname, _lwp_ctl. 2007-12-07 22:41:05 +00:00
ad 937533671d lockmgr -> rwlock 2007-12-06 14:53:35 +00:00
dyoung adde197943 Use IFADDR_EMPTY(). 2007-12-05 22:51:01 +00:00
yamt 65e70dc43b include mutex.h. 2007-12-05 12:01:24 +00:00
ad 73b6db8481 Make it compile. 2007-12-05 08:45:30 +00:00
ad a0ca06de3d lockmgr -> mutex 2007-12-05 08:39:46 +00:00
ad 78090667c0 Kill ref to lockmgr in comments (for grep). 2007-12-05 08:34:41 +00:00
ad a5bdf04ea6 lockmgr -> rwlock 2007-12-05 08:33:23 +00:00
dyoung 5a740a2a51 Extract common code into subroutine svr4_count_ifnum().
Don't open-code queue(3) macros (x = ifnet.tqh_first; y =
x.if_list.tqe_next).  Instead, use the macros themselves.

Use IFNET_FOREACH() and IFADDR_FOREACH().
2007-12-05 01:10:47 +00:00
dyoung cabaa89d1f Don't open-code queue(3) macros (x = ifnet.tqh_first; y =
x.if_list.tqe_next).  Instead, use the macros themselves.

Use IFNET_FOREACH() and IFADDR_FOREACH().
2007-12-05 01:06:23 +00:00
dyoung b86d03582a Use IFADDR_FOREACH(). 2007-12-05 01:03:30 +00:00
dsl cfc18fc34b Remove all the __P from here, including the other other mismatched one
that my sed script left behind and 'he' didn't notice.
2007-12-05 00:31:01 +00:00
he 5b4fada2e1 Re-balance a parenthesis. 2007-12-04 22:43:50 +00:00
dsl f2af9174b9 Remove all the __P 2007-12-04 18:40:07 +00:00
ad 86b20896d3 Use system-provided atomic ops. 2007-11-29 14:29:29 +00:00
pooka e49789dd46 more l removal 2007-11-28 18:50:10 +00:00
ad 16b547ec7f Please can we nuke this code? 2007-11-28 18:45:03 +00:00
he 756f91194a Follow up the removal of the lwp argument to VOP_ functions.
In some cases, use curlwp instead of the now missing argument.
2007-11-28 10:34:37 +00:00
dogcow 3c143b9440 more lwp cacking fallout 2007-11-27 23:30:56 +00:00
ad 23589af2fb lwp arg to VOPs is gone. 2007-11-27 22:12:24 +00:00
dogcow 6c09f19fb4 and one more lwp removal victim 2007-11-27 11:25:29 +00:00
dogcow 3465a006e9 more VFS_STATVFS(x,y,z) fallout; change them to VFS_STATVFS(x,y). (hi, pooka!) 2007-11-27 09:47:15 +00:00
he 0bfa260fce Remove a now-unused variable. 2007-11-26 23:16:15 +00:00
pooka 61e8303e9d Remove the "struct lwp *" argument from all VFS and VOP interfaces.
The general trend is to remove it from all kernel interfaces and
this is a start.  In case the calling lwp is desired, curlwp should
be used.

quick consensus on tech-kern
2007-11-26 19:01:26 +00:00
elad abb7851f4d Refactor time modification checks and place them in the secmodel code.
okay christos@
2007-11-25 00:35:26 +00:00
christos 3714528495 - move the save context before the signal reset (Arto Huusko)
- set the sigcontext cr2
2007-11-24 23:52:56 +00:00
elad 1d139a3075 Modify hpux_sys_stime_6x() to call settime(), like everyone else do.
okay christos@.
2007-11-24 20:43:34 +00:00
njoly 204ebc94bf Regen. 2007-11-16 12:58:12 +00:00
njoly 601a0e5173 Update, for linux_sys_readlink() removal. 2007-11-16 12:56:50 +00:00
njoly cb572617af Regen, for syscalls cleanup. 2007-11-16 12:53:56 +00:00
njoly 6412bda281 Cleanup. Remove a few linux syscalls definitions, now identical to
native ones (with stackgap and ALT_CHECK_xxx removal). No functional
changes expected.
2007-11-16 12:51:54 +00:00
dsl 300078900a regen 2007-11-12 22:23:29 +00:00
dsl 9bb5de8a76 syscall() needs to be 'NOARGS INDIR'.
Actually I wonder if this code could use the standard syscall table ?
2007-11-12 22:23:01 +00:00
christos 2e3ee66dc7 regen 2007-11-11 18:28:18 +00:00
dsl f36a9ec28b Fix builds for ports that don't define __HAVE_MINIMAL_EMUL (eg sparc64).
Fallout from a change that made #define names for syscalls (etc) start
NETBSD32 (not netbsd32).
2007-11-10 18:55:42 +00:00
dsl ddd89ca02b regen 2007-11-10 13:24:27 +00:00
dsl b6b07a31fd Mark 'syscall' as 'NOARGS INDIR" 2007-11-10 13:23:18 +00:00
dsl 2cabf5c1f0 Remove the pecoff system table defines, they aren't needed since the
emulation uses a user-space library and normal netbsd calls.
2007-11-10 09:41:01 +00:00
njoly d16de24e5a Make linux32_sys_oldolduname use LINUX_UNAME_ARCH instead of machine,
like other uname syscalls. While here, remove unneeded
LINUX_UNAME_ARCH #ifdef/#endif checks.
2007-11-09 17:43:17 +00:00
dsl ee077208d9 Regen 2007-11-09 15:10:27 +00:00
dsl 3107f9cd42 Add arguments to sys_syscall and sys___syscall.
Use MI wrappers for them in netbsd32.
Change prefix for constants from netbsd32 to NETBSD32 (used in #defines etc).
2007-11-09 15:05:33 +00:00
njoly 23e9f9fa6f Replace strncpy with strlcpy in compat linux and linux32 uname,
old_uname and oldold_uname syscalls to ensure that all *utsname fields
are always NUL terminated.
2007-11-08 21:07:23 +00:00
njoly 577cb10855 Regen for 64-bit linux syscalls removal. 2007-11-07 00:25:39 +00:00
njoly b32d95bfbf Remove remaining 64-bit compat linux syscalls linux_sys_xxx() (except
for ones without arguments), and replace them by their 32-bit
equivalent linux32_sys_xxxx().
2007-11-07 00:24:29 +00:00
ad d831186d55 Merge scheduler changes from the vmlocking branch. All discussed on
tech-kern:

- Invert priority space so that zero is the lowest priority. Rearrange
  number and type of priority levels into bands. Add new bands like
  'kernel real time'.
- Ignore the priority level passed to tsleep. Compute priority for
  sleep dynamically.
- For SCHED_4BSD, make priority adjustment per-LWP, not per-process.
2007-11-06 00:42:39 +00:00
rmind 6364fdeba5 - Replace lockmgr with mutex;
- Use condvars instead of tsleep/wakeup;
- Replace malloc with kmem;
- Use itimespecfix/tstohz;

Reviewed by <ad>.
2007-11-04 11:10:34 +00:00
oster 77002eb972 This should be a mutex_enter() instead of a mutex_exit().
Fixes:
Mutex error: mutex_vector_exit: assertion failed: MUTEX_OWNER(mtx->mtx_owner) == curthread
...
mutex_abort(c0aba23c,c07bf8b0,c09c9164,bfbfee34,10) at netbsd:mutex_abort+0x36
mutex_vector_exit(c0aba23c,10,c0aba23c,ca8efc6c,ca8f8540) at netbsd:mutex_vector_exit+0xe2
compat_20_sys_getfsstat(ca8f8540,cb243c48,cb243c68,805eb24,805e000) at netbsd:compat_20_sys_getfsstat+0x1bf
...
2007-11-01 03:49:52 +00:00
dsl 36acfb90ed regen 2007-10-31 22:39:17 +00:00
dsl 16c3c9c541 This file must use the netbsd32_xxx() system calls, not the sys_xxx() ones.
The latter actually function (due to luck) for calls with one argument,
but will fail badly if more than one is required.
Noticed as an error in the ktrace outut by Nicolas Joly, reported on
tech-kern.
2007-10-31 22:35:34 +00:00
njoly beab9df119 Regen for syscalls cleanup. 2007-10-31 21:06:19 +00:00
njoly 6f36d09e87 compat linux32 syscalls cleanup.
With stackgap and CHECK_ALT_xxx removal, some linux32 and netbsd32
syscalls are now identical.
To avoid code duplication, remove the linux32 definition and use the
netbsd32 one (no functional change).
2007-10-31 21:04:02 +00:00
njoly 99e027abbb Remove extra return 2007-10-31 09:16:55 +00:00
njoly d57ae6a62d Regen for chown additions. 2007-10-27 09:17:50 +00:00
njoly 97151f15f1 Add missing chown's syscalls family members.
This makes chown(1)/chgrp(1) works under compat linux32.

Problem reported and fix tested by Arto Huusko. Thanks.
2007-10-27 09:16:24 +00:00
pooka ea84bd1c76 vfs_getopsbyname("ngs") -> vfs_getopsbyname("nfs"). 'nuff said 2007-10-23 15:21:31 +00:00
njoly a478f23b9e Add compat_linux and exec_linux_elf lkm support for amd64:
- Add needed COMPAT_OSSAUDIO to GENERIC.
- Add missing includes needed by linux_syscallargs.h.
- Add lkm building.
2007-10-19 18:52:09 +00:00
ad a2a3828545 machine/{bus,cpu,intr}.h -> sys/{bus,cpu,intr}.h 2007-10-19 11:59:34 +00:00
he 167a62205a Follow up the removal of the lwp_t* argument to do_filereadv() and
do_filewritev().
2007-10-11 13:51:12 +00:00
ad 53b26d467e mountlist_slock is now a mutex. 2007-10-10 22:00:53 +00:00
ad 99b0354fb8 v_flag -> v_iflag 2007-10-10 21:59:11 +00:00
ad 7dad9f7391 Merge from vmlocking:
- Split vnode::v_flag into three fields, depending on field locking.
- simple_lock -> kmutex in a few places.
- Fix some simple locking problems.
2007-10-10 20:42:20 +00:00
ad 62fdbc4b9a LOCK_ASSERT -> KASSERT 2007-10-08 18:07:24 +00:00
ad 451aacda90 Merge file descriptor locking, cwdi locking and cross-call changes
from the vmlocking branch.
2007-10-08 15:12:05 +00:00
ad 74dc12ed8b fxsave() is a function, don't re-use the name. 2007-10-03 10:54:16 +00:00
he 525420f3c8 Remove a now-unused local variable. 2007-09-30 10:35:16 +00:00
dsl 2e20a70dbf Change the way p->p_limit (and hence p->p_rlimit) is locked.
Should fix PR/36939 and make the rlimit code MP safe.
Posted for comment to tech-kern (non received!)

The p_limit field (for a process) is only be changed once (on the first
  write), and a reference to the old structure is kept (for code paths
  that have cached the pointer).
Only p->p_limit is now locked by p->p_mutex, and since the referenced memory
  will not go away, is only needed if the pointer is to be changed.
The contents of 'struct plimit' are all locked by pl_mutex, except that the
  code doesn't bother to acquire it for reads (which are basically atomic).
Add FORK_SHARELIMIT that causes fork1() to share the limits between parent
  and child, use it for the IRIX_PR_SULIMIT.
Fix borked test for both IRIX_PR_SUMASK and IRIX_PR_SDIR being set.
2007-09-29 12:22:30 +00:00
dsl 2b7c33c183 Use netbsd32_uint64 instead of fsblkcnt_t and fsfilcnt_t in order to get
the correct alignment (4 bytes for i386) for the whole structure.
2007-09-29 10:47:45 +00:00
dsl 4bacff8183 Rename members of 'struct plimit' so that the fields are 'pl_xxx' and
no longer have the same names as members of 'struct proc'.
2007-09-21 19:19:20 +00:00
mlelstv 4bb7dae272 Implement OSS_SNDCTL_DSP_GETODELAY and provide a no-op function
for OSS_SNDCTL_DSP_PROFILE.
2007-09-18 19:49:53 +00:00
dsl 06b0a1bdab Define netbsd32_uint64 for 64bit integers with the alignment requirement
of the corresponding 32bit architecture.
Use it for the 64bit items in netbsd32_statvfs so that the structure
doesn't collect 8byte alignment (and 4 bytes of trailing padding).
This replaces the 'packed' attribute which wasn't architecture specific
and would cause massive overheads accessing every member of sparc64.
Should allow the MIPS64 port do DTRT.
2007-09-16 22:35:01 +00:00
gdt 9768560fd7 remove SIOCSIFALIFETIME_IN6 (should have been part of previous commit) 2007-09-11 19:59:18 +00:00
cube 7a185660d8 Some more licence clean up. 2007-09-10 10:54:20 +00:00
cube c725329722 Remove 3rd clause and my name from all the licences which were only in my
name.
2007-09-10 10:35:51 +00:00
dyoung f59a11881a Constify: LLADDR() -> CLLADDR(). 2007-08-29 22:33:42 +00:00
dyoung f004b71d98 Constify. 2007-08-26 22:36:35 +00:00
dyoung e6fc91327f Use satosdl(). 2007-08-26 22:33:25 +00:00
martin 4418b58c3f Remove all ioctls from the conversion list that are explicitly defined
to use struct oifreq - the magic size changing makes them fail.
2007-08-20 19:19:33 +00:00
martin 2adca4d368 Sigh - revert previous. Seems we can't avoid the big list, so fill it.
Now both "ifconfig ... create" and "pppoectl -d" work again with old
userland.
2007-08-20 17:48:17 +00:00