#
efda3bd0 |
| 05-Sep-2006 |
Matthew Dillon <dillon@dragonflybsd.org> |
Rename malloc->kmalloc, free->kfree, and realloc->krealloc. Pass 1
|
#
84204577 |
| 03-Sep-2006 |
Matthew Dillon <dillon@dragonflybsd.org> |
Rename functions to avoid conflicts with libc.
|
#
fef8985e |
| 28-Jul-2006 |
Matthew Dillon <dillon@dragonflybsd.org> |
MASSIVE reorganization of the device operations vector. Change cdevsw to dev_ops. dev_ops is a syslink-compatible operations vector structure similar to the vop_ops structure used by vnodes.
Remov
MASSIVE reorganization of the device operations vector. Change cdevsw to dev_ops. dev_ops is a syslink-compatible operations vector structure similar to the vop_ops structure used by vnodes.
Remove a huge number of instances where a thread pointer is still being passed as an argument to various device ops and other related routines. The device OPEN and IOCTL calls now take a ucred instead of a thread pointer, and the CLOSE call no longer takes a thread pointer.
show more ...
|
#
9ba76b73 |
| 13-Jun-2006 |
Matthew Dillon <dillon@dragonflybsd.org> |
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/s
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.
show more ...
|
#
753fd850 |
| 05-Jun-2006 |
Matthew Dillon <dillon@dragonflybsd.org> |
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 ove
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.
show more ...
|
#
f832287e |
| 27-May-2006 |
Matthew Dillon <dillon@dragonflybsd.org> |
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
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.
show more ...
|
#
228b401d |
| 19-May-2006 |
Matthew Dillon <dillon@dragonflybsd.org> |
Convert most manual accesses to filedesc->fd_files[] into the appropriate holdfp() call. Fix a number of places where ops were being executed on the file pointer without holding a private reference
Convert most manual accesses to filedesc->fd_files[] into the appropriate holdfp() call. Fix a number of places where ops were being executed on the file pointer without holding a private reference to it (mainly fo_ioctl(), revoke(), and lseek()).
Create procedures in kern_descrip.c to set and clear descriptor flags and to handle the bootstrap filedesc for proc0. Replace manual code elsewhere with calls to the new procedures.
Move getvnode() to kern_descrip.c. Remove nsmb_getfp(). Use holdfp() instead.
show more ...
|
#
fa541be6 |
| 19-May-2006 |
Matthew Dillon <dillon@dragonflybsd.org> |
Consolidate the file descriptor destruction code used when a newly created file descriptor must be destroyed due to an error into a new procedure, fdealloc(), rather then manually repeating it over a
Consolidate the file descriptor destruction code used when a newly created file descriptor must be destroyed due to an error into a new procedure, fdealloc(), rather then manually repeating it over and over again.
Move holdsock() and holdfp() into kern/kern_descrip.c.
show more ...
|
#
a9b80e23 |
| 17-May-2006 |
Matthew Dillon <dillon@dragonflybsd.org> |
Pass the process (p) instead of the vnode (p->p_tracep) to the kernel tracing API functions. This allows the vnode ref to be consolidated into one place.
|
#
9f87144f |
| 06-May-2006 |
Matthew Dillon <dillon@dragonflybsd.org> |
The fdrop() procedure no longer needs a thread argument, remove it.
|
#
87de5057 |
| 06-May-2006 |
Matthew Dillon <dillon@dragonflybsd.org> |
The thread/proc pointer argument in the VFS subsystem originally existed for... well, I'm not sure *WHY* it originally existed when most of the time the pointer couldn't be anything other then curth
The thread/proc pointer argument in the VFS subsystem originally existed for... well, I'm not sure *WHY* it originally existed when most of the time the pointer couldn't be anything other then curthread or curproc or the code wouldn't work. This is particularly true of lockmgr locks.
Remove the pointer argument from all VOP_*() functions, all fileops functions, and most ioctl functions.
show more ...
|
#
ef5c76d7 |
| 26-Apr-2006 |
Matthew Dillon <dillon@dragonflybsd.org> |
Fix the range checking for all read and write system calls. Fix the iovec code to properly range-check iovec elements and to ensure that the total length does not overflow a signed integer. Regardl
Fix the range checking for all read and write system calls. Fix the iovec code to properly range-check iovec elements and to ensure that the total length does not overflow a signed integer. Regardless of 'size_t', the kernel does not allow any single I/O operation to exceed 2^31 bytes.
show more ...
|
#
7f83ed38 |
| 26-Apr-2006 |
Matthew Dillon <dillon@dragonflybsd.org> |
Add the preadv() and pwritev() systems and regenerate.
Submitted-by: Chuck Tuffli <ctuffli@gmail.com> Loosely-based-on: FreeBSD
|
#
344ad853 |
| 14-Nov-2005 |
Matthew Dillon <dillon@dragonflybsd.org> |
Make tsleep/wakeup() MP SAFE for kernel threads and get us closer to making it MP SAFE for user processes. Currently the code is operating under the rule that access to a thread structure requires c
Make tsleep/wakeup() MP SAFE for kernel threads and get us closer to making it MP SAFE for user processes. Currently the code is operating under the rule that access to a thread structure requires cpu locality of reference, and access to a proc structure requires the Big Giant Lock. The two are not mutually exclusive so, for example, tsleep/wakeup on a proc needs both cpu locality of reference *AND* the BGL. This was true with the old tsleep/wakeup and has now been documented.
The new tsleep/wakeup algorithm is quite simple in concept. Each cpu has its own ident based hash table and each hash slot has a cpu mask which tells wakeup() which cpu's might have the ident. A wakeup iterates through all candidate cpus simply by chaining the IPI message through them until either all candidate cpus have been serviced, or (with wakeup_one()) the requested number of threads have been woken up.
Other changes made in this patch set:
* The sense of P_INMEM has been reversed. It is now P_SWAPPEDOUT. Also, P_SWAPPING, P_SWAPINREQ are not longer relevant and have been removed.
* The swapping code has been cleaned up and seriously revamped. The new swapin code staggers swapins to give the VM system a chance to respond to new conditions. Also some lwp-related fixes were made (more p_rtprio vs lwp_rtprio confusion).
* As mentioned above, tsleep/wakeup have been rewritten. The process p_stat no longer does crazy transitions from SSLEEP to SSTOP. There is now only SSLEEP and SSTOP is synthesized from P_SWAPPEDOUT for userland consumpion. Additionally, tsleep() with PCATCH will NO LONGER STOP THE PROCESS IN THE TSLEEP CALL. Instead, the actual stop is deferred until the process tries to return to userland. This removes all remaining cases where a stopped process can hold a locked kernel resource.
* A P_BREAKTSLEEP flag has been added. This flag indicates when an event occurs that is allowed to break a tsleep with PCATCH. All the weird undocumented setrunnable() rules have been removed and replaced with a very simple algorithm based on this flag.
* Since the UAREA is no longer swapped, we no longer faultin() on PHOLD(). This also incidently fixes the 'ps' command's tendancy to try to swap all processes back into memory.
* speedup_syncer() no longer does hackish checks on proc0's tsleep channel (td_wchan).
* Userland scheduler acquisition and release has now been tightened up and KKASSERT's have been added (one of the bugs Stefan found was related to an improper lwkt_schedule() that was found by one of the new assertions). We also have added other assertions related to expected conditions.
* A serious race in pmap_release_free_page() has been corrected. We no longer couple the object generation check with a failed pmap_release_free_page() call. Instead the two conditions are checked independantly. We no longer loop when pmap_release_free_page() succeeds (it is unclear how that could ever have worked properly).
Major testing by: Stefan Krueger <skrueger@meinberlikomm.de>
show more ...
|
#
0679adc4 |
| 22-Jun-2005 |
Matthew Dillon <dillon@dragonflybsd.org> |
File descriptor cleanup stage 2, remove the separate arrays for file pointers, fileflags, and allocation counts and replace the mess with a single structural array. Also revamp the code that checks
File descriptor cleanup stage 2, remove the separate arrays for file pointers, fileflags, and allocation counts and replace the mess with a single structural array. Also revamp the code that checks whether the file descriptor array is built-in or allocated.
Note that the removed malloc's were doing something weird, allocating 'nf * OFILESIZE + 1' bytes instead of 'nf * OFILESIZE' bytes. I could not find any reason at all why it was doing that. It's gone now anyway.
show more ...
|
#
e43a034f |
| 06-Jun-2005 |
Matthew Dillon <dillon@dragonflybsd.org> |
Remove spl*() calls from kern, replacing them with critical sections. Change the meaning of safepri from a cpl mask to a thread priority. Make a minor adjustment to tests within one of the buffer cac
Remove spl*() calls from kern, replacing them with critical sections. Change the meaning of safepri from a cpl mask to a thread priority. Make a minor adjustment to tests within one of the buffer cache's critical sections.
show more ...
|
#
ab2eb4eb |
| 29-Mar-2005 |
David Rhodus <drhodus@dragonflybsd.org> |
Remove some uses of the SCARG macro.
|
#
25b5b94d |
| 01-Mar-2005 |
Simon Schubert <corecode@dragonflybsd.org> |
Fix a bug in the ioctl mapping (written by me), which basically failed to provide the neccessary infrastructure for linux drm to work.
This changes DRM and sound handling in the linuxulator to make
Fix a bug in the ioctl mapping (written by me), which basically failed to provide the neccessary infrastructure for linux drm to work.
This changes DRM and sound handling in the linuxulator to make use of the new code.
API compatibility is retained in wide parts; nevertheless modules using ioctl maps (nvidia) need to be recompiled.
Discovered-and-fixed-by: Brock Johnson <wildefire@isentry.homelinux.org> Reviewed-by: corecode, joerg
show more ...
|
#
b525b7ed |
| 13-Sep-2004 |
David Rhodus <drhodus@dragonflybsd.org> |
Change the array of char to an array of struct pollfd to avoid an address being migaligned.
Merged from fbsd pr: kern/85214
|
#
a0c5fc96 |
| 13-Aug-2004 |
Joerg Sonnenberger <joerg@dragonflybsd.org> |
IOCTL mapping layer Part I/II
This adds a generic framework for mapping IOCTL requests (cmds) and attaching special processing functions. Instead of the former adhoc code using large switch statemen
IOCTL mapping layer Part I/II
This adds a generic framework for mapping IOCTL requests (cmds) and attaching special processing functions. Instead of the former adhoc code using large switch statements e.g. in emulation/linux/linux_ioctl.c, the emulation layer registers a handler with the mappings for the request ranges it wants to handle specially. Devices can afterwards add there own mappings to support e.g. Linux specific IOCTLs.
The first part adds the infrastructure, the second part converts the Linux emulation, dev/drm and dev/raid/aac.
Submitted-by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de> Some minor changes by myself.
show more ...
|
#
a94976ad |
| 07-Jan-2004 |
Matthew Dillon <dillon@dragonflybsd.org> |
tvtohz() was originally designed for tsleep() and timeout() operations but it is also used to time nanosleep() ops. The problem is that in order to compensate for the fact that a clock interrupt mig
tvtohz() was originally designed for tsleep() and timeout() operations but it is also used to time nanosleep() ops. The problem is that in order to compensate for the fact that a clock interrupt might occur just after a thread blocks or registers a timeout, this function effectively added +1 to the returned value plus added another +1 for timeouts that were not integer multiples if the clock interrupt frequency.
Split tvtohz() into two routines: tvtohz_low() and tvtohz_high(). tvtohz_low() does not do any compensation, tvtohz_high() does.
Add the kern.sleep_hardloop sysctl, which defaults to 0 (off). If set to 1 this will cause nanosleep() to attempt to time exactly the requested interval (which could cost more cpu) rather then rounding it off to a multiple of hz. If set to 2 nanosleep() will only do the more rigid timing for requests less then 1 second. Also change the normal hz-baesd case to only compensate by +1, not +2, in order to improve accuracy.
show more ...
|
#
f2e1ec42 |
| 21-Oct-2003 |
Matthew Dillon <dillon@dragonflybsd.org> |
Fix bug in last commit, flags were not being passed to fo_write() which broke pwrite(). This caused samba to stop working (amoung other things).
Samba problem reported by: David Rhodus <drhodus@cat
Fix bug in last commit, flags were not being passed to fo_write() which broke pwrite(). This caused samba to stop working (amoung other things).
Samba problem reported by: David Rhodus <drhodus@catpa.com>
show more ...
|
#
ba023347 |
| 17-Oct-2003 |
David P. Reese, Jr. <daver@dragonflybsd.org> |
Create kern_readv() and kern_writev() and use them to split read(), pread(), readv(), write(), pwrite(), and writev().
Also, rewrite linux_pread() and linux_pwrite() using the in-kernel syscalls.
|
#
8b5e4c8f |
| 11-Oct-2003 |
David Rhodus <drhodus@dragonflybsd.org> |
* Move variable 'p' into a more proper place.
|
#
955988ce |
| 02-Oct-2003 |
David Rhodus <drhodus@dragonflybsd.org> |
Correct a case in readv(2) where the file descriptor reference count should have been decremented but was not.
Reported by: Joost Pol <joost@pine.nl> Obtained from: FreeBSD
|