Remove __ptrvalue, __bounded and __unbounded.

This commit is contained in:
Joseph Myers 2013-02-13 23:30:40 +00:00
parent ffb1ec7b7f
commit 70d9946a44
60 changed files with 234 additions and 155 deletions

View File

@ -1,3 +1,80 @@
2013-02-13 Joseph Myers <joseph@codesourcery.com>
[BZ #13550]
* misc/sys/cdefs.h [!__BOUNDED_POINTERS__]: Remove conditional
code.
* csu/libc-start.c (LIBC_START_MAIN): Do not use __unbounded in
prototype or function definition. Rename ubp_* variables and
parameters. Remove argv definitions conditional on
[__BOUNDED_POINTERS__].
* debug/backtrace.c (__backtrace): Do not use __unbounded.
* elf/dl-runtime.c (_dl_fixup): Likewise.
* include/set-hooks.h (RUN_HOOK): Likewise.
* stdio-common/vfprintf.c (JUMP): Do not use __unbounded in either
definition.
* string/strcpy.c (strcpy): Do not use __unbounded.
* sysdeps/generic/frame.h (struct layout): Likewise.
* sysdeps/gnu/bits/msq.h (struct msqid_ds): Likewise.
* sysdeps/i386/dl-machine.h (_dl_fixup): Likewise.
* sysdeps/powerpc/powerpc32/backtrace.c (struct layout): Likewise.
* sysdeps/powerpc/powerpc64/backtrace.c (struct layout): Likewise.
* sysdeps/sparc/backtrace.c (struct layout): Likewise.
(__backtrace): Likewise.
* sysdeps/unix/sysv/linux/aio_sigqueue.c (__aio_sigqueue): Do not
use __ptrvalue.
* sysdeps/unix/sysv/linux/fxstat.c (__fxstat): Likewise.
* sysdeps/unix/sysv/linux/fxstatat.c (__fxstatat): Likewise.
* sysdeps/unix/sysv/linux/gai_sigqueue.c (__gai_sigqueue):
Likewise.
* sysdeps/unix/sysv/linux/i386/brk.c (__brk): Likewise.
* sysdeps/unix/sysv/linux/i386/fxstat.c (__fxstat): Likewise.
* sysdeps/unix/sysv/linux/i386/fxstatat.c (__fxstatat): Likewise.
* sysdeps/unix/sysv/linux/i386/lxstat.c (__lxstat): Likewise.
* sysdeps/unix/sysv/linux/i386/msgctl.c (struct __old_msqid_ds):
Do not use __unbounded.
* sysdeps/unix/sysv/linux/i386/setrlimit.c (__new_setrlimit):
Rename __unboundedrlimits parameter to rlimits in prototype.
* sysdeps/unix/sysv/linux/i386/shmctl.c (struct __old_shmid_ds):
Do not use __unbounded.
* sysdeps/unix/sysv/linux/i386/sigaction.c (__libc_sigaction): Do
not use __ptrvalue.
* sysdeps/unix/sysv/linux/i386/xstat.c (__xstat): Likewise.
* sysdeps/unix/sysv/linux/llseek.c (__llseek): Likewise.
* sysdeps/unix/sysv/linux/lxstat.c (__lxstat): Likewise.
* sysdeps/unix/sysv/linux/mmap64.c (__mmap64): Do not use
__ptrvalue or __unbounded.
(__mmap64) [__BOUNDED_POINTERS__]: Remove conditional code.
* sysdeps/unix/sysv/linux/msgctl.c (struct __old_msqid_ds): Do not
use __unbounded.
(__new_msgctl): Do not use __ptrvalue.
* sysdeps/unix/sysv/linux/msgrcv.c (struct ipc_kludge): Do not use
__unbounded.
(__libc_msgrcv): Do not use __ptrvalue.
* sysdeps/unix/sysv/linux/powerpc/libc-start.c (struct
startup_info): Do not use __unbounded.
(__libc_start_main): Likewise. Rename ubp_* variables and
parameters. Remove argv definitions conditional on
[__BOUNDED_POINTERS__].
* sysdeps/unix/sysv/linux/ptrace.c (ptrace): Do not use
__ptrvalue.
* sysdeps/unix/sysv/linux/semctl.c (struct __old_semid_ds): Do not
use __unbounded.
* sysdeps/unix/sysv/linux/shmat.c (shmat): Do not use __unbounded
or __ptrvalue.
* sysdeps/unix/sysv/linux/shmctl.c (struct __old_shmid_ds): Do not
use __unbounded.
(__new_shmctl): Do not use __ptrvalue.
* sysdeps/unix/sysv/linux/shmdt.c (shmdt): Likewise.
* sysdeps/unix/sysv/linux/sigaction.c (__libc_sigaction):
Likewise.
* sysdeps/unix/sysv/linux/sigqueue.c (__sigqueue): Likewise.
* sysdeps/unix/sysv/linux/sparc/sparc64/sigaction.c
(__libc_sigaction): Likewise.
* sysdeps/unix/sysv/linux/sysctl.c (__sysctl): Likewise.
* sysdeps/unix/sysv/linux/x86_64/sigaction.c (__libc_sigaction):
Likewise.
* sysdeps/unix/sysv/linux/xstat.c (__xstat): Likewise.
2013-02-13 Ondřej Bílka <neleai@seznam.cz>
* stdlib/Makefile (headers): Add bits/stdlib-bsearch.h.

View File

@ -101,14 +101,14 @@ apply_irel (void)
STATIC int LIBC_START_MAIN (int (*main) (int, char **, char **
MAIN_AUXVEC_DECL),
int argc,
char *__unbounded *__unbounded ubp_av,
char **argv,
#ifdef LIBC_START_MAIN_AUXVEC_ARG
ElfW(auxv_t) *__unbounded auxvec,
ElfW(auxv_t) *auxvec,
#endif
__typeof (main) init,
void (*fini) (void),
void (*rtld_fini) (void),
void *__unbounded stack_end)
void *stack_end)
__attribute__ ((noreturn));
@ -117,29 +117,23 @@ STATIC int LIBC_START_MAIN (int (*main) (int, char **, char **
finalizers were called in more than one place. */
STATIC int
LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
int argc, char *__unbounded *__unbounded ubp_av,
int argc, char **argv,
#ifdef LIBC_START_MAIN_AUXVEC_ARG
ElfW(auxv_t) *__unbounded auxvec,
ElfW(auxv_t) *auxvec,
#endif
__typeof (main) init,
void (*fini) (void),
void (*rtld_fini) (void), void *__unbounded stack_end)
void (*rtld_fini) (void), void *stack_end)
{
#if __BOUNDED_POINTERS__
char **argv;
#else
# define argv ubp_av
#endif
/* Result of the 'main' function. */
int result;
__libc_multiple_libcs = &_dl_starting_up && !_dl_starting_up;
#ifndef SHARED
char *__unbounded *__unbounded ubp_ev = &ubp_av[argc + 1];
char **ev = &argv[argc + 1];
__environ = ubp_ev;
__environ = ev;
/* Store the lowest stack address. This is done in ld.so if this is
the code for the DSO. */
@ -149,12 +143,12 @@ LIBC_START_MAIN (int (*main) (int, char **, char ** MAIN_AUXVEC_DECL),
/* First process the auxiliary vector since we need to find the
program header to locate an eventually present PT_TLS entry. */
# ifndef LIBC_START_MAIN_AUXVEC_ARG
ElfW(auxv_t) *__unbounded auxvec;
ElfW(auxv_t) *auxvec;
{
char *__unbounded *__unbounded evp = ubp_ev;
char **evp = ev;
while (*evp++ != NULL)
;
auxvec = (ElfW(auxv_t) *__unbounded) evp;
auxvec = (ElfW(auxv_t) *) evp;
}
# endif
_dl_aux_init (auxvec);

View File

@ -63,8 +63,8 @@ __backtrace (array, size)
int size;
{
struct layout *current;
void *__unbounded top_frame;
void *__unbounded top_stack;
void *top_frame;
void *top_stack;
int cnt = 0;
top_frame = FIRST_FRAME_POINTER;

View File

@ -62,9 +62,7 @@ _dl_fixup (
# ifdef ELF_MACHINE_RUNTIME_FIXUP_ARGS
ELF_MACHINE_RUNTIME_FIXUP_ARGS,
# endif
/* GKM FIXME: Fix trampoline to pass bounds so we can do
without the `__unbounded' qualifier. */
struct link_map *__unbounded l, ElfW(Word) reloc_arg)
struct link_map *l, ElfW(Word) reloc_arg)
{
const ElfW(Sym) *const symtab
= (const void *) D_PTR (l, l_info[DT_SYMTAB]);

View File

@ -41,7 +41,7 @@
# define RUN_HOOK(NAME, ARGS) \
do { \
void *const *__unbounded ptr; \
void *const *ptr; \
for (ptr = (void *const *) symbol_set_first_element (NAME); \
! symbol_set_end_p (NAME, ptr); ++ptr) \
(*(__##NAME##_hook_function_t *) *ptr) ARGS; \

View File

@ -128,14 +128,6 @@
#endif
/* Support for bounded pointers. */
#ifndef __BOUNDED_POINTERS__
# define __bounded /* nothing */
# define __unbounded /* nothing */
# define __ptrvalue /* nothing */
#endif
/* Fortify support. */
#define __bos(ptr) __builtin_object_size (ptr, __USE_FORTIFY_LEVEL > 1)
#define __bos0(ptr) __builtin_object_size (ptr, 0)

View File

@ -1,3 +1,9 @@
2013-02-13 Joseph Myers <joseph@codesourcery.com>
[BZ #13550]
* sysdeps/unix/sysv/linux/aarch64/sigaction.c (__libc_sigaction):
Do not use __ptrvalue.
2013-02-08 Joseph Myers <joseph@codesourcery.com>
[BZ #13550]

View File

@ -1,3 +1,9 @@
2013-02-13 Joseph Myers <joseph@codesourcery.com>
[BZ #13550]
* sysdeps/unix/sysv/linux/alpha/sigaction.c
(__syscall_rt_sigaction): Do not use __unbounded in prototype.
2013-02-08 Joseph Myers <joseph@codesourcery.com>
[BZ #13550]

View File

@ -1,3 +1,10 @@
2013-02-13 Joseph Myers <joseph@codesourcery.com>
[BZ #13550]
* sysdeps/am33/dl-machine.h (fixup): Do not use __unbounded.
* sysdeps/unix/sysv/linux/am33/brk.c (__brk): Do not use
__ptrvalue.
2013-01-02 Joseph Myers <joseph@codesourcery.com>
* All files with FSF copyright notices: Update copyright dates

View File

@ -1,3 +1,10 @@
2013-02-13 Joseph Myers <joseph@codesourcery.com>
[BZ #13550]
* sysdeps/arm/frame.h (struct layout): Do not use __unbounded.
* sysdeps/unix/sysv/linux/arm/sigaction.c (__libc_sigaction): Do
not use __ptrvalue.
2013-02-08 Joseph Myers <joseph@codesourcery.com>
[BZ #13550]

View File

@ -1,3 +1,17 @@
2013-02-13 Joseph Myers <joseph@codesourcery.com>
[BZ #13550]
* sysdeps/unix/sysv/linux/mips/mips64/fxstat64.c (__fxstat64): Do
not use __ptrvalue.
* sysdeps/unix/sysv/linux/mips/mips64/fxstatat64.c (__fxstatat64):
Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/lxstat64.c (__lxstat64):
Likewise.
* sysdeps/unix/sysv/linux/mips/mips64/xstat64.c (__xstat64):
Likewise.
* sysdeps/unix/sysv/linux/mips/sigaction.c (__libc_sigaction):
Likewise.
2013-02-11 Joseph Myers <joseph@codesourcery.com>
* sysdeps/mips/include/sys/asm.h: New file.

View File

@ -62,9 +62,7 @@ elf_machine_load_address (void)
We cannot use this scheme for profiling because the _mcount call
destroys the passed register information. */
/* GKM FIXME: Fix trampoline to pass bounds so we can do
without the `__unbounded' qualifier. */
static ElfW(Addr) fixup (struct link_map *__unbounded l, ElfW(Word) reloc_offset)
static ElfW(Addr) fixup (struct link_map *l, ElfW(Word) reloc_offset)
__attribute__ ((unused));
static ElfW(Addr) profile_fixup (struct link_map *l, ElfW(Word) reloc_offset,
ElfW(Addr) retaddr)

View File

@ -19,9 +19,9 @@
/* This is the APCS stack backtrace structure. */
struct layout
{
struct layout *__unbounded next;
void *__unbounded sp;
void *__unbounded return_address;
struct layout *next;
void *sp;
void *return_address;
};
#define FIRST_FRAME_POINTER ADVANCE_STACK_FRAME (__builtin_frame_address (0))

View File

@ -51,8 +51,8 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
}
result = INLINE_SYSCALL (rt_sigaction, 4, sig,
act ? __ptrvalue (&kact) : NULL,
oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
act ? &kact : NULL,
oact ? &koact : NULL, _NSIG / 8);
if (result >= 0 || errno != ENOSYS)
{
if (oact && result >= 0)

View File

@ -32,7 +32,7 @@
: INLINE_SYSCALL1(name, nr, args))
struct kernel_sigaction;
extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *__unbounded,
struct kernel_sigaction *__unbounded, size_t);
extern int __syscall_rt_sigaction (int, const struct kernel_sigaction *,
struct kernel_sigaction *, size_t);
#include <sysdeps/unix/sysv/linux/sigaction.c>

View File

@ -30,7 +30,7 @@ __brk (void *addr)
{
void *newbrk;
newbrk = INLINE_SYSCALL (brk, 1, __ptrvalue (addr));
newbrk = INLINE_SYSCALL (brk, 1, addr);
__curbrk = newbrk;

View File

@ -83,8 +83,8 @@ __libc_sigaction (sig, act, oact)
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
result = INLINE_SYSCALL (rt_sigaction, 4, sig,
act ? __ptrvalue (&kact) : NULL,
oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
act ? &kact : NULL,
oact ? &koact : NULL, _NSIG / 8);
if (oact && result >= 0)
{

View File

@ -34,7 +34,7 @@ __fxstat64 (int vers, int fd, struct stat64 *buf)
int result;
struct kernel_stat kbuf;
result = INLINE_SYSCALL (fstat, 2, fd, __ptrvalue (&kbuf));
result = INLINE_SYSCALL (fstat, 2, fd, &kbuf);
if (result == 0)
result = __xstat64_conv (vers, &kbuf, buf);

View File

@ -95,9 +95,9 @@ __fxstatat64 (int vers, int fd, const char *file, struct stat64 *st, int flag)
}
if (flag & AT_SYMLINK_NOFOLLOW)
result = INTERNAL_SYSCALL (lstat, err, 2, file, __ptrvalue (&kst));
result = INTERNAL_SYSCALL (lstat, err, 2, file, &kst);
else
result = INTERNAL_SYSCALL (stat, err, 2, file, __ptrvalue (&kst));
result = INTERNAL_SYSCALL (stat, err, 2, file, &kst);
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
return __xstat64_conv (vers, &kst, st);

View File

@ -33,7 +33,7 @@ __lxstat64 (int vers, const char *name, struct stat64 *buf)
int result;
struct kernel_stat kbuf;
result = INLINE_SYSCALL (lstat, 2, name, __ptrvalue (&kbuf));
result = INLINE_SYSCALL (lstat, 2, name, &kbuf);
if (result == 0)
result = __xstat64_conv (vers, &kbuf, buf);

View File

@ -34,7 +34,7 @@ __xstat64 (int vers, const char *name, struct stat64 *buf)
int result;
struct kernel_stat kbuf;
result = INLINE_SYSCALL (stat, 2, name, __ptrvalue (&kbuf));
result = INLINE_SYSCALL (stat, 2, name, &kbuf);
if (result == 0)
result = __xstat64_conv (vers, &kbuf, buf);

View File

@ -71,8 +71,8 @@ __libc_sigaction (sig, act, oact)
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
result = INLINE_SYSCALL (rt_sigaction, 4, sig,
act ? __ptrvalue (&kact) : NULL,
oact ? __ptrvalue (&koact) : NULL,
act ? &kact : NULL,
oact ? &koact : NULL,
sizeof (kernel_sigset_t));
if (oact && result >= 0)

View File

@ -302,7 +302,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
do \
{ \
int offset; \
void *__unbounded ptr; \
void *ptr; \
spec = (ChExpr); \
offset = NOT_IN_JUMP_RANGE (spec) ? REF (form_unknown) \
: table[CHAR_CLASS (spec)]; \
@ -315,7 +315,7 @@ vfprintf (FILE *s, const CHAR_T *format, va_list ap)
# define JUMP(ChExpr, table) \
do \
{ \
const void *__unbounded ptr; \
const void *ptr; \
spec = (ChExpr); \
ptr = NOT_IN_JUMP_RANGE (spec) ? REF (form_unknown) \
: table[CHAR_CLASS (spec)]; \

View File

@ -28,7 +28,7 @@ strcpy (dest, src)
const char *src;
{
char c;
char *__unbounded s = (char *__unbounded) src;
char *s = (char *) src;
const ptrdiff_t off = dest - s - 1;
do

View File

@ -18,6 +18,6 @@
struct layout
{
void *__unbounded next;
void *__unbounded return_address;
void *next;
void *return_address;
};

View File

@ -38,13 +38,13 @@ typedef unsigned short int msglen_t;
struct msqid_ds
{
struct ipc_perm msg_perm; /* structure describing operation permission */
struct msg *__unbounded __msg_first; /* pointer to first message on queue */
struct msg *__unbounded __msg_last; /* pointer to last message on queue */
struct msg *__msg_first; /* pointer to first message on queue */
struct msg *__msg_last; /* pointer to last message on queue */
__time_t msg_stime; /* time of last msgsnd command */
__time_t msg_rtime; /* time of last msgrcv command */
__time_t msg_ctime; /* time of last change */
struct wait_queue *__unbounded __wwait; /* ??? */
struct wait_queue *__unbounded __rwait; /* ??? */
struct wait_queue *__wwait; /* ??? */
struct wait_queue *__rwait; /* ??? */
unsigned short int __msg_cbytes;/* current number of bytes on queue */
msgqnum_t msg_qnum; /* number of messages currently on queue */
msglen_t msg_qbytes; /* max number of bytes allowed on queue */

View File

@ -151,11 +151,9 @@ elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
We cannot use this scheme for profiling because the _mcount call
destroys the passed register information. */
/* GKM FIXME: Fix trampoline to pass bounds so we can do
without the `__unbounded' qualifier. */
#define ARCH_FIXUP_ATTRIBUTE __attribute__ ((regparm (3), stdcall, unused))
extern ElfW(Addr) _dl_fixup (struct link_map *__unbounded l,
extern ElfW(Addr) _dl_fixup (struct link_map *l,
ElfW(Word) reloc_offset)
ARCH_FIXUP_ATTRIBUTE;
extern ElfW(Addr) _dl_profile_fixup (struct link_map *l,

View File

@ -31,8 +31,8 @@
*/
struct layout
{
struct layout *__unbounded next;
void *__unbounded return_address;
struct layout *next;
void *return_address;
};
int

View File

@ -33,9 +33,9 @@
*/
struct layout
{
struct layout *__unbounded next;
struct layout *next;
long condition_register;
void *__unbounded return_address;
void *return_address;
};
int

View File

@ -30,7 +30,7 @@ struct layout
unsigned long locals[8];
unsigned long ins[6];
unsigned long next;
void *__unbounded return_address;
void *return_address;
};
struct trace_arg
@ -127,9 +127,9 @@ __backtrace (void **array, int size)
asm volatile ("mov %%fp, %0" : "=r"(fp));
asm volatile ("mov %%i7, %0" : "=r"(i7));
current = (struct layout *__unbounded) (fp + BACKTRACE_STACK_BIAS);
current = (struct layout *) (fp + BACKTRACE_STACK_BIAS);
array[0] = (void *__unbounded) i7;
array[0] = (void *) i7;
if (size == 1)
return 1;
@ -140,8 +140,7 @@ __backtrace (void **array, int size)
array[count] = current->return_address;
if (!current->next)
break;
current = (struct layout *__unbounded) (current->next
+ BACKTRACE_STACK_BIAS);
current = (struct layout *) (current->next + BACKTRACE_STACK_BIAS);
}
}
else

View File

@ -47,8 +47,7 @@ __aio_sigqueue (sig, val, caller_pid)
info.si_uid = getuid ();
info.si_value = val;
return INLINE_SYSCALL (rt_sigqueueinfo, 3, info.si_pid,
sig, __ptrvalue (&info));
return INLINE_SYSCALL (rt_sigqueueinfo, 3, info.si_pid, sig, &info);
}
#else
# include <rt/aio_sigqueue.c>

View File

@ -45,7 +45,7 @@ __fxstat (int vers, int fd, struct stat *buf)
struct kernel_stat kbuf;
int result;
result = INLINE_SYSCALL (fstat, 2, fd, __ptrvalue (&kbuf));
result = INLINE_SYSCALL (fstat, 2, fd, &kbuf);
if (result == 0)
result = __xstat_conv (vers, &kbuf, buf);

View File

@ -125,9 +125,9 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
}
#else
if (flag & AT_SYMLINK_NOFOLLOW)
result = INTERNAL_SYSCALL (lstat, err, 2, file, __ptrvalue (&kst));
result = INTERNAL_SYSCALL (lstat, err, 2, file, &kst);
else
result = INTERNAL_SYSCALL (stat, err, 2, file, __ptrvalue (&kst));
result = INTERNAL_SYSCALL (stat, err, 2, file, &kst);
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
return __xstat_conv (vers, &kst, st);

View File

@ -47,8 +47,7 @@ __gai_sigqueue (sig, val, caller_pid)
info.si_uid = __getuid ();
info.si_value = val;
return INLINE_SYSCALL (rt_sigqueueinfo, 3, info.si_pid,
sig, __ptrvalue (&info));
return INLINE_SYSCALL (rt_sigqueueinfo, 3, info.si_pid, sig, &info);
}
#else
# include <resolv/gai_sigqueue.c>

View File

@ -31,11 +31,10 @@ weak_alias (__curbrk, ___brk_addr)
int
__brk (void *addr)
{
void *__unbounded newbrk;
void *newbrk;
INTERNAL_SYSCALL_DECL (err);
newbrk = (void *__unbounded) INTERNAL_SYSCALL (brk, err, 1,
__ptrvalue (addr));
newbrk = (void *) INTERNAL_SYSCALL (brk, err, 1, addr);
__curbrk = newbrk;

View File

@ -44,7 +44,7 @@ __fxstat (int vers, int fd, struct stat *buf)
{
struct stat64 buf64;
result = INLINE_SYSCALL (fstat64, 2, fd, __ptrvalue (&buf64));
result = INLINE_SYSCALL (fstat64, 2, fd, &buf64);
if (result == 0)
result = __xstat32_conv (vers, &buf64, buf);
return result;

View File

@ -110,9 +110,9 @@ __fxstatat (int vers, int fd, const char *file, struct stat *st, int flag)
}
if (flag & AT_SYMLINK_NOFOLLOW)
result = INTERNAL_SYSCALL (lstat64, err, 2, file, __ptrvalue (&st64));
result = INTERNAL_SYSCALL (lstat64, err, 2, file, &st64);
else
result = INTERNAL_SYSCALL (stat64, err, 2, file, __ptrvalue (&st64));
result = INTERNAL_SYSCALL (stat64, err, 2, file, &st64);
if (__builtin_expect (!INTERNAL_SYSCALL_ERROR_P (result, err), 1))
return __xstat32_conv (vers, &st64, st);

View File

@ -45,7 +45,7 @@ __lxstat (int vers, const char *name, struct stat *buf)
{
struct stat64 buf64;
result = INLINE_SYSCALL (lstat64, 2, name, __ptrvalue (&buf64));
result = INLINE_SYSCALL (lstat64, 2, name, &buf64);
if (result == 0)
result = __xstat32_conv (vers, &buf64, buf);
return result;

View File

@ -29,13 +29,13 @@
struct __old_msqid_ds
{
struct __old_ipc_perm msg_perm; /* structure describing operation permission */
struct msg *__unbounded __msg_first; /* pointer to first message on queue */
struct msg *__unbounded __msg_last; /* pointer to last message on queue */
struct msg *__msg_first; /* pointer to first message on queue */
struct msg *__msg_last; /* pointer to last message on queue */
__time_t msg_stime; /* time of last msgsnd command */
__time_t msg_rtime; /* time of last msgrcv command */
__time_t msg_ctime; /* time of last change */
struct wait_queue *__unbounded __wwait; /* ??? */
struct wait_queue *__unbounded __rwait; /* ??? */
struct wait_queue *__wwait; /* ??? */
struct wait_queue *__rwait; /* ??? */
unsigned short int __msg_cbytes; /* current number of bytes on queue */
unsigned short int msg_qnum; /* number of messages currently on queue */
unsigned short int msg_qbytes; /* max number of bytes allowed on queue */

View File

@ -24,7 +24,7 @@
#include <shlib-compat.h>
extern int __new_setrlimit (enum __rlimit_resource resource,
const struct rlimit *__unboundedrlimits);
const struct rlimit *rlimits);
/* Consider moving to syscalls.list. */

View File

@ -38,8 +38,8 @@ struct __old_shmid_ds
__ipc_pid_t shm_lpid; /* pid of last shmop */
unsigned short int shm_nattch; /* number of current attaches */
unsigned short int __shm_npages; /* size of segment (pages) */
unsigned long int *__unbounded __shm_pages; /* array of ptrs to frames -> SHMMAX */
struct vm_area_struct *__unbounded __attaches; /* descriptors for attaches */
unsigned long int *__shm_pages; /* array of ptrs to frames -> SHMMAX */
struct vm_area_struct *__attaches; /* descriptors for attaches */
};
struct __old_shminfo

View File

@ -72,8 +72,8 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
result = INLINE_SYSCALL (rt_sigaction, 4,
sig, act ? __ptrvalue (&kact) : NULL,
oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
sig, act ? &kact : NULL,
oact ? &koact : NULL, _NSIG / 8);
if (oact && result >= 0)
{

View File

@ -45,7 +45,7 @@ __xstat (int vers, const char *name, struct stat *buf)
{
struct stat64 buf64;
result = INLINE_SYSCALL (stat64, 2, name, __ptrvalue (&buf64));
result = INLINE_SYSCALL (stat64, 2, name, &buf64);
if (result == 0)
result = __xstat32_conv (vers, &buf64, buf);
return result;

View File

@ -32,7 +32,7 @@ __llseek (int fd, loff_t offset, int whence)
return (loff_t) (INLINE_SYSCALL (_llseek, 5, fd, (off_t) (offset >> 32),
(off_t) (offset & 0xffffffff),
__ptrvalue (&retval), whence) ?: retval);
&retval, whence) ?: retval);
}
weak_alias (__llseek, llseek)
strong_alias (__llseek, __libc_lseek64)

View File

@ -44,7 +44,7 @@ __lxstat (int vers, const char *name, struct stat *buf)
struct kernel_stat kbuf;
int result;
result = INLINE_SYSCALL (lstat, 2, name, __ptrvalue (&kbuf));
result = INLINE_SYSCALL (lstat, 2, name, &kbuf);
if (result == 0)
result = __xstat_conv (vers, &kbuf, buf);

View File

@ -53,14 +53,10 @@ __mmap64 (void *addr, size_t len, int prot, int flags, int fd, off64_t offset)
return MAP_FAILED;
}
void *result;
__ptrvalue (result) = (void *__unbounded)
INLINE_SYSCALL (mmap2, 6, __ptrvalue (addr),
result = (void *)
INLINE_SYSCALL (mmap2, 6, addr,
len, prot, flags, fd,
(off_t) (offset >> MMAP2_PAGE_SHIFT));
#if __BOUNDED_POINTERS__
__ptrlow (result) = __ptrvalue (result);
__ptrhigh (result) = __ptrvalue (result) + len;
#endif
return result;
}
weak_alias (__mmap64, mmap64)

View File

@ -30,13 +30,13 @@
struct __old_msqid_ds
{
struct __old_ipc_perm msg_perm; /* structure describing operation permission */
struct msg *__unbounded __msg_first; /* pointer to first message on queue */
struct msg *__unbounded __msg_last; /* pointer to last message on queue */
struct msg *__msg_first; /* pointer to first message on queue */
struct msg *__msg_last; /* pointer to last message on queue */
__time_t msg_stime; /* time of last msgsnd command */
__time_t msg_rtime; /* time of last msgrcv command */
__time_t msg_ctime; /* time of last change */
struct wait_queue *__unbounded __wwait; /* ??? */
struct wait_queue *__unbounded __rwait; /* ??? */
struct wait_queue *__wwait; /* ??? */
struct wait_queue *__rwait; /* ??? */
unsigned short int __msg_cbytes; /* current number of bytes on queue */
unsigned short int msg_qnum; /* number of messages currently on queue */
unsigned short int msg_qbytes; /* max number of bytes allowed on queue */
@ -103,8 +103,7 @@ __new_msgctl (int msqid, int cmd, struct msqid_ds *buf)
return -1;
}
}
result = INLINE_SYSCALL (ipc, 5, IPCOP_msgctl,
msqid, cmd, 0, __ptrvalue (&old));
result = INLINE_SYSCALL (ipc, 5, IPCOP_msgctl, msqid, cmd, 0, &old);
if (result != -1 && cmd != IPC_SET)
{
memset(buf, 0, sizeof(*buf));

View File

@ -27,7 +27,7 @@
arguments to a system call. */
struct ipc_kludge
{
void *__unbounded msgp;
void *msgp;
long int msgtyp;
};
@ -48,13 +48,12 @@ __libc_msgrcv (msqid, msgp, msgsz, msgtyp, msgflg)
tmp.msgtyp = msgtyp;
if (SINGLE_THREAD_P)
return INLINE_SYSCALL (ipc, 5, IPCOP_msgrcv, msqid, msgsz, msgflg,
__ptrvalue (&tmp));
return INLINE_SYSCALL (ipc, 5, IPCOP_msgrcv, msqid, msgsz, msgflg, &tmp);
int oldtype = LIBC_CANCEL_ASYNC ();
ssize_t result = INLINE_SYSCALL (ipc, 5, IPCOP_msgrcv, msqid, msgsz, msgflg,
__ptrvalue (&tmp));
&tmp);
LIBC_CANCEL_RESET (oldtype);

View File

@ -33,7 +33,7 @@ int __cache_line_size attribute_hidden;
struct startup_info
{
void *__unbounded sda_base;
void *sda_base;
int (*main) (int, char **, char **, void *);
int (*init) (int, char **, char **, void *);
void (*fini) (void);
@ -42,34 +42,28 @@ struct startup_info
int
/* GKM FIXME: GCC: this should get __BP_ prefix by virtue of the
BPs in the arglist of startup_info.main and startup_info.init. */
BP_SYM (__libc_start_main) (int argc, char *__unbounded *__unbounded ubp_av,
char *__unbounded *__unbounded ubp_ev,
ElfW (auxv_t) * __unbounded auxvec,
BP_SYM (__libc_start_main) (int argc, char **argv,
char **ev,
ElfW (auxv_t) * auxvec,
void (*rtld_fini) (void),
struct startup_info *__unbounded stinfo,
char *__unbounded *__unbounded stack_on_entry)
struct startup_info *stinfo,
char **stack_on_entry)
{
#if __BOUNDED_POINTERS__
char **argv;
#else
# define argv ubp_av
#endif
/* the PPC SVR4 ABI says that the top thing on the stack will
be a NULL pointer, so if not we assume that we're being called
as a statically-linked program by Linux... */
if (*stack_on_entry != NULL)
{
char *__unbounded * __unbounded temp;
char **temp;
/* ...in which case, we have argc as the top thing on the
stack, followed by argv (NULL-terminated), envp (likewise),
and the auxilary vector. */
/* 32/64-bit agnostic load from stack */
argc = *(long int *__unbounded) stack_on_entry;
ubp_av = stack_on_entry + 1;
ubp_ev = ubp_av + argc + 1;
argc = *(long int *) stack_on_entry;
argv = stack_on_entry + 1;
ev = argv + argc + 1;
#ifdef HAVE_AUX_VECTOR
temp = ubp_ev;
temp = ev;
while (*temp != NULL)
++temp;
auxvec = (ElfW (auxv_t) *)++ temp;
@ -86,7 +80,7 @@ int
break;
}
return generic_start_main (stinfo->main, argc, ubp_av, auxvec,
return generic_start_main (stinfo->main, argc, argv, auxvec,
stinfo->init, stinfo->fini, rtld_fini,
stack_on_entry);
}

View File

@ -42,8 +42,7 @@ ptrace (enum __ptrace_request request, ...)
if (request > 0 && request < 4)
data = &ret;
res = INLINE_SYSCALL (ptrace, 4, request, pid,
__ptrvalue (addr), __ptrvalue (data));
res = INLINE_SYSCALL (ptrace, 4, request, pid, addr, data);
if (res >= 0 && request > 0 && request < 4)
{
__set_errno (0);

View File

@ -33,10 +33,10 @@ struct __old_semid_ds
struct __old_ipc_perm sem_perm; /* operation permission struct */
__time_t sem_otime; /* last semop() time */
__time_t sem_ctime; /* last time changed by semctl() */
struct sem *__unbounded __sembase; /* ptr to first semaphore in array */
struct sem_queue *__unbounded __sem_pending; /* pending operations */
struct sem_queue *__unbounded __sem_pending_last; /* last pending operation */
struct sem_undo *__unbounded __undo; /* ondo requests on this array */
struct sem *__sembase; /* ptr to first semaphore in array */
struct sem_queue *__sem_pending; /* pending operations */
struct sem_queue *__sem_pending_last; /* last pending operation */
struct sem_undo *__undo; /* ondo requests on this array */
unsigned short int sem_nsems; /* number of semaphores in set */
};

View File

@ -36,7 +36,7 @@ shmat (shmid, shmaddr, shmflg)
{
INTERNAL_SYSCALL_DECL(err);
unsigned long resultvar;
void *__unbounded raddr;
void *raddr;
#if __BOUNDED_POINTERS__
size_t length = ~0;
@ -49,8 +49,8 @@ shmat (shmid, shmaddr, shmflg)
resultvar = INTERNAL_SYSCALL (ipc, err, 5, IPCOP_shmat,
shmid, shmflg,
(long int) __ptrvalue (&raddr),
__ptrvalue ((void *) shmaddr));
(long int) &raddr,
(void *) shmaddr);
if (INTERNAL_SYSCALL_ERROR_P (resultvar, err))
{
__set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, err));

View File

@ -39,8 +39,8 @@ struct __old_shmid_ds
__ipc_pid_t shm_lpid; /* pid of last shmop */
unsigned short int shm_nattch; /* number of current attaches */
unsigned short int __shm_npages; /* size of segment (pages) */
unsigned long int *__unbounded __shm_pages; /* array of ptrs to frames -> SHMMAX */
struct vm_area_struct *__unbounded __attaches; /* descriptors for attaches */
unsigned long int *__shm_pages; /* array of ptrs to frames -> SHMMAX */
struct vm_area_struct *__attaches; /* descriptors for attaches */
};
struct __old_shminfo
@ -115,8 +115,7 @@ __new_shmctl (int shmid, int cmd, struct shmid_ds *buf)
return -1;
}
}
result = INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd, 0,
__ptrvalue (&old.ds));
result = INLINE_SYSCALL (ipc, 5, IPCOP_shmctl, shmid, cmd, 0, &old.ds);
if (result != -1 && (cmd == SHM_STAT || cmd == IPC_STAT))
{
memset(buf, 0, sizeof(*buf));

View File

@ -30,5 +30,5 @@ int
shmdt (shmaddr)
const void *shmaddr;
{
return INLINE_SYSCALL (ipc, 5, IPCOP_shmdt, 0, 0, 0, __ptrvalue ((void *) shmaddr));
return INLINE_SYSCALL (ipc, 5, IPCOP_shmdt, 0, 0, 0, (void *) shmaddr);
}

View File

@ -55,8 +55,8 @@ __libc_sigaction (sig, act, oact)
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
result = INLINE_SYSCALL (rt_sigaction, 4, sig,
act ? __ptrvalue (&kact) : NULL,
oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
act ? &kact : NULL,
oact ? &koact : NULL, _NSIG / 8);
if (oact && result >= 0)
{

View File

@ -43,7 +43,7 @@ __sigqueue (pid, sig, val)
info.si_uid = __getuid ();
info.si_value = val;
return INLINE_SYSCALL (rt_sigqueueinfo, 3, pid, sig, __ptrvalue (&info));
return INLINE_SYSCALL (rt_sigqueueinfo, 3, pid, sig, &info);
}
weak_alias (__sigqueue, sigqueue)
#else

View File

@ -48,8 +48,8 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
ret = INLINE_SYSCALL (rt_sigaction, 5, sig,
act ? __ptrvalue (&kact) : 0,
oact ? __ptrvalue (&koact) : 0, stub, _NSIG / 8);
act ? &kact : 0,
oact ? &koact : 0, stub, _NSIG / 8);
if (oact && ret >= 0)
{

View File

@ -37,7 +37,7 @@ __sysctl (int *name, int nlen, void *oldval, size_t *oldlenp,
.newlen = newlen
};
return INLINE_SYSCALL (_sysctl, 1, __ptrvalue (&args));
return INLINE_SYSCALL (_sysctl, 1, &args);
}
libc_hidden_def (__sysctl)
weak_alias (__sysctl, sysctl)

View File

@ -62,8 +62,8 @@ __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact)
/* XXX The size argument hopefully will have to be changed to the
real size of the user-level sigset_t. */
result = INLINE_SYSCALL (rt_sigaction, 4,
sig, act ? __ptrvalue (&kact) : NULL,
oact ? __ptrvalue (&koact) : NULL, _NSIG / 8);
sig, act ? &kact : NULL,
oact ? &koact : NULL, _NSIG / 8);
if (oact && result >= 0)
{
oact->sa_handler = koact.k_sa_handler;

View File

@ -44,7 +44,7 @@ __xstat (int vers, const char *name, struct stat *buf)
struct kernel_stat kbuf;
int result;
result = INLINE_SYSCALL (stat, 2, name, __ptrvalue (&kbuf));
result = INLINE_SYSCALL (stat, 2, name, &kbuf);
if (result == 0)
result = __xstat_conv (vers, &kbuf, buf);