add vsyscall

- getcpu() is not implemented. It will cause SIGILL.
- gettimeofday() and time() are implemented with syscall.
This commit is contained in:
NAKAMURA Gou
2014-01-20 10:33:23 +09:00
parent 26d68d391d
commit f5b4057074
6 changed files with 116 additions and 0 deletions

View File

@@ -1698,6 +1698,21 @@ void init_low_area(struct page_table *pt)
set_pt_large_page(pt, 0, 0, PTATTR_WRITABLE);
}
static void init_vsyscall_area(struct page_table *pt)
{
extern char vsyscall_page[];
int error;
#define VSYSCALL_ADDR ((void *)(0xffffffffff600000))
error = __set_pt_page(pt, VSYSCALL_ADDR,
virt_to_phys(vsyscall_page), PTATTR_ACTIVE|PTATTR_USER);
if (error) {
panic("init_vsyscall_area:__set_pt_page failed");
}
return;
}
void init_page_table(void)
{
#ifdef USE_LARGE_PAGES
@@ -1712,6 +1727,7 @@ void init_page_table(void)
init_fixed_area(init_pt);
init_low_area(init_pt);
init_text_area(init_pt);
init_vsyscall_area(init_pt);
load_page_table(init_pt);
kprintf("Page table is now at %p\n", init_pt);