2008-04-14 Patrick Mansfield <patmans@us.ibm.com>

* libc/machine/spu/impure.c: New file, supply a non-static _impure_data.
        * libc/machine/spu/Makefile.am: Add new file impure.c.
        * libc/machine/spu/Makefile.in: Regenerate.
        * libc/machine/spu/sys/errno.h: Define errno to be _reent_data._errno.
This commit is contained in:
Jeff Johnston 2008-04-15 19:57:48 +00:00
parent e163fe2579
commit 45b142890d
5 changed files with 67 additions and 46 deletions

View File

@ -1,3 +1,10 @@
2008-04-14 Patrick Mansfield <patmans@us.ibm.com>
* libc/machine/spu/impure.c: New file, supply a non-static _impure_data.
* libc/machine/spu/Makefile.am: Add new file impure.c.
* libc/machine/spu/Makefile.in: Regenerate.
* libc/machine/spu/sys/errno.h: Define errno to be _reent_data._errno.
2008-04-14 Jeff Johnston <jjohnstn@redhat.com> 2008-04-14 Jeff Johnston <jjohnstn@redhat.com>
* libc/stdio/Makefile.am: Build vfprintf.c and vfscanf.c with * libc/stdio/Makefile.am: Build vfprintf.c and vfscanf.c with

View File

@ -12,10 +12,10 @@ lib_a_SOURCES = setjmp.S assert.c clearerr.c creat.c fclose.c feof.c \
ferror.c fflush.c fgetc.c fgetpos.c fgets.c fileno.c fiprintf.S \ ferror.c fflush.c fgetc.c fgetpos.c fgets.c fileno.c fiprintf.S \
fiscanf.S fopen.c fprintf.S fputc.c fputs.c fread.c freopen.c \ fiscanf.S fopen.c fprintf.S fputc.c fputs.c fread.c freopen.c \
fscanf.S fseek.c fsetpos.c ftell.c fwrite.c getc.c getchar.c \ fscanf.S fseek.c fsetpos.c ftell.c fwrite.c getc.c getchar.c \
gets.c iprintf.S iscanf.S memcmp.c memcpy.c memmove.c memset.c \ gets.c impure.c iprintf.S iscanf.S memcmp.c memcpy.c memmove.c \
perror.c printf.S putc.c putchar.c puts.c remove.c rename.c \ memset.c perror.c printf.S putc.c putchar.c puts.c remove.c \
rewind.c scanf.S setbuf.c setvbuf.c siprintf.S siscanf.S sleep.c \ rename.c rewind.c scanf.S setbuf.c setvbuf.c siprintf.S siscanf.S \
sniprintf.S snprintf.S sprintf.S sscanf.S stdio.c strcat.c \ sleep.c sniprintf.S snprintf.S sprintf.S sscanf.S stdio.c strcat.c \
strchr.c strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c \ strchr.c strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c \
strncpy.c strpbrk.c strrchr.c strspn.c strxfrm.c tmpfile.c \ strncpy.c strpbrk.c strrchr.c strspn.c strxfrm.c tmpfile.c \
tmpnam.c ungetc.c usleep.c vfiprintf.c vfiscanf.c vfprintf.c \ tmpnam.c ungetc.c usleep.c vfiprintf.c vfiscanf.c vfprintf.c \

View File

