27#define SLEEPER_KEY_TYPE_SHIFT 24
29#define SLEEPER_KEY(_type, _thread) (((_type) << SLEEPER_KEY_TYPE_SHIFT) | (_thread))
51#define TIMER_INVALID_ID 0xFF
131void os_run_timer(uint32_t start_microtime, uint32_t interval);
uint8_t Thread_t
Data type used for thread IDs.
Definition defines.h:72
#define SLEEPERS_MAX
How many sleeping threads can exist.
Definition kernel.h:41
int os_find_timer(Thread_t owner, enum eSleepType type)
Find a timer slot matching owner thread and timer type.
Definition timer.c:169
void os_run_timer(uint32_t start_microtime, uint32_t interval)
Fire scheduled events.
Definition timer.c:297
#define TIMER_INVALID_ID
Definition timer.h:51
void os_timer_init(void)
This routine initializes kernel scheduling subsystem.
Definition timer.c:252
int os_usleep(unsigned microseconds)
Kernel implementation of usleep() syscall.
Definition timer.c:230
uint32_t os_cpu_freq_get(void)
Get current CPU frequency.
Definition timer.c:372
int os_set_timed_event(unsigned microseconds, enum eSleepType type)
Find a slot for timed event and store it.
Definition timer.c:147
int os_cancel_sleeper(unsigned queue_id)
Cancel existing sleeper.
Definition timer.c:199
int os_cancel_timed_event(Thread_t owner, enum eSleepType type)
Cancels existing timed event.
Definition timer.c:175
bool os_schedule_timer(unsigned *delay)
Provide information on next scheduled event.
Definition timer.c:263
int os_setitimer(unsigned microseconds)
Kernel implementation of setitimer() syscall.
Definition timer.c:240
eSleepType
Definition timer.h:20
@ TIMER_PERIODIC
Definition timer.h:23
@ TIMER_SLEEP
Definition timer.h:21
@ TIMER_INTERVAL
Definition timer.h:24
@ TIMER_TIMEOUT
Definition timer.h:22
Description of one sleep request.
Definition timer.h:35
uint32_t interval
amount of time sleep shall take
Definition timer.h:38
uint32_t key
key created from timer_type and thread_id using SLEEPER_KEY
Definition timer.h:36
uint32_t sleep_from
time at which sleep has been requested
Definition timer.h:37
uint8_t timer_type
type of sleep performed
Definition timer.h:40
uint8_t thread_id
thread ID which requested the sleep
Definition timer.h:39
Entry for sorting sleep requests.
Definition timer.h:46
uint8_t entry_id
Definition timer.h:48
uint32_t resume_time
Definition timer.h:47