aboutsummaryrefslogtreecommitdiff
path: root/src/core/timer.c
AgeCommit message (Collapse)AuthorFilesLines
2017-03-27[time] Add sleep_fixed() function to sleep without checking for Ctrl-CMichael Brown1-3/+36
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-02-01[time] Report attempts to use timers before initialisationMichael Brown1-3/+25
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2017-01-26[time] Allow timer to be selected at runtimeMichael Brown1-1/+61
Allow the active timer (providing udelay() and currticks()) to be selected at runtime based on probing during the INIT_EARLY stage of initialisation. TICKS_PER_SEC is now a fixed compile-time constant for all builds, and is independent of the underlying clock tick rate. We choose the value 1024 to allow multiplications and divisions on seconds to be converted to bit shifts. TICKS_PER_MS is defined as 1, allowing multiplications and divisions on milliseconds to be omitted entirely. The 2% inaccuracy in this definition is negligible when using the standard BIOS timer (running at around 18.2Hz). TIMER_RDTSC now checks for a constant TSC before claiming to be a usable timer. (This timer can be tested in KVM via the command-line option "-cpu host,+invtsc".) Signed-off-by: Michael Brown <mcb30@ipxe.org>
2016-03-22[libc] Make sleep() interruptibleMichael Brown1-3/+19
Signed-off-by: Michael Brown <mcb30@ipxe.org>
2015-03-02[legal] Relicense files under GPL2_OR_LATER_OR_UBDLMichael Brown1-1/+5
These files cannot be automatically relicensed by util/relicense.pl since they either contain unusual but trivial contributions (such as the addition of __nonnull function attributes), or contain lines dating back to the initial git revision (and so require manual knowledge of the code's origin). Signed-off-by: Michael Brown <mcb30@ipxe.org>
2012-07-20[legal] Update FSF mailing address in GPL licence textsMichael Brown1-1/+2
Suggested-by: Daniel P. Berrange <berrange@redhat.com> Signed-off-by: Michael Brown <mcb30@ipxe.org>
2009-05-18[legal] Add a selection of FILE_LICENCE declarationsMichael Brown1-0/+2
Add FILE_LICENCE declarations to almost all files that make up the various standard builds of gPXE.
2008-10-12[timer] Formalise the timer APIMichael Brown1-82/+9
We now have two implementations for the timer API: one using the time-of-day counter at 40:70 and one using RDTSC. Both make use of timer2_udelay().
2008-03-18[Timers] Initialise timers on first useMichael Brown1-27/+25
Timers are sometimes required before the call to initialise(), so we cannot rely on initialise() to set up the timers before use. Also fix a potential integer overflow issue in generic_currticks_udelay()
2008-03-18[Timers] Miscellaneous timer system fixesMichael Brown1-22/+37
Add missing comments to timer code. Lock system if no suitable timer source is found. Fix initialisation order so that timers are initialised before code that needs to use them.
2008-03-02CleanupsAlexey Zaytsev1-6/+2
Replace a printf with a DBG in timer_rtdsc.c Replace a printf in timer.c with assert Return proper error codes from timer drivers Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
2008-03-02Introduce the new timer subsystem.Alexey Zaytsev1-15/+92
Timer subsystem initialization code in core/timer.c Split the BIOS and RTDSC timer drivers from i386_timer.c Split arch/i386/firmware/pcbios/bios.c into the RTSDC timer driver and arch/i386/core/nap.c Split the headers properly: include/unistd.h - delay functions to be used by the gPXE core and drivers. include/gpxe/timer.h - the fimer subsystem interface to be used by the timer drivers and currticks() to be used by the code gPXE subsystems. include/latch.h - removed include/timer.h - scheduled for removal. Some driver are using currticks, which is only for core subsystems. Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
2007-07-14Dead code removal.Michael Brown1-1/+0
Kill off use of etherboot.h outside drivers/net.
2006-08-14Kill off poll_interruptions(); it is lethal when we're acting as a PXEMichael Brown1-2/+0
stack or INT 13 emulator etc.
2005-03-08Initial revisionMichael Brown1-0/+30