summaryrefslogtreecommitdiff
path: root/payloads/libpayload/include
diff options
context:
space:
mode:
authorRaul E Rangel <rrangel@chromium.org>2018-08-20 12:31:11 -0600
committerMartin Roth <martinroth@google.com>2018-09-12 14:15:11 +0000
commit24ae85c3ffb48c72f67a514dcb843c1de54e5416 (patch)
tree7990b569495136ce505de044f6c27e265ff80233 /payloads/libpayload/include
parentac8ebd0e73774c83bfa5cb3dd460c662000e0d19 (diff)
downloadcoreboot-24ae85c3ffb48c72f67a514dcb843c1de54e5416.tar.xz
libpayload/x86/apic: Add an apic_delay method and calibrate the timer
The apic_delay method will halt the CPU and wait for a timer interrupt to fire. I went with usec because nsec is too granular to guarantee. This method will be called from an arch_ndelay() method when the delay is large enough to justify a sleep. BUG=b:109749762 TEST=Tested it on grunt by changing the _delay method to call apic_delay(). Change-Id: I80363f06bdb22d0907f895885e607fde1c4c468d Signed-off-by: Raul E Rangel <rrangel@chromium.org> Reviewed-on: https://review.coreboot.org/28242 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin Roth <martinroth@google.com>
Diffstat (limited to 'payloads/libpayload/include')
-rw-r--r--payloads/libpayload/include/x86/arch/apic.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/payloads/libpayload/include/x86/arch/apic.h b/payloads/libpayload/include/x86/arch/apic.h
index fdd447361a..ef962f44d8 100644
--- a/payloads/libpayload/include/x86/arch/apic.h
+++ b/payloads/libpayload/include/x86/arch/apic.h
@@ -40,4 +40,6 @@ uint8_t apic_id(void);
/** Signal the end of the interrupt handler. */
void apic_eoi(void);
+void apic_delay(unsigned int usec);
+
#endif /* __ARCH_X86_INCLUDES_ARCH_APIC_H__ */