summaryrefslogtreecommitdiffstats
path: root/sys/kern
Commit message (Collapse)AuthorAgeFilesLines
* Change description of kern.osreldate from "Operating system release date" toeivind2003-08-211-1/+5
| | | | "Kernel release date" - userland version is in /usr/include/osreldate.h
* Add mac_check_vnode_deleteextattr() and mac_check_vnode_listextattr():rwatson2003-08-213-8/+38
| | | | | | | | | | | explicit access control checks to delete and list extended attributes on a vnode, rather than implicitly combining with the setextattr and getextattr checks. This reflects EA API changes in the kernel made recently, including the move to explicit VOP's for both of these operations. Obtained from: TrustedBSD PRoject Sponsored by: DARPA, Network Associates Laboratories
* Remove about 40 lines of #ifdef/#endif by using new macrosrwatson2003-08-201-70/+31
| | | | | | | | | MAC_DEBUG_COUNTER_INC() and MAC_DEBUG_COUNTER_DEC() to maintain debugging counter values rather than #ifdef'ing the atomic operations to MAC_DEBUG. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* bde made a number of suggested improvements to the code. This commitimp2003-08-201-20/+17
| | | | | | | | | | represents the pruely stylistic changes and should have no net impact on the rest of the code. bde's more substantive changes will follow in a separate commit once we've come to closure on them. Submitted by: bde
* Fix an extreme edge case in leap second handling. We need to callimp2003-08-201-4/+6
| | | | | | | | | | | ntp_update_second twice when we have a large step in case that step goes across a scheduled leap second. The only way this could happen would be if we didn't call tc_windup over the end of day on the day of a leap second, which would only happen if timeouts were delayed for seconds. While it is an edge case, it is an important one to get right for my employer. Sponsored by: Timing Solutions Corporation
* Change instances of callout_init that specify MPSAFE behaviour tosam2003-08-197-8/+8
| | | | | use CALLOUT_MPSAFE instead of "1" for the second parameter. This does not change the behaviour; it just makes the intent more clear.
* It is not an error to have no devices in the kernel: Return thephk2003-08-171-4/+4
| | | | generation number and start it from one instead of zero.
* Use constants less throughout the code and instead use the objsizebmilekic2003-08-161-6/+6
| | | | | | | variable. This makes changing the size of an mbuf or cluster for testing/debugging/whatever purposes easier. Submitted by: sam
* Further cleanup <machine/cpu.h> and <machine/md_var.h>: move the MImarcel2003-08-161-1/+1
| | | | | | | | | | | | | | | | | | | prototypes of cpu_halt(), cpu_reset() and swi_vm() from md_var.h to cpu.h. This affects db_command.c and kern_shutdown.c. ia64: move all MD prototypes from cpu.h to md_var.h. This affects madt.c, interrupt.c and mp_machdep.c. Remove is_physical_memory(). It's not used (vm_machdep.c). alpha: the MD prototypes have been left in cpu.h with a comment that they should be there. Moving them is left for later. It was expected that the impact would be significant enough to be done in a seperate commit. powerpc: MD prototypes left in cpu.h. Comment added. Suggested by: bde Tested with: make universe (pc98 incomplete)
* Give timecounters a numeric quality field.phk2003-08-161-8/+35
| | | | | | | | | | | | | | | | A timecounter will be selected when registered if its quality is not negative and no less than the current timecounters. Add a sysctl to report all available timecounters and their qualities. Give the dummy timecounter a solid negative quality of minus a million. Give the i8254 zero and the ACPI 1000. The TSC gets 800, unless APM or SMP forces it negative. Other timecounters default to zero quality and thereby retain current selection behaviour.
* - Various style fixes in both code and comments.jhb2003-08-153-66/+75
| | | | | | | | | - Update some stale comments. - Sort a couple of includes. - Only set 'newcpu' in updatepri() if we use it. - No functional changes. Obtained from: bde (via an old diff I got a long time ago)
* Add or finish support for machine dependent ptrace requests. When wemarcel2003-08-151-22/+13
| | | | | | | | | | | | | | | | | check for permissions, do it for all requests, not the known requests. Later when we actually service the request we deal with the invalid requests we previously caught earlier. This commit changes the behaviour of the ptrace(2) interface for boundary cases such as an unknown request without proper permissions. Previously we would return EINVAL. Now we return EBUSY or EPERM. Platforms need to define __HAVE_PTRACE_MACHDEP when they have MD requests. This makes the prototype of cpu_ptrace() visible and introduces a call to this function for all requests greater or equal to PT_FIRSTMACH. Silence on: audit
* if we got this far, we definately don't have an EBADF. Return a morejmg2003-08-151-1/+1
| | | | | | | sane result of EPIPE. Reported by: nCircle dev team MFC after: 3 day
* add a read-only sysctl to display the number of entries in the fixed sizecg2003-08-141-5/+9
| | | | | | | | | kobj global method table; also kassert that the table has not overflowed when defining a new method. there are indications that the table is being overflowed in certain situations as we gain more kobj consumers- this will allow us to check whether kobj is at fault. symptoms would be incorrect methods being called.
* Update powerpc to use the (old thread,new thread) calling conventiongrehan2003-08-144-18/+0
| | | | for cpu_throw() and cpu_switch().
* - The vm_object pointer in pipe_buffer is unused. Remove it.alc2003-08-131-5/+2
| | | | | - Check for successful initialization of pipe_zone in pipeinit() rather than every call to pipe(2).
* Expand inline the relevant parts of src/COPYRIGHT for Matt Dillon'simp2003-08-121-3/+26
| | | | | | copyrighted files. Approved by: Matt Dillon
* Remove extra space.mux2003-08-121-1/+1
|
* - Convert Alpha over to the new calling conventions for cpu_throw() andjhb2003-08-124-5/+5
| | | | | | | | cpu_switch() where both the old and new threads are passed in as arguments. Only powerpc uses the old conventions now. - Update comments in the Alpha swtch.s to reflect KSE changes. Tested by: obrien, marcel
* Pipespace() no longer requires Giant.alc2003-08-111-2/+2
|
* Drop Giant in recvit before returning an error to the caller to avoidkan2003-08-111-1/+4
| | | | leaking the Giant on the syscall exit.
* Add the mlockall() and munlockall() system calls.bms2003-08-112-2/+2
| | | | | | | | | | | | | | | | | | | | | | | - All those diffs to syscalls.master for each architecture *are* necessary. This needed clarification; the stub code generation for mlockall() was disabled, which would prevent applications from linking to this API (suggested by mux) - Giant has been quoshed. It is no longer held by the code, as the required locking has been pushed down within vm_map.c. - Callers must specify VM_MAP_WIRE_HOLESOK or VM_MAP_WIRE_NOHOLES to express their intention explicitly. - Inspected at the vmstat, top and vm pager sysctl stats level. Paging-in activity is occurring correctly, using a test harness. - The RES size for a process may appear to be greater than its SIZE. This is believed to be due to mappings of the same shared library page being wired twice. Further exploration is needed. - Believed to back out of allocations and locks correctly (tested with WITNESS, MUTEX_PROFILING, INVARIANTS and DIAGNOSTIC). PR: kern/43426, standards/54223 Reviewed by: jake, alc Approved by: jake (mentor) MFC after: 2 weeks
* More pipe changes:silby2003-08-112-48/+34
| | | | | | | | | | | | | | From alc: Move pageable pipe memory to a seperate kernel submap to avoid awkward vm map interlocking issues. (Bad explanation provided by me.) From me: Rework pipespace accounting code to handle this new layout, and adjust our default values to account for the fact that we now have a solid limit on allocations. Also, remove the "maxpipes" limit, as it no longer has a purpose. (The limit on kva usage solves the problem of having two many pipes.)
* Use vm_page_hold() instead of vm_page_wire(). Otherwise, a multithreadedalc2003-08-111-3/+3
| | | | | | | | | | application could cause a wired page to be freed. In general, vm_page_hold() should be preferred for ephemeral kernel mappings of pages borrowed from a user-level address space. (vm_page_wire() should really be reserved for indefinite duration pinning by the "owner" of the page.) Discussed with: silby Submitted by: tegge
* panic() if we try to handle an out-of-range signal number innectar2003-08-101-2/+5
| | | | | | | | psignal()/tdsignal(). The test was historically in psignal(). It was changed into a KASSERT, and then later moved to tdsignal() when the latter was introduced. Reviewed by: iedowse, jhb
* Add or correct range checking of signal numbers in system calls andnectar2003-08-101-2/+2
| | | | | | | | | ioctls. In the particular case of ptrace(), this commit more-or-less reverts revision 1.53 of sys_process.c, which appears to have been erroneous. Reviewed by: iedowse, jhb
* Background: When proc_rwmem() wired and mapped a page, it also addedalc2003-08-091-30/+5
| | | | | | | | | | | | | | | | a reference to the containing object. The purpose of the reference being to prevent the destruction of the object and an attempt to free the wired page. (Wired pages can't be freed.) Unfortunately, this approach does not work. Some operations, like fork(2) that call vm_object_split(), can move the wired page to a difference object, thereby making the reference pointless and opening the possibility of the wired page being freed. A solution is to use vm_page_hold() in place of vm_page_wire(). Held pages can be freed. They are moved to a special hold queue until the hold is released. Submitted by: tegge
* - Remove GIANT_REQUIRED from pipespace().alc2003-08-081-4/+0
| | | | - Remove a duplicate initialization from pipe_create().
* Copyin the thread mailbox flags from the correct locationdeischen2003-08-082-2/+2
| | | | in the mailbox.
* td_dupfd just needs to be less than 0, it does not have to hold thejhb2003-08-072-2/+2
| | | | negative value of the index of the new file, so just use -1.
* Update some argument-documenting comments to match reality.nectar2003-08-073-6/+9
| | | | | Add an explicit range check to those same arguments to reduce risk of cardiac arrest in future code readers.
* Consistently use the BSD u_int and u_short instead of the SYSV uint andjhb2003-08-075-15/+15
| | | | | | | ushort. In most of these files, there was a mixture of both styles and this change just makes them self-consistent. Requested by: bde (kern_ktrace.c)
* The ktrace mutex does not need to be locked around the post of the ktracejhb2003-08-071-1/+1
| | | | | | | semaphore and doing so can lead to a possible reversal. WITNESS would have caught this if semaphores were used more often in the kernel. Submitted by: Ted Unangst <tedu@stanford.edu>, Dawson Engler
* - Remove GIANT_REQUIRED from pipe_free_kmem().alc2003-08-071-3/+0
| | | | | - Remove the acquisition and release of Giant around pipe_kmem_free() and uma_zfree() in pipeclose().
* If connect(2) has been interrupted by a signal and therefore theyar2003-08-061-3/+8
| | | | | | | | | | | | | | connection is to be established asynchronously, behave as in the case of non-blocking mode: - keep the SS_ISCONNECTING bit set thus indicating that the connection establishment is in progress, which is the case (clearing the bit in this case was just a bug); - return EALREADY, instead of the confusing and unreasonable EADDRINUSE, upon further connect(2) attempts on this socket until the connection is established (this also brings our connect(2) into accord with IEEE Std 1003.1.)
* kse.h is not needed for these files.davidxu2003-08-052-2/+0
|
* Introduce a thread mailbox flag TMF_NOUPCALL. On some architectures otherdavidxu2003-08-052-14/+36
| | | | | | | than i386 or AMD64, TP register points to thread mailbox, and they can not atomically clear km_curthread in kse mailbox, in this case, thread retrieves its thread pointer from TP register and sets flag TMF_NOUPCALL in its thread mailbox to indicate a critical region.
* Make the second argument to sooptcopyout() constant in order tohsu2003-08-051-4/+1
| | | | | | simplify the upcoming PIM patches. Submitted by: Pavlin Radoslavov <pavlin@icir.org>
* In the mknod(), mkfifo(), link(), symlink() and undelete() syscalls,iedowse2003-08-052-10/+46
| | | | | | | | | | | | | | use vrele() instead of vput() on the parent directory vnode returned by namei() in the case where it is equal to the target vnode. This handles namei()'s somewhat strange (but documented) behaviour of not locking either vnode when the two vnodes are equal and LOCKPARENT but not LOCKLEAF is specified. Note that since a vnode double-unlock is not currently fatal, these coding errors were effectively harmless. Spotted by: Juergen Hannken-Illjes <hannken@eis.cs.tu-bs.de> Reviewed by: mckusick
* Do some minor Giant pushdown made possible by copyin, fget, fdrop,dwmalone2003-08-042-19/+14
| | | | | | | | | malloc and mbuf allocation all not requiring Giant. 1) ostat, fstat and nfstat don't need Giant until they call fo_stat. 2) accept can copyin the address length without grabbing Giant. 3) sendit doesn't need Giant, so don't bother grabbing it until kern_sendit. 4) move Giant grabbing from each indivitual recv* syscall to recvit.
* Adjust a comment to remove staleness and take slightly less implementationjhb2003-08-041-6/+2
| | | | specific perspective.
* Set td_critnest to 1 when setting up a thread since it is a MI field withjhb2003-08-042-0/+2
| | | | | | | MI values. This ensures that td_critnest for a newly fork'd thread is always valid. Requested by: bde (a long time ago)
* Insert cosmetic spaces.jhb2003-08-041-2/+2
| | | | Reported by: kris
* Move more ACL logic from the UFS code (ufs_acl.c) to the central POSIX.1erwatson2003-08-043-3/+252
| | | | | | | | | | | | | | | | | | support routines in kern_acl.c: - Define ACL_OVERRIDE_MASK and ACL_PRESERVE_MASK centrally in acl.h: the mode bits that are (and aren't) stored in the ACL. - Add acl_posix1e_acl_to_mode(): given a POSIX.1e extended ACL, generate a compatibility mode (only the bits supported by the POSIX.1e ACL). - acl_posix1e_newfilemode(): Given a requested creation mode and default ACL, calculate the mode for the new file system object (only the bits supported by the POSIX.1e ACL). PR: 50148 Reported by: Ritz, Bruno <bruno_ritz@gmx.ch> Obtained from: TrustedBSD Project
* Both 'c' an 'lines' are unused, the bogus init of lines was accidentallyjhb2003-08-021-2/+1
| | | | left behind.
* Use kmem_alloc_nofault() rather than kmem_alloc_pageable() in proc_rwmem().alc2003-08-021-1/+1
| | | | | | See revision 1.140 of kern/sys_pipe.c for a detailed rationale. Submitted by: tegge
* Grab Giant in bufdonebio() since drivers may not hold it.phk2003-08-021-0/+4
| | | | | This only protects the "struct buf" consumers (ie: DEV_STRATEGY()), but does not protect BIO_STRATEGY() users.
* Grab Giant in physio() since non-giant drivers are starting to appear.phk2003-08-021-0/+3
|
* Eliminate an abuse of kmem_alloc_pageable() in bufinit()alc2003-08-021-6/+1
| | | | | | by using VM_ALLOC_NOOBJ to allocate the bogus page. Reviewed by: tegge
* Use kmem_alloc_nofault() rather than kmem_alloc_pageable() in sf_buf_init().alc2003-08-021-1/+1
| | | | | | (See revision 1.140 of kern/sys_pipe.c for a detailed rationale.) Submitted by: tegge
OpenPOWER on IntegriCloud