x86: move ioapic code where it belongs