git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
feat: The waitpid family!
[lunaix-os.git]
/
lunaix-os
/
includes
/
lunaix
/
timer.h
diff --git
a/lunaix-os/includes/lunaix/timer.h
b/lunaix-os/includes/lunaix/timer.h
index 567b8d24d70e72462ad1ee941c20c1c26e2ed25e..c02d7f6bb49a55b003a8c38a3fdc7d4ed7dd3faf 100644
(file)
--- a/
lunaix-os/includes/lunaix/timer.h
+++ b/
lunaix-os/includes/lunaix/timer.h
@@
-4,32
+4,34
@@
#include <lunaix/ds/llist.h>
#include <stdint.h>
#include <lunaix/ds/llist.h>
#include <stdint.h>
-#define SYS_TIMER_FREQUENCY_HZ
2048
+#define SYS_TIMER_FREQUENCY_HZ 2048
-#define TIMER_MODE_PERIODIC
0x1
+#define TIMER_MODE_PERIODIC 0x1
typedef uint32_t ticks_t;
typedef uint32_t ticks_t;
-struct lx_timer_context {
- struct lx_timer *active_timers;
+struct lx_timer_context
+{
+ struct lx_timer* active_timers;
/**
* @brief APIC timer base frequency (ticks per seconds)
/**
* @brief APIC timer base frequency (ticks per seconds)
- *
+ *
*/
ticks_t base_frequency;
/**
* @brief Desired system running frequency
*/
ticks_t base_frequency;
/**
* @brief Desired system running frequency
- *
+ *
*/
uint32_t running_frequency;
/**
* @brief Ticks per hertz
*/
uint32_t running_frequency;
/**
* @brief Ticks per hertz
- *
+ *
*/
ticks_t tphz;
};
*/
ticks_t tphz;
};
-struct lx_timer {
+struct lx_timer
+{
struct llist_header link;
ticks_t deadline;
ticks_t counter;
struct llist_header link;
ticks_t deadline;
ticks_t counter;
@@
-38,25
+40,30
@@
struct lx_timer {
uint8_t flags;
};
uint8_t flags;
};
-
/**
* @brief Initialize the system timer that runs at specified frequency
/**
* @brief Initialize the system timer that runs at specified frequency
- *
+ *
* @param frequency The frequency that timer should run in Hz.
*/
void
timer_init(uint32_t frequency);
struct lx_timer*
* @param frequency The frequency that timer should run in Hz.
*/
void
timer_init(uint32_t frequency);
struct lx_timer*
-timer_run_second(uint32_t second, void (*callback)(void*), void* payload, uint8_t flags);
+timer_run_second(uint32_t second,
+ void (*callback)(void*),
+ void* payload,
+ uint8_t flags);
struct lx_timer*
struct lx_timer*
-timer_run_ms(uint32_t millisecond, void (*callback)(void*), void* payload, uint8_t flags);
+timer_run_ms(uint32_t millisecond,
+ void (*callback)(void*),
+ void* payload,
+ uint8_t flags);
struct lx_timer*
timer_run(ticks_t ticks, void (*callback)(void*), void* payload, uint8_t flags);
struct lx_timer*
timer_run(ticks_t ticks, void (*callback)(void*), void* payload, uint8_t flags);
-struct lx_timer_context*
+struct lx_timer_context*
timer_context();
#endif /* __LUNAIX_TIMER_H */
timer_context();
#endif /* __LUNAIX_TIMER_H */