summaryrefslogtreecommitdiffstats
path: root/sys/alpha/include
Commit message (Collapse)AuthorAgeFilesLines
...
* Add multiple inclusion protection.obrien2000-12-282-0/+10
| | | | | PR: 23902 Submitted by: Christian Weisgerber <naddy@mips.inka.de>
* Store in globaldata our CPU ID#. Provide a lock for panics - only onemjacob2000-12-093-0/+4
| | | | | CPU can panic at a time. Obtained from:Andrew Gallatin <gallatin@cs.duke.edu>
* Next phase in the PCI subsystem cleanup.msmith2000-12-082-2/+2
| | | | | | | | | | | | | | | | | | | | - 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
* Don't use p->p_sigstk.ss_flags to keep state of whether themarcel2000-11-301-0/+2
| | | | | | | | | | | | | | | process is on the alternate stack or not. For compatibility with sigstack(2) state is being updated if such is needed. We now determine whether the process is on the alternate stack by looking at its stack pointer. This allows a process to siglongjmp from a signal handler on the alternate stack to the place of the sigsetjmp on the normal stack. When maintaining state, this would have invalidated the state information and causing a subsequent signal to be delivered on the normal stack instead of the alternate stack. PR: 22286
* Add a consistent API to a feature that most modern CPUs have; a fastmarkm2000-11-211-0/+10
| | | | | | | | | | | | | | counter register in-CPU. This is to be used as a fast "timer", where linearity is more important than time, and multiple lines in the linearity caused by multiple CPUs in an SMP machine is not a problem. This adds no code whatsoever to the FreeBSD kernel until it is actually used, and then as a single-instruction inline routine (except for the 80386 and 80486 where it is some more inline code around nanotime(9). Reviewed by: bde, kris, jhb
* Make programs which still #include <machine/{mouse,console}.h> failphk2000-11-202-13/+2
| | | | | | | at compiletime, with an explanatory error message. Previously they would only get a warning. These files will be finally removed 2001-01-15
* 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
|
* Make MINSIGSTKSZ machine dependent, and have the sigaltstackmarcel2000-11-091-0/+6
| | | | | | | | | | | | | | | | | | | | | | syscall compare against a variable sv_minsigstksz in struct sysentvec as to properly take the size of the machine- and ABI dependent struct sigframe into account. The SVR4 and iBCS2 modules continue to have a minsigstksz of 8192 to preserve behavior. The real values (if different) are not known at this time. Other ABI modules use the real values. The native MINSIGSTKSZ is now defined as follows: Arch MINSIGSTKSZ ---- ----------- alpha 4096 i386 2048 ia64 12288 Reviewed by: mjacob Suggested by: bde
* Fix CMSG and ALIGN macro usage.asmodai2000-11-081-17/+37
| | | | | | | | | | | | | | | | | | | Previously we had to include <machine/param.h> or <sys/param.h> bogusly due to the fact that <sys/socket.h> CMSG macros needed the ALIGN macro, which was defined in param.h. However, including param.h was a disaster for namespace pollution. This solution, as contributed by shin a while ago, fixes it elegantly by wrapping the definitions around some namespace pollution preventer definitions. This patch was long overdue. This should allow any network programmer to use <sys/socket.h> as before. PR: 19971, 20530 Submitted by: Martin Kaeske <MartinKaeske@lausitz.net> Mark Andrews <Mark.Andrews@nominum.com> Patch submitted by: shin Reviewed by: bde
* - Modify alpha_setup_intr() to take interrupt handler flags as an additionaljhb2000-11-011-1/+1
| | | | | | | | | | | | | argument. These flags include INTR_FAST, INTR_MPSAFE, etc. - Properly handle INTR_EXCL when it is passed in to allow an interrupt handler to claim exclusive ownership of an interrupt thread. - Add support for psuedo-fast interrupts on the alpha. For fast interrupts, we don't allocate an interrupt thread; instead, during dispatching of an interrupt, we run the handler directly instead of scheduling the thread to run. Note that the handler is currently run without Giant and must be MP safe. The only fast handler currently is for the sio driver. Requested by: dfr
* Convert all users of fldoff() to offsetof(). fldoff() is badphk2000-10-271-0/+5
| | | | | | | | | | | | | | | | | | | | | | | because it only takes a struct tag which makes it impossible to use unions, typedefs etc. Define __offsetof() in <machine/ansi.h> Define offsetof() in terms of __offsetof() in <stddef.h> and <sys/types.h> Remove myriad of local offsetof() definitions. Remove includes of <stddef.h> in kernel code. NB: Kernelcode should *never* include from /usr/include ! Make <sys/queue.h> include <machine/ansi.h> to avoid polluting the API. Deprecate <struct.h> with a warning. The warning turns into an error on 01-12-2000 and the file gets removed entirely on 01-01-2001. Paritials reviews by: various. Significant brucifications by: bde
* Merge from i386: Add MSP ioctlroger2000-10-271-0/+10
|
* - Overhaul the software interrupt code to use interrupt threads for eachjhb2000-10-252-4/+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
* Only use 1 set of memory barrier operations with the atomic_*_{acq,rel}_ptrjhb2000-10-251-2/+0
| | | | functions.
* Adjust commentsobrien2000-10-242-8/+20
| | | | | | | Submitted by: bde Add ISO C99's long long type limits. Reviewed by: bde
* 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.
* Grrrr. Fix the order of the #define's so atomic_cmpset_{acq,rel}_longjhb2000-10-201-5/+5
| | | | are defined before atomic_cmpset_{acq,rel}_ptr tries to call them.
* Fix the atomic_cmpset_{acq,rel}_ptr() functions to do proper type-casting.jhb2000-10-201-4/+18
|
* Catch up to moving headers:jhb2000-10-201-2/+2
| | | | | - machine/ipl.h -> sys/ipl.h - machine/mutex.h -> sys/mutex.h
* - 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().
* - Expand the set of atomic operations to optionally include memory barriersjhb2000-10-201-0/+169
| | | | | | | | | | | | | | | | | | | | | | | | | | in most of the atomic operations. Now for these operations, you can use the normal atomic operation, you can use the operation with a read barrier, or you can use the operation with a write barrier. The function names follow the same semantics used in the ia64 instruction set. An atomic operation with a read barrier has the extra suffix 'acq', due to it having "acquire" semantics. An atomic operation with a write barrier has the extra suffix 'rel'. These suffixes are inserted between the name of the operation to perform and the typename. For example, the atomic_add_int() function now has 3 variants: - atomic_add_int() - this is the same as the previous function - atomic_add_acq_int() - this function combines the add operation with a read memory barrier - atomic_add_rel_int() - this function combines the add operation with a write memory barrier - Add 'ptr' to the list of types that we can perform atomic operations on. This allows one to do atomic operations on uintptr_t's. This is useful in the mutex code, for example, because the actual mutex lock is a pointer. - Add two new operations for doing loads and stores with memory barriers. The new load operations use a read barrier before the load, and the new store operations use a write barrier after the load. For example, atomic_load_acq_int() will atomically load an integer as well as enforcing a read barrier.
* Axe the barrier_{read,write,rw}() helper functions as this method ofjhb2000-10-201-12/+0
| | | | | | | doing memory barriers doesn't really scale well for the ia64. Also, memory barriers are more a property of the CPU than bus space. Requested by: dfr
* Add in a simple API for memory barriers to machine/bus.h:jhb2000-10-181-0/+12
| | | | | | - barrier_read() enforces a memory read barrier - barrier_write() enforces a memory write barrier - barrier_rw() enforces a memory read/write barrier
* Implement write combining for crashdumps. This is useful whenps2000-10-171-0/+1
| | | | | | | | | | | | | | | | | | write caching is disabled on both SCSI and IDE disks where large memory dumps could take up to an hour to complete. Taking an i386 scsi based system with 512MB of ram and timing (in seconds) how long it took to complete a dump, the following results were obtained: Before: After: WCE TIME WCE TIME ------------------ ------------------ 1 141.820972 1 15.600111 0 797.265072 0 65.480465 Obtained from: Yahoo! Reviewed by: peter
* Fix problems booting large kernels on alphas. The symptom is that the kernelgallatin2000-10-161-1/+4
| | | | | | | | | | | | | | | loads, prints the copyright, and either hangs or locks solid. The PC tends to be in the data segment and the RA is in XentMM Doug really came up with the fix, I'm just the monkey typing. Doug says: The alpha can only support 64k of globals with $gp pointing at base+32k so that the code can use 16bit signed offsets from $gp to access it. .... it is possible to have multiple .got subsections and the linker handles this with the relocations for 'ldgp' pseudo instructions. [Without this patch] the code in exception.s has been linked to use a different gp from locore.s (where pal_kgp is set). Reviewed by: dfr
* Move DELAY() from <machine/clock.h> to <sys/systm.h>phk2000-10-151-1/+0
|
* Initiate deorbit burn sequence for <machine/mouse.h>.phk2000-10-091-334/+4
| | | | | | | | | | Replace all in-tree uses with <sys/mouse.h> which repo-copied a few moments ago from src/sys/i386/include/mouse.h by peter. This is also the appropriate fix for exo-tree sources. Put warnings in <machine/mouse.h> to discourage use. November 15th 2000 the warnings will be converted to errors. January 15th 2001 the <machine/mouse.h> files will be removed.
* Initiate deorbit burn sequence for <machine/console.h>.phk2000-10-081-0/+4
| | | | | | | | | Replace all in-tree uses with necessary subset of <sys/{fb,kb,cons}io.h>. This is also the appropriate fix for exo-tree sources. Put warnings in <machine/console.h> to discourage use. November 15th 2000 the warnings will be converted to errors. January 15th 2001 the <machine/console.h> files will be removed.
* Cleanup comment in machine/param.h regarding mbuf-related sizes, and get ridbmilekic2000-10-081-8/+6
| | | | | of MCLOFSET, which does not appear to be used anywhere anymore, and if it is, it probably shouldn't be.
* Work around a bug by adding struct tags. gcc-2.95 apparently gets thebde2000-10-061-2/+2
| | | | | | | | | check in the [basic.link] section of the C++ standard wrong. gcc-2.7.2.3 apparently doesn't do the check, so the bug doesn't affect RELENG_3. PR: 16170, 21427 Submitted by: Max Khon <fjoe@lark.websci.ru> (i386 version) Discussed with: jdp
* - Change fast interrupts on x86 to push a full interrupt frame and tojhb2000-10-062-3/+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-055-100/+13
| | | | | | | | | | | - 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
* Add atomic_readandclear_int and atomic_readandclear_long.jhb2000-10-051-0/+42
|
* Reduce userland namespace polution.jasone2000-10-041-1/+4
|
* Move MAXCPU from machine/smp.h to machine/param.h to fix breakageps2000-09-233-5/+5
| | | | | with !SMP kernels. Also, replace NCPUS with MAXCPU since they are redundant.
* #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 a few leftover CLBYTES related bits.phk2000-09-161-7/+0
| | | | | This was in the good old days to patch up a logical pagesize on hardware with stupid VM pagesize. Vaxen I belive.
* 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
* - Remove the inthand2_t type and use the equivalent driver_intr_t type fromjhb2000-09-131-3/+0
| | | | | | | | | | | | | newbus for referencing device interrupt handlers. - Move the 'struct intrec' type which describes interrupt sources into sys/interrupt.h instead of making it just be a x86 structure. - Don't create 'ithd' and 'intrec' typedefs, instead, just use 'struct ithd' and 'struct intrec' - Move the code to translate new-bus interrupt flags into an interrupt thread priority out of the x86 nexus code and into a MI ithread_priority() function in sys/kern/kern_intr.c. - Remove now-uneeded x86-specific headers from sys/dev/ata/ata-all.c and sys/pci/pci_compat.c.
* - 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.
* * Redo the cmpset inlines to use one less register. This incidentallydfr2000-09-121-22/+156
| | | | | | | | | | | fixes a serious problem with the previous version where an input could have been placed in the same register as an output which would stop the inline from working properly. * Redo atomic_{set,clear,add,subtract}_{32,64} as inlines since the code sequence is shorter than the call sequence to the code in atomic.s. I will remove the functions from atomic.s after a grace period to allow people to rebuild kernel modules.
* 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.
OpenPOWER on IntegriCloud