From d6819ff659c94e8d279889a47920db08ff3bc950 Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Mon, 21 Sep 2009 14:46:10 +0000 Subject: [PATCH] various syscall entry points --- lib/i386/misc/_cpuid.s | 3 +-- lib/posix/_getpid.c | 2 +- lib/syscall/Makefile.in | 8 ++++++++ lib/syscall/getngid.s | 7 +++++++ lib/syscall/getnuid.s | 7 +++++++ lib/syscall/mmap.s | 10 ++++++++++ lib/syscall/sleep.s | 6 ++++++ lib/syscall/vm_getphys.s | 7 +++++++ lib/syscall/vm_getrefcount.s | 7 +++++++ lib/syscall/vm_query_exit.s | 7 +++++++ lib/syscall/vm_remap.s | 7 +++++++ lib/syscall/vm_set_priv.s | 7 +++++++ lib/syscall/vm_unmap.s | 7 +++++++ 13 files changed, 82 insertions(+), 3 deletions(-) create mode 100644 lib/syscall/getngid.s create mode 100644 lib/syscall/getnuid.s create mode 100755 lib/syscall/vm_getphys.s create mode 100755 lib/syscall/vm_getrefcount.s create mode 100644 lib/syscall/vm_query_exit.s create mode 100755 lib/syscall/vm_remap.s create mode 100644 lib/syscall/vm_set_priv.s create mode 100755 lib/syscall/vm_unmap.s diff --git a/lib/i386/misc/_cpuid.s b/lib/i386/misc/_cpuid.s index 6ca569a30..7be01bf53 100755 --- a/lib/i386/misc/_cpuid.s +++ b/lib/i386/misc/_cpuid.s @@ -3,8 +3,7 @@ .sect .text; .sect .rom; .sect .data; .sect .bss .sect .text -! int _cpuid(u32_t eax, u32_t *eax, u32_t *ebx, u32_t *ecx, u32_t *edx); -! 0 for OK, nonzero for unsupported +! void _cpuid(u32_t eax, u32_t *eax, u32_t *ebx, u32_t *ecx, u32_t *edx); .define __cpuid diff --git a/lib/posix/_getpid.c b/lib/posix/_getpid.c index 25e843a69..7f6e0e4f4 100755 --- a/lib/posix/_getpid.c +++ b/lib/posix/_getpid.c @@ -6,5 +6,5 @@ PUBLIC pid_t getpid() { message m; - return(_syscall(MM, GETPID, &m)); + return(_syscall(MM, MINIX_GETPID, &m)); } diff --git a/lib/syscall/Makefile.in b/lib/syscall/Makefile.in index d5b27e0d6..8dee5e90a 100644 --- a/lib/syscall/Makefile.in +++ b/lib/syscall/Makefile.in @@ -47,6 +47,8 @@ libc_FILES=" \ getgroups.s \ getitimer.s \ getnpid.s \ + getnuid.s \ + getngid.s \ getnprocnr.s \ getpgrp.s \ getpid.s \ @@ -69,6 +71,12 @@ libc_FILES=" \ mkfifo.s \ mknod.s \ mmap.s \ + vm_getphys.s \ + vm_getrefcount.s \ + vm_remap.s \ + vm_unmap.s \ + vm_set_priv.s \ + vm_query_exit.s \ mount.s \ nanosleep.s \ open.s \ diff --git a/lib/syscall/getngid.s b/lib/syscall/getngid.s new file mode 100644 index 000000000..810d9f2cc --- /dev/null +++ b/lib/syscall/getngid.s @@ -0,0 +1,7 @@ +.sect .text +.extern __getngid +.define _getngid +.align 2 + +_getngid: + jmp __getngid diff --git a/lib/syscall/getnuid.s b/lib/syscall/getnuid.s new file mode 100644 index 000000000..be9487588 --- /dev/null +++ b/lib/syscall/getnuid.s @@ -0,0 +1,7 @@ +.sect .text +.extern __getnuid +.define _getnuid +.align 2 + +_getnuid: + jmp __getnuid diff --git a/lib/syscall/mmap.s b/lib/syscall/mmap.s index 60664320f..a6c4b80a4 100755 --- a/lib/syscall/mmap.s +++ b/lib/syscall/mmap.s @@ -1,7 +1,17 @@ .sect .text .extern __mmap .define _mmap +.extern __munmap +.define _munmap +.extern __munmap_text +.define _munmap_text .align 2 _mmap: jmp __mmap + +_munmap: + jmp __munmap + +_munmap_text: + jmp __munmap_text diff --git a/lib/syscall/sleep.s b/lib/syscall/sleep.s index 6760731b3..a5394ef36 100755 --- a/lib/syscall/sleep.s +++ b/lib/syscall/sleep.s @@ -5,3 +5,9 @@ _sleep: jmp __sleep + +.extern __nanosleep +.define _nanosleep + +_nanosleep: + jmp __nanosleep diff --git a/lib/syscall/vm_getphys.s b/lib/syscall/vm_getphys.s new file mode 100755 index 000000000..f153bfdac --- /dev/null +++ b/lib/syscall/vm_getphys.s @@ -0,0 +1,7 @@ +.sect .text +.extern __vm_getphys +.define _vm_getphys +.align 2 + +_vm_getphys: + jmp __vm_getphys diff --git a/lib/syscall/vm_getrefcount.s b/lib/syscall/vm_getrefcount.s new file mode 100755 index 000000000..0020cf2e7 --- /dev/null +++ b/lib/syscall/vm_getrefcount.s @@ -0,0 +1,7 @@ +.sect .text +.extern __vm_getrefcount +.define _vm_getrefcount +.align 2 + +_vm_getrefcount: + jmp __vm_getrefcount diff --git a/lib/syscall/vm_query_exit.s b/lib/syscall/vm_query_exit.s new file mode 100644 index 000000000..f84ecfd8f --- /dev/null +++ b/lib/syscall/vm_query_exit.s @@ -0,0 +1,7 @@ +.sect .text +.extern __vm_query_exit +.define _vm_query_exit +.align 2 + +_vm_query_exit: + jmp __vm_query_exit diff --git a/lib/syscall/vm_remap.s b/lib/syscall/vm_remap.s new file mode 100755 index 000000000..c8e7c0d58 --- /dev/null +++ b/lib/syscall/vm_remap.s @@ -0,0 +1,7 @@ +.sect .text +.extern __vm_remap +.define _vm_remap +.align 2 + +_vm_remap: + jmp __vm_remap diff --git a/lib/syscall/vm_set_priv.s b/lib/syscall/vm_set_priv.s new file mode 100644 index 000000000..09a7bc9ab --- /dev/null +++ b/lib/syscall/vm_set_priv.s @@ -0,0 +1,7 @@ +.sect .text +.extern __vm_set_priv +.define _vm_set_priv +.align 2 + +_vm_set_priv: + jmp __vm_set_priv diff --git a/lib/syscall/vm_unmap.s b/lib/syscall/vm_unmap.s new file mode 100755 index 000000000..69ff2050d --- /dev/null +++ b/lib/syscall/vm_unmap.s @@ -0,0 +1,7 @@ +.sect .text +.extern __vm_unmap +.define _vm_unmap +.align 2 + +_vm_unmap: + jmp __vm_unmap -- 2.44.0