diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-11-29 17:43:22 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2020-11-29 17:43:22 +0100 |
commit | 1d93a5628adc0f08463fe4272dc88fb0f61e631d (patch) | |
tree | b96cb74f50ab891af2fc72ebaf0d8ac6309ae385 /sys/src/9/xen/archxen.c | |
parent | 32a5ff9658cfa2d0d15cecf3b2a27be6b0742227 (diff) |
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.
Diffstat (limited to 'sys/src/9/xen/archxen.c')
-rw-r--r-- | sys/src/9/xen/archxen.c | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/sys/src/9/xen/archxen.c b/sys/src/9/xen/archxen.c index 50bf70f19..c4f1b5607 100644 --- a/sys/src/9/xen/archxen.c +++ b/sys/src/9/xen/archxen.c @@ -52,9 +52,7 @@ shutdown(void) HYPERVISOR_shutdown(1); } -int xenintrenable(Vctl *v); -int xenintrvecno(int irq); -int xenintrdisable(int irq); +int xenintrassign(Vctl *v); void xentimerenable(void); uvlong xentimerread(uvlong*); void xentimerset(uvlong); @@ -64,16 +62,14 @@ PCArch archxen = { .ident= identify, .reset= shutdown, .intrinit= intrinit, -.intrenable= xenintrenable, -.intrvecno= xenintrvecno, -.intrdisable= xenintrdisable, +.intrassign= xenintrassign, .clockenable= xentimerenable, .fastclock= xentimerread, .timerset= xentimerset, }; /* - * Placeholders to satisfy external references in generic devarch.c + * Placeholders to satisfy external references in devarch.c */ ulong getcr4(void) { return 0; } void putcr4(ulong) {} @@ -83,19 +79,7 @@ ulong inl(int) { return 0; } void outb(int, int) {} void outs(int, ushort) {} void outl(int, ulong) {} -void i8042reset(void) {} -void i8253enable(void) {} -void i8253init(void) {} -void i8253link(void) {} -uvlong i8253read(uvlong*) { return 0; } -void i8253timerset(uvlong) {} -int i8259disable(int) { return 0; } -int i8259enable(Vctl*) { return 0; } -void i8259init(void) {} -int i8259isr(int) { return 0; } -void i8259on(void) {} -void i8259off(void) {} -int i8259vecno(int) { return 0; } + int mtrrprint(char*, long) { return 0; } char* mtrr(uvlong, uvlong, char *) { return nil; } void mtrrsync(void) {} |