Fix: mman behavior
This commit is contained in:
@@ -47,15 +47,17 @@ timer_t *_pop(timer_t *t)
|
||||
}
|
||||
|
||||
static inline
|
||||
void _set_timer_interrrupt()
|
||||
void _set_timer_interrupt()
|
||||
{
|
||||
if (global_timer) {
|
||||
uint64_t cntpct_el0;
|
||||
R_SYSREG(cntpct_el0, cntpct_el0);
|
||||
DEBUG_EXCEP(cntpct_el0);
|
||||
|
||||
uint64_t firing_tick = MAX(global_timer->data.firing_tick, cntpct_el0);
|
||||
W_SYSREG(cntp_cval_el0, firing_tick);
|
||||
if (global_timer->data.firing_tick < cntpct_el0)
|
||||
W_SYSREG(cntp_tval_el0, 1);
|
||||
else
|
||||
W_SYSREG(cntp_cval_el0, global_timer->data.firing_tick);
|
||||
|
||||
_enable_timer_irq(true);
|
||||
}
|
||||
@@ -71,9 +73,9 @@ void _traverse(timer_t *t)
|
||||
_traverse(t->_r);
|
||||
}
|
||||
|
||||
void add_task(task_t task)
|
||||
void add_timer_task(task_t task)
|
||||
{
|
||||
DEBUG_EXCEP("add task");
|
||||
DEBUG_EXCEP("add timer task");
|
||||
timer_t *newtimer = kmalloc(sizeof(timer_t));
|
||||
*newtimer = (timer_t){
|
||||
._l = (timer_t *)0x0,
|
||||
@@ -86,7 +88,7 @@ void add_task(task_t task)
|
||||
global_timer = _merge(global_timer, newtimer);
|
||||
|
||||
_traverse(global_timer);
|
||||
_set_timer_interrrupt();
|
||||
_set_timer_interrupt();
|
||||
}
|
||||
|
||||
void timer_irq_handler(void)
|
||||
@@ -104,5 +106,5 @@ void timer_irq_handler(void)
|
||||
global_timer = _pop(global_timer);
|
||||
}
|
||||
|
||||
_set_timer_interrrupt();
|
||||
_set_timer_interrupt();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user