summaryrefslogtreecommitdiff
path: root/sys/arch/i386/include
AgeCommit message (Collapse)Author
2014-03-16Kill DB_*TASK_NAME* macros which were only ever on i386/amd64 and never used.Philip Guenther
2014-03-14rework mplocks to use tickets instead of spinning. this providesDavid Gwynne
fairer access to the kernel lock between logical cpus, especially in multi socket systems. i first wrote this diff in 2011. ok n2k14 for post 5.5 (deraadt@ and kettenis@ in particular)
2014-03-11lint is gone, and the 'lint' conditional was never in the implementationPhilip Guenther
namespace, so stop changing behavior when it's #defined ok beck@ krw@
2014-02-13Some Linux i915 drm "fast" path code relies on being able to "disable" pageMark Kettenis
faults to avoid sleeping. Implement this functionality for i386 and amd64 for faults in the user address space. If the ci_inatomic flag is set in struct cpu_info, copyin(9) and copyout(9) will return EFAULT when a user-space address needs to be faulted in. Use this to properly implement __copy_to_user_inatomic() and __copy_from_user_inatomic_nocache() in the inteldrm(4) code. ok krw@, guenther@
2014-01-30Move declaration of struct vm_page_md from <machine/vmparam.h> toMiod Vallat
<machine/pmap.h> where it belongs, and compensate in <uvm/uvm_extern.h> by including <uvm/uvm_pmap.h> before <uvm/uvm_page.h>. Tested on all MACHINE_ARCH but amd64 and i386 (and hppa64).
2014-01-24Disable lapic when halting CPUs. Allegedly this is necessary to makeMark Kettenis
suspend work on some machines. ok deraadt@, mlarkin@
2014-01-23unifdef -D__HAVE_VM_PAGE_MD - no functional change.Miod Vallat
2014-01-06Increase NPTECL, as cache-lines are 64-bytes nowadays.Stefan Fritsch
Also move it from pmap.h to pmap.c because it is an internal detail.
2014-01-05Don't use the first 64KB for anything, including tramps. Move tramps andMike Larkin
hibernate goo up after 64KB to avoid posible corruption by buggy BIOS SMM code. Diff also ensures the first 64KB doesn't get handed to UVM either. ok deraadt@, tested by many with no regressions reported
2013-12-23Add an instruction barrier to bus_space_barrier(). From David Hill.Mark Kettenis
ok deraadt@
2013-12-18Provide MI symbol _STACKALIGNBYTESTheo de Raadt
2013-12-12Remove the scatter/gather dma implementation as it is no longer used.Mark Kettenis
ok krw@, deraadt@
2013-12-06Make clflush() flush the cache line specified by the address we pass itMark Kettenis
instead of the cache line containing the local variable used to specify the address. Fixes the gnome corruption and hangs people have been experiencing for the last couple of months or so. ok deraadt@, mlarkin@
2013-11-02Cleanup bios_oconsdev_t. Make sure you have a halfway recent bootloaderMark Kettenis
(at least BOOT 3.20 on amd64 and BOOT 3.18 on i386) or you'll risk losing your serial console. ok deraadt@
2013-10-17Remove a.out leftovers now that libsa loadfile() will only boot ELF binaries.Miod Vallat
2013-10-17Remove support for a.out and ecoff. We only do elf now.Theo de Raadt
ok miod
2013-10-09Use monitor/mwait to idle when available. Make cpu_unidle() do nothingPhilip Guenther
if it can tell the target CPU isn't actually idling and introduce cpu_kick() for the cases where we want to force a non-idle CPU into the kernel. just a port of the amd64 version; testing by many
2013-08-24Cleanup amd64 and i386 MTRR code -Mike Larkin
1. Makes amd64 and i386 MTRR code nearly identical 2. Removes support for per-process MTRRs (which were never implemented) 3. Treat "unknown" MTRR types as uncacheable instead of trying to preserve bogus settings made by the BIOS 4. Various KNF cleanups Should be no functional change. ok jsg@, deraadt@
2013-08-07We uniformly define size_t to be unsigned long and ssize_t to be long. MakeMark Kettenis
sure that SIZE_MAX and SSIZE_MAX are defined as constants with a matching type on all are architectures. ok millert@, matthew@
2013-07-14IPL_VM is "mpsafe" now as well.Mark Kettenis
2013-07-13unify register_t to long on all platformsTheo de Raadt
ok miod 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-07-05Take II, this time without flubbing off_t: : move several internalPhilip Guenther
type definitions that are the same across all archs from <machine/_types.h> to <sys/_types.h> ok deraadt@ kettenis@ otto@
2013-07-04backout previous; off_t must be signed and there might be other C++ APIOtto Moerbeek
breakage lurking; ok kettenis@
2013-07-04To ease future changes, move several internal type definitions that arePhilip Guenther
the same across all archs from <machine/_types.h> to <sys/_types.h> ok deraadt@
2013-06-04Remove remaining references to HIBERNATE_COPY_PAGE. It was effectivelyMike Larkin
removed at n2k13 but a few errant references still remained. No functional change. Spot tested by my on i386 and amd64 UP environments, no regressions seen. noticed by deraadt@
2013-06-04Add RCS ids.Paul Irofti
2013-06-01cleanup and consolidate the spinlock_lock (what a name!) code.Ted Unangst
it's now atomic_lock to better reflect its usage, and librthread now features a new spinlock that's really a ticket lock. thrlseep can handle both types of lock via a flag in the clock arg. (temp back compat hack) remove some old stuff that's accumulated along the way and no longer used. some feedback from dlg, who is concerned with all things ticket lock. (you need to boot a new kernel before installing librthread)
2013-05-31We need to halt the APs on MP hibernate resume or else they will beMike Larkin
executing code possibly causing side effects during the image unpack operation. But before we can halt the APs, we need to complete their init (as they will be hatched but idling, possibly with interrupts off). Introduces MD function hibernate_quiesce_cpus to do this, called from the MI hibernate resume code. ok deraadt
2013-05-31remove counters for simplelocksTed Unangst
2013-05-30Make interrupt handling in hibernate resume MI by providing MD-specificMike Larkin
functions to enable and disable interrupts, if needed. If a platform doesnt need interrupt handling in this way, the MD function can be a no-op. discussed with pirofti and deraadt
2013-05-21remove unused cpu_lock code (where it is truly unused). it is notTed Unangst
part of the future we have planned. middling ok from a few
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-08this comment is not attached to this value. removeTed Unangst
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-01Do not expose the trap T_* values to userland, since they invade theTheo de Raadt
namespace a bit much. These are the names for the value encoded in core.c_ucode or siginfo.si_trapno, but userland never looks directly and only cares about the abstract signal code. ok guenther
2013-03-31try to avoid pulling in pte.h and other more crazy things. Checked againstTheo de Raadt
the things that libkvm needs.
2013-03-28Add STRONG_ALIAS macros to be used from assembly code in libc andMartynas Venckus
libm. While at it, remove now unused workarounds for lint. Agreed by kettenis@, guenther@, matthew@.
2013-03-28Add __strong_alias macros for all architectures to be able to aliasMartynas Venckus
another symbol without weak attribute. To be used in libc and libm soon. Agreed by kettenis@, guenther@, matthew@.
2013-03-26PGSHIFT and PGOFSET are now contained inside the kernel namespace.Theo de Raadt
2013-03-25PGSHIFT -> PAGE_SHIFTTheo de Raadt
2013-03-25unused relicsTheo de Raadt
2013-03-25ALIGNBYTES/ALIGN/ALIGNED_POINTER can move to the MI file.Theo de Raadt
2013-03-23refactor sys/param.h and machine/param.h. A lot of #ifdef _KERNEL is addedTheo de Raadt
to keep definitions our of user space. The MD files now follow a consistant order -- all namespace intrusion is at the tail can be cleaned up independently. locore, bootblocks, and libkvm still see enough visibility to build. Checked on 90% of platforms...
2013-03-17Add an interface to rebind AGP DMA mappings. To be used by the upcoming KMSMark Kettenis
support to reload bindings after suspend/resume and to update cachability flags in the address translation table entries.
2013-03-12Fix kernel profiling on MP systems by using per-CPU buffers and teachMartin Pieuchot
kgmon(8) to deal with them, this time without public header changes. Previously various CPUs were iterating over the same global buffer at the same time to modify it and never ended. This diff includes some ideas submited by Thor Simon to NetBSD via miod@. ok deraadt@, mikeb@, haesbaert@
2013-02-12Back out per-CPU kernel profiling, it shouldn't modify a public headerMartin Pieuchot
at this moment.
2013-02-11Fix kernel profiling on MP systems by using per-CPU buffer. PreviouslyMartin Pieuchot
various CPUs were iterating over the same global buffer at the same time to modify it and never ended. This diff includes some ideas submited by Thor Simon to NetBSD via miod@. ok mikeb@, haesbaert@
2013-01-29the bus_space api implies that there's a bus endianness that it willDavid Gwynne
swap for you to the hosts endianness. sometimes you dont want this hand holding and just want raw access to the registers. bus_space does have stuff to do this already, but they deal with buffers which can be awkward if you just want to get or set a single register. this adds the following to i386 and amd64: bus_space_read_raw_2() bus_space_read_raw_4() bus_space_read_raw_8() bus_space_write_raw_2() bus_space_write_raw_4() bus_space_write_raw_8() sparc64 already implements this, even though it wasnt part of the official api. how handy. i'll do other archs as i can. kettenis@ and miod@ seem ok with this