kernel: add standard clock system
This commit is contained in:
27
include/socks/clock.h
Normal file
27
include/socks/clock.h
Normal file
@@ -0,0 +1,27 @@
|
||||
#ifndef SOCKS_CLOCK_H_
|
||||
#define SOCKS_CLOCK_H_
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#define HZ (clock_hz())
|
||||
|
||||
typedef uint64_t clock_ticks_t;
|
||||
|
||||
extern volatile clock_ticks_t clock_ticks;
|
||||
|
||||
extern clock_ticks_t clock_hz(void);
|
||||
|
||||
extern void clock_calibrate(clock_ticks_t hz);
|
||||
extern void clock_advance(clock_ticks_t ticks);
|
||||
extern void clock_wait(clock_ticks_t ticks);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user