mirror of
https://github.com/ipxe/ipxe
synced 2025-12-17 01:52:08 +03:00
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>
33 lines
648 B
C
33 lines
648 B
C
#ifndef GPXE_TIMER_H
|
|
#define GPXE_TIMER_H
|
|
|
|
#include <stddef.h>
|
|
|
|
typedef uint32_t tick_t;
|
|
|
|
#define MSECS_IN_SEC (1000)
|
|
#define USECS_IN_SEC (1000*1000)
|
|
#define USECS_IN_MSEC (1000)
|
|
|
|
#define TICKS_PER_SEC USECS_IN_SEC
|
|
|
|
tick_t currticks(void);
|
|
|
|
void generic_currticks_udelay(unsigned int usecs);
|
|
|
|
struct timer {
|
|
/* Returns zero on successful initialisation. */
|
|
int (*init) (void);
|
|
|
|
/* Return the current time, int mictoseconds since the beginning. */
|
|
tick_t (*currticks) (void);
|
|
|
|
/* Sleep for a few useconds. */
|
|
void (*udelay) (unsigned int useconds);
|
|
};
|
|
|
|
#define __timer(order) __table (struct timer, timers, order)
|
|
|
|
#endif /* GPXE_TIMER_H */
|
|
|