sleep.o usleep.o raise.o abort.o assert.o alarm.o pause.o \
__signal.o signal.o bsd_signal.o siglist.o siglongjmp.o \
sigaction.o sigpending.o sigprocmask.o sigsuspend.o \
- brk.o sbrk.o malloc.o realloc.o calloc.o mmap.o \
+ brk.o sbrk.o malloc.o realloc.o calloc.o mmap.o getpagesize.o \
memcpy.o memcmp.o memset.o memccpy.o memmem.o memswap.o \
memmove.o \
strcasecmp.o strncasecmp.o strndup.o strerror.o \
touch $@
%/static.obj: %.dir
- $(MAKE) objects-$(basename $(notdir $@)) DIR=$*
+ $(MAKE) objects-$(basename $(notdir $@)) DIR=$*/
-STATIC = $(addsuffix .o,$(basename $(wildcard $(DIR)/*.[cS])))
+STATIC = $(addsuffix .o,$(basename $(wildcard $(DIR)*.[cS])))
objects-static: $(STATIC)
- touch $(DIR)/static.obj
+ touch $(DIR)static.obj
clean: archclean
find . -type f -a \( -name \*.[isoa] -o -name \*.l[iso] \) -print0 | xargs -0rt rm -f
bitsize:
@echo $(BITSIZE)
-ifneq ($(wildcard $(DIR)/.*.d),)
-include $(wildcard $(DIR)/.*.d)
+ifneq ($(wildcard $(DIR).*.d),)
+include $(wildcard $(DIR).*.d)
endif
__asm__ __volatile__ \
("sc \n\t" \
"mfcr %1 " \
- : "=&r" (__sc_3), "=&r" (__sc_0) \
- : "0" (__sc_3), "1" (__sc_0), \
- "r" (__sc_4), \
- "r" (__sc_5), \
- "r" (__sc_6), \
- "r" (__sc_7), \
- "r" (__sc_8) \
- : __syscall_clobbers); \
+ : "+r" (__sc_3), \
+ "+r" (__sc_0), \
+ "+r" (__sc_4), \
+ "+r" (__sc_5), \
+ "+r" (__sc_6), \
+ "+r" (__sc_7), \
+ "+r" (__sc_8) \
+ : : "cr0", "ctr", "memory", \
+ "r9", "r10", "r11", "r12"); \
__sc_ret = __sc_3; \
__sc_err = __sc_0; \
} \
- __syscall_return (type); \
+ if (__sc_err & 0x10000000) \
+ { \
+ errno = (int)__sc_ret; \
+ __sc_ret = -1; \
+ } \
+ return (type)__sc_ret; \
}
#endif /* _syscall6() missing */
--- /dev/null
+/*
+ * getpagesize.c
+ */
+
+#include <sys/syscall.h>
+#include <asm/page.h>
+
+/* Presumably there is a better way to do this... */
+#ifdef __ia64__
+# define __NR_getpagesize 1171
+#endif
+
+#ifdef __NR_getpagesize
+
+_syscall0(int,getpagesize);
+
+#else
+
+int getpagesize(void)
+{
+ return PAGE_SIZE;
+}
+
+#endif
+
+
struct _IO_file;
typedef struct _IO_file FILE;
-#define stdin ((FILE *)0)
-#define stdout ((FILE *)1)
-#define stderr ((FILE *)2)
-
#ifndef EOF
# define EOF (-1)
#endif
return (int)(size_t)__f - 1;
}
-static __inline__ FILE * __create_file(int __fd)
-{
- return (FILE *)(size_t)(__fd + 1);
-}
+/* This is a macro so it can be used as initializer */
+#define __create_file(__fd) ((FILE *)(size_t)((__fd) + 1))
+
+#define stdin __create_file(0)
+#define stdout __create_file(1)
+#define stderr __create_file(2)
__extern FILE *fopen(const char *, const char *);
__extern int isatty(int);
+__extern int getpagesize(void);
+
/* Standard file descriptor numbers. */
#define STDIN_FILENO 0
#define STDOUT_FILENO 1
* Prefer mmap2() over mmap(), except on the architectures listed
*/
-#if defined(__NR_mmap2) && !defined(__sparc__) && !defined(__ia64__) && !defined(__powerpc64__)
+#if defined(__NR_mmap2) && !defined(__sparc__) && !defined(__ia64__) && !defined(__powerpc__) && !defined(__powerpc64__)
/* This architecture uses mmap2() */
#include <unistd.h>
#ifdef __i386__
-#include <sys/vm86.h>
+# include <sys/vm86.h>
#endif