blob: 8c33fdfa3c353337986822f7b0b932f107b50701 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#include <errno.h>
#include <kernel/con.h>
#include <kernel/sched.h>
#include <stdint.h>
#include <time.h>
#include <unistd.h>
extern uint32_t ticks;
int sys_puts(char *s) {
return printk(s);
}
time_t sys_time(void) {
return ticks / 100;
}
pid_t sys_getpid(void) {
return ctask->pid;
}
void *sys_getpdir(void) {
uint32_t pdir;
__asm__ ("mov %%cr3, %%eax" : "=a" (pdir));
return (void*) pdir;
}
int sys_dummy(void) {
return -ENOSYS;
}
|