apic.clearErrors();
localAPIC.clearErrors();
    final void startup(ResourceManager rm) throws ResourceNotFreeException {        // Save resource manager, so when this processor starts, it can be        // used right away.        this.rm = rm;        final VmProcessor me = current();        Unsafe.debug("Startup of 0x" + NumberUtils.hex(getId(), 2) + " from "                + NumberUtils.hex(me.getId(), 2) + "\n");        // Setup kernel structures        setupStructures();        // Setup the boot code        final Address bootCode = setupBootCode(rm, gdt);                // Make sure APIC is enabled (the apic of the current CPU!)        Unsafe.debug("Enabling APIC: current state " + apic.isEnabled() + "\n");        apic.setEnabled(true);        apic.clearErrors();        // TimeUtils.loop(5000);        // Send INIT IPI        Unsafe.debug("Sending INIT IPI\n");        apic.sendInitIPI(getId(), true);        apic.loopUntilNotBusy();        TimeUtils.loop(10);        // Send INIT-DeAssert IPI        Unsafe.debug("Sending INIT-DeAssert IPI\n");        apic.sendInitIPI(getId(), false);        apic.loopUntilNotBusy();        TimeUtils.loop(10);        final int numStarts = 2;        for (int i = 0; i < numStarts; i++) {            // Send STARTUP IPI            Unsafe.debug("Sending STARTUP IPI to " + getId() + "\n");            apic.clearErrors();            apic.sendStartupIPI(getId(), bootCode);            apic.loopUntilNotBusy();            // Unsafe.debug("Not busy");            TimeUtils.loop(100);            apic.clearErrors();        }        Unsafe.debug("X86 CPU Start finished\n");        // BootLog.info("loop 5000");        // TimeUtils.loop(5000);    }