diff options
author | Dale S. Rahn <rahnds@cvs.openbsd.org> | 2000-08-25 03:36:39 +0000 |
---|---|---|
committer | Dale S. Rahn <rahnds@cvs.openbsd.org> | 2000-08-25 03:36:39 +0000 |
commit | 0cd8d4ceaee31a72650a6c2cb68d2d9e48032bbd (patch) | |
tree | da1d9ec0ec43ed588bb2f8a4aa1e94274255dc0c /libexec/ld.so/powerpc/syscall.h | |
parent | 2bde682f9b3063d01cafc9b2ce46bb515b340f71 (diff) |
Cleanup of powerpc ld.so files.
instead of #if 0, make them potentially useful -> LD_PRINTF_DEBUG
Deal with _dl_suid_ok correctly, this is not something that should
be hardcoded. - pointed out a few weeks ago.
Diffstat (limited to 'libexec/ld.so/powerpc/syscall.h')
-rw-r--r-- | libexec/ld.so/powerpc/syscall.h | 56 |
1 files changed, 8 insertions, 48 deletions
diff --git a/libexec/ld.so/powerpc/syscall.h b/libexec/ld.so/powerpc/syscall.h index e169333b8a3..2c5780f0274 100644 --- a/libexec/ld.so/powerpc/syscall.h +++ b/libexec/ld.so/powerpc/syscall.h @@ -1,4 +1,4 @@ -/* $OpenBSD: syscall.h,v 1.1 2000/06/13 03:40:39 rahnds Exp $ */ +/* $OpenBSD: syscall.h,v 1.2 2000/08/25 03:36:38 rahnds Exp $ */ /* * Copyright (c) 1998 Per Fogelstrom, Opsycon AB @@ -135,24 +135,6 @@ _dl_read (int fd, const char* buf, int len) : "0", "3", "4", "5"); return status; } -#if 0 -static inline int -_dl__syscall(quad_t val, ...) -{ - register int status __asm__ ("3"); - __asm__ volatile ("mr 0,%1\n\t" - "mr 3,%2\n\t" - "sc\n\t" - "cmpwi 0, 0\n\t" - "beq 1f\n\t" - "li 3,-1\n\t" - "1:" - : "=r" (status) - : "r" (SYS___syscall), "r" (val) - : "0"); - -} -#else #define STRINGIFY(x) #x #define XSTRINGIFY(x) STRINGIFY(x) @@ -167,7 +149,7 @@ __asm__(".align 2\n\t" "li 3, -1\n\t" "1:\n\t" "blr"); -#endif + static int _dl_mmap (void *addr, unsigned int len, unsigned int prot, unsigned int flags, int fd, off_t offset) @@ -212,7 +194,6 @@ _dl_mprotect (const void *addr, int size, int prot) : "0", "3", "4", "5"); return status; } -#if 0 #ifdef USE_CACHE static inline int @@ -228,7 +209,7 @@ _dl_stat (const char *addr, struct stat *sb) "li 3,-1\n\t" "1:" : "=r" (status) - : "r" (SYS_read), "r" (addr), "r" (sb) + : "r" (SYS_stat), "r" (addr), "r" (sb) : "0", "3", "4"); return status; } @@ -239,7 +220,7 @@ _dl_stat (const char *addr, struct stat *sb) whether this is OK or not. */ static inline int -_dl_getuid (const void *addr, int size, int prot) +_dl_getuid () { register int status __asm__ ("3"); __asm__ volatile ("mr 0,%1\n\t" @@ -254,7 +235,7 @@ _dl_getuid (const void *addr, int size, int prot) return status; } static inline int -_dl_geteuid (const void *addr, int size, int prot) +_dl_geteuid () { register int status __asm__ ("3"); __asm__ volatile ("mr 0,%1\n\t" @@ -269,7 +250,7 @@ _dl_geteuid (const void *addr, int size, int prot) return status; } static inline int -_dl_getgid (const void *addr, int size, int prot) +_dl_getgid () { register int status __asm__ ("3"); __asm__ volatile ("mr 0,%1\n\t" @@ -284,7 +265,7 @@ _dl_getgid (const void *addr, int size, int prot) return status; } static inline int -_dl_getuid (const void *addr, int size, int prot) +_dl_getegid () { register int status __asm__ ("3"); __asm__ volatile ("mr 0,%1\n\t" @@ -294,22 +275,7 @@ _dl_getuid (const void *addr, int size, int prot) "li 3,-1\n\t" "1:" : "=r" (status) - : "r" (SYS_getegid), - : "0", "3"); - return status; -} -static inline int -_dl_getuid (const void *addr, int size, int prot) -{ - register int status __asm__ ("3"); - __asm__ volatile ("mr 0,%1\n\t" - "sc\n\t" - "cmpwi 0, 0\n\t" - "beq 1f\n\t" - "li 3,-1\n\t" - "1:" - : "=r" (status) - : "r" (SYS_read), + : "r" (SYS_getgid) : "0", "3"); return status; } @@ -324,11 +290,5 @@ _dl_suid_ok (void) egid = _dl_getegid(); return (uid == euid && gid == egid); } -#endif -static inline int -_dl_suid_ok(void) -{ - return 1; -} #include <elf_abi.h> |