@ -74,7 +74,7 @@ DIST_COMMON = $(srcdir)/../../../../config.guess \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \ $(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \ $(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile \ $(srcdir)/../../../../compile $(srcdir)/../../../../compile \
$(srcdir)/../../../../compile $(srcdir)/../../../../compile $(srcdir)/../../../../compile
subdir = . subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../../../acinclude.m4 \ am__aclocal_m4_deps = $(top_srcdir)/../../../acinclude.m4 \
@ -103,35 +103,35 @@ am_lib_a_OBJECTS = lib_a-setjmp.$(OBJEXT) lib_a-assert.$(OBJEXT) \
lib_a-fsetpos.$(OBJEXT) lib_a-ftell.$(OBJEXT) \ lib_a-fsetpos.$(OBJEXT) lib_a-ftell.$(OBJEXT) \
lib_a-fwrite.$(OBJEXT) lib_a-getc.$(OBJEXT) \ lib_a-fwrite.$(OBJEXT) lib_a-getc.$(OBJEXT) \
lib_a-getchar.$(OBJEXT) lib_a-gets.$(OBJEXT) \ lib_a-getchar.$(OBJEXT) lib_a-gets.$(OBJEXT) \
lib_a-iprintf.$(OBJEXT) lib_a-iscanf.$(OBJEXT) \ lib_a-impure.$(OBJEXT) lib_a-iprintf.$(OBJEXT) \
lib_a-memcmp.$(OBJEXT) lib_a-memcpy.$(OBJEXT) \ lib_a-iscanf.$(OBJEXT) lib_a-memcmp.$(OBJEXT) \
lib_a-memmove.$(OBJEXT) lib_a-memset.$(OBJEXT) \ lib_a-memcpy.$(OBJEXT) lib_a-memmove.$(OBJEXT) \
lib_a-perror.$(OBJEXT) lib_a-printf.$(OBJEXT) \ lib_a-memset.$(OBJEXT) lib_a-perror.$(OBJEXT) \
lib_a-putc.$(OBJEXT) lib_a-putchar.$(OBJEXT) \ lib_a-printf.$(OBJEXT) lib_a-putc.$(OBJEXT) \
lib_a-puts.$(OBJEXT) lib_a-remove.$(OBJEXT) \ lib_a-putchar.$(OBJEXT) lib_a-puts.$(OBJEXT) \
lib_a-rename.$(OBJEXT) lib_a-rewind.$(OBJEXT) \ lib_a-remove.$(OBJEXT) lib_a-rename.$(OBJEXT) \
lib_a-scanf.$(OBJEXT) lib_a-setbuf.$(OBJEXT) \ lib_a-rewind.$(OBJEXT) lib_a-scanf.$(OBJEXT) \
lib_a-setvbuf.$(OBJEXT) lib_a-siprintf.$(OBJEXT) \ lib_a-setbuf.$(OBJEXT) lib_a-setvbuf.$(OBJEXT) \
lib_a-siscanf.$(OBJEXT) lib_a-sleep.$(OBJEXT) \ lib_a-siprintf.$(OBJEXT) lib_a-siscanf.$(OBJEXT) \
lib_a-sniprintf.$(OBJEXT) lib_a-snprintf.$(OBJEXT) \ lib_a-sleep.$(OBJEXT) lib_a-sniprintf.$(OBJEXT) \
lib_a-sprintf.$(OBJEXT) lib_a-sscanf.$(OBJEXT) \ lib_a-snprintf.$(OBJEXT) lib_a-sprintf.$(OBJEXT) \
lib_a-stdio.$(OBJEXT) lib_a-strcat.$(OBJEXT) \ lib_a-sscanf.$(OBJEXT) lib_a-stdio.$(OBJEXT) \
lib_a-strchr.$(OBJEXT) lib_a-strcmp.$(OBJEXT) \ lib_a-strcat.$(OBJEXT) lib_a-strchr.$(OBJEXT) \
lib_a-strcpy.$(OBJEXT) lib_a-strcspn.$(OBJEXT) \ lib_a-strcmp.$(OBJEXT) lib_a-strcpy.$(OBJEXT) \
lib_a-strlen.$(OBJEXT) lib_a-strncat.$(OBJEXT) \ lib_a-strcspn.$(OBJEXT) lib_a-strlen.$(OBJEXT) \
lib_a-strncmp.$(OBJEXT) lib_a-strncpy.$(OBJEXT) \ lib_a-strncat.$(OBJEXT) lib_a-strncmp.$(OBJEXT) \
lib_a-strpbrk.$(OBJEXT) lib_a-strrchr.$(OBJEXT) \ lib_a-strncpy.$(OBJEXT) lib_a-strpbrk.$(OBJEXT) \
lib_a-strspn.$(OBJEXT) lib_a-strxfrm.$(OBJEXT) \ lib_a-strrchr.$(OBJEXT) lib_a-strspn.$(OBJEXT) \
lib_a-tmpfile.$(OBJEXT) lib_a-tmpnam.$(OBJEXT) \ lib_a-strxfrm.$(OBJEXT) lib_a-tmpfile.$(OBJEXT) \
lib_a-ungetc.$(OBJEXT) lib_a-usleep.$(OBJEXT) \ lib_a-tmpnam.$(OBJEXT) lib_a-ungetc.$(OBJEXT) \
lib_a-vfiprintf.$(OBJEXT) lib_a-vfiscanf.$(OBJEXT) \ lib_a-usleep.$(OBJEXT) lib_a-vfiprintf.$(OBJEXT) \
lib_a-vfprintf.$(OBJEXT) lib_a-vfscanf.$(OBJEXT) \ lib_a-vfiscanf.$(OBJEXT) lib_a-vfprintf.$(OBJEXT) \
lib_a-viprintf.$(OBJEXT) lib_a-viscanf.$(OBJEXT) \ lib_a-vfscanf.$(OBJEXT) lib_a-viprintf.$(OBJEXT) \
lib_a-vprintf.$(OBJEXT) lib_a-vscanf.$(OBJEXT) \ lib_a-viscanf.$(OBJEXT) lib_a-vprintf.$(OBJEXT) \
lib_a-vsiprintf.$(OBJEXT) lib_a-vsiscanf.$(OBJEXT) \ lib_a-vscanf.$(OBJEXT) lib_a-vsiprintf.$(OBJEXT) \
lib_a-vsniprintf.$(OBJEXT) lib_a-vsnprintf.$(OBJEXT) \ lib_a-vsiscanf.$(OBJEXT) lib_a-vsniprintf.$(OBJEXT) \
lib_a-vsprintf.$(OBJEXT) lib_a-vsscanf.$(OBJEXT) \ lib_a-vsnprintf.$(OBJEXT) lib_a-vsprintf.$(OBJEXT) \
lib_a-stack_reg_va.$(OBJEXT) lib_a-vsscanf.$(OBJEXT) lib_a-stack_reg_va.$(OBJEXT)
lib_a_OBJECTS = $(am_lib_a_OBJECTS) lib_a_OBJECTS = $(am_lib_a_OBJECTS)
DEFAULT_INCLUDES = -I. -I$(srcdir) DEFAULT_INCLUDES = -I. -I$(srcdir)
depcomp = depcomp =
@ -262,10 +262,10 @@ lib_a_SOURCES = setjmp.S assert.c clearerr.c creat.c fclose.c feof.c \
ferror.c fflush.c fgetc.c fgetpos.c fgets.c fileno.c fiprintf.S \ ferror.c fflush.c fgetc.c fgetpos.c fgets.c fileno.c fiprintf.S \
fiscanf.S fopen.c fprintf.S fputc.c fputs.c fread.c freopen.c \ fiscanf.S fopen.c fprintf.S fputc.c fputs.c fread.c freopen.c \
fscanf.S fseek.c fsetpos.c ftell.c fwrite.c getc.c getchar.c \ fscanf.S fseek.c fsetpos.c ftell.c fwrite.c getc.c getchar.c \
gets.c iprintf.S iscanf.S memcmp.c memcpy.c memmove.c memset.c \ gets.c impure.c iprintf.S iscanf.S memcmp.c memcpy.c memmove.c \
perror.c printf.S putc.c putchar.c puts.c remove.c rename.c \ memset.c perror.c printf.S putc.c putchar.c puts.c remove.c \
rewind.c scanf.S setbuf.c setvbuf.c siprintf.S siscanf.S sleep.c \ rename.c rewind.c scanf.S setbuf.c setvbuf.c siprintf.S siscanf.S \
sniprintf.S snprintf.S sprintf.S sscanf.S stdio.c strcat.c \ sleep.c sniprintf.S snprintf.S sprintf.S sscanf.S stdio.c strcat.c \
strchr.c strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c \ strchr.c strcmp.c strcpy.c strcspn.c strlen.c strncat.c strncmp.c \
strncpy.c strpbrk.c strrchr.c strspn.c strxfrm.c tmpfile.c \ strncpy.c strpbrk.c strrchr.c strspn.c strxfrm.c tmpfile.c \
tmpnam.c ungetc.c usleep.c vfiprintf.c vfiscanf.c vfprintf.c \ tmpnam.c ungetc.c usleep.c vfiprintf.c vfiscanf.c vfprintf.c \
@ -574,6 +574,12 @@ lib_a-gets.o: gets.c
lib_a-gets.obj: gets.c lib_a-gets.obj: gets.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-gets.obj `if test -f 'gets.c'; then $(CYGPATH_W) 'gets.c'; else $(CYGPATH_W) '$(srcdir)/gets.c'; fi` $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-gets.obj `if test -f 'gets.c'; then $(CYGPATH_W) 'gets.c'; else $(CYGPATH_W) '$(srcdir)/gets.c'; fi`
lib_a-impure.o: impure.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-impure.o `test -f 'impure.c' || echo '$(srcdir)/'`impure.c
lib_a-impure.obj: impure.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-impure.obj `if test -f 'impure.c'; then $(CYGPATH_W) 'impure.c'; else $(CYGPATH_W) '$(srcdir)/impure.c'; fi`
lib_a-memcmp.o: memcmp.c lib_a-memcmp.o: memcmp.c
$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memcmp.o `test -f 'memcmp.c' || echo '$(srcdir)/'`memcmp.c $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(lib_a_CFLAGS) $(CFLAGS) -c -o lib_a-memcmp.o `test -f 'memcmp.c' || echo '$(srcdir)/'`memcmp.c

View File

@ -0,0 +1,14 @@
#include <reent.h>
/* Note that there is a copy of this in sys/reent.h. */
#ifndef __ATTRIBUTE_IMPURE_PTR__
#define __ATTRIBUTE_IMPURE_PTR__
#endif
#ifndef __ATTRIBUTE_IMPURE_DATA__
#define __ATTRIBUTE_IMPURE_DATA__
#endif
struct _reent __ATTRIBUTE_IMPURE_DATA__ _impure_data = _REENT_INIT(impure_data);
struct _reent *__ATTRIBUTE_IMPURE_PTR__ _impure_ptr = &_impure_data;
struct _reent *_CONST __ATTRIBUTE_IMPURE_PTR__ _global_impure_ptr = &_impure_data;

View File

@ -19,10 +19,6 @@
on which it is based, except values used or returned by syscalls must on which it is based, except values used or returned by syscalls must
be those of the Linux ppc. */ be those of the Linux ppc. */
/* errno is not a global variable, because that would make using it
non-reentrant. Instead, its address is returned by the function
__errno. */
#ifndef _SYS_ERRNO_H_ #ifndef _SYS_ERRNO_H_
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@ -31,10 +27,8 @@ extern "C" {
#include <sys/reent.h> #include <sys/reent.h>
#ifndef _REENT_ONLY extern struct _reent _reent_data;
#define errno (*__errno()) #define errno (_reent_data._errno)
extern int *__errno _PARAMS ((void));
#endif
/* Please don't use these variables directly. /* Please don't use these variables directly.
Use strerror instead. */ Use strerror instead. */