mirror of
https://github.com/drasko/codezero.git
synced 2026-01-12 10:53:16 +01:00
Added a new system call sys_timer.
sys_timer accumulates timer ticks into seconds, minutes, hours and days. It's left to the user to calculate from days into a date. It is not yet known if the calculation is even roughly correct. Reduced 2 kmem_reclaim/grant calls into one kmem_control call.
This commit is contained in:
@@ -48,8 +48,8 @@ struct kip {
|
||||
u8 api_version;
|
||||
u32 api_flags;
|
||||
|
||||
u32 kmem_reclaim;
|
||||
u32 kmem_grant;
|
||||
u32 kmem_control;
|
||||
u32 time;
|
||||
|
||||
u32 space_control;
|
||||
u32 thread_control;
|
||||
|
||||
@@ -21,9 +21,9 @@
|
||||
#define sys_map_offset 0x20
|
||||
#define sys_getid_offset 0x24
|
||||
#define sys_kread_offset 0x28
|
||||
#define sys_kmem_grant_offset 0x2C
|
||||
#define sys_kmem_reclaim_offset 0x30
|
||||
#define syscalls_end_offset sys_kmem_reclaim_offset
|
||||
#define sys_kmem_control_offset 0x2C
|
||||
#define sys_time_offset 0x30
|
||||
#define syscalls_end_offset sys_time_offset
|
||||
#define SYSCALLS_TOTAL ((syscalls_end_offset >> 2) + 1)
|
||||
|
||||
int sys_ipc(struct syscall_args *);
|
||||
@@ -37,7 +37,7 @@ int sys_ipc_control(struct syscall_args *);
|
||||
int sys_map(struct syscall_args *);
|
||||
int sys_getid(struct syscall_args *);
|
||||
int sys_kread(struct syscall_args *);
|
||||
int sys_kmem_grant(struct syscall_args *);
|
||||
int sys_kmem_reclaim(struct syscall_args *);
|
||||
int sys_kmem_control(struct syscall_args *);
|
||||
int sys_time(struct syscall_args *);
|
||||
|
||||
#endif /* __SYSCALL_H__ */
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
#include INC_GLUE(memory.h)
|
||||
|
||||
/* Ticks per second, try ticks = 1000 + timeslice = 1 for regressed preemption test. */
|
||||
#define HZ 10
|
||||
#define TASK_TIMESLICE_DEFAULT 500
|
||||
#define HZ 100
|
||||
#define TASK_TIMESLICE_DEFAULT 5000
|
||||
/* #define TASK_TIMESLICE_DEFAULT (HZ/100)*/
|
||||
|
||||
static inline struct ktcb *current_task(void)
|
||||
@@ -42,11 +42,11 @@ void sched_runqueue_init(void);
|
||||
void sched_start_task(struct ktcb *task);
|
||||
void sched_resume_task(struct ktcb *task);
|
||||
void sched_suspend_task(struct ktcb *task);
|
||||
void sched_process_post_ipc(struct ktcb *, struct ktcb *);
|
||||
void sched_tell(struct ktcb *task, unsigned int flags);
|
||||
void scheduler_start(void);
|
||||
void sched_yield(void);
|
||||
void schedule(void);
|
||||
|
||||
/* Asynchronous notifications to scheduler */
|
||||
void sched_notify_resume(struct ktcb *task);
|
||||
void sched_notify_sleep(struct ktcb *task);
|
||||
|
||||
Reference in New Issue
Block a user