summaryrefslogtreecommitdiffstats
path: root/sys/arch/i386/pci (follow)
Commit message (Collapse)AuthorAgeFilesLines
* spellingjsg2021-03-112-5/+5
|
* ansijsg2021-03-061-3/+2
|
* timecounting: use C99-style initialization for all timecounter structscheloha2021-02-233-27/+27
| | | | | | | | | | | | | | | | | | The timecounter struct is large and I think it may change in the future. Changing it later will be easier if we use C99-style initialization for all timecounter structs. It also makes reading the code a bit easier. For reasons I cannot explain, switching to C99-style initialization sometimes changes the hash of the resulting object file, even though the resulting struct should be the same. So there is a binary change here, but only sometimes. No behavior should change in either case. I can't compile-test this everywhere but I have been staring at the diff for days now and I'm relatively confident this will not break compilation. Fingers crossed. ok gnezdo@
* Allocate address space for reposting vga devices using km_alloc(9) ratherjmatthew2021-01-031-7/+9
| | | | | | than uvm_km_valloc(9). ok kettenis@
* Add support for timeconting in userland.pirofti2020-07-063-6/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | This diff exposes parts of clock_gettime(2) and gettimeofday(2) to userland via libc eliberating processes from the need for a context switch everytime they want to count the passage of time. If a timecounter clock can be exposed to userland than it needs to set its tc_user member to a non-zero value. Tested with one or multiple counters per architecture. The timing data is shared through a pointer found in the new ELF auxiliary vector AUX_openbsd_timekeep containing timehands information that is frequently updated by the kernel. Timing differences between the last kernel update and the current time are adjusted in userland by the tc_get_timecount() function inside the MD usertc.c file. This permits a much more responsive environment, quite visible in browsers, office programs and gaming (apparently one is are able to fly in Minecraft now). Tested by robert@, sthen@, naddy@, kmos@, phessler@, and many others! OK from at least kettenis@, cheloha@, naddy@, sthen@
* add a dumb pci_intr_establish_cpu().dlg2020-06-172-2/+16
| | | | | | | | | i386 doesnt support msix, and the interrupt code assumes that it only ties stuff to cpu0. this mostly exists so the api exists for multiq drivers to compile against, but fail with when they try to use it. tested with a hacked up vmx(4).
* dev/rndvar.h no longer has statistical interfaces (removed during variousderaadt2020-05-292-5/+2
| | | | | | conversion steps). it only contains kernel prototypes for 4 interfaces, all of which legitimately belong in sys/systm.h, which are already included by all enqueue_randomness() users.
* Declare pci_intr_map_msix() as static inline instead of using a define.mpi2020-03-201-2/+7
| | | | | | This makes compiler no longer complain about unused variables. ok kettenis@, patrick@
* consistently uppercase pci product definesjsg2020-01-051-2/+2
| | | | ok mpi@
* remove AMD64 strings from pcidevsjsg2020-01-041-3/+3
| | | | ok mortimer@ mpi@ deraadt@
* Retire piixpcib(4).mpi2019-12-061-371/+0
| | | | | | | When PAE came back in 2015 the use of kvm86, required for SpeedStep on such machine, got disabled. So there's no loss of functionality. ok stsp@
* Extents code has its own set of flags and does not use malloc's.bluhm2019-01-071-2/+2
| | | | | | The code in pci_init_extents() accidently passed M_NOWAIT which is EX_FAST and does no harm. Replace it with EX_NOWAIT. from Christian Ludwig; OK kettenis@
* Add support for multiple PCI segments. Only really implemented for arm64kettenis2018-08-192-9/+18
| | | | | | | for now as amd64/i386 firmware still caters for legacy OSes that only support a single PCI segment. ok patrick@
* Use the MI interrupt enable/distable API instead of the MD one on i386 andkettenis2018-07-301-6/+4
| | | | | | remove the MD API. ok deraadt@
* Properly pass around the PCI "chipset tag" in acpi(4) and refactorkettenis2018-07-042-5/+15
| | | | | | | acpimcfg(4) to call an MD initialization functions that sets up a tag for PCI ECAM. ok guenther@, mlarkin@, krw@
* replace add_*_randomness with enqueue_randomness()jasper2018-04-282-4/+4
| | | | | | | | | this gets rid of the source annotation which doesn't really add anything other than adding complexitiy. randomess is generally good enough that the few extra bits that the source type would add are not worth it. ok mikeb@ deraadt@
* Add sizes for free() in the Geode LX Security Block crypto accelerator.fcambus2017-12-271-6/+6
| | | | OK visa@
* If you use sys/param.h, you don't need sys/types.hderaadt2017-09-082-4/+2
|
* Switch glxsb(4), VIA padlock and AES-NI drivers over to the new AESmikeb2017-05-021-3/+3
|
* Reduce the per-packet allocation costs for crypto operations (cryptop)patrick2017-02-071-5/+5
| | | | | | | | | | | | | | by pre-allocating two cryptodesc objects and storing them in an array instead of a linked list. If more than two cryptodesc objects are required use mallocarray to fetch them. Adapt the drivers to the new API. This change results in one pool-get per ESP packet instead of three. It also simplifies softraid crypto where more cryptodesc objects are allocated than used. From, with and ok markus@, ok bluhm@ "looks sane" mpi@
* Initial support for MSI-X. Only supported on amd64 for now. I have diffs tokettenis2016-05-041-1/+2
| | | | | | | | | | actually use this in em(4) and xhci(4), but I'm not committing those yet because we almost certainly need to save and restore the MSI-X registers during suspend/resume. However, this allows mpi@ to play with multiple-vector support in networking hardware. Requested by mpi@ ok mlarkin@, mikeb@
* sizes for free(); ok semariederaadt2015-09-082-5/+7
|
* convert several malloc(9) to mallocarray(9).semarie2015-09-081-2/+2
| | | | ok deraadt@ guenther@ "re-wrap the long lines" kettenis@
* fairly simple sizes for free()deraadt2015-09-014-10/+10
|
* Avoid assigning low addresses to PCI BARs. Some machines don't claim thesekettenis2015-07-171-1/+6
| | | | | | | | memory addresses in their BIOS memory map making us believe they are available. However these addresses will never actually be routed to the PCI bus and therefore guaranteed not to work. ok krw@, mlarkin@
* Include executable mapping for BIOS32 pages. Fixes a problem where mappingsmlarkin2015-07-171-1/+3
| | | | | | | | | | | | | done in this region using PAE w/NX caused #PFs (as they lacked the exec permission previously). Also unmap the region when we're finished. No sense in leaving extra executable regions lying around. Fixes non-ACPI uniprocessor i386 machines that have NX/PAE (these would previously panic in pcibiosattach). ok deraadt@
* Bring PAE code back to life, in a different form. This diff (via bluhm thenmlarkin2015-04-121-1/+6
| | | | | | | | | | | | | | | | | | | | | | | to deraadt, then myself) brings the PAE pmap on i386 (not touched in any significant way for years) closer to the current non-PAE pmap and allows us to take a big next step toward better i386 W^X in the kernel (similar to what we did a few months ago on amd64). Unlike the original PAE pmap, this diff will not be supporting > 4GB physical memory on i386 - this effort is specifically geared toward providing W^X (via NX) only. There still seems to be a bug removing certain pmap entries when PAE is enabled, so I'm leaving PAE mode disabled for the moment until we can figure out what is going on, but with this diff in the tree hopefully others can help. The pmap functions now operate through function pointers, due to the need to support both non-PAE and PAE forms. My unscientific testing showed less than 0.3% (a third of a percent) slowdown with this approach during a base build. Discussed for months with guenther, kettenis, and deraadt. ok kettenis@, deraadt@
* Add bus_dmamem_alloc_range(9) to allow drivers to allocate DMA'able memorykettenis2015-01-241-1/+2
| | | | | | within a range that is more (or less) restrictive than the default range. ok deraadt@, stsp@
* Convert watchdog(4) devices to use autoconf(9) framework.mikeb2014-12-102-4/+34
| | | | ok deraadt, tests on glxpcib and ok mpi
* Replace some malloc(n*size,...) calls with mallocarray().doug2014-12-091-2/+3
| | | | ok tedu@ deraadt@
* Replace a plethora of historical protection options with justderaadt2014-11-162-6/+6
| | | | | | | PROT_NONE, PROT_READ, PROT_WRITE, and PROT_EXEC from mman.h. PROT_MASK is introduced as the one true way of extracting those bits. Remove UVM_ADV_* wrapper, using the standard names. ok doug guenther kettenis
* On i386, agp_map_subregion might sleep, which is not allowed in some ofkettenis2014-09-201-39/+48
| | | | | | | the inteldrm code. Fix this by adding new interfaces that can map a single page without sleeping and use that in the execbuffer fast path that needs this "atomic" behaviour. Should fix the panic I've seen under memory pressure on i386.
* remove uneeded proc.h includesjsg2014-09-144-8/+4
| | | | ok mpi@ kspillner@
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-127-21/+21
| | | | after discussions with beck deraadt kettenis.
* decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hderaadt2014-07-081-1/+3
| | | | | don't need to be married. ok guenther miod beck jsing kettenis
* Don't ridiculously assume that sysctl.h will (through a set of extremelyderaadt2014-06-291-1/+3
| | | | unfortunate circumstances) pull machine/cpufunc.h
* format string fixes for bus_addr_t and bus_size_tsf2014-05-041-5/+5
| | | | | | bus_addr_t and bus_size_t are u_long everywhere ok kettenis@
* Don't panic if we're trying to disestablish an MSI but the hardware is gone.kettenis2014-04-191-5/+3
| | | | tested by & ok mlarkin@
* No need for <uvm/uvm_page.h>mpi2014-04-081-3/+2
|
* More <uvm/uvm.h> -> <uvm/uvm_extern.h> cleaning.mpi2014-04-011-3/+4
| | | | ok kettenis@, deraadt@
* It's been a quarter century: we can assume volatile is present with that name.guenther2014-03-292-6/+6
| | | | ok dlg@ mpi@ deraadt@
* No need to include <sys/lock.h> when only <sys/rwlock.h> is needed,mpi2014-03-262-3/+4
| | | | | | so remove the former and include the latter instead of pulling it in <dev/pci/agpvar.h>. This header already requires various other types anyway. While here remove unneeded headers.
* Remove MD intagp(4) code that is unused now that inteldrm(4) manages the GTTkettenis2013-12-091-129/+1
| | | | all by itself.
* Remove the agp-specific bus_dma code. It is no longer used now thatkettenis2013-12-071-104/+1
| | | | | | inteldrm(4) manages the GTT by itself. ok miod@
* Add a DVACT_WAKEUP op to the *_activate() API. This is called after thederaadt2013-12-061-10/+4
| | | | | | | | kernel resumes normal (non-cold, able to run processes, etc) operation. Previously we were relying on specific DVACT_RESUME op's in drivers creating callback/threads themselves, but that has become too common, indicating the need for a built-in mechanism. ok dlg kettenis, tested by a sufficient amount of people
* Appease LLVM's integrated assembler.brad2013-11-281-3/+3
| | | | | | | | | error: ambiguous instructions require an explicit suffix (could be 'cmpb', 'cmpw', 'cmpl', or 'cmpq' error: unknown token in expression cmp -> cmpl, %cs:* -> *%cs: ok kettenis@
* 1 << 31 cleanup. Eitan Adler pointed out that there has been aderaadt2013-11-261-2/+2
| | | | | resurrection of the bad idiom in the tree. sufficient review by miod, kettenis, tedu
* Add support for Power Resources for Dx states and the necessary hookmpi2013-11-062-6/+13
| | | | | | | | | | | | | | | | for PCI devices. This hook should be called twice, before and after changing the power state of a PCI device. Before setting the device to the new state, the ACPI layer will notify every power resources linked to the device for that state and make sure they are turned "_ON". After changing the state of the device, it will decrement the reference of every power resources linked to that device for the old state and turn them "_OFF" if they are no longer referenced. This fixes the no-USB after resume problem seen on various ThinkPad, problem initialy diagnosed with Alexander Polakov. ok kettenis@, deraadt@
* unbreak glxsb(4) by properly allocating it's key schedule;mikeb2013-10-291-5/+15
| | | | reduce pctr.h usage while here. ok jsing, deraadt
* Format string fixes: Use %l* for paddr_tsf2013-10-021-2/+2
|