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
Decoupling Architectural-specific Code (#35)
[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 5ab38644c24cf4b615dcc8760c31750f11f0a7a9..08718adc474a1d8147476b739bb35be9b92d8fc4 100644
(file)
--- a/
lunaix-os/includes/lunaix/timer.h
+++ b/
lunaix-os/includes/lunaix/timer.h
@@
-2,19
+2,18
@@
#define __LUNAIX_TIMER_H
#include <lunaix/ds/llist.h>
#define __LUNAIX_TIMER_H
#include <lunaix/ds/llist.h>
-#include <stdint.h>
+#include <lunaix/time.h>
+#include <lunaix/hart_state.h>
-#define SYS_TIMER_FREQUENCY_HZ 10
24
+#define SYS_TIMER_FREQUENCY_HZ 10
00
#define TIMER_MODE_PERIODIC 0x1
#define TIMER_MODE_PERIODIC 0x1
-typedef u32_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
timer hardware
base frequency (ticks per seconds)
*
*/
ticks_t base_frequency;
*
*/
ticks_t base_frequency;
@@
-22,7
+21,7
@@
struct lx_timer_context
* @brief Desired system running frequency
*
*/
* @brief Desired system running frequency
*
*/
-
u32
_t running_frequency;
+
ticks
_t running_frequency;
/**
* @brief Ticks per hertz
*
/**
* @brief Ticks per hertz
*
@@
-30,6
+29,12
@@
struct lx_timer_context
ticks_t tphz;
};
ticks_t tphz;
};
+struct timer_init_param
+{
+ struct lx_timer_context* context;
+ void* timer_update_isr;
+};
+
struct lx_timer
{
struct llist_header link;
struct lx_timer
{
struct llist_header link;
@@
-46,7
+51,7
@@
struct lx_timer
* @param frequency The frequency that timer should run in Hz.
*/
void
* @param frequency The frequency that timer should run in Hz.
*/
void
-timer_init(
u32_t frequency
);
+timer_init();
struct lx_timer*
timer_run_second(u32_t second,
struct lx_timer*
timer_run_second(u32_t second,