summaryrefslogtreecommitdiff
path: root/sys/arch/i386/isa
AgeCommit message (Collapse)Author
2015-09-27free(x, 0) cleanup:Sebastien Marie
- set size argument of free() - remove pointless if expression around free() call ok guenther@
2015-09-01fairly simple sizes for free()Theo de Raadt
2015-07-16Move grab/release of the kernel_lock for softintrs from the ASM stubs toPhilip Guenther
softintr_dispatch(). Delete traces of long superseded stats code. ok beck@ mpi@ uebayasi@
2015-07-13remove unused isa_nodefaultirq; ok kettenis, mlarkinMike Belopuhov
2015-06-28Split AST handling from trap() into ast() and get rid of T_ASTFLTPhilip Guenther
testing by krw@, and then many via snapshots
2015-02-11deprecate use of sys/lock.h and replace it with sys/atomic.h orDavid Gwynne
machine/lock.h as appropriate.
2015-02-10Switch uiomovei(..., sizeof whatever, ...) to uiomove().Miod Vallat
2015-02-10First step towards making uiomove() take a size_t size argument:Miod Vallat
- rename uiomove() to uiomovei() and update all its users. - introduce uiomove(), which is similar to uiomovei() but with a size_t. - rewrite uiomovei() as an uiomove() wrapper. ok kettenis@
2015-01-24Add bus_dmamem_alloc_range(9) to allow drivers to allocate DMA'able memoryMark Kettenis
within a range that is more (or less) restrictive than the default range. ok deraadt@, stsp@
2014-12-22bcopy -> memcpy, as in amd64Theo de Raadt
2014-07-13The correct place to call _bus_dmamap_sync() is after we copy data *to* theMark Kettenis
bounce buffer and before we copy data *from* the bounce buffer. Currently _bus_dmamap_sync() is a no-op, but keeping it #ifdef'ed out in the wrong place makes no sense. ok deraadt@, miod@
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-03-29It's been a quarter century: we can assume volatile is present with that name.Philip Guenther
ok dlg@ mpi@ deraadt@
2013-11-16Copied from amd64..Brad Smith
Use an explicit suffix for the "fld" instruction to shut up clang. The correct instruction is fldl since we try to load a double-precision value. GCC actually gets it wrong and emits "flds" (which is harmless). ok guenther@
2013-07-14IPL_VM is "mpsafe" now as well.Mark Kettenis
2013-07-10To prevent lock ordering problems with the kernel lock, we need to make sureMark Kettenis
we block all interrupts that can grab the kernel lock. The simplest way to achieve this is to make sure mutexes always raise the ipl to the highest level that has interrupts that grab the kernel lock. This will allow us to have "mpsafe" interrupt handlers at lower priority levels. No change for non-MULTIPROCESSOR kernels. ok matthew@
2013-05-16Implement a mechanism to establish interrupt handlers that don't grab theMark Kettenis
kernel lock upon entry through a new IPL_MPSAFE flag/level.
2013-05-08remove stale cyrix emc support, and switch to just using intial npxcwTed Unangst
ok kettenis
2013-05-06the use of modern intel performance counter msrs to measure the number ofDavid Gwynne
cycles per second isnt reliable, particularly inside "virtual" machines. cpuspeed can be calculated as 0, which causes a divide by zero later on which is bad. this goes to more effort to detect if the performance counters are in use by the hypervisor, or detecting if they gave us a cpuspeed of 0 so we can fall through to using rdtsc. ok jsg@
2013-04-17Don't set the frequency of the statclock if we don't have one.Gerhard Roth
Prevents strange hang-ups during reboot. Joint work with hshoexer@. ok mikeb@, mlarkin@, miod@, deraadt@
2012-11-10Recent x86 CPUs come with a constant time stamp counter. If this isMarcus Glocker
the case we verify if the CPU supports a specific version of the architectural performance monitoring feature and read out the current frequency from the fixed-function performance counter of the unhalted core. My initial motivation to implement this was the Soekris net6501-70 which comes with an Intel Atom E6xx 1.60GHz CPU. It has a constant time stamp counter plus speed step support and boots on the lowest frequency of 600MHz. This caused hw.cpuspeed and hw.setperf to reflect the wrong values. The diff is a cooperation work with jsg@. The fixed-function performance counter read code comes from a former diff of him. OK jsg@
2011-07-11Revert art@'s moving around of the KERNEL_LOCK()/KERNEL_UNLOCK() calls,Philip Guenthe
as it causes hangs in some ports, including libsigsegv's configure script confirmed by krw@, landry@
2011-07-07There is a bunch of places in the kernel entry points where we don'tArtur Grabowski
hold the kernel lock, but still need call one function that needs it. Instead of grabbing the lock all over the place, move the locks into the affected functions: trapsignal, scdebug*, ktrsyscall, ktrsysret, systrace_redirect and ADDUPROF. In the cases we already hold the biglock we'll just recurse. kettenis@, beck@ ok
2011-07-06Clean up after P_BIGLOCK removal.Artur Grabowski
KERNEL_PROC_LOCK -> KERNEL_LOCK KERNEL_PROC_UNLOCK -> KERNEL_UNLOCK oga@ ok
2011-07-05N: Thou shalt not call hardclock() with biglock held.Owain Ainsworth
i386 disobeys the Nth commandment. Fix this. While here, make i386 and amd64 definitions of iplclock and statclock match. ok art@, kettenis@
2011-04-16More than a decade ago, interrupt handlers on sparc started returning 0Theo de Raadt
(interrupt was not for me), 1 (positive interrupt was for me), or -1 (i am not sure...). We have continued with this practice in as many drivers as possible, throughout the tree. This makes some of the architectures use that information in their interrupt handler calling code -- if 1 is returned (and we know this specific machine does not have edge-shared interrupts), we finish servicing other possible handlers on the same pin. If the interrupt pin remains asserted (from a different device), we will end up back in the interrupt servicing code of course... but this is cheaper than calling all the chained interrupts on a pin. This does of course count on shared level interrupts being properly sorted by IPL. There have been some concerns about starvation of drivers which incorrectly return 1. Those drivers should be hunted down so that they return -1. ok and help from various people. In snaps for about a week now.
2011-03-20When reading MXCSR from userland sigcontext or a ptrace request,Philip Guenthe
mask out invalid bits to prevent a protect fault. Original diff by joshe@; further feedback and ok kettenis@
2011-01-03remove unused fileAlexandr Shadchin
ok krw, miod
2010-12-21Convert netisr to a normal soft interrupt instead of hanving MD codeClaudio Jeker
for it. This makes the netisr a real C function which will help further development. No noticable performance change on i386 and amd64. With input from kettenis@ and miod@ additional OKs mikeb@ and henning@
2010-11-20typoMiod Vallat
2010-09-29Back out previous, it appears to be broken.Joshua Elsasser
2010-09-29When reading MXCSR from userland sigcontext, mask out invalid bits.Joshua Elsasser
This prevents a protection fault if a userland signal handler scribbles all over it's struct sigcontext Help from and ok guenther@ kettenis@
2010-09-20Get rid of evcount's support for arranging counters in a treeMatthew Dempsky
hierarchy. Everything attached to a single root node anyway, so at best we had a bush. "i think it is good" deraadt@
2010-08-11Disable the RTC the periodic interrupt. Leaving it enabled causes theMark Kettenis
Dell Inspirion 4150 to wake up immediately even though RTC_EN isn't set in the PM1 Enable register. ok deraadt@, mlarkin@
2010-08-10spaces and tabs, no binary changeMarco Peereboom
2010-07-25in the clock drivers, seperate the soft-state and hard-state which wasTheo de Raadt
all jumbled up in the same functions. the rtc (mc chip) and clock (i8243) startup was also mixed up. they the soft state and hardware state can be started in the right order, and it is easy to restart just the neccessary parts upon resume. tested in numerous cases: (apic, pic) * (GENERIC.MP, GENERIC) * (mp, non-mp) * (i386, amd64) ok kettenis
2010-07-23Change the strategy for using the FPU in the kernel. The kernel FPU stateMark Kettenis
is now shared with all processes/threads. As a result, you can now use the FPU in true process context (instead of just in kernel threads), but you need to make sure you restore the default FPU state before calling fpu_kernel_exit() if you change rounding mode, precision or exception masks. Lots of discussion with thib@ and Mike Belopuhov. ok thib@, deraadt@
2010-07-23Don't leak the contents of the FPU and SSE registers between processes.Mark Kettenis
ok deraadt@
2010-07-21Make sure that the FPU IPIs shoot down the right FPU context and not the FPUMark Kettenis
context of some random process that happened to be switched onto the FPU after the decision was made to send the IPI.
2010-06-29fpu_kernel_{enter,exit}; Functions to allow the use ofThordur I. Bjornsson
the FPU in the kernel. From Mike Belopuhov; Little bits by myself. Comments/OK kettenis@
2010-05-09Make i386 use a pointer to the trap frame like everybody else instead ofMark Kettenis
the weird "pass by reference" that causes problems with gcc4. ok nicm@, tom@
2010-03-25Make the i386 and amd64 bus_dma functions for isa less stupid:Owain Ainsworth
1) when you have a wrapper function in a dmatag that just calls the _bus_dmamem original, you don't need it, just put the original function in the tag 2) don't trunc_page the avail_end/ISA_BOUNCE_THRESHOLD stuff (see icb for a discussion of why this is wrong about 00:00 gmt). make i386 and amd64 both do this the same (the amd64 way is cleaner and makes the third diff actually possible without a lot of pain). just do dmamem_alloc_range(0, threshold) and if that fails do a alloc_range(0, -1) and assume we'll bounce to pick up the pieces. Also using avail_end for alloc_range is not nice (miod has been trying to avoid these abuses iirc), so just use (paddr_t)-1, which is equivalent since you want "any" memory. 3) now this is the funny one. consider point 2. then considering why using the same bloody function to allocate your bouncebuffer is just f'ing wrong. instead allocate with alloc_range(0, threshold) to make sure that our bouncebuffer is actually uner 16megs. ok deraadt@, kettenis@. Tested by several people.
2009-10-28delete balony comment; ok kettenisTheo de Raadt
2009-10-26Load %mxcsr when initializing the FPU on machines that support SSE.Mark Kettenis
ok deraadt@
2009-10-03Properly handle XMM exceptions instead of panicing the kernel. Fixes theMark Kettenis
issue reported by Slava Pestov. ok deraadt@
2009-08-22Constify the what/name parameter of pci_intr_establish().Michael Knudsen
Tested by myself, sthen, oga, kettenis, and jasper. Input from sthen and jasper. ok kettenis (Manpage follows shortly.)
2009-03-29make various strings ("can't map mem space" and similar) more consistentStuart Henderson
between instances, saving space in the kernel. feedback from many (some incorporated, some left for future work). ok deraadt, kettenis, "why not" miod.
2009-03-10remove the _BUS_DMA_PRIVATE define from amd64 and i386.Owain Ainsworth
a define needed to get to ``private'' functions that needs to be defined 5 or more times isn't much use and may cause namespace issues anyway. Other archs will probably follow. Discussed in portugal. "Hell yes" weingart@, ok kettenis@, no objections miod@
2009-01-29Only start using the rtc for statclock after we've received the firstMark Kettenis
interrupt. On some machines the rtc doesn't generate interrupts and we would end up not running statclock() at all. ok miod@, art@
2008-12-11Kill the $ARCH prefix for isa_dma_cookie. With this change, the i386 andOwain Ainsworth
amd64 isa dma code is identical save for some formatting, and a slight difference in bus_dmamem_alloc. "Die x86_!" krw@.