mirror of
https://github.com/drasko/codezero.git
synced 2026-03-22 12:01:51 +01:00
Updated the timer service to introduce irq handling.
This commit is contained in:
@@ -1,36 +1,23 @@
|
||||
/*
|
||||
* Timer details.
|
||||
*/
|
||||
#ifndef __TIMER_H__
|
||||
#define __TIMER_H__
|
||||
|
||||
/*
|
||||
* Timer specific things are here
|
||||
*/
|
||||
#include <l4lib/mutex.h>
|
||||
#include <l4/lib/list.h>
|
||||
#include <l4lib/types.h>
|
||||
|
||||
/*
|
||||
* Structure representing the sleeping tasks,
|
||||
* tgid: tgid of sleeping task
|
||||
* wait_count: time left, in microseconds, after which task
|
||||
* will be signalled to get out of sleep
|
||||
*/
|
||||
struct timer_task {
|
||||
struct link list;
|
||||
l4id_t tgid;
|
||||
unsigned int wait_count;
|
||||
};
|
||||
|
||||
/*
|
||||
* Timer structure,
|
||||
* base: base address of sp804 timer encapsulated
|
||||
* count: Count in microseconds from the start of this timer
|
||||
* tasklist: list of tasks sleeping for some value of count
|
||||
* lock: lock protecting the corruption of tasklist
|
||||
*/
|
||||
struct sp804_timer {
|
||||
unsigned int base;
|
||||
unsigned int count;
|
||||
struct link tasklist;
|
||||
struct l4_mutex lock;
|
||||
* Timer structure
|
||||
*/
|
||||
struct timer {
|
||||
int slot; /* Notify slot on utcb */
|
||||
unsigned int base; /* Virtual base address */
|
||||
u64 count; /* Counter */
|
||||
struct link task_list; /* List of sleepers */
|
||||
struct l4_mutex lock; /* Lock for structure */
|
||||
struct capability cap; /* Capability describing timer */
|
||||
};
|
||||
|
||||
#endif /* __TIMER_H__ */
|
||||
|
||||
Reference in New Issue
Block a user