summaryrefslogtreecommitdiffstats
path: root/sys/i386
Commit message (Collapse)AuthorAgeFilesLines
* Use bitmasks of the KTR_* constants instead of hexidecimal values forjhb2001-06-041-2/+2
| | | | the KTR_COMPILE and KTR_MASK examples.
* Properly wrap mtx_intr_enable() macro in "do $bla while (0)"phk2001-06-021-1/+1
|
* This file is not needed any more, the definitions and declarations ittmm2001-06-011-13/+0
| | | | contained have been moved to i386/isa/icu.h and sys/interrupt.h.
* Clean up the code exporting interrupt statistics via sysctl a bit:tmm2001-06-015-5/+2
| | | | | | | | | | | | | - move the sysctl code to kern_intr.c - do not use INTRCNT_COUNT, but rather eintrcnt - intrcnt to determine the length of the intrcnt array - move the declarations of intrnames, eintrnames, intrcnt and eintrcnt from machine-dependent include files to sys/interrupt.h - remove the hw.nintr sysctl, it is not needed. - fix various style bugs Requested by: bde Reviewed by: bde (some time ago)
* Add ``options RANDOM_IP_ID'' which randomizes the ID field of IP packets.kris2001-06-011-0/+7
| | | | | | | | | This closes a minor information leak which allows a remote observer to determine the rate at which the machine is generating packets, since the default behaviour is to increment a counter for each packet sent. Reviewed by: -net Obtained from: OpenBSD
* Add device driver support for the Level 1 LXT1001 NetCelleratorwpaul2001-05-311-0/+4
| | | | | | | | | | | | | | | gigabit ethernet controller chip. This device is used on some fiber optic gigE cards from SMC, D-Link and Addtron. Jumbograms and TCP/IP checksum offload on receive are supported. Hardware VLAN filtering is not, because it doesn't play well with our existing VLAN code. Also add manual page. There is a 4.x version of this driver available at http://www.freebsd.org/~wpaul/Level1/4.x if anyone feels adventurous and wants to test it. I still need to do performance testing and tuning with this device. (For my next trick, I will make the 3Com 3cR990 sit up and beg.)
* Quiet warnings by adding a prototype for set_user_ldt_rv() and making itjhb2001-05-301-1/+6
| | | | conditional on #ifdef SMP.
* We can't grab the sched_lock in set_user_ldt() because when it is calledjhb2001-05-302-6/+25
| | | | | | | | | | | from cpu_switch(), curproc has been changed, but the sched_lock owner will not be updated until we return to mi_switch(), thus we deadlock against ourselves. As a workaround, push the acquire and release of sched_lock out to the callers of set_user_ldt(). Note that we can't use a mtx_assert() in set_user_ldt for the same reason. Sleuting by: tmm Tested by: tmm, dougb
* move wx to be part of miibus requiring chipsetsmjacob2001-05-301-1/+1
|
* Remove MFS options from all example kernel configs.phk2001-05-293-4/+1
|
* Clarify that the old CD-ROM drivers are only for non-ATAPI drives.phk2001-05-281-3/+3
| | | | | | PR: 25369 Submitted by: Matt Emmerton matt@gsicomp.on.ca MFC after: 1 week
* Remove pcm hints here now that it's gone from GENERIC.jkh2001-05-261-4/+0
| | | | Reminded-by: bde
* Update reality in the strings commentdougb2001-05-261-1/+1
|
* Take pcm (audio) back out of GENERIC; there appears to be somejkh2001-05-251-3/+0
| | | | | | | concensus, most notably among the maintainers, that it's better loaded as a module. Finally-pushed-over-the-edge-by-the-anguished-cries-of: rwatson
* o Merge contents of struct pcred into struct ucred. Specifically, add therwatson2001-05-251-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | real uid, saved uid, real gid, and saved gid to ucred, as well as the pcred->pc_uidinfo, which was associated with the real uid, only rename it to cr_ruidinfo so as not to conflict with cr_uidinfo, which corresponds to the effective uid. o Remove p_cred from struct proc; add p_ucred to struct proc, replacing original macro that pointed. p->p_ucred to p->p_cred->pc_ucred. o Universally update code so that it makes use of ucred instead of pcred, p->p_ucred instead of p->p_pcred, cr_ruidinfo instead of p_uidinfo, cr_{r,sv}{u,g}id instead of p_*, etc. o Remove pcred0 and its initialization from init_main.c; initialize cr_ruidinfo there. o Restruction many credential modification chunks to always crdup while we figure out locking and optimizations; generally speaking, this means moving to a structure like this: newcred = crdup(oldcred); ... p->p_ucred = newcred; crfree(oldcred); It's not race-free, but better than nothing. There are also races in sys_process.c, all inter-process authorization, fork, exec, and exit. o Remove sigio->sio_ruid since sigio->sio_ucred now contains the ruid; remove comments indicating that the old arrangement was a problem. o Restructure exec1() a little to use newcred/oldcred arrangement, and use improved uid management primitives. o Clean up exit1() so as to do less work in credential cleanup due to pcred removal. o Clean up fork1() so as to do less work in credential cleanup and allocation. o Clean up ktrcanset() to take into account changes, and move to using suser_xxx() instead of performing a direct uid==0 comparision. o Improve commenting in various kern_prot.c credential modification calls to better document current behavior. In a couple of places, current behavior is a little questionable and we need to check POSIX.1 to make sure it's "right". More commenting work still remains to be done. o Update credential management calls, such as crfree(), to take into account new ruidinfo reference. o Modify or add the following uid and gid helper routines: change_euid() change_egid() change_ruid() change_rgid() change_svuid() change_svgid() In each case, the call now acts on a credential not a process, and as such no longer requires more complicated process locking/etc. They now assume the caller will do any necessary allocation of an exclusive credential reference. Each is commented to document its reference requirements. o CANSIGIO() is simplified to require only credentials, not processes and pcreds. o Remove lots of (p_pcred==NULL) checks. o Add an XXX to authorization code in nfs_lock.c, since it's questionable, and needs to be considered carefully. o Simplify posix4 authorization code to require only credentials, not processes and pcreds. Note that this authorization, as well as CANSIGIO(), needs to be updated to use the p_cansignal() and p_cansched() centralized authorization routines, as they currently do not take into account some desirable restrictions that are handled by the centralized routines, as well as being inconsistent with other similar authorization instances. o Update libkvm to take these changes into account. Obtained from: TrustedBSD Project Reviewed by: green, bde, jhb, freebsd-arch, freebsd-audit
* Submitted by: Juha-Matti Liukkonen (Cubical Solutions Ltd) (jml@cubical.fi)hm2001-05-253-15/+40
| | | | | | Add a CAPI (hardware independent) driver i4bcapi(4) and hardware driver iavc (4) to support active CAPI-based BRI and PRI cards (currently AVM B1 and T1 cards) to isdn4bsd.
* Don't acquire Giant just to call trap_fatal(), we are about to panicjhb2001-05-231-4/+0
| | | | | anyway so we'd rather see the printf's then block if the system is hosed.
* pmap_mapdev needs the vm_mtx, aquire it if not already lockedalfred2001-05-231-0/+8
|
* lock vm while playing with pmapalfred2001-05-231-0/+9
|
* - FDESC, FIFO, NULL, PORTAL, PROC, UMAP and UNION fileru2001-05-232-4/+4
| | | | | | | | | | | | | | | systems were repo-copied from sys/miscfs to sys/fs. - Renamed the following file systems and their modules: fdesc -> fdescfs, portal -> portalfs, union -> unionfs. - Renamed corresponding kernel options: FDESC -> FDESCFS, PORTAL -> PORTALFS, UNION -> UNIONFS. - Install header files for the above file systems. - Removed bogus -I${.CURDIR}/../../sys CFLAGS from userland Makefiles.
* Convert npx interrupts into traps instead of vice versa. This is muchbde2001-05-225-107/+105
| | | | | | | | simpler for npx exceptions that start as traps (no assembly required...) and works better for npx exceptions that start as interrupts (there is no longer a problem for nested interrupts). Submitted by: original (pre-SMPng) version by luoqi
* Remove a few more spl's I missed earlier.jhb2001-05-221-2/+0
| | | | | Reported by: Michael Harnois <mdharnois@home.com> Pointy hat: me
* Sort includes.jhb2001-05-212-2/+2
|
* Axe unneeded spl()'s.jhb2001-05-211-3/+0
|
* Throw away the complications in npxsave() and their infrastructure.bde2001-05-201-53/+23
| | | | | | | | | | | | npxsave() went to great lengths to excecute fnsave with interrupts enabled in case executing it froze the CPU. This case can't happen, at least for Intel CPU/NPX's. Spurious IRQ13's don't imply spurious freezes. Anyway, the complications were usually no-ops because IRQ13 is not used on i486's and newer CPUs, and because SMPng broke them in rev.1.84. Forcible enabling of interrupts was changed to write_eflags(old_eflags), but since SMPng usually calls npxsave() from cpu_switch() with interrupts disabled, write_eflags() usually just kept interrupts disabled.
* Use a critical region to protect almost everything in npxinit().bde2001-05-201-0/+6
| | | | | | | | | | | npxinit() didn't have the usual race because it doesn't save to curpcb, but it may have had a worse form of it since it uses the npx when it doesn't "own" it. I'm not sure if locking prevented this. npxinit() is normally caled with the proc lock but not sched_lock. Use a critical region to protect pushing of curproc's npx state to curpcb in npxexit(). Not doing so was harmless since it at worst saved a wrong state to a dieing pcb.
* Use a critical region to protect pushing of curproc's npx state tobde2001-05-201-1/+4
| | | | | curpcb in vm86_bioscall(). I don't know if the state is ever in the npx at that point.
* Use a critical region to protect saving of the npx state in savectx().bde2001-05-201-1/+4
| | | | | | | | Not doing this was fairly harmless because savectx() is only called for panic dumps and the bug could at worse reset the state. savectx() is still missing saving of (volatile) debug registers, and still isn't called for core dumps.
* Introduce a global lock for the vm subsystem (vm_mtx).alfred2001-05-197-15/+46
| | | | | | | | | | | | | | | | | | | vm_mtx does not recurse and is required for most low level vm operations. faults can not be taken without holding Giant. Memory subsystems can now call the base page allocators safely. Almost all atomic ops were removed as they are covered under the vm mutex. Alpha and ia64 now need to catch up to i386's trap handlers. FFS and NFS have been tested, other filesystems will need minor changes (grabbing the vm lock when twiddling page properties). Reviewed (partially) by: jake, jhb
* Make _BSD_TIME_T_ (time_t) an `int' rather than `long'. This will helpobrien2001-05-181-1/+1
| | | | | | | flag errors where programmers assume time_t is a long, which it is not on 64-bit platforms. Submitted by: bde
* Style changes -- revert ordering to mostly two revs ago.obrien2001-05-181-51/+51
| | | | | | Embellish some comments, fix tab'ing. Requested by: bde
* - Move the setting of bootverbose to a MI SI_SUB_TUNABLES SYSINIT.jhb2001-05-171-5/+1
| | | | | | | | - Attach a writable sysctl to bootverbose (debug.bootverbose) so it can be toggled after boot. - Move the printf of the version string to a SI_SUB_COPYRIGHT SYSINIT just afer the display of the copyright message instead of doing it by hand in three MD places.
* Use NHWI instead of APIC_IMEN_BITS.jhb2001-05-171-1/+1
|
* - Axe the IMEN_BITS and APIC_IMEN_BITS constants.jhb2001-05-171-4/+3
| | | | | | - Add back in a definition of NHWI which is preferred over ICU_LEN. Submitted by: bde
* Consistently define the rune types.obrien2001-05-161-1/+19
| | | | Follow NetBSD's lead and add a _BSD_MBSTATE_T_ type.
* Move the int typedefs to the top so they can be used in defining other types.obrien2001-05-161-30/+30
| | | | | | Ensure every platform has __offsetof. Make multiple inclusion detection consistent with other <platform>/include/*.h files.
* Lock the procfs functions for doing a single step and reading/writingjhb2001-05-161-49/+19
| | | | | | registers better. Hold sched_lock not only for checking the flag but also while performing the actual operation to ensure the process doesn't get swapped out by another CPU while we the operation is being performed.
* "Sir, the deorbit burn completed succesfully."jhb2001-05-153-114/+0
| | | | RIP {sys/machine}/ipl.h.
* Remove unneeded includes of sys/ipl.h and machine/ipl.h.jhb2001-05-1516-17/+0
|
* Move the definition of HWI_MASK to the i386/isa/icu.h header right next tojhb2001-05-151-0/+2
| | | | the definition of ICU_LEN.
* - Use ICU_LEN rather than NHWI for the size of the array of ithreads.jhb2001-05-151-2/+1
| | | | - Remove unneeded include of sys/ipl.h.
* Implement a few more floppy ioctl commands and IO options, namely:joerg2001-05-141-2/+18
| | | | | | | | | | | | | | | | | | | | | . FD_CLRERR clears the error counter, thus re-enables kernel error printf()s, . FD_GSTAT obtains the last FDC operation state, if any, . FDOPT_NOERRLOG (temporarily) turns off kernel printf() floppy error logging, . FDOPT_NOERROR makes the kernel ignore an FDC error, thus can enable the transfer of an erroneous sector to the user application All options are being cleared on (last) close. Prime consumer of the last features will be fdread(1), to be committed shortly. (FD_CLRERR should be wired into fdcontrol(8), but then fdcontrol(8) needs a major rewrite anyway.)
* Convert DEVFS from an "opt-in" to an "opt-out" option.phk2001-05-133-3/+1
| | | | | | | | | If for some reason DEVFS is undesired, the "NODEVFS" option is needed now. Pending any significant issues, DEVFS will be made mandatory in -current on july 1st so that we can start reaping the full benefits of having it.
* Use a critical region to protect pushing of the parent's npx state to thebde2001-05-131-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | pcb for fork(). It was possible for the state to be saved twice when an interrupt handler saved it concurrently. This corrupted (reset) the state because fnsave has the (in)convenient side effect of doing an implicit fninit. Mundane null pointer bugs were not possible, because we save to an "arbitrary" process's pcb and not to the "right" place (npxproc). Push the parent's %gs to the pcb for fork(). Changes to %gs before fork() were not preserved in the child unless an accidental context switch did the pushing. Updated the list of pcb contents which is supposed to inhibit bugs like this. pcb_dr*, pcb_gs and pcb_ext were missing. Copying is correct for pcb_dr*, and pcb_ext is already handled specially (although XXX'ly). Reducing the savectx() call to an npxsave() call in rev.1.80 was a mistake. The above bugs are duplicated in many places, including in savectx() itself. The arbitraryness of the parent process pointer for the fork() subroutines, the pcb pointer for savectx(), and the save87 pointer for npxsave(), is illusory. These functions don't work "right" unless the pointers are precisely curproc, curpcb, and the address of npxproc's save87 area, respectively, although the special context in which they are called allows savectx(&dumppcb) to sort of work and npxsave(&dummy) to work. cpu_fork() just doesn't work unless the parent process pointer is curproc, or the caller has pushed %gs to the pcb, or %gs happens to already be in the pcb.
* Revert part of last commit. Instead of using %fs for KSD/TSD, we'lldeischen2001-05-121-0/+1
| | | | | | follow Linux' convention and use %gs. This adds back the setting of %fs to a sane value in sendsig(). The value of %gs remains preserved to whatever it was in user context.
* Preserve the state of the %gs register when setting up the signaldeischen2001-05-121-2/+0
| | | | | | | | | | handler in Linux emulation. According to bde, this is what Linux does. Recent versions of linuxthreads use %gs for thread-specific data, while FreeBSD uses %fs (mostly because WINE uses %gs). Tested by: drew
* Simplify the vm fault trap handling code a bit by using if-else instead ofjhb2001-05-111-29/+15
| | | | | duplicating code in the then case and then using a goto to jump around the else case.
* Add support for gigabit ethernet cards based on the NatSemi DP83820wpaul2001-05-111-0/+5
| | | | | | | | | | | | | | | | | | | and DP83821 gigabit ethernet MAC chips and the NatSemi DP83861 10/100/1000 copper PHY. There are a whole bunch of very low cost cards available with this chipset selling for $150USD or less. This includes the SMC9462TX, D-Link DGE-500T, Asante GigaNIX 1000TA and 1000TPC, and a couple cards from Addtron. This chip supports TCP/IP checksum offload, VLAN tagging/insertion. 2048-bit multicast filter, jumbograms and has 8K TX and 32K RX FIFOs. I have not done serious performance testing with this driver. I know it works, and I want it under CVS control so I can keep tabs on it. Note that there's no serious mutex stuff in here yet either: I need to talk more with jhb to figure out the right way to do this. That said, I don't think there will be any problems. This driver should also work on the alpha. It's not turned on in GENERIC.
* Un-swap irq/link byte values so that printf works.msmith2001-05-112-2/+2
|
* - Split out the support for per-CPU data from the SMP code. UP kernelsjhb2001-05-102-3/+3
| | | | | | | have per-CPU data and gdb on the i386 at least needs access to it. - Clean up includes in kern_idle.c and subr_smp.c. Reviewed by: jake
OpenPOWER on IntegriCloud