Commit Graph

80 Commits

Author SHA1 Message Date
njoly 8668268571 Fix semaphore permissions returned by semctl+IPC_STAT, by masking
anything else that the expected lower 9 bits.
2008-04-22 12:14:12 +00:00
ad 4a780c9ae2 Merge vmlocking2 to head. 2008-01-02 11:48:20 +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
ad a9eb927490 Merge from vmlocking2: don't hold semlock across copyin(). 2007-12-08 15:02:46 +00:00
rmind 8cfca2b5e3 - Retry the operations (instead of failing) in case of reallocation.
Suggested by <yamt>.
- Use predicts in checks for reallocation state.
2007-11-25 19:03:24 +00:00
yamt b53fa282d6 fix deadlocks. 2007-11-04 13:09:32 +00:00
rmind defb3f5b28 Support for dynamic changing of SysV message queues and semaphores limits.
Also fixes the alignment problem, which was here forever.  Thanks for <uwe>
for discussion and <martin> for testing.

Reviewed by: <tech-kern>, <gdt>
2007-11-04 11:20:34 +00:00
ad 215f99bf1f Remove obsolete comment. 2007-08-17 23:46:34 +00:00
skd 617b9b58ef Don't put the condvars in the *middle* of the undo structures.
(semu + seminfo.semmnu) is wrong, because the type of semu is int*.
You could fix the offset ((char *)semu + seminfo.semusz), but simply
putting the condvars first is more clear.
2007-08-17 23:05:06 +00:00
ad e4f6da7b0c Mark the SysV semaphore syscalls MP safe. 2007-08-04 10:52:57 +00:00
ad 88ab7da936 Merge some of the less invasive changes from the vmlocking branch:
- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
2007-07-09 20:51:58 +00:00
dsl 27aa94d0d3 Use get_semctl_arg() here instead of the switch statement. 2007-06-17 10:27:16 +00:00
christos 53524e44ef Kill caddr_t; there will be some MI fallout, but it will be fixed shortly. 2007-03-04 05:59:00 +00:00
ad b07ec3fc38 Merge newlock2 to head. 2007-02-09 21:55:00 +00:00
yamt 1a7bc55dcc remove some __unused from function parameters. 2006-11-01 10:17:58 +00:00
christos 4d595fd7b1 - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
2006-10-12 01:30:41 +00:00
christos 1d0edbd583 Coverity CID 2951, 2953, 2954: Add KASSERTS before null deref 2006-09-29 19:39:43 +00:00
ad f474dceb13 Use the LWP cached credentials where sane. 2006-07-23 22:06:03 +00:00
kardel de4337ab21 merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
  time.tv_sec -> time_second
- struct timeval mono_time is gone
  mono_time.tv_sec -> time_uptime
- access to time via
	{get,}{micro,nano,bin}time()
	get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
  Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
  NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
2006-06-07 22:33:33 +00:00
elad 215bd95ba4 integrate kauth. 2006-05-14 21:15:11 +00:00
christos b0c1177d65 Coverity CID 840: Add KASSERT before deref. 2006-04-15 04:26:43 +00:00
thorpej 218b07e98d Use ANSI function delcs. 2005-12-07 06:14:13 +00:00
christos 60305c1ba1 fix debugging. 2005-11-10 18:45:36 +00:00
chs ff50b97f19 fix the SYSV semop number of operations per request to be limited by
seminfo.semopm (which is tunable via the SEMOPM config variable)
rather than an arbitrary constant.
2005-11-03 16:57:03 +00:00
yamt 6b2d8b66a4 merge yamt-km branch.
- don't use managed mappings/backing objects for wired memory allocations.
  save some resources like pv_entry.  also fix (most of) PR/27030.
- simplify kernel memory management API.
- simplify pmap bootstrap of some ports.
- some related cleanups.
2005-04-01 11:59:21 +00:00
briggs 9f506888d3 Update sem_otime on successful call to semop(). 2004-10-07 05:34:09 +00:00
enami 8d37dcb7dc The different loop variable is no longer necessary due to recent change. 2004-08-05 22:06:48 +00:00
junyoung a222c81884 Nuke __P(). 2004-03-23 13:22:03 +00:00
enami 55c19744c4 - remove unnecessary code.
- factor out common code.
- don't stop searching before the target.
- touch the correct object.
- validate the argument before the loop otherwise we need to roll back.
2004-03-18 22:57:38 +00:00
enami a67d24818d Whitespace nits and wrap some lines. 2004-03-18 22:53:16 +00:00
christos b4d69b5716 PR/24814: Colin Percival: sysv_sem waiter counting problem 2004-03-18 01:16:44 +00:00
jdolecek ae0ead8db3 fix semaphore ID bound checking
problem pointed and patch provided in kern/23585 by Jeff Ito
2003-11-29 11:43:25 +00:00
jdolecek 2e59e9ae06 allocate virtual memory for SYSV shm, msg and semaphore structures
separately from the bufpages, so that it would be possible to eventually
make their limits changeable in runtime

