summaryrefslogtreecommitdiffstats
path: root/sys/i386/include/cpufunc.h
Commit message (Collapse)AuthorAgeFilesLines
* Major update to the way synchronization is done in the kernel. Highlightsjasone2000-09-071-6/+15
| | | | | | | | | | | | | | | include: * Mutual exclusion is used instead of spl*(). See mutex(9). (Note: The alpha port is still in transition and currently uses both.) * Per-CPU idle processes. * Interrupts are run in their own separate kernel threads and can be preempted (i386 only). Partially contributed by: BSDi (BSD/OS) Submissions by (at least): cp, dfr, dillon, grog, jake, jhb, sheldonh
* Fix an __asm operand constraint which broke the -O3 and -O0 builds.bsd2000-02-211-6/+6
| | | | | Submitted by: Seigo Tanimura <tanimura@freebsd.org> Approved by: jkh
* Don't forget to reset the hardware debug registers when a process thatbsd2000-02-201-0/+50
| | | | | | | | | | was using them exits. Don't allow a user process to cause the kernel to take a TRCTRAP on a user space address. Reviewed by: jlemon, sef Approved by: jkh
* Fixed style bugs related to the access functions for the bsfl and bsrlbde2000-01-091-31/+24
| | | | i386 instructions.
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"peter1999-12-291-3/+3
| | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come.
* Segment registers can be read(write) to(from) memory locations as well asluoqi1999-11-151-4/+4
| | | | general registers.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Undo my previous commit and do it differently. Break the ffs() etc macrospeter1999-08-191-14/+27
| | | | | | | | into two parts - one to do the bsfl and the other to convert the result (base 0) to ffs()-like (base 1) in inline C. This enables the optimizer to be a lot smarter in certain cases, like where it knows that the argument is non-zero and we want ffs(known non zero arg) - 1. This appears to produce identical code to the old inline when the argument is unknown.
* Try using the builtin ffs() for egcs, it (by random inspection)peter1999-08-191-1/+5
| | | | | generates slightly better code and avoids the incl then subl when using ffs(foo) - 1.
* atomic.h:alc1999-07-231-12/+1
| | | | | | | | | | | | | | | | | Change "void *" to "volatile TYPE *", improving type safety and eliminating some warnings (e.g., mp_machdep.c rev 1.106). cpufunc.h: Eliminate setbits. As defined, it's not precisely correct; and it's redundant. (Use atomic_set_int instead.) ipl_funcs.c: Use atomic_set_int instead of setbits. systm.h: Include atomic.h. Reviewed by: bde
* loadandclear() uses an atomic instruction (even on SMP, where it's anpeter1999-05-091-2/+2
| | | | | | implicitly LOCK'ed instruction), so there shouldn't be any harm in making it volatile pointer compatable for one of the users of it. It seems to generate the same code regardless.
* Enable vmspace sharing on SMP. Major changes are,luoqi1999-04-281-1/+33
| | | | | | | | | | | | | | | | | - %fs register is added to trapframe and saved/restored upon kernel entry/exit. - Per-cpu pages are no longer mapped at the same virtual address. - Each cpu now has a separate gdt selector table. A new segment selector is added to point to per-cpu pages, per-cpu global variables are now accessed through this new selector (%fs). The selectors in gdt table are rearranged for cache line optimization. - fask_vfork is now on as default for both UP and SMP. - Some aio code cleanup. Reviewed by: Alan Cox <alc@cs.rice.edu> John Dyson <dyson@iquest.net> Julian Elischer <julian@whistel.com> Bruce Evans <bde@zeta.org.au> David Greenman <dg@root.com>
* Don't put operands in clobber lists, since this is dubious for oldbde1999-01-091-13/+16
| | | | | | versions of gcc and broken for current versions of egcs. Submitted by: "John S. Dyson" <dyson@iquest.net> but rewritten by me
* Fixed some style bugs. Clarified a comment.bde1999-01-081-13/+12
|
* Unspammed includes in <machine/cpufunc.h> in the !SMP case. Partiallybde1999-01-081-10/+13
| | | | unspammed them in the SMP case.
* Moved declarations related to copying and zeroing to the right place.bde1999-01-081-2/+1
|
* Add macros for accessing device memory.dfr1998-08-171-1/+9
|
* Don't pretend to support ix86's with 16-bit ints by using longsbde1998-07-111-32/+32
| | | | | | | | | | | | | | just to ensure 32-bit variables. Doing so broke and/or pessimized i386's with 64-bit longs (unnecessary use of 64-bit variables caused remarkably few problems in C code, but the inline asm here tended to fail because there are no 64-bit registers). Since the interfaces here are very machine-dependent and shouldn't be used outside of the kernel, use a standard types of "known" width instead of fixed-width types. Changed all quad_t's to u_int64_t's. quad_t isn't standard, and using signed types for 64-bit registers was bogus (but made no difference).
* For SMP, use prv_PPAGE1/prv_PMAP1 instead of PADDR1/PMAP1.tegge1998-05-171-1/+15
| | | | | get_ptbase and pmap_pte_quick no longer generates IPIs. This should reduce the number of IPIs during heavy paging.
* Fix alot of silly LINT that I left in the code.dyson1998-05-121-2/+2
|
* Support better performance with P6 architectures and in SMPdyson1998-05-111-3/+11
| | | | | mode. Unnecessary TLB flushes removed. More efficient page zeroing on P6 (modify page only if non-zero.)
* Undo previous commit. The cpuid symbol has been already used by SMPkato1998-01-251-10/+1
| | | | | | stuff. Pointed-out by: Manfred Antar <root@mantar.slip.netcom.com>
* Added cpuid instruction.kato1998-01-251-1/+10
|
* Implementation of Bus Space for FreeBSD-x86.gibbs1998-01-151-4/+4
| | | | Obtained From: NetBSD
* After one of my analysis passes to evaluate methods for SMP TLB mgmt, Idyson1997-12-141-1/+7
| | | | | | | | | | | noticed some major enhancements available for UP situations. The number of UP TLB flushes is decreased much more than significantly with these changes. Since a TLB flush appears to cost minimally approx 80 cycles, this is a "nice" enhancement, equiv to eliminating between 40 and 160 instructions per TLB flush. Changes include making sure that kernel threads all use the same PTD, and eliminate unneeded PTD switches at context switch time.
* General cleanup of the lock pushdown code. They are grouped and enabledfsmp1997-09-071-7/+3
| | | | | | | | | from machine/smptests.h: #define PUSHDOWN_LEVEL_1 #define PUSHDOWN_LEVEL_2 #define PUSHDOWN_LEVEL_3 #define PUSHDOWN_LEVEL_4_NOT
* General cleanup of the sub-system locking macros.fsmp1997-09-011-3/+7
| | | | | | | | Eliminated the RECURSIVE_MPINTRLOCK. clock.c and microtime use clock_lock. sio.c and cy.c use com_lock. Suggestions by: Bruce Evans <bde@zeta.org.au>
* Another round of lock pushdown.fsmp1997-08-301-1/+6
| | | | | | | | | Add a simplelock to deal with disable_intr()/enable_intr() as used in UP kernel. UP kernel expects that this is enough to guarantee exclusive access to regions of code bracketed by these 2 functions. Add a simplelock to bracket clock accesses in clock.c: clock_lock. Help from: Bruce Evans <bde@zeta.org.au>
* Add support for 4MB pages. This includes the .text, .data, .data partsdyson1997-07-171-1/+3
| | | | | | | | of the kernel, and also most of the dynamic parts of the kernel. Additionally, 4MB pages will be allocated for display buffers as appropriate (only.) The 4MB support for SMP isn't complete, but doesn't interfere with operation either.
* remove #include of <machine/spl.h> - they are externed nowpeter1997-05-311-3/+1
| | | | Reviewed by: bde
* Make setbits() SMP-safe. Eliminate the SETBITS() macro, and replacejdp1997-05-211-2/+6
| | | | | | | | | | all uses of it with the equivalent calls to setbits(). This change incidentally eliminates a problem building ELF kernels that was caused by SETBITS. Reviewed by: fsmp, peter Submitted by: bde
* remove #include "opt_smp.h" and <machine/smp.h>. Slightly elaborate onpeter1997-05-071-7/+3
| | | | a comment.
* remove all the SMP_INVLTLB defines, making the code default for APIC_IO.fsmp1997-04-281-5/+7
| | | | Reviewed by: informal discussion with Peter Wemm <peter@spinner.DIALix.COM>
* Try and make these usermode safe, Steve beat me in finding these..peter1997-04-261-3/+5
|
* Man the liferafts! Here comes the long awaited SMP -> -current merge!peter1997-04-261-1/+16
| | | | | | | | | | | | | | | | There are various options documented in i386/conf/LINT, there is more to come over the next few days. The kernel should run pretty much "as before" without the options to activate SMP mode. There are a handful of known "loose ends" that need to be fixed, but have been put off since the SMP kernel is in a moderately good condition at the moment. This commit is the result of the tinkering and testing over the last 14 months by many people. A special thanks to Steve Passe for implementing the APIC code!
* Improved CPU identification and initialization routines. Thiskato1997-03-221-1/+15
| | | | | | | | | | | | | supports All Cyrix CPUs, IBM Blue Lightning CPU and NexGen (now AMD) Nx586 CPU, and initialize special registers of Cyrix CPU and msr of IBM Blue Lightning CPU. If revision of Cyrix 6x86 CPU < 2.7, CPU cache is enabled in write-through mode. This can be disabled by kernel configuration options. Reviewed by: Bruce Evans <bde@freebsd.org> and Jordan K. Hubbard <jkh@freebsd.org>
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Added "memory" to clobber list in invlpg(). It needs it if invltlb()bde1996-09-291-20/+21
| | | | | | | | | | | needs it. Fixed style in invlpg(). Sorted recently renamed functions. Added prototypes in the non-gcc section for recently added/renamed functions.
* Essentially rename pmap_update to be invltlb. It is a very machinedyson1996-09-281-4/+3
| | | | | | | dependent operation, and not really a correct name. invltlb and invlpg are more descriptive, and in the case of invlpg, a real opcode. Additionally, fix the tlb management code for 386 machines.
* Move pmap_update_1pg to cpufunc.h. Additionally,dyson1996-09-281-1/+7
| | | | | use the invlpg opcode instead of the nasty looking .byte directives. There are some other minor micro-level code improvements to pmap.c
* Fixed a few hundred warnings (2400 in LINT) for signed vs unsignedbde1996-09-241-6/+13
| | | | | | | | | | | | | comparisons in the inb() and outb() macros. I decided that int args are OK here. Any type that can hold a u_int16_t without overflow is correct, and 32-bit types are optimal. Introduced a few tens of warnings (100 in LINT) for use of pessimized (short) types for the port arg. Only a few drivers are affected by this. u_short pessimizations aren't detected. Added `__extension__' before the statement-expression in inb() so that it can be compiled without warnings by gcc -pedantic.
* Another round of merge/update.asami1996-09-121-49/+1
| | | | | | | | | (1) Add PC98 support to apm_bios.h and ns16550.h, remove pc98/pc98/ic (2) Move PC98 specific code out of cpufunc.h (to pc98.h) (3) Let the boot subtrees look more alike Submitted by: The FreeBSD(98) Development Team <freebsd98-hackers@jp.freebsd.org>
* Add an fls() inline function which does the opposite operation towollman1996-08-011-1/+12
| | | | ffs(). (That is to say, it searches in the opposite direction.)
* Update to current state of PC98 world.asami1996-07-231-1/+3
| | | | Submitted by: The FreeBSD(98) development team
* Fixed lots of warnings about unportable casts of pointers to volatilebde1996-07-011-3/+10
| | | | | | variables: don't depend on the compiler generating atomic code to set the variables - use inline asm to specify the atomic instruction(s) explicitly.
* Moved declarations of non-cpu things from <machine/cpufunc.h> to betterbde1996-07-011-19/+1
| | | | places.
* The Great PC98 Merge.asami1996-06-141-1/+48
| | | | | | | | All new code is "#ifdef PC98"ed so this should make no difference to PC/AT (and its clones) users. Ok'd by: core Submitted by: FreeBSD(98) development team
* Changed bdb() to breakpoint() and always enable it.bde1996-04-071-34/+30
| | | | Made the style more consistent, especially for the new Pentium functions.
* Moved rtcin() to clock.c.bde1996-03-311-2/+1
| | | | | | | | Always delay using one inb(0x84) after each i/o in rtcin() - don't do this conditional on the bogus option DUMMY_NOPS not being defined. If you want an optionally slightly faster rtcin() again, then inline it and use a better named option or sysctl variable. It only needs to be fast in rtcintr().
OpenPOWER on IntegriCloud