initial support for a commpage, which is a chunk of memory in high kernel space with user readonly permissions.

The first use is to let the kernel decide what the preferred syscall mechanism is at boot time and copy the
appropriate user space code there. Can be used for routines the kernel can decide best how to use (memcpy, some
timing routines, etc).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20161 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Travis Geiselbrecht
2007-02-19 00:32:44 +00:00
parent badc7b674e
commit 1cbf8f4b3c
7 changed files with 143 additions and 2 deletions
+9 -2
View File
@@ -1,3 +1,7 @@
/*
* Copyright 2007, Travis Geiselbrecht. All rights reserved.
* Distributed under the terms of the MIT License.
*/
/*
** Copyright 2001, Travis Geiselbrecht. All rights reserved.
** Distributed under the terms of the NewOS License.
@@ -7,16 +11,18 @@
* syscall interface works as such:
* eax has syscall #
* esp + 4 points to the syscall parameters
* branch to the syscall vector in the commpage
*/
#include <os/kernel/arch/x86/commpage.h>
#define _SYSCALL(name, n) \
.globl name; \
.type name,@function; \
.align 8; \
name: \
movl $n,%eax; \
int $99; \
ret
jmp *(USER_COMMPAGE_ADDR + COMMPAGE_ENTRY_SYSCALL * 4)
#define SYSCALL0(name, n) _SYSCALL(name, n)
#define SYSCALL1(name, n) _SYSCALL(name, n)
@@ -35,3 +41,4 @@ name: \
#define SYSCALL14(name, n) _SYSCALL(name, n)
#define SYSCALL15(name, n) _SYSCALL(name, n)
#define SYSCALL16(name, n) _SYSCALL(name, n)