summaryrefslogtreecommitdiffstats
path: root/sys/powerpc/include
Commit message (Collapse)AuthorAgeFilesLines
* Add a macro mtx_intr_enable() to alter a spin lock such that interruptsjhb2001-02-101-0/+1
| | | | will be enabled when it is released.
* Change and clean the mutex lock interface.bmilekic2001-02-091-31/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mtx_enter(lock, type) becomes: mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks) mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized) similarily, for releasing a lock, we now have: mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN. We change the caller interface for the two different types of locks because the semantics are entirely different for each case, and this makes it explicitly clear and, at the same time, it rids us of the extra `type' argument. The enter->lock and exit->unlock change has been made with the idea that we're "locking data" and not "entering locked code" in mind. Further, remove all additional "flags" previously passed to the lock acquire/release routines with the exception of two: MTX_QUIET and MTX_NOSWITCH The functionality of these flags is preserved and they can be passed to the lock/unlock routines by calling the corresponding wrappers: mtx_{lock, unlock}_flags(lock, flag(s)) and mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN locks, respectively. Re-inline some lock acq/rel code; in the sleep lock case, we only inline the _obtain_lock()s in order to ensure that the inlined code fits into a cache line. In the spin lock case, we inline recursion and actually only perform a function call if we need to spin. This change has been made with the idea that we generally tend to avoid spin locks and that also the spin locks that we do have and are heavily used (i.e. sched_lock) do recurse, and therefore in an effort to reduce function call overhead for some architectures (such as alpha), we inline recursion for this case. Create a new malloc type for the witness code and retire from using the M_DEV type. The new type is called M_WITNESS and is only declared if WITNESS is enabled. Begin cleaning up some machdep/mutex.h code - specifically updated the "optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently need those. Finally, caught up to the interface changes in all sys code. Contributors: jake, jhb, jasone (in no particular order)
* Convert all simplelocks to mutexes and remove the simplelock implementations.jasone2001-01-241-14/+0
|
* - Rename the gd_cpuno member of struct globaldata to gd_cpuid.jhb2001-01-242-8/+12
| | | | - Add a globaldata_register() prototype in the SMP case.
* Move most of sys/mutex.h into kern/kern_mutex.c, thereby making the mutexjasone2001-01-211-0/+6
| | | | | | | | | | | inline functions non-inlined. Hide parts of the mutex implementation that should not be exposed. Make sure that WITNESS code is not executed during boot until the mutexes are fully initialized by SI_SUB_MUTEX (the original motivation for this commit). Submitted by: peter
* Make intr_nesting_level per-process, rather than per-cpu. Setupjake2001-01-212-2/+0
| | | | | | | | interrupt threads to run with it always >= 1, so that malloc can detect M_WAITOK from "interrupt" context. This is also necessary in order to context switch from sched_ithd() directly. Reviewed By: peter
* Remove unused per-cpu variables inside_intr and ss_eflags.jake2001-01-122-2/+0
|
* - Remove compatibility macros for accessing per-cpu variables.jake2001-01-111-13/+0
| | | | | | | __FreeBSD_version 500015 can be used to detect their disappearance. - Move the symbols for SMP_prvspace and lapic from globals.s to locore.s. - Remove globals.s with extreme prejudice.
* Remove seconds types we don't use that came in thru the NetBSD heiratage.obrien2001-01-081-1/+0
|
* PowerPC atomic operation functions.benno2001-01-071-56/+298
| | | | | | | Some of these are dependant on an inline function (powerpc_mb()) that is yet to come. Reviewed by: obrien
* PowerPC assembler #defines.benno2001-01-071-0/+95
| | | | | Reviewed by: obrien Obtained from: NetBSD
* Implement accessors for per-cpu variables which don't depend on thejake2001-01-061-0/+1
| | | | | | | | | | | | | | | | | symbols in globals.s. PCPU_GET(name) returns the value of the per-cpu variable PCPU_PTR(name) returns a pointer to the per-cpu variable PCPU_SET(name, val) sets the value of the per-cpu variable In general these are not yet used, compatibility macros remain. Unifdef SMP struct globaldata, this makes variables such as cpuid available for UP as well. Rebuilding modules is probably a good idea, but I believe old modules will still work, as most of the old infrastructure remains.
* PowerPC platform-specific definitions (modeled on sys/i386/include/setjmp.h)obrien2001-01-021-0/+46
|
* PowerPC platform-specific definitions (modeled on sys/i386/include/types.h)obrien2001-01-021-0/+67
|
* Minor style tweaks.obrien2001-01-022-8/+11
|
* PowerPC platform-specific definitions (modeled on sys/i386/include/param.h)obrien2001-01-021-0/+175
|
* MP shells for the PowerPC platform.obrien2001-01-011-0/+50
|
* PowerPC platform-specific page size setting.obrien2001-01-011-0/+37
|
* PowerPC platform-specific definitions.obrien2001-01-011-0/+97
| | | | Obtained from: NetBSD (parts)
* Shells for the atomic operations FreeBSD needs.obrien2001-01-011-0/+228
| | | | This is just waiting for a budding PowerPC ASM guy to fill in the blanks.
* PowerPC platform-specific type definitions.obrien2001-01-011-0/+128
|
* PowerPC specific ELF ABI definitions.obrien2001-01-011-0/+170
|
* Store in globaldata our CPU ID#. Provide a lock for panics - only onemjacob2000-12-092-0/+2
| | | | | CPU can panic at a time. Obtained from:Andrew Gallatin <gallatin@cs.duke.edu>
* Next phase in the PCI subsystem cleanup.msmith2000-12-081-1/+1
| | | | | | | | | | | | | | | | | | | | - Move PCI core code to dev/pci. - Split bridge code out into separate modules. - Remove the descriptive strings from the bridge drivers. If you want to know what a device is, use pciconf. Add support for broadly identifying devices based on class/subclass, and for parsing a preloaded device identification database so that if you want to waste the memory, you can identify *anything* we know about. - Remove machine-dependant code from the core PCI code. APIC interrupt mapping is performed by shadowing the intline register in machine- dependant code. - Bring interrupt routing support to the Alpha (although many platforms don't yet support routing or mapping interrupts entirely correctly). This resulted in spamming <sys/bus.h> into more places than it really should have gone. - Put sys/dev on the kernel/modules include path. This avoids having to change *all* the pci*.h includes.
* Remove the last of the MD netisr code. It is now all MI. Removejake2000-12-051-1/+0
| | | | | | | | spending, which was unused now that all software interrupts have their own thread. Make the legacy schednetisr use an atomic op for setting bits in the netisr mask. Reviewed by: jhb
* Add the 'witness_spin_check' per-CPU variable.jhb2000-11-153-0/+3
|
* Fix all the interrupt enabled/disabled assertions which were backwards.jhb2000-11-151-6/+6
|
* Beginnings of the powerpc machine dependant includes.benno2000-11-102-0/+138
| | | | | Reviewed by: obrien Obtained from: NetBSD
* Our SHRT_MIN definition was actually 4 bits too big.obrien2000-11-042-2/+2
| | | | Submitted by: Bradley T. Hughes <bhughes@trolltech.com>
* - Overhaul the software interrupt code to use interrupt threads for eachjhb2000-10-251-1/+1
| | | | | | | | | | | | | | | | | | | type of software interrupt. Roughly, what used to be a bit in spending now maps to a swi thread. Each thread can have multiple handlers, just like a hardware interrupt thread. - Instead of using a bitmask of pending interrupts, we schedule the specific software interrupt thread to run, so spending, NSWI, and the shandlers array are no longer needed. We can now have an arbitrary number of software interrupt threads. When you register a software interrupt thread via sinthand_add(), you get back a struct intrhand that you pass to sched_swi() when you wish to schedule your swi thread to run. - Convert the name of 'struct intrec' to 'struct intrhand' as it is a bit more intuitive. Also, prefix all the members of struct intrhand with 'ih_'. - Make swi_net() a MI function since there is now no point in it being MD. Submitted by: cp
* * Update commentsobrien2000-10-242-40/+62
| | | | | | | * convert decimal constants to hex Submitted by: bde * Add ISO-C99 long long limits
* Move bogus proc reference stuff into <machine/globals.h>. There is nomjacob2000-10-231-0/+2
| | | | | | | | more include file including <sys/proc.h>, but there still is this wonky and (causes warnings on i386) reference in globals.h. CURTHD is now defined in <machine/globals.h> as well. The correct thing to do is provide a platform function for this.
* Define the mtx_legal2block() macro used in the witness code that managedjhb2000-10-201-0/+3
| | | | | | to get lost during the MI mutex conversion. Reported by: Steve Kargl <sgk@troutmask.apl.washington.edu>
* Fix a braino in the ASS_SIEN() macro in the MUTEX_DEBUG case by usingjhb2000-10-201-1/+2
| | | | mtx_saveintr instead of saveintr.
* Catch up to some of the changes to _getlock_spin_block. Specifically,jhb2000-10-201-4/+4
| | | | use _obtain_lock() instead of a manual atomic_cmpset_ptr.
* - Make the mutex code almost completely machine independent. This greatlyjhb2000-10-201-468/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reducues the maintenance load for the mutex code. The only MD portions of the mutex code are in machine/mutex.h now, which include the assembly macros for handling mutexes as well as optionally overriding the mutex micro-operations. For example, we use optimized micro-ops on the x86 platform #ifndef I386_CPU. - Change the behavior of the SMP_DEBUG kernel option. In the new code, mtx_assert() only depends on INVARIANTS, allowing other kernel developers to have working mutex assertiions without having to include all of the mutex debugging code. The SMP_DEBUG kernel option has been renamed to MUTEX_DEBUG and now just controls extra mutex debugging code. - Abolish the ugly mtx_f hack. Instead, we dynamically allocate seperate mtx_debug structures on the fly in mtx_init, except for mutexes that are initiated very early in the boot process. These mutexes are declared using a special MUTEX_DECLARE() macro, and use a new flag MTX_COLD when calling mtx_init. This is still somewhat hackish, but it is less evil than the mtx_f filler struct, and the mtx struct is now the same size with and without mutex debugging code. - Add some micro-micro-operation macros for doing the actual atomic operations on the mutex mtx_lock field to make it easier for other archs to override/optimize mutex ops if needed. These new tiny ops also clean up the code in some places by replacing long atomic operation function calls that spanned 2-3 lines with a short 1-line macro call. - Don't call mi_switch() from mtx_enter_hard() when we block while trying to obtain a sleep mutex. Calling mi_switch() would bogusly release Giant before switching to the next process. Instead, inline most of the code from mi_switch() in the mtx_enter_hard() function. Note that when we finally kill Giant we can back this out and go back to calling mi_switch().
* Move DELAY() from <machine/clock.h> to <sys/systm.h>phk2000-10-151-1/+0
|
* - Change fast interrupts on x86 to push a full interrupt frame and tojhb2000-10-061-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | return through doreti to handle ast's. This is necessary for the clock interrupts to work properly. - Change the clock interrupts on the x86 to be fast instead of threaded. This is needed because both hardclock() and statclock() need to run in the context of the current process, not in a separate thread context. - Kill the prevproc hack as it is no longer needed. - We really need Giant when we call psignal(), but we don't want to block during the clock interrupt. Instead, use two p_flag's in the proc struct to mark the current process as having a pending SIGVTALRM or a SIGPROF and let them be delivered during ast() when hardclock() has finished running. - Remove CLKF_BASEPRI, which was #ifdef'd out on the x86 anyways. It was broken on the x86 if it was turned on since cpl is gone. It's only use was to bogusly run softclock() directly during hardclock() rather than scheduling an SWI. - Remove the COM_LOCK simplelock and replace it with a clock_lock spin mutex. Since the spin mutex already handles disabling/restoring interrupts appropriately, this also lets us axe all the *_intr() fu. - Back out the hacks in the APIC_IO x86 cpu_initclocks() code to use temporary fast interrupts for the APIC trial. - Add two new process flags P_ALRMPEND and P_PROFPEND to mark the pending signals in hardclock() that are to be delivered in ast(). Submitted by: jakeb (making statclock safe in a fast interrupt) Submitted by: cp (concept of delaying signals until ast())
* - Heavyweight interrupt threads on the alpha for device I/O interrupts.jhb2000-10-051-2/+4
| | | | | | | | | | | - Make softinterrupts (SWI's) almost completely MI, and divorce them completely from the x86 hardware interrupt code. - The ihandlers array is now gone. Instead, there is a MI shandlers array that just contains SWI handlers. - Most of the former machine/ipl.h files have moved to a new sys/ipl.h. - Stub out all the spl*() functions on all architectures. Submitted by: dfr
* Reduce userland namespace polution.jasone2000-10-041-1/+4
|
* #include <sys/proc.h> in order to get curproc. This seems to be the lesserjasone2000-09-231-2/+1
| | | | | of two evils; the greater evil is requiring sys/proc.h to be included before including machine/mutex.h.
* Remove the mtx_t, witness_t, and witness_blessed_t types. Instead, justjhb2000-09-141-25/+23
| | | | | | use struct mtx, struct witness, and struct witness_blessed. Requested by: bde
* - Fix spinlock exiting to handle recursion properly and only enablejhb2000-09-131-5/+7
| | | | | | interrupts at the proper time. - Remove an uneeded test and just always set the MTX_RECURSE bit when recursing on a sleep lock.
* Really disable interrupts for spin mutexes instead of just pretending.dfr2000-09-121-8/+6
|
* The alpha doesn't have a eflags register, so don't refer to it here.jhb2000-09-111-2/+0
|
* Style cleanups. No functional changes.jasone2000-09-091-71/+63
|
* Add file and line arguments to WITNESS_ENTER() and WITNESS_EXIT, sincejasone2000-09-091-16/+16
| | | | | | __FILE__ and __LINE__ don't get expanded usefully in inline functions. Add const to all witness*() arguments that are filenames.
* Add missing \'s to multline macros used for assertions.jhb2000-09-091-2/+2
|
* Use inline functions instead of macros for mtx_enter(), mtx_try_enter(),jasone2000-09-081-146/+160
| | | | | | | | | | | and mtx_exit(). This change tracks the i386 version. Rename mtx_enter(), mtx_try_enter(), and mtx_exit() and wrap them with cpp macros that expand to pass filename and line number information. This is necessary since we're using inline functions instead of macros now. Add const to the filename pointers passed througout the mtx and witness code.
* Major update to the way synchronization is done in the kernel. Highlightsjasone2000-09-074-0/+784
| | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud