Commit Graph

15 Commits (master)

Author SHA1 Message Date
cinap_lenrek 1d93a5628a pc, pc64, xen: rewrite interrupt handling code
This implements proper intrdisable() support for all
interrupt controllers.

For enable, (*arch->intrassign)(Vctl*) fills in the
Vctl.enable and Vctl.disable pointers with the
appropriate routines and returns the assigned
vector number.

Once the Vctl struct has been linked to its vector
chain, Vctl.enable(Vctl*, shared) gets called with a
flag if the vector has been already enabled (shared).

This order is important here as enabling the interrupt
on the controller before we have linked the chain can
cause spurious interrupts, expecially on mp system
where the interrupt can target a different cpu than
the caller of intrenable().

The intrdisable() case is the other way around.
We first disable the interrupt on the controller
and after that unlink the Vctl from the chain.
On a multiprocessor, the xfree() of the Vctl struct
is delayed to avoid freeing it while it is still
in use by another cpu.

The xen port now also uses pc/irq.c which has been
made generic enougth to handle xen's irq scheme.
Also, archgeneric is now a separate file to avoid
pulling in dependencies from the 8259 interrupt
controller code.
2020-11-29 17:43:22 +01:00
cinap_lenrek 0f56fefd45 pc, pc64: implement disabling of msi interrupts 2020-11-21 21:48:25 +01:00
cinap_lenrek 4f85115526 kernel: massive pci code rewrite
The new pci code is moved to port/pci.[hc] and shared by
all ports.

Each port has its own PCI controller implementation,
providing the pcicfgrw*() functions for low level pci
config space access. The locking for pcicfgrw*() is now
done by the caller (only port/pci.c).

Device drivers now need to include "../port/pci.h" in
addition to "io.h".

The new code now checks bridge windows and membars,
while enumerating the bus, giving the pc driver a chance
to re-assign them. This is needed because some UEFI
implementations fail to assign the bars for some devices,
so we need to do it outselfs. (See pcireservemem()).

While working on this, it was discovered that the pci
code assimed the smallest I/O bar size is 16 (pcibarsize()),
which is wrong. I/O bars can be as small as 4 bytes.
Bit 1 in an I/O bar is also reserved and should be masked off,
making the port mask: port = bar & ~3;
2020-09-13 20:33:17 +02:00
cinap_lenrek 3bcc34f276 pc, pc64: implement 64-bit pci membar support 2020-06-06 14:58:20 +02:00
aiju 3a77c01f43 pc kernel: get rid of ugly and partially broken cpuid macros 2018-07-11 14:50:22 +01:00
aiju 773be02aa1 kernel: add support for hardware watchpoints 2017-06-12 19:03:07 +00:00
cinap_lenrek b137420eff pc/io.h: fix comment for PciSID 2015-05-30 16:45:02 +02:00
cinap_lenrek a9155014c0 pc, pc64: handle sse simd exceptions 2014-05-11 05:59:10 +02:00
ppatience0 7c28d33d4b io.h: change indentation from spaces to tabs 2013-10-03 17:15:11 -04:00
cinap_lenrek a47521a3ed experimental acpi support for apic irq routing 2012-06-17 23:12:19 +02:00
cinap_lenrek 1d58cb8832 pci: add pcicap 2012-02-11 00:49:39 +01:00
cinap_lenrek c6c2e04d4a segdesc: add /dev/^(ldt gdt) support 2011-07-12 15:46:22 +02:00
aiju fe668572ff added basic MSI and PCI capabilities support 2011-05-16 00:35:16 +00:00
Taru Karttunen a9060cc06b Import sources from 2011-03-30 iso image - lib 2011-03-30 19:35:09 +03:00
Taru Karttunen e5888a1ffd Import sources from 2011-03-30 iso image 2011-03-30 15:46:40 +03:00