DragonFly BSD

CVS log for src/sys/sys/syscall-hide.h

[BACK] Up to [DragonFly] / src / sys / sys

Request diff between arbitrary revisions


Keyword substitution: kv
Default branch: MAIN


Revision 1.63: download - view: text, markup, annotated - select for diffs
Tue Nov 11 00:55:49 2008 UTC (6 years ago) by pavalos
Branches: MAIN
CVS tags: HEAD
Diff to: previous 1.62: preferred, unified
Changes since revision 1.62: +2 -1 lines
Add the lchflags() syscall.

This is essentially the same as chflags(), but it operates on the symlink,
not on the underlying file.

Documentation-from: FreeBSD
Reviewed-by: dillon

Revision 1.62: download - view: text, markup, annotated - select for diffs
Sun Jun 1 19:55:32 2008 UTC (6 years, 5 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_RELEASE_2_0_Slip, DragonFly_RELEASE_2_0, DragonFly_Preview
Diff to: previous 1.61: preferred, unified
Changes since revision 1.61: +2 -1 lines
Implement a new system call: getvfsstat().  This system call returns
an array of statfs and statvfs structures.  Unfortunately there is no way
to just return an array of statvfs structures because the statvfs structure
does not have sufficient information in it to identify the mount point.

    getvfsstat(struct statfs *buf, struct statvfs *vbuf,
	       long vbufsize, int flags);

Revision 1.61: download - view: text, markup, annotated - select for diffs
Sun Jun 1 19:27:37 2008 UTC (6 years, 5 months ago) by dillon
Branches: MAIN
Diff to: previous 1.60: preferred, unified
Changes since revision 1.60: +3 -0 lines
* Implement new system calls in the kernel:  statvfs(), fstatvfs(),
  fhstatvfs().

* Implement a new VFS op, VFS_STATVFS().  Implement a default for this new
  op for VFSs which do not implement VFS_STATVFS(), which calls VFS_STATFS()
  and converts the structure (using Joerg's conversion procedure from libc).

* Remove statvfs(), fstatvfs(), and fhstatvfs() from libc.  These functions
  are now system calls.

Revision 1.60: download - view: text, markup, annotated - select for diffs
Mon May 19 10:19:49 2008 UTC (6 years, 6 months ago) by corecode
Branches: MAIN
Diff to: previous 1.59: preferred, unified
Changes since revision 1.59: +1 -1 lines
Don't #include <sys/select.h> from sys/types.h, to conform to SUS.

Some old BSD programs assume that sys/types.h is basically enough
to get all types and even functions declared, so adjust these.
sys/param.h still works as kitchensink and includes sys/select.h.

Revision 1.59: download - view: text, markup, annotated - select for diffs
Thu Jan 10 22:30:28 2008 UTC (6 years, 10 months ago) by nth
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_12_Slip, DragonFly_RELEASE_1_12
Diff to: previous 1.58: preferred, unified
Changes since revision 1.58: +2 -1 lines

Add pselect syscall.

Add pselect man page (obtained from FreeBSD).

Add pselect wrapper in libthread_xu that calls pselect syscall.

Add pselect wrapper in libc_r that calls poll syscall (see XXX in code
and BUGS in pselect man page).

Changed libbind to use pselect syscall instead of locally defined wrapper.

Revision 1.58: download - view: text, markup, annotated - select for diffs
Sat Jun 16 20:00:36 2007 UTC (7 years, 5 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_10_Slip, DragonFly_RELEASE_1_10
Diff to: previous 1.57: preferred, unified
Changes since revision 1.57: +2 -1 lines
Regenerate system callsa (add uuidgen()).

Revision 1.57: download - view: text, markup, annotated - select for diffs
Thu May 3 23:04:36 2007 UTC (7 years, 6 months ago) by dillon
Branches: MAIN
Diff to: previous 1.56: preferred, unified
Changes since revision 1.56: +2 -1 lines
Add a new system call, lwp_rtprio(), and regenerate system calls.
int lwp_rtprio (int, pid_t, lwpid_t, struct rtprio *);

This patch provides an alternative to rtprio(2) which is able to operate
on individual LWPs.

Submitted-by: Aggelos Economopoulos <aoiko@cc.ece.ntua.gr>

Revision 1.56: download - view: text, markup, annotated - select for diffs
Sun Apr 22 00:59:27 2007 UTC (7 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.55: preferred, unified
Changes since revision 1.55: +1 -1 lines
Just throw all the main arguments for syslink() into syslink_info and
pass the structure.  Do not pass the descriptor separately, do not pass
a pointer to the structure size (just pass the size directly).  The
search routines just return one structure at a time so a return size
field is not needed.

Start revamping syslink() to make it more mbuf-centric.  This work is
very much still in progress.

Revision 1.55: download - view: text, markup, annotated - select for diffs
Mon Apr 16 17:40:16 2007 UTC (7 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.54: preferred, unified
Changes since revision 1.54: +1 -1 lines
Probably the last change to the syslink() system call.  Allow a generic
structure to be passed and returned and revamp the command structure.

Revision 1.54: download - view: text, markup, annotated - select for diffs
Wed Mar 21 20:06:36 2007 UTC (7 years, 8 months ago) by dillon
Branches: MAIN
Diff to: previous 1.53: preferred, unified
Changes since revision 1.53: +0 -0 lines
syslink work - Implement code for a reformulated system call, giving the
kernel the ability to manage multiple syslink routing hubs.  Include the
physical id space reservation and allocation and assignment of same.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Mon Mar 12 23:45:04 2007 UTC (7 years, 8 months ago) by corecode
Branches: MAIN
Diff to: previous 1.52: preferred, unified
Changes since revision 1.52: +3 -1 lines
Regen.

Revision 1.52: download - view: text, markup, annotated - select for diffs
Thu Mar 1 01:48:51 2007 UTC (7 years, 9 months ago) by corecode
Branches: MAIN
Diff to: previous 1.51: preferred, unified
Changes since revision 1.51: +2 -1 lines
Regen.

Revision 1.51: download - view: text, markup, annotated - select for diffs
Sun Feb 25 14:08:08 2007 UTC (7 years, 9 months ago) by corecode
Branches: MAIN
Diff to: previous 1.50: preferred, unified
Changes since revision 1.50: +2 -1 lines
Regen

Revision 1.50: download - view: text, markup, annotated - select for diffs
Mon Jan 8 21:41:59 2007 UTC (7 years, 10 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_8_Slip, DragonFly_RELEASE_1_8
Diff to: previous 1.49: preferred, unified
Changes since revision 1.49: +7 -7 lines
Rename the following special extended I/O system calls.  Only libc, libc_r,
and VKERNEL are currently known to use these calls so the rename should have
no major effects.

Fix broken prototypes in unistd.h.

__accept    ->      extaccept
__connect   ->      extconnect
__pread     ->      extpread
__preadv    ->      extpreadv
__pwrite    ->      extpwrite
__pwritev   ->      extpwritev

Broken-Prototypes-Reported-by: Joe Talbott <josepht@cstone.net>

Revision 1.49: download - view: text, markup, annotated - select for diffs
Mon Jan 8 03:33:43 2007 UTC (7 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.48: preferred, unified
Changes since revision 1.48: +1 -1 lines
Modify the trapframe sigcontext, ucontext, etc.  Add %gs to the trapframe
and xflags and an expanded floating point save area to sigcontext/ucontext
so traps can be fully specified.

Remove all the %gs hacks in the system code and signal trampoline and handle
%gs faults natively, like we do %fs faults.

Implement writebacks to the virtual page table to set VPTE_M and VPTE_A and
add checks for VPTE_R and VPTE_W.

Consolidate the TLS save area into a MD structure that can be accessed by MI
code.

Reformulate the vmspace_ctl() system call to allow an extended context to be
passed (for TLS info and soon the FP and eventually the LDT).

Adjust the GDB patches to recognize the new location of %gs.

Properly detect non-exception returns to the virtual kernel when the virtual
kernel is running an emulated user process and receives a signal.

And misc other work on the virtual kernel.

Revision 1.48: download - view: text, markup, annotated - select for diffs
Sat Jan 6 01:46:44 2007 UTC (7 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.47: preferred, unified
Changes since revision 1.47: +3 -3 lines
Rename system calls, removing a "sys_" prefix that turned out not to be
such a good idea.

sys_set_tls_area() to set_tls_area()
sys_get_tls_area() to get_tls_area()

Revision 1.47: download - view: text, markup, annotated - select for diffs
Tue Oct 10 15:43:15 2006 UTC (8 years, 1 month ago) by dillon
Branches: MAIN
Diff to: previous 1.46: preferred, unified
Changes since revision 1.46: +3 -1 lines
Add two more vmspace_*() system calls to read and write a vmspace.  These
will be used by the virtual kernel to handle copyin/copyout.  The routines
are just empty wrappers at the moment.

Implement the body for vmspace_mmap() and vmspace_munmap().

Revision 1.46: download - view: text, markup, annotated - select for diffs
Sun Sep 17 21:09:39 2006 UTC (8 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.45: preferred, unified
Changes since revision 1.45: +7 -6 lines
Make some adjustments to low level madvise/mcontrol/mmap support code to
accomodate vmspace_*() calls.

Reformulate the new vmspace_*() calls so they operate similarly to the
MAP_VPAGETABLE and mcontrol() calls.  This also makes vmspace's more
'programmable' in the sense that it will be possible to mix virtual
pagetable mmap()ings with other mmap()ing in a vmspace.

Fill in the code for all the new vmspace_*() calls except for
vmspace_ctl().  NOTE: vmspace calls are effectively disabled unless
vm.vkernel_enable is turned on, just like MAP_VPAGETABLE.

Renumber the new mcontrol() and vmspace_*() calls and regenerate.

Revision 1.45: download - view: text, markup, annotated - select for diffs
Wed Sep 13 17:10:40 2006 UTC (8 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.44: preferred, unified
Changes since revision 1.44: +2 -1 lines
MAP_VPAGETABLE support part 3/3.

Implement a new system call called mcontrol() which is an extension of
madvise(), adding an additional 64 bit argument.  Add two new advisories,
MADV_INVAL and MADV_SETMAP.

MADV_INVAL will invalidate the pmap for the specified virtual address
range.  You need to do this for the virtual addresses effected by changes
made in a virtual page table.

MADV_SETMAP sets the top-level page table entry for the virtual page table
governing the mapped range.  It only works for memory governed by a virtual
page table and strange things will happen if you only set the root
page table entry for part of the virtual range.

Further refine the virtual page table format.  Keep with 32 bit VPTE's for
the moment, but properly implement VPTE_PS and VPTE_V.  VPTE_PS can be
used to suport 4MB linear maps in the top level page table and it can also
be used when specifying the 'root' VPTE to disable the page table entirely
and just linear map the backing store.  VPTE_V is the 'valid' bit (before
it was inverted, now it is normal).

Revision 1.44: download - view: text, markup, annotated - select for diffs
Sun Sep 3 17:11:50 2006 UTC (8 years, 2 months ago) by dillon
Branches: MAIN
Diff to: previous 1.43: preferred, unified
Changes since revision 1.43: +6 -1 lines
Add skeleton procedures for the vmspace_*() series of system calls which
will be used by virtual kernels to implement processes.

Revision 1.43: download - view: text, markup, annotated - select for diffs
Sun Aug 6 18:56:46 2006 UTC (8 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.42: preferred, unified
Changes since revision 1.42: +2 -1 lines
Add structures and skeleton code for a new system call called syslink()
which will support the kernel syslink API.  This is the link protocol that
will be used for user<->kernel (e.g. user VFS) and kernel<->kernel (cluster)
communications.

Syslink-based protocols will be used for DEV, VFS, CCMS, and other
cluster-related operations.

Revision 1.42: download - view: text, markup, annotated - select for diffs
Tue Jun 13 21:04:17 2006 UTC (8 years, 5 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_6_Slip, DragonFly_RELEASE_1_6
Diff to: previous 1.41: preferred, unified
Changes since revision 1.41: +3 -1 lines
Add two more system calls, __accept and __connect.  The old accept() and
connect() are still present but will eventually be replaced with a libc
wrapper.

The new system calls add a flags argument, allowing O_FBLOCKING
or O_FNONBLOCKING to be passed to override the non-blocking setting in
the file pointer.  They are intended to be used by libc_r.

Revision 1.41: download - view: text, markup, annotated - select for diffs
Tue Jun 13 08:12:04 2006 UTC (8 years, 5 months ago) by dillon
Branches: MAIN
Diff to: previous 1.40: preferred, unified
Changes since revision 1.40: +4 -4 lines
Add kernel syscall support for explicit blocking and non-blocking I/O
regardless of the setting applied to the file pointer.

send/sendmsg/sendto/recv/recvmsg/recfrom: New MSG_ flags defined in
sys/socket.h may be passed to these functions to override the settings
applied to the file pointer on a per-I/O basis.

MSG_FBLOCKING	- Force the operation to be blocking
MSG_FNONBLOCKING- Force the operation to be non-blocking

pread/preadv/pwrite/pwritev: These system calls have been renamed and
wrappers will be added to libc.  The new system calls are prefixed with
a double underscore (like getcwd vs __getcwd) and include an additional
flags argument.  The new flags are defined in sys/fcntl.h and may be
used to override settings applied to the file pointer on a per-I/O basis.

Additionally, the internal __ versions of these functions now accept an
offset of -1 to mean 'degenerate into a read/readv/write/writev' (i.e.
use the offset in the file pointer and update it on completion).

O_FBLOCKING	- Force the operation to be blocking
O_FNONBLOCKING	- Force the operation to be non-blocking
O_FAPPEND	- Force the write operation to append (to a regular file)
O_FOFFSET	- (implied of the offset != -1) - offset is valid
O_FSYNCWRITE	- Force a synchronous write
O_FASYNCWRITE	- Force an asynchronous write
O_FUNBUFFERED	- Force an unbuffered operation (O_DIRECT)
O_FBUFFERED	- Force a buffered operation (negate O_DIRECT)

If the flags do not specify an operation (e.g. neither FBLOCKING or
FNONBLOCKING are set), then the settings in the file pointer are used.

The original system calls will become wrappers in libc, without the flags
arguments.  The new system calls will be made available to libc_r to allow
it to perform non-blocking I/O without having to mess with a descriptor's
file flags.

NOTE: the new __pread and __pwrite system calls are backwards compatible
with the originals due to a pad byte that libc always set to 0.
The new __preadv and __pwritev system calls are NOT backwards compatible,
but since they were added to HEAD just two months ago I have decided
to not renumber them either.

NOTE: The subrev has been bumped to 1.5.4 and installworld will refuse to
install if you are not running at least a 1.5.4 kernel.

Revision 1.40: download - view: text, markup, annotated - select for diffs
Wed Jun 7 03:02:11 2006 UTC (8 years, 5 months ago) by dillon
Branches: MAIN
Diff to: previous 1.39: preferred, unified
Changes since revision 1.39: +1 -1 lines
Remove the asynchronous system call interface sendsys/waitsys.  It was an
idea before its time.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Mon Jun 5 07:26:11 2006 UTC (8 years, 5 months ago) by dillon
Branches: MAIN
Diff to: previous 1.38: preferred, unified
Changes since revision 1.38: +1 -1 lines
Modify kern/makesyscall.sh to prefix all kernel system call procedures
with "sys_".  Modify all related kernel procedures to use the new naming
convention.  This gets rid of most of the namespace overloading between
the kernel and standard header files.

Revision 1.38: download - view: text, markup, annotated - select for diffs
Mon Jun 5 00:35:05 2006 UTC (8 years, 5 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.37: preferred, unified
Changes since revision 1.37: +1 -1 lines
Regenerate.

Revision 1.37: download - view: text, markup, annotated - select for diffs
Sat May 27 20:17:17 2006 UTC (8 years, 6 months ago) by dillon
Branches: MAIN
Diff to: previous 1.36: preferred, unified
Changes since revision 1.36: +1 -1 lines
Mark various forms of read() and write() MPSAFE.  Note that the MP lock is
still acquire, but now its a lot deeper in the fileops.

Mark dup(), dup2(), close(), closefrom(), and fcntl() MPSAFE.  Some code
paths don't have to get the MP lock, but most still do deeper into the
fileops.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Wed Apr 26 17:17:57 2006 UTC (8 years, 7 months ago) by dillon
Branches: MAIN
Diff to: previous 1.35: preferred, unified
Changes since revision 1.35: +3 -1 lines
Add the preadv() and pwritev() systems and regenerate.

Submitted-by: Chuck Tuffli <ctuffli@gmail.com>
Loosely-based-on: FreeBSD

Revision 1.35: download - view: text, markup, annotated - select for diffs
Wed Nov 16 02:24:33 2005 UTC (9 years ago) by dillon
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_4_Slip, DragonFly_RELEASE_1_4
Diff to: previous 1.34: preferred, unified
Changes since revision 1.34: +2 -1 lines
Continue work on our pluggable scheduler abstraction.  Implement a system
call to set the scheduler for the current process (and future children),
and add an abstraction for scheduler registration.

Submitted-by: Sergey Glushchenko <deen@smz.com.ua>

Revision 1.34: download - view: text, markup, annotated - select for diffs
Sat Aug 27 20:23:05 2005 UTC (9 years, 3 months ago) by joerg
Branches: MAIN
Diff to: previous 1.33: preferred, unified
Changes since revision 1.33: +2 -0 lines
Make struct dirent contain a full 64bit inode. Allow more than 255 byte
filenames by increasing d_namlen to 16bit. Remove UFS specific macros
from sys/dirent.h, programs which really need them should include
vfs/ufs/dir.h. MAXNAMLEN should not be used, but replaced by NAME_MAX.

To keep the impact for older BSD code small, d_ino and d_fileno are kept
in the old meaning when __BSD_VISIBLE is defined, otherwise the POSIX
version d_ino is used. This will be changed later to always define only
d_ino and make d_fileno a compatiblity macro for __BSD_VISIBLE.

d_name is left with hard-coded 256 byte space, this will be changed at
some point in the future and doesn't affect the ABI. Programs should
correctly allocate space themselve, since the maximum directory entry
length can be > 256 byte.

For allocating dirents (e.g. for readdir_r), _DIRENT_RECLEN and
_DIRENT_DIRSIZ should be used. NetBSD has choosen the same names.
Revamp the compatibility code to always use a local kernel buffer and
write out the entries. This will be changed later by passing down the
output function to vop_readdir, elimininating the redundant copy.

Change NFS and CD9660 to use to use vop_write_dirent, for CD9660 ensure
that the buffers are big enough by prepending char arrays of the right
size.

Tested-by & discussed-with: dillon

Revision 1.33: download - view: text, markup, annotated - select for diffs
Tue Aug 2 13:19:30 2005 UTC (9 years, 3 months ago) by joerg
Branches: MAIN
Diff to: previous 1.32: preferred, unified
Changes since revision 1.32: +6 -2 lines
Regen.

Revision 1.32: download - view: text, markup, annotated - select for diffs
Sat Jul 30 20:31:01 2005 UTC (9 years, 4 months ago) by joerg
Branches: MAIN
Diff to: previous 1.31: preferred, unified
Changes since revision 1.31: +3 -1 lines
Regen.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Sat Jul 23 23:27:28 2005 UTC (9 years, 4 months ago) by joerg
Branches: MAIN
Diff to: previous 1.30: preferred, unified
Changes since revision 1.30: +2 -4 lines
regen.

Revision 1.30: download - view: text, markup, annotated - select for diffs
Fri Jul 15 17:54:48 2005 UTC (9 years, 4 months ago) by eirikn
Branches: MAIN
Diff to: previous 1.29: preferred, unified
Changes since revision 1.29: +1 -0 lines
Tie SCTP into the kernel, this includes adding a new syscall (sctp_peeloff).

Obtained from: KAME

Revision 1.29: download - view: text, markup, annotated - select for diffs
Fri Apr 8 08:31:45 2005 UTC (9 years, 7 months ago) by joerg
Branches: MAIN
CVS tags: DragonFly_Stable
Diff to: previous 1.28: preferred, unified
Changes since revision 1.28: +2 -1 lines
Regen.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Mon Mar 21 16:47:49 2005 UTC (9 years, 8 months ago) by joerg
Branches: MAIN
CVS tags: DragonFly_RELEASE_1_2_Slip, DragonFly_RELEASE_1_2
Diff to: previous 1.27: preferred, unified
Changes since revision 1.27: +1 -1 lines
regen

Revision 1.27: download - view: text, markup, annotated - select for diffs
Mon Feb 21 21:40:58 2005 UTC (9 years, 9 months ago) by dillon
Branches: MAIN
Diff to: previous 1.26: preferred, unified
Changes since revision 1.26: +2 -0 lines
Implement TLS support, tls manual pages, and link the umtx and tls manual
pages together.  TLS stands for 'thread local storage' and is used to
support efficient userland threading and threaded data access models.

Three TLS segments are supported in order to (eventually) support GCC3's
__thread qualifier.  David Xu's thread library only uses one descriptor
for now.  The system calls implement a mostly machine-independant API
which return architecture-specific results.  Rather then pass the actual
descriptor structure, which unnecessarily pollutes the userland
implementation, we pass a more generic (base,size) and the system call
returns the %gs load value for IA32.  For AMD64 and other architectures,
the returned value will be something for those architectures.

The current low level assembly support is not as efficient as it could be,
but it is good enough for now.  The heavy weight switch code for processes
does the work.  The light weight switch code for pure kernel threads has not
been changed (since the kernel doesn't use TLS descriptors we can just ignore
them).

Based on work by David Xu <davidxu@freebsd.org> and Matthew Dillon <dillon@backplane.com>

Revision 1.26: download - view: text, markup, annotated - select for diffs
Sun Feb 20 03:24:47 2005 UTC (9 years, 9 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.25: preferred, unified
Changes since revision 1.25: +1 -1 lines
Regen.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Sun Feb 20 01:17:43 2005 UTC (9 years, 9 months ago) by davidxu
Branches: MAIN
Diff to: previous 1.24: preferred, unified
Changes since revision 1.24: +2 -0 lines
Implement sigtimedwait and sigwaitinfo syscalls.

Reviewed by: dillon

Revision 1.24: download - view: text, markup, annotated - select for diffs
Mon Jan 31 17:38:30 2005 UTC (9 years, 9 months ago) by joerg
Branches: MAIN
Diff to: previous 1.23: preferred, unified
Changes since revision 1.23: +2 -1 lines
Regen.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Fri Jan 14 04:19:55 2005 UTC (9 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.22: preferred, unified
Changes since revision 1.22: +1 -1 lines
Minor correction in umtx_*() calls, the mutex pointer should point to
volatile store.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Fri Jan 14 02:20:24 2005 UTC (9 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.21: preferred, unified
Changes since revision 1.21: +3 -1 lines
Add syscall primitives for generic userland accessible sleep/wakeup
functions.  These functions are capable of sleeping and waking up based on
a generic user VM address.  Programs capable of sharing memory are also
capable of interaction through these functions.

Also regenerate our system calls.

umtx_sleep(ptr, matchvalue, timeout)

    If *(int *)ptr (userland pointer) does not match the matchvalue,
    sleep for timeout microseconds.  Access to the contents of *ptr plus
    entering the sleep is interlocked against calls to umtx_wakeup().
    Various error codes are turned depending on what causes the function
    to return.  Note that the timeout may not exceed 1 second.

utmx_wakeup(ptr, count)

    Wakeup at least count processes waiting on the specified userland
    address.  A count of 0 wakes all waiting processes up.  This function
    interlocks against umtx_sleep().

The typical race case showing resolution between two userland processes is
shown below.  A process releasing a contested mutex may adjust the contents
of the pointer after the kernel has tested *ptr in umtx_sleep(), but this does
not matter because the first process will see that the mutex is set to a
contested state and will call wakeup after changing the contents of the
pointer.  Thus, the kernel itself does not have to execute any
compare-and-exchange operations in order to support userland mutexes.

    PROCESS 1			PROCESS 2		******** RACE#1 ******

    cmp_exg(ptr, FREE, HELD)
	.			cmp_exg(ptr, HELD, CONTESTED)
	.			umtx_sleep(ptr, CONTESTED, 0)
	.			[kernel tests *ptr]     <<<< COMPARE vs
    cmp_exg(CONTESTED, FREE)		.		<<<< CHANGE
	.			tsleep(....)
    umtx_wakeup(ptr, 1)			.
	.				.
	.				.



    PROCESS 1			PROCESS 2		******** RACE#2 ******

    cmp_exg(ptr, FREE, HELD)
				cmp_exg(ptr, HELD, CONTESTED)
				umtx_sleep(ptr, CONTESTED, 0)
    cmp_exg(CONTESTED, FREE)				<<<< CHANGE vs
    umtx_wakeup(ptr, 1)
				[kernel tests *ptr]	<<<< COMPARE
				[MISMATCH, DO NOT TSLEEP]


These functions are very loosely based on Jeff Roberson's umtx work in
FreeBSD.  These functions are greatly simplified relative to that work in
order to provide a more generic mechanism.

This is precursor work for a port of David Xu's 1:1 userland threading
library.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Wed Dec 29 02:40:03 2004 UTC (9 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.20: preferred, unified
Changes since revision 1.20: +1 -1 lines
Journaling layer work.

* Adjust the new mountctl syscall to make the passed file descriptor an
  explicit argument rather then storing the fd in the control structure.
  Convert the fd to a file pointer to make kern_mountctl() callable from
  a pure thread.

* Get rid of vop_stdmountctl and just have the VOP default ops call
  journal_mountctl(), which makes things less confusing.

* Get more of the journaling infrastructure working.  Basic installation
  and removal of the journaling structure and the creation and destruction
  of the worker thread and stream file pointer now works (with lots of XXX's).

* Add a journaling vector for VOP_NMKDIR to test the journaling VOP ops shim.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Fri Dec 24 05:00:22 2004 UTC (9 years, 11 months ago) by dillon
Branches: MAIN
Diff to: previous 1.19: preferred, unified
Changes since revision 1.19: +2 -1 lines
Journaling layer work.  Add a new system call, mountctl, which will be used
to manage the journaling layer.  Add a new VOP, VOP_MOUNTCTL, which will
be used to pass mountctl operations down into the VFS layer.

Revision 1.19: download - view: text, markup, annotated - select for diffs
Tue Nov 23 06:32:34 2004 UTC (10 years ago) by dillon
Branches: MAIN
Diff to: previous 1.18: preferred, unified
Changes since revision 1.18: +2 -1 lines
There is enough demand for Kip Macy's checkpointing code to warrent
permanent integration into the kernel.  Add a fixed system call,
sys_checkpoint(2), to support the checkpt(1) utility as well as user
programs which want to install their own signal handler (SIGCKPT).

Revision 1.18: download - view: text, markup, annotated - select for diffs
Thu Aug 12 19:59:30 2004 UTC (10 years, 3 months ago) by eirikn
Branches: MAIN
CVS tags: DragonFly_Snap29Sep2004, DragonFly_Snap13Sep2004
Diff to: previous 1.17: preferred, unified
Changes since revision 1.17: +1 -1 lines
Add message passed syscall's.

Split up sendsys2() into two parts, sendsys2() and waitsys2(). sendsys2() will
take care of the synchronous syscall's and initate asynchronous syscall's, and
waitsys2() will wait for a asynchronous syscall to finish.

Asynchronous syscall's can currently only be issued by the root user, but this
limitation will be removed when the code becomes more stable and better tested.

Add userland support for the synchronous and asynchronous sysmsg's to libcr.
Libcr defaults to the use of synchronous sysmsg's now, but this will be changes
as soon as we allow every user to do asynchronous sysmsg's.

Add a limitation to the number of sysmsg's one proc can have running at any
given time. This defaults to unlimited and can be changed with the
kern.max_sysmsg sysctl.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Sat Mar 6 22:14:16 2004 UTC (10 years, 8 months ago) by dillon
Branches: MAIN
CVS tags: DragonFly_1_0_REL, DragonFly_1_0_RC1, DragonFly_1_0A_REL
Diff to: previous 1.16: preferred, unified
Changes since revision 1.16: +3 -1 lines
Additional CAPS IPC work.  Add additional system calls to allow a CAPS
server to set a generation number and a CAPS client to query it, which can
be used for any purpose but which is intended to allow a server to tell its
clients to invalidate their caches.

Add missing fork-handling code.  CAPS links are only good on a thread-by-thread
basis.  When a process forks/rforks/clones any active CAPS links will be
created as dummy entries in the forked process, causing CAPS syscalls to
return ENOTCONN.   This allows code based on CAPS to detect when it has been
forked so it can re-connect to the service.

Make a slight change to the API.  caps_sys_put() now returns an immediate
ENOTCONN if it forked.  Note that userland CAPS code must still deal with
the case where a message has been sent and the connection is lost before the
reply is returned.  The kernel automatically replies unreplied messages
with 0-length data in these cases.

Add additional flags to the API, including one that allows a client to
block when connecting to a non-existant service.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Tue Jan 20 18:41:51 2004 UTC (10 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.15: preferred, unified
Changes since revision 1.15: +3 -1 lines
Resident executable support stage 1/4: Add kernel bits and syscall support
for in-kernel caching of vmspace structures.  The main purpose of this
feature is to make it possible to run dynamically linked programs as fast
as if they were statically linked, by vmspace_fork()ing their vmspace and
saving the copy in the kernel, then using that whenever the program is
exec'd.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Sun Jan 18 12:31:09 2004 UTC (10 years, 10 months ago) by dillon
Branches: MAIN
Diff to: previous 1.14: preferred, unified
Changes since revision 1.14: +9 -1 lines
CAPS IPC library stage 2/3: Adjust syscalls.master and regenerate our
system calls.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Fri Nov 21 05:29:02 2003 UTC (11 years ago) by dillon
Branches: MAIN
Diff to: previous 1.13: preferred, unified
Changes since revision 1.13: +2 -0 lines
Implement an upcall mechanism to support userland LWKT.  This mechanism will
allow multiple processes sharing the same VM space (aka clone/threading)
to send each other what are basically IPIs.

Two new system calls have been added, upc_register() and upc_control().
Documentation is forthcoming.  The upcalls are nicely abstracted and a
program can register as many as it wants up to the kernel limit (which
is 32 at the moment).

The upcalls will be used for passing asynch data from kernel to userland,
such as asynch syscall message replies, for thread preemption timing,
software interrupts, IPIs between virtual cpus (e.g. between the processes
that are sharing the single VM space).

Revision 1.13: download - view: text, markup, annotated - select for diffs
Thu Nov 20 06:05:31 2003 UTC (11 years ago) by dillon
Branches: MAIN
Diff to: previous 1.12: preferred, unified
Changes since revision 1.12: +1 -1 lines
This is a major cleanup of the LWKT message port code.  The messaging code
is getting closer to being directly useable by userland.  With these changes
message/port operations are now far better abstracted then they were before.

    * Stale fields have been removed from struct lwkt_msg.
    * lwkt_abortmsg() has been revamped to make it easier to support.
    * lwkt_waitmsg has been converted to a port function.
    * mp_*port() function fields have been renamed for better readability.
    * ms_cleanupmsg has been removed from struct lwkt_msg.
    * Union sysmsg is now struct sysmsg.
    * A copyout function has been added to struct sysmsg.
    * The system calls have been regenerated.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Mon Nov 10 23:58:58 2003 UTC (11 years ago) by dillon
Branches: MAIN
Diff to: previous 1.11: preferred, unified
Changes since revision 1.11: +2 -1 lines
Add the varsym_list() system call and add listing support to the varsym
utility.

Work done by:  Eirik Nygaard <eirikn@kerneled.com> and Matt Dillon

Revision 1.11: download - view: text, markup, annotated - select for diffs
Wed Nov 5 23:26:21 2003 UTC (11 years ago) by dillon
Branches: MAIN
Diff to: previous 1.10: preferred, unified
Changes since revision 1.10: +3 -1 lines
Variant symlink support stage 1/2: Implement support for storing and retrieving
system-specific, user-specific, and process-specific variables.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Fri Oct 24 14:10:46 2003 UTC (11 years, 1 month ago) by daver
Branches: MAIN
Diff to: previous 1.9: preferred, unified
Changes since revision 1.9: +1 -6 lines
Remove the FreeBSD 3.x signal code.  This includes osendsig(),
osigreturn() and a couple of structures that these syscalls depended
on.

Split the sigaction(), sigprocmask(), sigpending(), sigsuspend(),
sigaltstack() and kill() syscalls.

Move the 4.3BSD signal syscalls osigvec(), osigblock(), osigsetmask(),
osigstack() and okillpg() to the 43bsd subtree.  I'm not too sure
if these will even work with the FreeBSD-4 signal trampoline code,
but they do compile and link.

Implement linux_signal(), linux_rt_sigaction(), linux_sigprocmask(),
linux_rt_sigprocmask(), linux_sigpending(), linux_kill(),
linux_sigaction(), linux_sigsuspend(), linux_rt_sigsuspend(),
linux_pause(), and linux_sigaltstack() with the new in-kernel syscalls.
This patch kills 7 stackgap allocations in the Linuxolator.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Wed Oct 8 01:30:32 2003 UTC (11 years, 1 month ago) by daver
Branches: MAIN
Diff to: previous 1.8: preferred, unified
Changes since revision 1.8: +0 -1 lines
Introduce the function iovec_copyin() and it's friend iovec_free().
These remove a great deal of duplicate code in the syscall functions.
For those who like numbers, this patch uses iovec_copyin() four times
in uipc_syscalls.c, two times in linux_socket.c and two times in
43bsd_socket.c.  Would somebody please comment on the inclusion of
sys/malloc.h in sys/uio.h?

Remove sockargs() which was used once in the svr4 emulation code.  It
is replaced with a small piece of code that gets an mbuf and copyin()'s
to it's data region.

Remove the osendfile() syscall which was inapropriately named and placed
in the COMPAT_43 code where it doesn't belong.

Split the socket(), shutdown() and sendfile() syscalls.  All of the
syscalls in kern/uipc_syscalls.c are now split.

Prevent a panic due to m_freem()'ing a dangling pointer in recvmsg(),
orecvmsg(), linux_recvmsg().

This patch completely removes COMPAT_43 from kern/uipc_syscalls.c.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Wed Aug 20 07:31:21 2003 UTC (11 years, 3 months ago) by rob
Branches: MAIN
Diff to: previous 1.7: preferred, unified
Changes since revision 1.7: +0 -0 lines
__P() != wanted, begin removal, in order to preserve white space this needs
to be done by hand, as I accidently killed a source tree that I had gotten
this far on. I'm committing this now, LINT and GENERIC both build with
these changes, there are many more to come.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Tue Aug 12 02:36:15 2003 UTC (11 years, 3 months ago) by dillon
Branches: MAIN
Diff to: previous 1.6: preferred, unified
Changes since revision 1.6: +0 -0 lines
Syscall messaging 4: Further expand the kernel-version of the syscall message.
The (in-kernel) syscall message is now arranged:

    struct blah_args {
	sysmsg
	usrmsg
	... syscall arguments ...
    }

Original system calls copyin() just the arguments and then initialize sysmsg
and go.  Syscall messages copyin() usrmsg+arguments and then initialize sysmsg
as appropriate and go.

Further detail work for EASYNC support.  Implement td_msgport as a reply port
and start working on an async capability for the nanosleep() system call.

NOTE: Preliminary system call messaging can be tested using the suite of
programs in /usr/src/test/sysmsg.

NOTE: Work is still in progress  and you can crash the system, so use of
MSGF_ASYNC for messaging system calls is currently restricted to root.

Also fixed a bug in the syscall module helper code in sys/sysent.h, which
might have been causing the linux problems (or might not have).

All system call headers had to be regenerated to deal with the structural
changes.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Wed Jul 30 00:19:16 2003 UTC (11 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.5: preferred, unified
Changes since revision 1.5: +0 -0 lines
syscall messaging 3: Expand the 'header' that goes in front of the syscall
arguments in the kernel copy.  The header was previously just an lwkt_msg.
The header is now a 'union sysmsg'.  'union sysmsg' contains an lwkt_msg
plus space for the additional meta data required to asynchronize various
system calls.   We haven't actually asynchronized anything yet and will not
be able to until the reply port and abort processing infrastructure is
in place.  See sys/sysmsg.h for more information on the new header.

Also cleanup syscall generation somewhat and add some ibcs2 stuff I missed.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Thu Jul 24 23:52:39 2003 UTC (11 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.4: preferred, unified
Changes since revision 1.4: +0 -0 lines
Syscall messaging work 2: Continue with the implementation of sendsys(),
using int 0x81.  This entry point will be responsible for sending system
call messages or waiting for messages / port activity.

With this commit system call messages can be run through 0x81 but at the
moment they will always run synchronously. Here's the core interface
code for IA32:

    static __inline int
    sendsys(void *port, void *msg, int msgsize)
    {
	int error;
	__asm __volatile("int $0x81" : "=a"(error) :
			"a"(port), "c"(msg), "d"(msgsize) : "memory");
	return(error);
    }

Performance verses a direct system call is currently excellent considering
that this is my initial attempt.

		600MHzC3	1.2GHzP3x2(SMP)

getuid()	1300 ns		 909 ns
getuid_msg()	1700 ns		1077 ns

Revision 1.4: download - view: text, markup, annotated - select for diffs
Thu Jul 24 01:41:27 2003 UTC (11 years, 4 months ago) by dillon
Branches: MAIN
Diff to: previous 1.3: preferred, unified
Changes since revision 1.3: +1 -1 lines
Preliminary syscall messaging work.  Adjust all <syscall>_args structures
to include an lwkt_msg at their base which will eventually allow syscalls
to run asynch.  Note that this is for the kernel copy of the arguments, the
userland argument format has not changed for the standard syscall entry
point.

Begin abstracting a messaging syscall interface (#if 0'd out at the moment).

Change the syscall2 entry point to take the new expanded argument structure
into account.  Change sysent argument calculation (AS macro) to take the
new expanded argument structure into account.

Note: existing linux, svr4, and ibcs2 emulation may break with this commit,
though it is not intentional.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Mon Jun 23 17:55:50 2003 UTC (11 years, 5 months ago) by dillon
Branches: MAIN
CVS tags: PRE_MP
Diff to: previous 1.2: preferred, unified
Changes since revision 1.2: +1 -1 lines
proc->thread stage 2: MAJOR revamping of system calls, ucred, jail API,
and some work on the low level device interface (proc arg -> thread arg).
As -current did, I have removed p_cred and incorporated its functions
into p_ucred.  p_prison has also been moved into p_ucred and adjusted
accordingly.  The jail interface tests now uses ucreds rather then processes.

The syscall(p,uap) interface has been changed to just (uap).  This is inclusive
of the emulation code.  It makes little sense to pass a proc pointer around
which confuses the MP readability of the code, because most system call code
will only work with the current process anyway.  Note that eventually
*ALL* syscall emulation code will be moved to a kernel-protected userland
layer because it really makes no sense whatsoever to implement these
emulations in the kernel.

suser() now takes no arguments and only operates with the current process.
The process argument has been removed from suser_xxx() so it now just takes
a ucred and flags.

The sysctl interface was adjusted somewhat.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Tue Jun 17 04:28:59 2003 UTC (11 years, 5 months ago) by dillon
Branches: MAIN
Diff to: previous 1.1: preferred, unified
Changes since revision 1.1: +2 -2 lines
Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids.  Most
ids have been removed from !lint sections and moved into comment sections.

Revision 1.1: download - view: text, markup, annotated - select for diffs
Tue Jun 17 02:55:53 2003 UTC (11 years, 5 months ago) by dillon
Branches: MAIN
CVS tags: FREEBSD_4_FORK
import from FreeBSD RELENG_4 1.65.2.10

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options