2 \ ioapic and local apic tester
4 \ Copyright (C) 2003 Stefan Reinauer
6 \ See the file "COPYING" for further information about
7 \ the copyright and warranty status of this work.
12 fee00000 constant lapic_base
13 fec00000 constant ioapic_base
15 : read_lapic ( regoffset -- value )
19 : write_lapic ( value regoffset -- )
23 : read_ioapic ( regoffset -- low_value high_value )
25 ioapic_base l! ioapic_base 4 cells + l@
27 ioapic_base l! ioapic_base 4 cells + l@
30 : write_ioapic ( low high regoffset -- )
31 2* 10 + dup ( low high offs offs )
32 ioapic_base l! rot ioapic_base 4 cells + l! ( high offs )
34 ioapic_base l! ioapic_base 4 cells + l! ( high offs )
38 s" Dumping local apic:" type cr
40 i dup ( lapic_base + ) s" 0x" type . s" = 0x" type read_lapic space .
41 i 30 and 0= if cr then
47 s" Dumping io apic:" type cr
49 i dup s" irq=" type . read_ioapic s" = 0x" type . s" ." type .
62 \ tag: apic test utility