Logo Search packages:      
Sourcecode: virtualbox-ose version File versions

kHlpSys-darwin.c File Reference


Detailed Description

kHlpBare -

Definition in file kHlpSys-darwin.c.

#include <k/kHlpSys.h>
#include <unistd.h>
#include <errno.h>
#include <dlfcn.h>
#include <sys/mman.h>
#include <mach/mach_time.h>

Go to the source code of this file.

Defines

#define DARWIN_SYSCALL(name, code)   asm("\ .text \n\ .globl _" #name " \n\ _" #name ": \n\ mov $ " #code ", %eax \n\ call 1f \n\ 1: \n\ pop %edx \n\ mov %esp, %ecx \n\ sysenter \n\ jnae 2f \n\ ret \n\ 2: \n\ neg %eax \n\ ret \n\ ")
#define DARWIN_SYSCALL_NOERR(name, code)   asm("\ .text \n\ .globl _" #name " \n\ _" #name ": \n\ mov $ " #code ", %eax \n\ call 1f \n\ 1: \n\ pop %edx \n\ mov %esp, %ecx \n\ sysenter \n\ ret \n\ ")
#define DARWIN_SYSCALL_RET64(name, code)   asm("\ .text \n\ .globl _" #name " \n\ _" #name ": \n\ mov $ " #code ", %eax \n\ int $0x80 \n\ jnae 2f \n\ ret \n\ 2: \n\ neg %eax \n\ mov $0xffffffff, %edx \n\ ret \n\ ")
#define USE_DARWIN_SYSCALLS

Functions

 asm ("\n\ .text \n\ .globl _mach_absolute_time \n\ _mach_absolute_time: \n\ mov $0xffff1700, %edx \n\ jmp *%edx\n")
 DARWIN_SYSCALL (mach_timebase_info, 0xffffffa7)
 DARWIN_SYSCALL (mach_wait_until, 0xffffffa6)
 DARWIN_SYSCALL (semaphore_signal, 0xffffffdf)
 DARWIN_SYSCALL (semaphore_wait, 0xffffffdc)
 DARWIN_SYSCALL (kHlpSys_exit, 0x00040001)
 DARWIN_SYSCALL (kHlpSys_munmap, 0x00080049)
 DARWIN_SYSCALL (kHlpSys_mprotect, 0x000c004a)
 DARWIN_SYSCALL (kHlpSys_mmap, 0x020000c5)
 DARWIN_SYSCALL (kHlpSys_write, 0x000c0004)
 DARWIN_SYSCALL (kHlpSys_read, 0x000c0003)
 DARWIN_SYSCALL (kHlpSys_close, 0x000c0006)
 DARWIN_SYSCALL (kHlpSys_open, 0x000c0005)
 DARWIN_SYSCALL (kHlpSys_readlink, 0x000c003a)
 DARWIN_SYSCALL_NOERR (mach_task_self, 0xffffffe4)
 DARWIN_SYSCALL_RET64 (kHlpSys_lseek, 0x000000c7)
int dlclose (void *pvMod)
void * dlopen (const char *pszModule, int fFlags)
void * dlsym (void *pvMod, const char *pszSymbol)
kern_return_t semaphore_create (task_t t, semaphore_t *ps, int p, int v)
kern_return_t semaphore_destroy (task_t t, semaphore_t s)


Generated by  Doxygen 1.6.0   Back to index