Add time() syscall
This commit is contained in:
@ -11,6 +11,7 @@
|
||||
#include "proc.h"
|
||||
#include "fs.h"
|
||||
#include "dev.h"
|
||||
#include "time.h"
|
||||
|
||||
int32_t SYSCALL1(sys_debugprint, string) {
|
||||
char *p = (char *)string;
|
||||
@ -52,4 +53,5 @@ SyscallFn SYSCALL_TABLE[SYSCALLS_MAX] = {
|
||||
[SYS_DEV_LISTSIZE] = &sys_dev_listsize,
|
||||
[SYS_DEV_STAT] = &sys_dev_stat,
|
||||
[SYS_DEV_CMD] = &sys_dev_cmd,
|
||||
[SYS_TIME] = &sys_time,
|
||||
};
|
||||
|
||||
13
kernel/syscall/time.c
Normal file
13
kernel/syscall/time.c
Normal file
@ -0,0 +1,13 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include "syscall.h"
|
||||
#include "time.h"
|
||||
#include "sysdefs/time.h"
|
||||
#include "time/time.h"
|
||||
#include "errors.h"
|
||||
|
||||
int32_t SYSCALL1(sys_time, timestruct1) {
|
||||
Time *time = (Time *)timestruct1;
|
||||
time_get(time);
|
||||
return E_OK;
|
||||
}
|
||||
9
kernel/syscall/time.h
Normal file
9
kernel/syscall/time.h
Normal file
@ -0,0 +1,9 @@
|
||||
#ifndef SYSCALL_TIME_H_
|
||||
#define SYSCALL_TIME_H_
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
int32_t SYSCALL1(sys_time, timestruct1);
|
||||
|
||||
#endif // SYSCALL_TIME_H_
|
||||
Reference in New Issue
Block a user