summaryrefslogtreecommitdiffstats
path: root/sys/amd64/isa
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix a warning (the prototypes probably shouldn't be so over-zealouslypeter2001-01-192-2/+2
| | | | #ifdef'ed though)
* Free the intrhand name when free'ing a intrhand.jhb2001-01-162-0/+2
| | | | Submitted by: bde
* Implement an optimization for INTREN/INTRDIS that bde pointed out lastpeter2001-01-152-0/+28
| | | | | | | | | | | time I tinkered around here. Since INTREN is called from the interrupt critical path now, it should not be too expensive. In this case, we look at the bits being changed to decide which 8 bit IO port to write to rather than unconditionally writing to both. I could probably have gone further and only done the write if the bits actually changed, but that seemed overkill for the usual case in interrupt threads. [an outb is rather expensive when it has to cross the ISA bus]
* Use PCPU_GET, PCPU_PTR and PCPU_SET to access all per-cpu variablesjake2001-01-101-17/+17
| | | | other then curproc.
* Use %fs to access per-cpu variables in uni-processor kernels the samejake2001-01-063-0/+6
| | | | | | | | | | | | | | | | | as multi-processor kernels. The old way made it difficult for kernel modules to be portable between uni-processor and multi-processor kernels. It is no longer necessary to jump through hoops. - always load %fs with the private segment on entry to the kernel - change the type of the self referntial pointer from struct privatespace to struct globaldata - make the globaldata symbol have value 0 in all cases, so the symbols in globals.s are always offsets, not aliases for fields in globaldata - define the globaldata space used for uniprocessor kernels in C, rather than assembler - change the assmebly language accessors to use %fs, add a macro PCPU_ADDR(member, reg), which loads the register reg with the address of the per-cpu variable member
* Introduce a new potientially cleaner interface for accessing per-cpujake2000-12-133-6/+6
| | | | | | | | | | | variables from i386 assembly language. The syntax is PCPU(member) where member is the capitalized name of the per-cpu variable, without the gd_ prefix. Example: movl %eax,PCPU(CURPROC). The capitalization is due to using the offsets generated by genassym rather than the symbols provided by linking with globals.o. asmacros.h is the wrong place for this but it seemed as good a place as any for now. The old implementation in asnames.h has not been removed because it is still used to de-mangle the symbols used by the C variables for the UP case.
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-082-8/+6
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* Cleanup some leftover lint from the old interrupt system.peter2000-12-048-273/+57
| | | | | | | | Also, while here, run up to 32 interrupt sources on APIC systems. Normalize INTREN/INTRDIS so they are the same on both UP and SMP systems rather than sometimes a macro, and sometimes a function. Reviewed by: jhb, jakeb
* Namespace cleanup. Remove some #includes in favour of an explicitmarkm2000-12-021-0/+5
| | | | | | declaration. Asked for by: bde
* Change doreti to take a trapframe instead of an intrframe.jake2000-12-013-6/+6
| | | | | | Remove associated pushes of dummy units to convert frame. Reviewed by: jhb
* Assert that Giant is not owned during the main loop of ithd_loop().jhb2000-11-151-0/+1
|
* Revert two experimental changes which escaped from my devel machine.phk2000-10-281-1/+1
|
* Fix a couple of whitespace nits.jhb2000-10-272-4/+4
|
* Convert all users of fldoff() to offsetof(). fldoff() is badphk2000-10-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | 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
* Fast interrupts have no associated process, therefore do not tryps2000-10-252-22/+26
| | | | and schedule it. This fixes booting machines with broken MP tables.
* - Overhaul the software interrupt code to use interrupt threads for eachjhb2000-10-255-80/+76
| | | | | | | | | | | | | | | | | | | 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
* Catch up to moving headers:jhb2000-10-201-1/+1
| | | | | - machine/ipl.h -> sys/ipl.h - machine/mutex.h -> sys/mutex.h
* Actually harvest interrupt threads when the last handler is removed from ajhb2000-10-203-6/+51
| | | | thread.
* - machine/mutex.h -> sys/mutex.hjhb2000-10-201-3/+3
| | | | | - machine/ipl.h -> sys/ipl.h - Use MUTEX_DECLARE() for clock_lock
* Convert the type of bus_space_handle_t of pc98 from structure intokato2000-10-201-10/+10
| | | | | | pointer to structure. Reviewed by: nyan
* - Change fast interrupts on x86 to push a full interrupt frame and tojhb2000-10-064-223/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-059-218/+19
| | | | | | | | | | | - 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 a new process flag P_NOLOAD that marks a process that should bejhb2000-09-151-0/+1
| | | | | ignored during load average calcuations. - Set this flag for the idle processes and the softinterrupt process.
* Check to see if we actually have an interrupt descriptor and an interruptjhb2000-09-151-0/+21
| | | | | | | | thread for each interrupt that comes in. If we don't, log the event and return immediately for a hardware interrupt. For a softinterrupt, panic instead. Submitted by: ben
* - Remove the inthand2_t type and use the equivalent driver_intr_t type fromjhb2000-09-135-66/+51
| | | | | | | | | | | | | 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.
* Don't panic for delivery of a multiplexed SWI. Most SWI handlersbde2000-09-121-1/+4
| | | | | | | | | | | | don't take an arg, but swi_generic() is special in order to avoid one whole conditional branch in the old SWI dispatch code. The new SWI dispatch code passed it a garbage arg. Bypass swi_generic() and call swi_dispatcher() directly, like the corresponding alpha code has always done. The panic was rare because because it only occurred if more than one of the {sio,cy,rc} drivers was configured and one was active, and the cy driver doesn't even compile.
* Don't assume that address of I/O address table increase (PC-98 only).nyan2000-09-071-2/+2
| | | | Pointed out by: Tomokazu HARADA <tkhara@osk4.3web.ne.jp>
* Major update to the way synchronization is done in the kernel. Highlightsjasone2000-09-0713-1082/+950
| | | | | | | | | | | | | | | 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
* Change the behavior of isa_nmi to log an error message instead ofps2000-08-062-36/+62
| | | | | | | | | panicing and return a status so that we can decide whether to drop into DDB or panic. If the status from isa_nmi is true, panic the kernel based on machdep.panic_on_nmi, otherwise if DDB is enabled, drop to DDB based on machdep.ddb_on_nmi. Reviewed by: peter, phk
* Allow use of TSC even if APM is compiled in but disabled.phk2000-07-301-1/+6
|
* Previous commit changing SYSCTL_HANDLER_ARGS violated KNF.phk2000-07-041-2/+2
| | | | Pointed out by: bde
* Style police catches up with rev 1.26 of src/sys/sys/sysctl.h:phk2000-07-031-2/+2
| | | | | | | | Sanitize SYSCTL_HANDLER_ARGS so that simplistic tools can grog our sources: -sysctl_vm_zone SYSCTL_HANDLER_ARGS +sysctl_vm_zone (SYSCTL_HANDLER_ARGS)
* Fixed atpic_attach() for the SMP (specifically APIC_IO) case.fsmp2000-06-242-2/+4
| | | | Approved by: msmith@freebsd.org
* Make the PnP 'slopsucker' quiet in the !bootverbose case - the real NPXmsmith2000-06-231-1/+5
| | | | | probe happens much earlier, and may come to very different conclusions about the system's NPX setup.
* Add PnP probe methods to some common AT hardware drivers. In each case,msmith2000-06-234-1/+229
| | | | | | | | | the PnP probe is merely a stub as we make assumptions about some of this hardware before we have probed it. Since these devices (with the exception of the speaker) are 'standard', suppress output in the !bootverbose case to clean up the probe messages somewhat.
* Pack the SWI bits to save some time and space.bde2000-05-313-18/+6
|
* Add SWI_TQ_MASK to all interrupt masks except SWI_CLOCK_MASK. Use abde2000-05-314-6/+6
| | | | | | | new macro SWI_LOW_MASK to give the mask for low priority SWIs instead of hard-coding this mask as SWI_CLOCK_MASK. Reviewed by: dfr
* Add SWI_TQ_MASK to imask definition.dfr2000-05-293-3/+3
|
* Redo the isa compat driver shim so that each driver is self containedpeter2000-05-281-5/+0
| | | | | | | and does not require that evil list of drivers in isa_compat.h. It uses the same strategy that pci drivers use, namely a COMPAT_ISA_DRIVER() macro that creates the glue on the fly. Theoretically old-style isa drivers should be preloadable now.
* 1. `movl' is for use with 32-bit operands. Do NOT use it with 16-bitobrien2000-05-103-27/+27
| | | | | | | operands. `movw' could be used, but instead let the assembler decide the right instruction to use. 2. AT&T asm syntax requires a leading '*' in front of the operand for indirect calls and jumps.
* Add a little do-nothing ``slopsucker'' device which gives a homewollman2000-05-041-0/+44
| | | | to PNP0c04 (legacy ISA coprocessor support). Tourist info.
* Mark two functions as private.peter2000-04-293-0/+11
|
* Added indirect pio into the bus space stuff for the NEC PC-98. bus.hkato2000-03-291-0/+102
| | | | | | | | | | | includes one of bus_at386.h and bus_pc98.h. Becuase only bus_pc98.h supports indirect pio and bus_at386.h is identical to old bus.h, there is no functional change in PC-AT's kernels. That is, it cannot cause performance loss. Submitted by: nyan Reviewed by: imp bde and luoqi provided useful comments for earlier version.
* Isolate the Timecounter internals in their own two files.phk2000-03-201-6/+7
| | | | | | | | | | | | | | | Make the public interface more systematically named. Remove the alternate method, it doesn't do any good, only ruins performance. Add counters to profile the usage of the 8 access functions. Apply the beer-ware to my code. The weird +/- counts are caused by two repocopies behind the scenes: kern/kern_clock.c -> kern/kern_tc.c sys/time.h -> sys/timetc.h (thanks peter!)
* Connect the ISA and PCI compatability shims to an option. In this casepeter2000-03-191-1/+5
| | | | | | | | it's options COMPAT_OLDISA and COMPAT_OLDPCI. This is meant to be a fairly strong incentive to update the older drivers to newbus, but doesn't (quite) leave anybody hanging with no hardware support. I was talking with a few folks and I was encouraged to simply break or disable the shims but that was a bit too drastic for my liking.
* Stop isadma from abusing the B_READ, B_RAW and B_WRITE flags.phk2000-03-132-12/+16
| | | | | Define ISADMA_{READ,WRITE,RAW} macros with the same numeric values as the B_{READ,WRITE,RAW} and use them instead throughout.
* Remove a bunch of unused (NO-OP) #if NFOO > 0 type includes and somepeter2000-01-291-5/+0
| | | | #include "foo.h" headers.
* Use device_printf() instead of device_print_prettyname().dfr2000-01-251-10/+9
|
* ISA device drivers use the ISA source interrupt number in locations wheretegge2000-01-041-9/+27
| | | | | | | | | | | | | | the low level interrupt handler number should be used. Change setup_apic_irq_mapping() to allocate low level interrupt handler X (Xintr${X}) for any ISA interrupt X mentioned in the MP table. Remove an assumption in the driver for the system clock (clock.c) that interrupts mentioned in the MP table as delivered to IOAPIC #0 intpin Y is handled by low level interrupt handler Y (Xintr${Y}) but don't assume that low level interrupt handler 0 (Xintr0) is used. Don't allocate two low level interrupt handlers for the system clock. Reviewed by: NOKUBI Hirotaka <hnokubi@yyy.or.jp>
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"peter1999-12-292-4/+4
| | | | | | 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.
OpenPOWER on IntegriCloud