make static all local variables which do not need to be exported to other
kernel parts
2003-10-26 10:32:24 +00:00
fvdl d5aece61d6 Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
2003-06-29 22:28:00 +00:00
darrenr 960df3c8d1 Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records.  The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
2003-06-28 14:20:43 +00:00
thorpej e0d8d366df Merge the nathanw_sa branch. 2003-01-18 10:06:22 +00:00
christos 22839acdb9 use the exithook mechanism to clean up semaphores. 2002-03-17 22:21:58 +00:00
nathanw 3f0d660168 Make the debugging printfs compile:
- printf format checking doesn't like %x for pointers; use %p like we should.
 - LP64 fixes.
2002-03-05 23:28:58 +00:00
lukem adc783d537 add RCSIDs 2001-11-12 15:25:01 +00:00
jdolecek c650c8d91c make local 'nsops' same unsigned type as the value we store there in sys_semop() 2001-08-03 05:58:18 +00:00
simonb da251cb08f Delete a couple of <uvm/uvm_extern.h> includes that were for
<sys/sysctl.h> only.
2000-07-22 16:11:02 +00:00
mrg 32aa199ccf remove include of <vm/vm.h> 2000-06-27 17:41:07 +00:00
simonb 38cc1b3975 Add new sysctl node "KERN_SYSVIPC_INFO" with "KERN_SYSVIPC_MSG_INFO",
"KERN_SYSVIPC_SEM_INFO" and "KERN_SYSVIPC_SHM_INFO" to return the
info and data structures for the relevent SysV IPC types.  The return
structures use fixed-size types and should be compat32 safe.  All
user-visible changes are protected with
	#if !defined(_POSIX_C_SOURCE) && !defined(_XOPEN_SOURCE)

Make all variable declarations extern in msg.h, sem.h and shm.h and
add relevent variable declarations to sysv_*.c and remove unneeded
header files from those .c files.

Make compat14 SysV IPC conversion functions and sysctl_file() static.

Change the data pointer to "void *" in sysctl_clockrate(),
sysctl_ntptime(), sysctl_file() and sysctl_doeproc().
2000-06-02 15:53:03 +00:00
sommerfeld f460c85cb3 Remove existing semaphore system locking mechanism and turn
sys_semconfig into a placebo system call, to avoid giving folks an
easy way to wedge processes which use semaphores.

NOTE: unlike 386bsd and freebsd, processes which did not have
semaphore undo records would not be affected by this problem (reducing
it from a serious local denial-of-service problem to a largely
cosmetic problem, since virtually nobody uses semaphores).  But the
code is just Wrong so we're ripping it out anyway.
2000-05-27 21:00:25 +00:00
thorpej 21fc65e1a8 sleep() -> tsleep() 2000-05-27 04:52:27 +00:00
augustss 264f1d27c6 Get rid of register declarations. 2000-03-30 09:27:11 +00:00
christos 3cbe025990 __semctl13 -> ____semctl13 because this now is not called directly.
The fourth argument to it is a pointer to union semun not union semun,
because passing structs and unions to syscalls cannot be handled portably.
2000-01-31 15:12:30 +00:00
thorpej dc8ecaa15b Overhaul of the SVID IPC facilities, primarily to use the types specified
by the Single UNIX Specification version 2, rather than the SVR2-derived
types.  While I was here, I did a namespace sweep to expose the constants
and strucutures, and structure members described by SUSv2; documentation
updates coming shortly.

Fixes kern/8158.
1999-08-25 05:05:48 +00:00
tron bac6bb6bf2 No need to get definition of "SYSV..." from "opt_sysv.h" because they
must be set if these files are compiled.
1998-10-21 22:24:28 +00:00
tron bb56b72356 Defopt SYSVMSG, SYSVSEM and SYSVSHM. 1998-10-19 22:19:27 +00:00