summaryrefslogtreecommitdiffstats
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* Fixed namespace pollution in uma changes:bde2002-09-051-2/+3
| | | | | | | | | | | | - use `struct uma_zone *' instead of uma_zone_t, so that <sys/uma.h> isn't a prerequisite. - don't include <sys/uma.h>. Namespace pollution makes "opaque" types like uma_zone_t perfectly non-opaque. Such types should never be used (see style(9)). Fixed subsequently grwon dependencies of this header on its own pollution: - include <sys/_mutex.h> and its prerequisite <sys/_lock.h> instead of depending on namespace pollution 2 layers deep in <sys/uma.h>.
* Re-insert TUNABLE() export of MAC Biba and MAC MLS module 'enabled'rwatson2002-09-052-0/+2
| | | | | | | sysctls. Apparently lost during some or another merge. Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories
* Make the printf messages when routing interrupts more consistent in thejhb2002-09-052-7/+8
| | | | various PCI bridge drivers.
* Test PCIbios.ventry against 0 to see if we found a PCIbios entry point,jhb2002-09-053-6/+6
| | | | | | | | | not the 'entry' member. The entry point is formed from both a base and a relative entry point. 'entry' is that relative offset. It is perfectly valid to have an entry point with a relative offset of 0. PCIbios.ventry is the virtual address of the entry point that takes both 'base' and 'entry' into account, thus it is the proper variable to test to see if we have an entry point or not.
* Move some variables to the BSS instead of explicitly zero'ing them. Thisjhb2002-09-052-6/+6
| | | | also makes all of the PCIbios variable be zero'd, not just the entry field.
* Statically compile pcn(4) into the install kernel vs. using as module.obrien2002-09-052-2/+2
| | | | | | | lnc(4) will attach to AMD PCnet/FAST NICs if pcn(4) does not attach. I.e. pcn(4) gets first chance. There is a problem however in that pcn(4) was moved out of the install kernel so that the module would be used. This however causes bad installs if one has an AMD PCnet/FAST NIC.
* Make recursion prevention variable per-instance and remove XXX commentsobomax2002-09-052-7/+5
| | | | | | about thread-unsafety. MFC after: 2 weeks
* Include <sys/mutex.h> and its prerequisite <sys/lock.h> instead of dependingbde2002-09-051-8/+6
| | | | | | on namespace pollution 4 layers deep in <netinet/in_pcb.h>. Removed unused includes. Sorted includes.
* Use `struct uma_zone *' instead of uma_zone_t, so that <sys/uma.h> isn'tbde2002-09-052-2/+2
| | | | a prerequisite.
* Include <sys/systm.h> for the definition of offsetof() instead of dependingbde2002-09-051-0/+1
| | | | | on the definition being misplaced in <sys/types.h>. The definition probably belongs in <sys/stddef.h>.
* Include <sys/systm.h> for the definition of offsetof() instead of dependingbde2002-09-051-0/+1
| | | | | on the definition being misplaced in <sys/types.h>. The definition probably belongs in <sys/stddef.h>.
* Do not cast from a pointer to an integer of a possibly different size.bde2002-09-051-1/+1
| | | | This fixes a warning on i386's with 64-bit longs.
* Add debug.rman_debug sysctl MIB and loader tunable instead of brokeniwasaki2002-09-051-5/+7
| | | | | RMAN_DEBUG option. This would be useful for debugging resource manager code.
* Fix a format buglet.phk2002-09-051-1/+1
| | | | Spotted by: iedowse
* Parse hint.acpi.0.disabled correctly.iwasaki2002-09-051-2/+10
| | | | | | Now that hint.acpi.0.disabled="0" won't disable acpi as expected. Pointed-out by: bde
* Include <sys/malloc.h> instead of depending on namespace pollution 2bde2002-09-051-9/+11
| | | | | | | | | layers deep in <sys/proc.h> or <sys/vnode.h>. Include <sys/vmmeter.h> instead of depending on namespace pollution in <sys/pcpu.h>. Sorted includes as much as possible.
* Forward declare struct uio so that <sys/uio.h> isn't a prerequisite.bde2002-09-051-3/+2
| | | | Removed bogus forward declarations of structs.
* Include <sys/malloc.h> instead of depending on namespace pollution 2bde2002-09-054-14/+10
| | | | | | layers deep in <sys/proc.h> or <sys/vnode.h>. Removed unused includes. Sorted includes.
* Pad after "char *n_name;" in the !_AOUT_INCLUDE_ case so that struct nlistbde2002-09-051-0/+2
| | | | | has some chance of having the same layout in all cases on machines with sizeof(char *) != sizeof(long).
* Forward declare struct vnode so that <sys/vnode.h> or some other headerbde2002-09-051-0/+1
| | | | | that happens to forward declare struct vnode isn't a prerequisite (most places get it from <sys/imgact.h>).
* s/SGNL/SIG/davidxu2002-09-0511-42/+45
| | | | | | | | | | s/SNGL/SINGLE/ s/SNGLE/SINGLE/ Fix abbreviation for P_STOPPED_* etc flags, in original code they were inconsistent and difficult to distinguish between them. Approved by: julian (mentor)
* Include <sys/malloc.h> instead of depending on namespace pollution 2bde2002-09-059-54/+45
| | | | | | | | | layers deep in <sys/proc.h> or <sys/vnode.h>. Removed unused includes. Fixed some printf format errors (1 fatal on i386's; 1 fatal on alphas; 1 not fatal on any supported machine).
* Uncommented MAC options so that they get linted. This exposes brokennessbde2002-09-051-4/+4
| | | | in kern_mac.c.
* Implement LINUX_TIOCSCTTY.marcel2002-09-051-1/+4
| | | | PR: kern/42404
* Split up ptrace() into a wrapper that does the copying to and fromiedowse2002-09-053-163/+142
| | | | | | | user space and a kern_ptrace() implementation. Use the kern_*() version in the Linux emulation code to remove more stack gap uses. Approved by: des
* Under DIAGNOSTIC, complain if a timeout(9) routine took more than 1msec.phk2002-09-041-4/+23
|
* On the ElanSC520 CPU use general purpose timer#2 as timecounter.phk2002-09-041-0/+19
| | | | | | | | | | | | This is a vast improvement over the i8254, since it is a simple memory load rather than a comples sequence of interrupt blocking, multiple input/output instructions, and wrap-around detection. I have not bothered to time the fundamental timecounter get routine, but gettimeofday(2) is 10% faster with the ELAN timecounte. The downside is that HZ=100 is not enough, 150 or more recommended, I use 250 myself.
* Change the support for AMDs ElanSC520 CPU from being a device driver tophk2002-09-048-94/+63
| | | | | | | | be options CPU_ELAN (NB: Soekris.com users!) It is cleaner this way. We still recognize the cpu on the host-pci bridge.
* Do not employ timecounter hardware if our hz does not support theirphk2002-09-041-2/+10
| | | | correct rewinding.
* Function prototypes don't need 'extern'.jhb2002-09-042-12/+12
|
* Don't let children attach fast interrupts if the parent interrupt is normal.phk2002-09-041-2/+2
| | | | Submitted by: bde
* Make consistent; turn spaces into tabs where there is a mixture.markm2002-09-042-42/+42
|
* Bring back the PUC_FASTINTR option, and implement it correctly so thatphk2002-09-042-2/+13
| | | | | | child devices also know if they are fast or normal. Requested by: bde
* Give up on calling tc_ticktock() from a timeout, we have timeoutphk2002-09-043-4/+9
| | | | | | | | functions which run for several milliseconds at a time and getting in queue behind one or more of those makes us miss our rewind. Instead call it from hardclock() like we used to do, but retain the prescaler so we still cope with high HZ values.
* Add in_hosteq() and in_nullhost() macros to make life of developerssobomax2002-09-041-0/+3
| | | | | | porting NetBSD code a little bit easier. Obtained from: NetBSD
* Sigh. The fix to the suspend code wasn't complete, since the resumescottl2002-09-041-2/+2
| | | | | | | code was broken in the same way. Submitted by: co9@xs4all.nl MFC after: 3 days
* More in the continuing saga of phk vs his strange serial card.imp2002-09-041-80/+20
| | | | | | | | | | | In this installment, we learn that it is bad to access registers that are only defined for mfc cards in the interrupt handler when we do not in fact have a mfc card. For MFC cards, we'll only call the ISR if the this card interrupted bit is set. For non mfc cards (which are basically 90% of pccards in use), we always call the ISR and avoid touching the suspect registers. We always pacify the bit in the MFC case on the off chance that will help in the itnerrupt handler not being registed.
* Alright, fix the problems with the elf loader for the Alpha. It turnsdillon2002-09-041-8/+18
| | | | | | | | | | | | | | | | out that there is no easy way to discern the difference between a text segment and a data segment through the read-only OR execute attribute in the elf segment header, so revert the algorithm to what it was before. Neither can we account for multiple data load segments in the vmspace structure (at least not without more work), due to assumptions obreak() makes in regards to the data start and data size fields. Retain RLIMIT_VMEM checking by using a local variable to track the total bytes of data being loaded. Reviewed by: peter X-MFC after: ASAP
* Fix up a comment.jhb2002-09-041-2/+2
|
* Use resource_list_print_type() instead of duplicating the code injhb2002-09-044-132/+12
| | | | nexus_print_resources().
* - Make pci_load_vendor_data() static and do it during MOD_LOAD instead ofjhb2002-09-043-19/+16
| | | | | | | when the first PCI bus attaches. - Create /dev/pci during MOD_LOAD as well. - Destroy /dev/pci during MOD_UNLOAD (not that you can kldunload pci, but might as well get the code right)
* Use resource_list_print_types() instead of duplicating the code.jhb2002-09-041-40/+4
|
* Make the text segment locating heuristics from rev 1.121 more reliablepeter2002-09-031-15/+10
| | | | | | | | so that it works on the Alpha. This defines the segment that the entry point exists in as 'text' and any others (usually one) as data. Submitted by: tmm Tested on: i386, alpha
* - Change falloc() to acquire an fd from the process table last so thatjhb2002-09-031-108/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | it can do it w/o needing to hold the filelist_lock sx lock. - fdalloc() doesn't need Giant to call free() anymore. It also doesn't need to drop and reacquire the filedesc lock around free() now as a result. - Try to make the code that copies fd tables when extending the fd table in fdalloc() a bit more readable by performing assignments in separate statements. This is still a bit ugly though. - Use max() instead of an if statement so to figure out the starting point in the search-for-a-free-fd loop in fdalloc() so it reads better next to the min() in the previous line. - Don't grow nfiles in steps up to the size needed if we dup2() to some really large number. Go ahead and double 'nfiles' in a loop prior to doing the malloc(). - malloc() doesn't need Giant now. - Use malloc() and free() instead of MALLOC() and FREE() in fdalloc(). - Check to see if the size we are going to grow to is too big, not if the current size of the fd table is too big in the loop in fdalloc(). This means if we are out of space or if dup2() requests too high of a fd, then we will return an error before we go off and try to allocate some huge table and copy the existing table into it. - Move all of the logic for dup'ing a file descriptor into do_dup() instead of putting some of it in do_dup() and duplicating other parts in four different places. This makes dup(), dup2(), and fcntl(F_DUPFD) basically wrappers of do_dup now. fcntl() still has an extra check since it uses a different error return value in one case then the other functions. - Add a KASSERT() for an assertion that may not always be true where the fdcheckstd() function assumes that falloc() returns the fd requested and not some other fd. I think that the assertion is always true because we are always single-threaded when we get to this point, but if one was using rfork() and another process sharing the fd table were playing with the fd table, there might could be a problem. - To handle the problem of a file descriptor we are dup()'ing being closed out from under us in dup() in general, do_dup() now obtains a reference on the file in question before calling fdalloc(). If after the call to fdalloc() the file for the fd we are dup'ing is a different file, then we drop our reference on the original file and return EBADF. This race was only handled in the dup2() case before and would just retry the operation. The error return allows the user to know they are being stupid since they have a locking bug in their app instead of dup'ing some other descriptor and returning it to them. Tested on: i386, alpha, sparc64
* - Move $FreeBSD$ to the top of the file.jhb2002-09-031-2/+21
| | | | | | | - Fix a few grammar bogons. - Add a small style guide. Reviewed by: bde (a while ago)
* Add some KASSERT()'s to ensure that we don't perform spin mutex ops onjhb2002-09-032-8/+32
| | | | | | sleep mutexes and vice versa. WITNESS normally should catch this but not everyone uses WITNESS so this is a fallback to catch nasty but easy to do bugs.
* Remove aic7xxx from the module build framework until all bootstrappinggibbs2002-09-031-1/+0
| | | | issues are resolved.
* In the kernel code, we have the tsleep() call with the PCATCH argument.davidxu2002-09-034-13/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | PCATCH means 'if we get a signal, interrupt me!" and tsleep returns either EINTR or ERESTART depending on the circumstances. ERESTART is "special" because it causes the system call to fail, but right as it returns back to userland it tells the trap handler to move %eip back a bit so that userland will immediately re-run the syscall. This is a syscall restart. It only works for things like read() etc where nothing has changed yet. Note that *userland* is tricked into restarting the syscall by the kernel. The kernel doesn't actually do the restart. It is deadly for things like select, poll, nanosleep etc where it might cause the elapsed time to be reset and start again from scratch. So those syscalls do this to prevent userland rerunning the syscall: if (error == ERESTART) error = EINTR; Fake "signals" like SIGTSTP from ^Z etc do not normally invoke userland signal handlers. But, in -current, the PCATCH *is* being triggered and tsleep is returning ERESTART, and the syscall is aborted even though no userland signal handler was run. That is the fault here. We're triggering the PCATCH in cases that we shouldn't. ie: it is being triggered on *any* signal processing, rather than the case where the signal is posted to userland. --- Peter The work of psignal() is a patchwork of special case required by the process debugging and job-control facilities... --- Kirk McKusick "The design and impelementation of the 4.4BSD Operating system" Page 105 in STABLE source, when psignal is posting a STOP signal to sleeping process and the signal action of the process is SIG_DFL, system will directly change the process state from SSLEEP to SSTOP, and when SIGCONT is posted to the stopped process, if it finds that the process is still on sleep queue, the process state will be restored to SSLEEP, and won't wakeup the process. this commit mimics the behaviour in STABLE source tree. Reviewed by: Jon Mini, Tim Robbins, Peter Wemm Approved by: julian@freebsd.org (mentor)
* Remove a debug printf.phk2002-09-031-2/+2
| | | | Correctly identify the ARGOSY SP320 dual port serial PCMCIA card.
* Drop another cookie to wet Warners appetite:phk2002-09-031-0/+6
| | | | | We need to call the drivers interrupt function even though the card is not multifunction.
OpenPOWER on IntegriCloud