OsStatus_t ApicWaitForIdle(void) { int Error = 0; WaitForConditionWithFault(Error, (ApicReadLocal(APIC_ICR_LOW) & APIC_DELIVERY_BUSY) == 0, 200, 1); return (Error == 0) ? OsSuccess : OsError; }
/* Get the max LVT */ int ApicGetMaxLvt(void) { /* Read LVR */ uint32_t Version = ApicReadLocal(APIC_VERSION); /* Calculate */ return APIC_INTEGRATED((Version & 0xFF)) ? (((Version) >> 16) & 0xFF) : 2; }
/* Get the version of the local apic */ uint32_t ApicGetVersion(void) { return (ApicReadLocal(APIC_VERSION) & 0xFF); }