summaryrefslogtreecommitdiffstats
path: root/sys/i386
Commit message (Collapse)AuthorAgeFilesLines
* Add needed includes of machine/smp.h, remove nested include in sys/smp.hjake2002-03-073-0/+3
| | | | so that inlines in machine/smp.h can use variables declared in sys/smp.h.
* Sync with GENERIC. WITNESS_SKIPSPIN, and the ciss and iir devices.cjc2002-03-061-0/+3
|
* Add a new variable mp_maxid. This is used so that per cpu datastructures mayjeff2002-03-053-3/+12
| | | | | | | | | | | | | be allocated as arrays indexed by the cpu id. Previously the only reliable way to know the max cpu id was through MAXCPU. mp_ncpus isn't useful here because cpu ids may be sparsely mapped, although x86 and alpha do not do this. Also, call cpu_mp_probe much earlier so the max cpu id is known before the VM starts up. This is intended to help support per cpu queues for the new allocator, but may be useful elsewhere. Reviewed by: jake Approved by: jake
* Add generalized power profile code.iwasaki2002-03-043-0/+110
| | | | | | | | | | | | | This makes other power-management system (APM for now) to be able to generate power profile change events (ie. AC-line status changes), and other kernel components, not only the ACPI components, can be notified the events. - move subroutines in acpi_powerprofile.c (removed) to kern/subr_power.c - call power_profile_set_state() also from APM driver when AC-line status changes - add call-back function for Crusoe LongRun controlling on power profile changes for a example
* Support for USB fm radio.alfred2002-03-041-0/+2
| | | | Submitted by: David Yeske <dyeske@yahoo.com>
* - Move a comment from being on the same line as a #ifdef to the linearr2002-02-281-1/+2
| | | | | | | following it. This should have gone in the previous commit, but misviewed Bruce's patch. Requested by: bde
* Make it a bit clearer where this file is to be used and where itmarkm2002-02-281-0/+2
| | | | | | should not be. (Comments only) Inspired by: bde
* - trap -> trap() in panic() string.arr2002-02-281-3/+3
| | | | | | | - Translate the message into some sort of understandable english. - Fix a couple near-by style nits. Submitted by: bde
* Fix a minor swap leak.silby2002-02-281-0/+20
| | | | | | | | | | | Previously, the UPAGES/KSTACK area of processes/threads would leak memory at the time that a previously swapped process was terminated. Lukcily, the leak was only 12K/proc, so it was unlikely to be a major problem unless you had an undersized swap partition. Submitted by: dillon Reviewed by: silby MFC after: 1 week
* Make MPLOCKED work again in asm files and stringify it explicitlybmilekic2002-02-282-10/+10
| | | | | | where necessary. Reviewed by: jake
* Fix warning (const lost in assignment), harmless in this case.peter2002-02-281-1/+1
|
* Fix warnings (prototype for nonexisting static function)peter2002-02-281-2/+0
|
* Fix warnings.. bootpc_init() and related.peter2002-02-281-5/+2
|
* Fix format warning.peter2002-02-271-1/+1
| | | | Submitted by: LINT, -Werror
* Back out part of KSE/M2 that snuck in under the radar: changing thejhb2002-02-271-2/+2
| | | | | | prototype of bzero() on the i386 to have a volatile first argument. Requested by: bde, jake
* - Insert a space in the panic() string in order more clearly show thearr2002-02-271-1/+1
| | | | message.
* Use td_ucred and thus remove now unneeded proc lock acquire and release.jhb2002-02-271-3/+1
|
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-278-13/+13
| | | | reference.
* Fix a horribly suboptimal algorithm in the vm_daemon.silby2002-02-271-8/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | In order to determine what to page out, the vm_daemon checks reference bits on all pages belonging to all processes. Unfortunately, the algorithm used reacted badly with shared pages; each shared page would be checked once per process sharing it; this caused an O(N^2) growth of tlb invalidations. The algorithm has been changed so that each page will be checked only 16 times. Prior to this change, a fork/sleepbomb of 1300 processes could cause the vm_daemon to take over 60 seconds to complete, effectively freezing the system for that time period. With this change in place, the vm_daemon completes in less than a second. Any system with hundreds of processes sharing pages should benefit from this change. Note that the vm_daemon is only run when the system is under extreme memory pressure. It is likely that many people with loaded systems saw no symptoms of this problem until they reached the point where swapping began. Special thanks go to dillon, peter, and Chuck Cranor, who helped me get up to speed with vm internals. PR: 33542, 20393 Reviewed by: dillon MFC after: 1 week
* Add the following functions/macros to support byte order conversions andtmm2002-02-272-19/+70
| | | | | | | | | | | | | | | | | | | | | | | | device drivers for bus system with other endinesses than the CPU (using interfaces compatible to NetBSD): - bwap16() and bswap32(). These have optimized implementations on some architectures; for those that don't, there exist generic implementations. - macros to convert from a certain byte order to host byte order and vice versa, using a naming scheme like le16toh(), htole16(). These are implemented using the bswap functions. - stream bus space access functions, which do not perform a byte order conversion (while the normal access functions would if the bus endianess differs from the CPU endianess). htons(), htonl(), ntohs() and ntohl() are implemented using the new functions above for kernel usage. None of the above interfaces is currently exported to user land. Make use of the new functions in a few places where local implementations of the same functionality existed. Reviewed by: mike, bde Tested on alpha by: mike
* Use the updated getcredhostname() function.robert2002-02-273-4/+3
|
* - Use the new getcredhostname function in xenix_utsname(),robert2002-02-273-4/+9
| | | | | | ibcs2_getipdomainname(), and ibcs2_utssys(). Reviewed by: phk
* Re-fix a pointer/integer warning.peter2002-02-271-1/+1
|
* Back out all the pmap related stuff I've touched over the last few days.peter2002-02-2717-1130/+496
| | | | | | There is some unresolved badness that has been eluding me, particularly affecting uniprocessor kernels. Turning off PG_G helped (which is a bad sign) but didn't solve it entirely. Userland programs still crashed.
* Bandaid for the Uniprocessor kernel exploding. This makes a UP kernelpeter2002-02-271-1/+1
| | | | | | boot and run (and indeed I am committing from it) instead of exploding during the int 0x15 call from inside the atkbd driver to get the keyboard repeat rates.
* clarify panic messagealfred2002-02-271-1/+1
|
* Jake further reduced IPI shootdowns on sparc64 in loops by using rangedpeter2002-02-271-58/+28
| | | | | | | | shootdowns in a couple of key places. Do the same for i386. This also hides some physical addresses from higher levels and has it use the generic vm_page_t's instead. This will help for PAE down the road. Obtained from: jake (MI code, suggestions for MD part)
* didn't quite undo the last reversion. This gets it.dillon2002-02-271-1/+1
|
* revert compatibility fix temporarily (thought it would not break anythingdillon2002-02-261-1/+1
| | | | leaving it in).
* revert last commit temporarily due to whining on the lists.dillon2002-02-2621-1041/+272
|
* Make peter's commit compatible with interrupt-enabled critical_enter()dillon2002-02-261-2/+2
| | | | | and exit(), which has already solved the problem in regards to deadlocked IPI's.
* STAGE-1 of 3 commit - allow (but do not require) interrupts to remaindillon2002-02-2621-272/+1041
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | enabled in critical sections and streamline critical_enter() and critical_exit(). This commit allows an architecture to leave interrupts enabled inside critical sections if it so wishes. Architectures that do not wish to do this are not effected by this change. This commit implements the feature for the I386 architecture and provides a sysctl, debug.critical_mode, which defaults to 1 (use the feature). For now you can turn the sysctl on and off at any time in order to test the architectural changes or track down bugs. This commit is just the first stage. Some areas of the code, specifically the MACHINE_CRITICAL_ENTER #ifdef'd code, is strictly temporary and will be cleaned up in the STAGE-2 commit when the critical_*() functions are moved entirely into MD files. The following changes have been made: * critical_enter() and critical_exit() for I386 now simply increment and decrement curthread->td_critnest. They no longer disable hard interrupts. When critical_exit() decrements the counter to 0 it effectively calls a routine to deal with whatever interrupts were deferred during the time the code was operating in a critical section. Other architectures are unaffected. * fork_exit() has been conditionalized to remove MD assumptions for the new code. Old code will still use the old MD assumptions in regards to hard interrupt disablement. In STAGE-2 this will be turned into a subroutine call into MD code rather then hardcoded in MI code. The new code places the burden of entering the critical section in the trampoline code where it belongs. * I386: interrupts are now enabled while we are in a critical section. The interrupt vector code has been adjusted to deal with the fact. If it detects that we are in a critical section it currently defers the interrupt by adding the appropriate bit to an interrupt mask. * In order to accomplish the deferral, icu_lock is required. This is i386-specific. Thus icu_lock can only be obtained by mainline i386 code while interrupts are hard disabled. This change has been made. * Because interrupts may or may not be hard disabled during a context switch, cpu_switch() can no longer simply assume that PSL_I will be in a consistent state. Therefore, it now saves and restores eflags. * FAST INTERRUPT PROVISION. Fast interrupts are currently deferred. The intention is to eventually allow them to operate either while we are in a critical section or, if we are able to restrict the use of sched_lock, while we are not holding the sched_lock. * ICU and APIC vector assembly for I386 cleaned up. The ICU code has been cleaned up to match the APIC code in regards to format and macro availability. Additionally, the code has been adjusted to deal with deferred interrupts. * Deferred interrupts use a per-cpu boolean int_pending, and masks ipending, spending, and fpending. Being per-cpu variables it is not currently necessary to lock; bus cycles modifying them. Note that the same mechanism will enable preemption to be incorporated as a true software interrupt without having to further hack up the critical nesting code. * Note: the old critical_enter() code in kern/kern_switch.c is currently #ifdef to be compatible with both the old and new methodology. In STAGE-2 it will be moved entirely to MD code. Performance issues: One of the purposes of this commit is to enhance critical section performance, specifically to greatly reduce bus overhead to allow the critical section code to be used to protect per-cpu caches. These caches, such as Jeff's slab allocator work, can potentially operate very quickly making the effective savings of the new critical section code's performance very significant. The second purpose of this commit is to allow architectures to enable certain interrupts while in a critical section. Specifically, the intention is to eventually allow certain FAST interrupts to operate rather then defer. The third purpose of this commit is to begin to clean up the critical_enter()/critical_exit()/cpu_critical_enter()/ cpu_critical_exit() API which currently has serious cross pollution in MI code (in fork_exit() and ast() for example). The fourth purpose of this commit is to provide a framework that allows kernel-preempting software interrupts to be implemented cleanly. This is currently used for two forward interrupts in I386. Other architectures will have the choice of using this infrastructure or building the functionality directly into critical_enter()/ critical_exit(). Finally, this commit is designed to greatly improve the flexibility of various architectures to manage critical section handling, software interrupts, preemption, and other highly integrated architecture-specific details.
* Initialize a variable bogusly to avoid a gcc bug that causes a spuriousbde2002-02-261-0/+3
| | | | warning.
* Fix a warning. useracc() should take a const pointer argument.peter2002-02-261-2/+2
|
* Work-in-progress commit syncing up pmap cleanups that I have been workingpeter2002-02-2516-442/+1105
| | | | | | | | | | | | | | | | | | | | | | | | | | on for a while: - fine grained TLB shootdown for SMP on i386 - ranged TLB shootdowns.. eg: specify a range of pages to shoot down with a single IPI, since the IPI is very expensive. Adjust some callers that used to trigger this inside tight loops to do a ranged shootdown at the end instead. - PG_G support for SMP on i386 (options ENABLE_PG_G) - defer PG_G activation till after we decide what we are going to do with PSE and the 4MB pages at the start of the kernel. This should solve some rumored strangeness about stale PG_G entries getting stuck underneath the 4MB pages. - add some instrumentation for the fine TLB shootdown - convert some asm instruction wrappers from functions to inlines. gcc seems to do a fair bit better with this. - [temporarily!] pessimize the tlb shootdown IPI handlers. I will fix this again shortly. This has been working fairly well for me for a while, but I have tweaked it again prior to commit since my last major testing round. The only outstanding problem that I know of is PG_G related, which is why there is an option for it (not on by default for SMP). I have seen a world speedups by a few percent (as much as 4 or 5% in one case) but I have *not* accurately measured this - I am a bit sceptical of these numbers.
* Tidy up some warningspeter2002-02-252-7/+8
|
* Lock struct pgrp, session and sigio.tanimura2002-02-233-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | New locks are: - pgrpsess_lock which locks the whole pgrps and sessions, - pg_mtx which protects the pgrp members, and - s_mtx which protects the session members. Please refer to sys/proc.h for the coverage of these locks. Changes on the pgrp/session interface: - pgfind() needs the pgrpsess_lock held. - The caller of enterpgrp() is responsible to allocate a new pgrp and session. - Call enterthispgrp() in order to enter an existing pgrp. - pgsignal() requires a pgrp lock held. Reviewed by: jhb, alfred Tested on: cvsup.jp.FreeBSD.org (which is a quad-CPU machine running -current)
* Add some DIAGNOSTIC code.julian2002-02-221-14/+25
| | | | | | | | | | | | While in userland, keep the thread's ucred reference in a shadow field so that the usual place to store it is NULL. If DIAGNOSTIC is not set, the thread ucred is kept valid until the next kernel entry, at which time it is checked against the process cred and possibly corrected. Produces a BIG speedup in kernels with INVARIANTS set. (A previous commit corrected it for the non INVARIANTS case already) Reviewed by: dillon@freebsd.org
* Convert p->p_runtime and PCPU(switchtime) to bintime format.phk2002-02-223-3/+3
|
* Pass me the pointy hat please. Be sure to return a value in a non-voidpeter2002-02-201-1/+1
| | | | | function. I've been running with this buried in the mountains of compiler output for about a month on my desktop.
* Fix typos in some comments.cjc2002-02-201-2/+2
| | | | | PR: i386/35114 Submitted by: Gavin Atkinson <gavin.atkinson@ury.york.ac.uk>
* Some more tidy-up of stray "unsigned" variables instead of p[dt]_entry_tpeter2002-02-202-23/+25
| | | | etc.
* Add C++ support.mike2002-02-191-0/+5
|
* o Move NTOHL() and associated macros into <sys/param.h>. These aremike2002-02-181-39/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | deprecated in favor of the POSIX-defined lowercase variants. o Change all occurrences of NTOHL() and associated marcros in the source tree to use the lowercase function variants. o Add missing license bits to sparc64's <machine/endian.h>. Approved by: jake o Clean up <machine/endian.h> files. o Remove unused __uint16_swap_uint32() from i386's <machine/endian.h>. o Remove prototypes for non-existent bswapXX() functions. o Include <machine/endian.h> in <arpa/inet.h> to define the POSIX-required ntohl() family of functions. o Do similar things to expose the ntohl() family in libstand, <netinet/in.h>, and <sys/param.h>. o Prepend underscores to the ntohl() family to help deal with complexities associated with having MD (asm and inline) versions, and having to prevent exposure of these functions in other headers that happen to make use of endian-specific defines. o Create weak aliases to the canonical function name to help deal with third-party software forgetting to include an appropriate header. o Remove some now unneeded pollution from <sys/types.h>. o Add missing <arpa/inet.h> includes in userland. Tested on: alpha, i386 Reviewed by: bde, jake, tmm
* Correct path to pucdata.cjedgar2002-02-181-1/+1
| | | | Reviewed by: jhay
* Add bus_space_unmap() and bus_space_free() functions to releasenyan2002-02-181-0/+26
| | | | a bus_space_handle allocated by bus_space_subregion().
* Add stubs for bus_space_unmap() and bus_space_free(). They are needed tonyan2002-02-181-4/+15
| | | | release a bus_space_handle allocated by bus_space_subregion().
* Use struct __ucontext in prototypes and associated functions instead ofdeischen2002-02-174-2/+10
| | | | | | | | | | ucontext_t. Forward declare struct __ucontext in <sys/signal.h> and remove reliance on <sys/ucontext.h> being included. While I'm here, also hide osigcontext types from userland; suggested by bde. Namespace pollution noticed by: Kevin Day <toasty@shell.dragondata.com>
* Correct typo.nyan2002-02-171-1/+1
|
* Move the bus_space_subregion function from the puc driver to the bus_spacenyan2002-02-171-3/+14
| | | | | | sutff. Reviewed by: jhay
OpenPOWER on IntegriCloud