--- /dev/null
+#
+# For a description of the syntax of this configuration file,
+# see extra/config/Kconfig-language.txt
+#
+
+mainmenu "uClibc C Library Configuration"
+
+menu "Target Architecture Features and Options"
+
+config ARCH_CFLAGS
+ string
+
+config ARCH_LDFLAGS
+ string
+
+config LIBGCC_CFLAGS
+ string
+
+config HAVE_ELF
+ bool
+ default y
+
+config ARCH_HAS_NO_MMU
+ bool
+ default y
+
+config ARCH_HAS_NO_FPU
+ bool
+ default y
+
+config ARCH_HAS_C_SYMBOL_PREFIX
+ bool
+ default y
+
+config HAVE_NO_PIC
+ bool
+ default y
+
+config CROSS
+ string
+ default "mb-"
+
+source "extra/Configs/Config.in.arch"
+
+endmenu
+
+source "extra/Configs/Config.in"
+
+
--- /dev/null
+#
+# Automatically generated make config: don't edit
+#
+
+#
+# Target Architecture Features and Options
+#
+HAVE_ELF=y
+ARCH_HAS_NO_MMU=y
+ARCH_HAS_NO_FPU=y
+ARCH_HAS_C_SYMBOL_PREFIX=y
+HAVE_NO_PIC=y
+CROSS="mb-"
+UCLIBC_HAS_FLOATS=y
+UCLIBC_HAS_SOFT_FLOAT=y
+# DO_C99_MATH is not set
+WARNINGS="-Wall"
+KERNEL_SOURCE="/home/jwilliam/uClinux-dist/linux-2.4.x"
+UCLIBC_UCLINUX_BROKEN_MUNMAP=y
+EXCLUDE_BRK=y
+C_SYMBOL_PREFIX="_"
+
+#
+# General Library Settings
+#
+# UCLIBC_HAS_THREADS is not set
+UCLIBC_HAS_LFS=y
+MALLOC=y
+# MALLOC_930716 is not set
+HAS_SHADOW=y
+UCLIBC_HAS_REGEX=y
+UNIX98PTY_ONLY=y
+# ASSUME_DEVPTS is not set
+
+#
+# Networking Support
+#
+UCLIBC_HAS_IPV6=y
+UCLIBC_HAS_RPC=y
+UCLIBC_HAS_FULL_RPC=y
+
+#
+# String and Stdio Support
+#
+# UCLIBC_HAS_WCHAR is not set
+USE_OLD_VFPRINTF=y
+
+#
+# Library Installation Options
+#
+DEVEL_PREFIX="/usr/local/tools/microblaze-elf-gcc"
+SYSTEM_DEVEL_PREFIX="/usr/local"
+DEVEL_TOOL_PREFIX="$(DEVEL_PREFIX)"
+
+#
+# uClibc hacking options
+#
+DODEBUG=y
+# DOASSERTS is not set
--- /dev/null
+# Makefile for uClibc
+#
+# Copyright (C) 2001,2002 NEC Corporation
+# Copyright (C) 2001,2002 Miles Bader <miles@gnu.org>
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Library General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more
+# details.
+#
+# You should have received a copy of the GNU Library General Public License
+# along with this program; if not, write to the Free Software Foundation, Inc.,
+# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+TOPDIR=../../../../
+include $(TOPDIR)Rules.mak
+
+CFLAGS += -I..
+SFLAGS = $(CFLAGS) -D__ASSEMBLER -DASM_GLOBAL_DIRECTIVE=.globl
+
+TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine)
+
+CRT0_SRC = crt0.S
+CRT0_OBJ = crt0.o crt1.o
+
+SSRC = setjmp.S __longjmp.S vfork.S
+SOBJS = $(patsubst %.S,%.o, $(SSRC))
+
+CSRC = _mmap.c syscall.c clone.c
+COBJS = $(patsubst %.c,%.o, $(CSRC))
+
+OBJS = $(SOBJS) $(COBJS)
+
+
+all: $(OBJS) $(LIBC)
+
+$(LIBC): ar-target
+
+ar-target: $(OBJS) $(CRT0_OBJ)
+ $(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+ cp $(CRT0_OBJ) $(TOPDIR)lib/
+
+$(CRT0_OBJ): $(CRT0_SRC)
+ $(CC) $(CFLAGS) -DL_$* $< -c -o $*.o
+ $(STRIPTOOL) -x -R .note -R .comment $*.o
+
+$(SOBJS): %.o : %.S
+ $(CC) $(SFLAGS) -c $< -o $@
+ $(STRIPTOOL) -x -R .note -R .comment $*.o
+
+$(COBJS): %.o : %.c
+ $(CC) $(CFLAGS) -c $< -o $@
+ $(STRIPTOOL) -x -R .note -R .comment $*.o
+
+headers:
+
+clean:
+ rm -f *.[oa] *~ core
+ rm -f bits/sysnum.h
+
--- /dev/null
+/*
+ * libc/sysdeps/linux/microblaze/longjmp.S -- `longjmp' for microblaze
+ *
+ * Copyright (C) 2003 John Williams <jwilliams@itee.uq.edu.au>
+ * Copyright (C) 2001 NEC Corporation
+ * Copyright (C) 2001 Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License. See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+
+#include <clinkage.h>
+
+ .text
+C_ENTRY(__longjmp):
+ /* load registers from memory to r5 (arg0)*/
+ lwi r1, r5, 0
+ lwi r15, r5, 4
+ lwi r18, r5, 8
+ lwi r19, r5, 12
+ lwi r20, r5, 16
+ lwi r21, r5, 20
+ lwi r22, r5, 24
+ lwi r23, r5, 28
+ lwi r24, r5, 32
+ lwi r25, r5, 36
+ lwi r26, r5, 40
+ lwi r27, r5, 44
+ lwi r28, r5, 48
+ lwi r29, r5, 52
+ lwi r30, r5, 56
+
+ addi r3, r0, 1 // return val
+ rtsd r15, 8 // normal return
+ nop
+
+C_END(__longjmp)
+
+.weak C_SYMBOL_NAME(__sigprocmask)
+C_SYMBOL_NAME(__sigprocmask) = C_SYMBOL_NAME(sigprocmask)
--- /dev/null
+/* Use new style mmap for microblaze */
+
+#include <unistd.h>
+#include <errno.h>
+#include <sys/mman.h>
+#include <sys/syscall.h>
+
+_syscall6 (__ptr_t, mmap, __ptr_t, addr, size_t, len, int, prot,
+ int, flags, int, fd, __off_t, offset);
--- /dev/null
+/*
+ * libc/sysdeps/linux/microblaze/bits/byteswap.h -- Macros to swap the order
+ * of bytes in integer values
+ *
+ * Copyright (C) 2001 NEC Corporation
+ * Copyright (C) 2001 Miles Bader <miles@gnu.org>
+ * Copyright (C) 1997,1998,2001 Free Software Foundation, Inc.
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License. See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ */
+
+#if !defined _BYTESWAP_H && !defined _NETINET_IN_H
+# error "Never use <bits/byteswap.h> directly; include <byteswap.h> instead."
+#endif
+
+/* Swap bytes in 16 bit value. */
+#define __bswap_constant_16(x) \
+ ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
+
+# define __bswap_16(x) __bswap_constant_16 (x)
+
+/* Swap bytes in 32 bit value. */
+#define __bswap_constant_32(x) \
+ ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
+ (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
+
+# define __bswap_32(x) __bswap_constant_32 (x)
+
+#if defined __GNUC__ && __GNUC__ >= 2
+/* Swap bytes in 64 bit value. */
+# define __bswap_64(x) \
+ (__extension__ \
+ ({ union { unsigned long long int __ll; \
+ unsigned long int __l[2]; } __bswap_64_v, __bswap_64_r; \
+ __bswap_64_v.__ll = (x); \
+ __bswap_64_r.__l[0] = __bswap_32 (__bswap_64_v.__l[1]); \
+ __bswap_64_r.__l[1] = __bswap_32 (__bswap_64_v.__l[0]); \
+ __bswap_64_r.__ll; }))
+#endif
--- /dev/null
+/*
+ * libc/sysdeps/linux/microblaze/bits/endian.h -- Define processor endianess
+ *
+ * Copyright (C) 2003 John Williams <jwilliams@itee.uq.edu.au>
+ * Copyright (C) 2001 NEC Corporation
+ * Copyright (C) 2001 Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License. See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ * Microblaze port by John Williams
+ */
+
+#ifndef _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#define __BYTE_ORDER __BIG_ENDIAN
--- /dev/null
+/* O_*, F_*, FD_* bit values for Linux.
+ Copyright (C) 2000 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _FCNTL_H
+# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
+#endif
+
+
+#include <sys/types.h>
+
+/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
+ located on an ext2 file system */
+#define O_ACCMODE 0003
+#define O_RDONLY 00
+#define O_WRONLY 01
+#define O_RDWR 02
+#define O_CREAT 0100 /* not fcntl */
+#define O_EXCL 0200 /* not fcntl */
+#define O_NOCTTY 0400 /* not fcntl */
+#define O_TRUNC 01000 /* not fcntl */
+#define O_APPEND 02000
+#define O_NONBLOCK 04000
+#define O_NDELAY O_NONBLOCK
+#define O_SYNC 010000
+#define O_FSYNC O_SYNC
+#define O_ASYNC 020000
+
+#ifdef __USE_GNU
+# define O_DIRECTORY 040000 /* Must be a directory. */
+# define O_NOFOLLOW 0100000 /* Do not follow links. */
+# define O_DIRECT 0200000 /* Direct disk access. */
+# define O_STREAMING 04000000/* streaming access */
+#endif
+
+/* For now Linux has synchronisity options for data and read operations.
+ We define the symbols here but let them do the same as O_SYNC since
+ this is a superset. */
+#if defined __USE_POSIX199309 || defined __USE_UNIX98
+# define O_DSYNC O_SYNC /* Synchronize data. */
+# define O_RSYNC O_SYNC /* Synchronize read operations. */
+#endif
+
+#ifdef __USE_LARGEFILE64
+# define O_LARGEFILE 0400000
+#endif
+
+/* Values for the second argument to `fcntl'. */
+#define F_DUPFD 0 /* Duplicate file descriptor. */
+#define F_GETFD 1 /* Get file descriptor flags. */
+#define F_SETFD 2 /* Set file descriptor flags. */
+#define F_GETFL 3 /* Get file status flags. */
+#define F_SETFL 4 /* Set file status flags. */
+#ifndef __USE_FILE_OFFSET64
+# define F_GETLK 5 /* Get record locking info. */
+# define F_SETLK 6 /* Set record locking info (non-blocking). */
+# define F_SETLKW 7 /* Set record locking info (blocking). */
+#else
+# define F_GETLK F_GETLK64 /* Get record locking info. */
+# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/
+# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */
+#endif
+#define F_GETLK64 12 /* Get record locking info. */
+#define F_SETLK64 13 /* Set record locking info (non-blocking). */
+#define F_SETLKW64 14 /* Set record locking info (blocking). */
+
+#if defined __USE_BSD || defined __USE_XOPEN2K
+# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */
+# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */
+#endif
+
+#ifdef __USE_GNU
+# define F_SETSIG 10 /* Set number of signal to be sent. */
+# define F_GETSIG 11 /* Get number of signal to be sent. */
+#endif
+
+#ifdef __USE_GNU
+# define F_SETLEASE 1024 /* Set a lease. */
+# define F_GETLEASE 1025 /* Enquire what lease is active. */
+# define F_NOTIFY 1026 /* Request notfications on a directory. */
+#endif
+
+/* For F_[GET|SET]FL. */
+#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
+
+/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
+#define F_RDLCK 0 /* Read lock. */
+#define F_WRLCK 1 /* Write lock. */
+#define F_UNLCK 2 /* Remove lock. */
+
+/* For old implementation of bsd flock(). */
+#define F_EXLCK 4 /* or 3 */
+#define F_SHLCK 8 /* or 4 */
+
+#ifdef __USE_BSD
+/* Operations for bsd flock(), also used by the kernel implementation. */
+# define LOCK_SH 1 /* shared lock */
+# define LOCK_EX 2 /* exclusive lock */
+# define LOCK_NB 4 /* or'd with one of the above to prevent
+ blocking */
+# define LOCK_UN 8 /* remove lock */
+#endif
+
+#ifdef __USE_GNU
+# define LOCK_MAND 32 /* This is a mandatory flock: */
+# define LOCK_READ 64 /* ... which allows concurrent read operations. */
+# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */
+# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */
+#endif
+
+#ifdef __USE_GNU
+/* Types of directory notifications that may be requested with F_NOTIFY. */
+# define DN_ACCESS 0x00000001 /* File accessed. */
+# define DN_MODIFY 0x00000002 /* File modified. */
+# define DN_CREATE 0x00000004 /* File created. */
+# define DN_DELETE 0x00000008 /* File removed. */
+# define DN_RENAME 0x00000010 /* File renamed. */
+# define DN_ATTRIB 0x00000020 /* File changed attibutes. */
+# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */
+#endif
+
+struct flock
+ {
+ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
+ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
+#ifndef __USE_FILE_OFFSET64
+ __off_t l_start; /* Offset where the lock begins. */
+ __off_t l_len; /* Size of the locked area; zero means until EOF. */
+#else
+ __off64_t l_start; /* Offset where the lock begins. */
+ __off64_t l_len; /* Size of the locked area; zero means until EOF. */
+#endif
+ __pid_t l_pid; /* Process holding the lock. */
+ };
+
+#ifdef __USE_LARGEFILE64
+struct flock64
+ {
+ short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
+ short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
+ __off64_t l_start; /* Offset where the lock begins. */
+ __off64_t l_len; /* Size of the locked area; zero means until EOF. */
+ __pid_t l_pid; /* Process holding the lock. */
+ };
+#endif
+
+/* Define some more compatibility macros to be backward compatible with
+ BSD systems which did not managed to hide these kernel macros. */
+#ifdef __USE_BSD
+# define FAPPEND O_APPEND
+# define FFSYNC O_FSYNC
+# define FASYNC O_ASYNC
+# define FNONBLOCK O_NONBLOCK
+# define FNDELAY O_NDELAY
+#endif /* Use BSD. */
+
+/* Advise to `posix_fadvise'. */
+#ifdef __USE_XOPEN2K
+# define POSIX_FADV_NORMAL 0 /* No further special treatment. */
+# define POSIX_FADV_RANDOM 1 /* Expect random page references. */
+# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */
+# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
+# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
+#endif
--- /dev/null
+/* Stat structure for linux/microblaze*/
+
+#ifndef _BITS_STAT_STRUCT_H
+#define _BITS_STAT_STRUCT_H
+
+struct kernel_stat
+{
+ __kernel_dev_t st_dev;
+ __kernel_ino_t st_ino;
+ __kernel_mode_t st_mode;
+ __kernel_nlink_t st_nlink;
+ __kernel_uid_t st_uid;
+ __kernel_gid_t st_gid;
+ __kernel_dev_t st_rdev;
+ __kernel_off_t st_size;
+ unsigned long st_blksize;
+ unsigned long st_blocks;
+ unsigned long st_atime;
+ unsigned long __unused1;
+ unsigned long st_mtime;
+ unsigned long __unused2;
+ unsigned long st_ctime;
+ unsigned long __unused3;
+ unsigned long __unused4;
+ unsigned long __unused5;
+};
+
+struct kernel_stat64
+{
+ __kernel_dev_t st_dev;
+ unsigned long __unused0;
+ unsigned long __unused1;
+
+ __kernel_ino64_t st_ino;
+
+ __kernel_mode_t st_mode;
+ __kernel_nlink_t st_nlink;
+
+ __kernel_uid_t st_uid;
+ __kernel_gid_t st_gid;
+
+ __kernel_dev_t st_rdev;
+ unsigned long __unused2;
+ unsigned long __unused3;
+
+ __kernel_loff_t st_size;
+ unsigned long st_blksize;
+
+ unsigned long __unused4; /* future possible st_blocks high bits */
+ unsigned long st_blocks; /* Number 512-byte blocks allocated. */
+
+ unsigned long st_atime;
+ unsigned long __unused5;
+
+ unsigned long st_mtime;
+ unsigned long __unused6;
+
+ unsigned long st_ctime;
+ unsigned long __unused7; /* high 32 bits of ctime someday */
+};
+
+#endif /* _BITS_STAT_STRUCT_H */
--- /dev/null
+/*
+ * sysdeps/linux/microblaze/bits/kernel_types.h -- Kernel versions of standard types
+ *
+ * Copyright (C) 2003 John Williams <jwilliams@itee.uq.edu.au>
+ * Copyright (C) 2001,2002 NEC Corporation
+ * Copyright (C) 2001,2002 Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License. See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ * Microblaze port by John Williams
+ */
+
+#ifndef __MICROBLAZE_POSIX_TYPES_H__
+#define __MICROBLAZE_POSIX_TYPES_H__
+
+typedef unsigned int __kernel_dev_t;
+typedef unsigned long __kernel_ino_t;
+typedef unsigned long long __kernel_ino64_t;
+typedef unsigned int __kernel_mode_t;
+typedef unsigned int __kernel_nlink_t;
+typedef long __kernel_off_t;
+typedef long long __kernel_loff_t;
+typedef int __kernel_pid_t;
+typedef unsigned short __kernel_ipc_pid_t;
+typedef unsigned int __kernel_uid_t;
+typedef unsigned int __kernel_gid_t;
+typedef unsigned int __kernel_size_t;
+typedef int __kernel_ssize_t;
+typedef int __kernel_ptrdiff_t;
+typedef long __kernel_time_t;
+typedef long __kernel_suseconds_t;
+typedef long __kernel_clock_t;
+typedef int __kernel_daddr_t;
+typedef char * __kernel_caddr_t;
+typedef unsigned short __kernel_uid16_t;
+typedef unsigned short __kernel_gid16_t;
+typedef unsigned int __kernel_uid32_t;
+typedef unsigned int __kernel_gid32_t;
+
+typedef unsigned short __kernel_old_uid_t;
+typedef unsigned short __kernel_old_gid_t;
+
+typedef struct {
+#ifdef __USE_ALL
+ int val[2];
+#else
+ int __val[2];
+#endif
+} __kernel_fsid_t;
+
+#endif /* __MICROBLAZE_POSIX_TYPES_H__ */
--- /dev/null
+/* Definitions for POSIX memory map interface. Linux/microblaze version.
+ Copyright (C) 1997, 1999, 2001, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+/* These are the bits used by 4.4 BSD and its derivatives. On systems
+ (such as GNU) where these facilities are not system services but can be
+ emulated in the C library, these are the definitions we emulate. */
+
+#ifndef _SYS_MMAN_H
+# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
+#endif
+
+/* The following definitions basically come from the kernel headers.
+ But the kernel header is not namespace clean. */
+
+
+/* Protections are chosen from these bits, OR'd together. The
+ implementation does not necessarily support PROT_EXEC or PROT_WRITE
+ without PROT_READ. The only guarantees are that no writing will be
+ allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
+
+#define PROT_READ 0x1 /* Page can be read. */
+#define PROT_WRITE 0x2 /* Page can be written. */
+#define PROT_EXEC 0x4 /* Page can be executed. */
+#define PROT_NONE 0x0 /* Page can not be accessed. */
+
+/* Sharing types (must choose one and only one of these). */
+#define MAP_SHARED 0x01 /* Share changes. */
+#define MAP_PRIVATE 0x02 /* Changes are private. */
+#ifdef __USE_MISC
+# define MAP_TYPE 0x0f /* Mask for type of mapping. */
+#endif
+
+/* Other flags. */
+#define MAP_FIXED 0x10 /* Interpret addr exactly. */
+#ifdef __USE_MISC
+# define MAP_FILE 0
+# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
+# define MAP_ANON MAP_ANONYMOUS
+#endif
+
+/* These are Linux-specific. */
+#ifdef __USE_MISC
+# define MAP_GROWSDOWN 0x0100 /* Stack-like segment. */
+# define MAP_DENYWRITE 0x0800 /* ETXTBSY */
+# define MAP_EXECUTABLE 0x1000 /* Mark it as an executable. */
+# define MAP_LOCKED 0x2000 /* Lock the mapping. */
+# define MAP_NORESERVE 0x4000 /* Don't check for reservations. */
+#endif
+
+/* Flags to `msync'. */
+#define MS_ASYNC 1 /* Sync memory asynchronously. */
+#define MS_SYNC 4 /* Synchronous memory sync. */
+#define MS_INVALIDATE 2 /* Invalidate the caches. */
+
+/* Advice to `madvise'. */
+#ifdef __USE_BSD
+# define MADV_NORMAL 0 /* No further special treatment. */
+# define MADV_RANDOM 1 /* Expect random page references. */
+# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define MADV_WILLNEED 3 /* Will need these pages. */
+# define MADV_DONTNEED 4 /* Don't need these pages. */
+#endif
+
+/* The POSIX people had to invent similar names for the same things. */
+#ifdef __USE_XOPEN2K
+# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
+# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
+# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
+# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
+# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
+#endif
+
+
+/* Flags for `mlockall' (can be OR'd together). */
+#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
+#define MCL_FUTURE 2 /* Lock all additions to address
+ space. */
+
+/* Flags for `mremap'. */
+#ifdef __USE_GNU
+# define MREMAP_MAYMOVE 1
+#endif
--- /dev/null
+/* Copyright (C) 1997, 2001 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_POLL_H
+# error "Never use <bits/poll.h> directly; include <sys/poll.h> instead."
+#endif
+
+/* Event types that can be polled for. These bits may be set in `events'
+ to indicate the interesting event types; they will appear in `revents'
+ to indicate the status of the file descriptor. */
+#define POLLIN 0x001 /* There is data to read. */
+#define POLLPRI 0x002 /* There is urgent data to read. */
+#define POLLOUT 0x004 /* Writing now will not block. */
+
+#ifdef __USE_XOPEN
+/* These values are defined in XPG4.2. */
+# define POLLRDNORM 0x040 /* Normal data may be read. */
+# define POLLRDBAND 0x080 /* Priority data may be read. */
+# define POLLWRNORM POLLOUT /* Writing now will not block. */
+# define POLLWRBAND 0x100 /* Priority data may be written. */
+#endif
+
+/* Event types always implicitly polled for. These bits need not be set in
+ `events', but they will appear in `revents' to indicate the status of
+ the file descriptor. */
+#define POLLERR 0x008 /* Error condition. */
+#define POLLHUP 0x010 /* Hung up. */
+#define POLLNVAL 0x020 /* Invalid polling request. */
--- /dev/null
+/*
+ * include/bits/select.h -- fd_set operations
+ *
+ * Copyright (C) 2003 John Williams <jwilliams@itee.uq.edu.au>
+ * Copyright (C) 2001 NEC Corporation
+ * Copyright (C) 2001 Miles Bader <miles@gnu.org>
+ * Copyright (C) 1997, 1998 Free Software Foundation, Inc.
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License. See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ */
+
+#ifndef _SYS_SELECT_H
+# error "Never use <bits/select.h> directly; include <sys/select.h> instead."
+#endif
+
+#ifdef __GNUC__
+
+/* We don't use `memset' because this would require a prototype and
+ the array isn't too big. */
+#define __FD_ZERO(s) \
+ do { \
+ unsigned int __i; \
+ fd_set *__arr = (s); \
+ for (__i = 0; __i < sizeof (fd_set) / sizeof (__fd_mask); ++__i) \
+ __FDS_BITS (__arr)[__i] = 0; \
+ } while (0)
+
+#define __FD_SET(fd, s) \
+ do { \
+ int __fd = (fd); \
+ unsigned int *__addr = (unsigned int *)&__FDS_BITS (s); \
+ *__addr |= (1 << __fd); \
+ } while (0)
+
+#define __FD_CLR(fd, s) \
+ do { \
+ int __fd = (fd); \
+ unsigned int *__addr = (unsigned int *)&__FDS_BITS (s); \
+ *__addr &= ~(1 << __fd); \
+ } while (0)
+
+#define __FD_ISSET(fd, s) \
+ ({ \
+ int __fd = (fd); \
+ unsigned int *__addr = (unsigned int *)&__FDS_BITS (s); \
+ int res; \
+ res = (*__addr & (1 << fd)) ? 1 : 0; \
+ })
+
+#else /* !__GNUC__ */
+
+#define __FD_SET(d, s) (__FDS_BITS (s)[__FDELT(d)] |= __FDMASK(d))
+#define __FD_CLR(d, s) (__FDS_BITS (s)[__FDELT(d)] &= ~__FDMASK(d))
+#define __FD_ISSET(d, s) ((__FDS_BITS (s)[__FDELT(d)] & __FDMASK(d)) != 0)
+
+#endif /* __GNUC__ */
--- /dev/null
+/*
+ * libc/sysdeps/linux/microblaze/bits/setjmp.h -- microblaze version of `jmp_buf' type
+ *
+ * Copyright (C) 2003 John Williams <jwilliams@itee.uq.edu.au>
+ * Copyright (C) 2001 NEC Corporation
+ * Copyright (C) 2001 Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License. See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#ifndef _SETJMP_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
+
+#ifndef _ASM
+typedef struct
+ {
+ /* Stack pointer. */
+ void *__sp;
+
+ /* Link pointer. */
+ void *__lp;
+
+ /* Callee-saved registers r18-r30. */
+ int __regs[13];
+ } __jmp_buf[1];
+#endif
+
+#define JB_SIZE (4 * 15)
+
+/* Test if longjmp to JMPBUF would unwind the frame
+ containing a local variable at ADDRESS. */
+#define _JMPBUF_UNWINDS(jmpbuf, address) \
+ ((__ptr_t) (address) < &(jmpbuf)[0].__sp)
--- /dev/null
+#ifndef _BITS_SYSCALLS_H
+#define _BITS_SYSCALLS_H
+#ifndef _SYSCALL_H
+# error "Never use <bits/syscalls.h> directly; include <sys/syscall.h> instead."
+#endif
+
+#include <features.h>
+
+/* Do something very evil for now. Until we create our own syscall
+ * macros, short circuit bits/sysnum.h and use asm/unistd.h instead */
+#include <asm/unistd.h>
+
+/* This includes the `__NR_<name>' syscall numbers taken from the Linux kernel
+ * header files. It also defines the traditional `SYS_<name>' macros for older
+ * programs. */
+#include <bits/sysnum.h>
+
+#endif /* _BITS_SYSCALLS_H */
+
--- /dev/null
+/* Copyright (C) 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#define __WORDSIZE 32
--- /dev/null
+/*
+ * libc/sysdeps/linux/microblaze/clinkage.h -- Macros for C symbols in assembler
+ *
+ * Copyright (C) 2003 John Williams <jwilliams@itee.uq.edu.au>
+ * Copyright (C) 2001 NEC Corporation
+ * Copyright (C) 2001 Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License. See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#include <asm/clinkage.h>
--- /dev/null
+/*
+ * libc/sysdeps/linux/microblaze/clone.c -- `clone' syscall for linux/microblaze
+ *
+ * Copyright (C) 2003 John Williams <jwilliams@itee.uq.edu.au>
+ * Copyright (C) 2002,03 NEC Electronics Corporation
+ * Copyright (C) 2002,03 Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License. See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ * Microblaze port by John Williams
+ */
+
+#include <errno.h>
+#include <sys/syscall.h>
+
+int
+clone (int (*fn)(void *arg), void *child_stack, int flags, void *arg)
+{
+ register unsigned long rval asm (SYSCALL_RET) = -EINVAL;
+
+ if (fn && child_stack)
+ {
+ register unsigned long syscall asm (SYSCALL_NUM);
+ register unsigned long arg0 asm (SYSCALL_ARG0);
+ register unsigned long arg1 asm (SYSCALL_ARG1);
+
+ /* Clone this thread. */
+ arg0 = flags;
+ arg1 = (unsigned long)child_stack;
+ syscall = __NR_clone;
+ asm volatile ("bralid r17, trap;nop;"
+ : "=r" (rval), "=r" (syscall)
+ : "1" (syscall), "r" (arg0), "r" (arg1)
+ : SYSCALL_CLOBBERS);
+
+ if (rval == 0)
+ /* In child thread, call FN and exit. */
+ {
+ arg0 = (*fn) (arg);
+ syscall = __NR_exit;
+ asm volatile ("bralid r17, trap;nop;"
+ : "=r" (rval), "=r" (syscall)
+ : "1" (syscall), "r" (arg0)
+ : SYSCALL_CLOBBERS);
+ }
+ }
+
+ __syscall_return (int, rval);
+}
--- /dev/null
+/*
+ * libc/sysdeps/linux/microblaze/crt0.S -- Initial program entry point for linux/microblaze
+ *
+ * Copyright (C) 2003 John Williams <jwilliams@itee.uq.edu.au>
+ * Copyright (C) 2001,2002 NEC Corporation
+ * Copyright (C) 2001,2002 Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License. See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#include <clinkage.h>
+
+/* Upon entry, the stack contains the following data:
+ argc, argv[0], ..., argv[argc-1], 0, envp[0], ..., 0
+*/
+
+ .text
+C_ENTRY(_start):
+ lw r5, r0, r1 // Arg 0: argc
+
+ addi r6, r1, 4 // Arg 1: argv
+
+ // Arg 2: envp
+ addi r3, r5, 1 // skip argc elements to get envp start
+ // ...plus the NULL at the end of argv
+ add r3, r3, r3 // Make word offset
+ add r3, r3, r3
+ add r7, r6, r3 // add to argv to get offset
+
+ // Load SDAs
+ la r2, r0, C_SYMBOL_NAME(_SDA_BASE_)
+ la r13, r0, C_SYMBOL_NAME(_SDA2_BASE_)
+
+ // tail-call uclibc's startup routine
+ brid C_SYMBOL_NAME(__uClibc_main)
+ nop
+
+
+/* Stick in a dummy reference to `main', so that if an application
+ is linking when the `main' function is in a static library (.a)
+ we can be sure that `main' actually gets linked in. */
+L_dummy_main_reference:
+ .long C_SYMBOL_NAME(main)
--- /dev/null
+/*
+ * libc/sysdeps/linux/microblaze/longjmp.S -- `longjmp' for microblaze
+ *
+ * Copyright (C) 2003 John Williams <jwilliams@itee.uq.edu.au>
+ * Copyright (C) 2001 NEC Corporation
+ * Copyright (C) 2001 Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License. See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+
+#include <clinkage.h>
+
+ .text
+C_ENTRY(__longjmp):
+ /* load registers from memory to r5 (arg0)*/
+ lwi r1, r5, 0
+ lwi r15, r5, 4
+ lwi r18, r5, 8
+ lwi r19, r5, 12
+ lwi r20, r5, 16
+ lwi r21, r5, 20
+ lwi r22, r5, 24
+ lwi r23, r5, 28
+ lwi r24, r5, 32
+ lwi r25, r5, 36
+ lwi r26, r5, 40
+ lwi r27, r5, 44
+ lwi r28, r5, 48
+ lwi r29, r5, 52
+ lwi r30, r5, 56
+
+ addi r3, r0, 1 // return val
+ rtsd r15, 8 // normal return
+ nop
+
+C_END(__longjmp)
+
+.weak C_SYMBOL_NAME(longjmp)
+C_SYMBOL_NAME(longjmp) = C_SYMBOL_NAME(__longjmp)
+
+.weak C_SYMBOL_NAME(siglongjmp)
+C_SYMBOL_NAME(siglongjmp) = C_SYMBOL_NAME(__longjmp)
+
+.weak C_SYMBOL_NAME(__sigprocmask)
+C_SYMBOL_NAME(__sigprocmask) = C_SYMBOL_NAME(sigprocmask)
--- /dev/null
+/*
+ * libc/sysdeps/linux/microblaze/setjmp.S -- `setjmp' for microblaze
+ *
+ * Copyright (C) 2003 John Williams <jwilliams@itee.uq.edu.au>
+ * Copyright (C) 2001,2002 NEC Corporation
+ * Copyright (C) 2001,2002 Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License. See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+
+#include <clinkage.h>
+
+ .text
+C_ENTRY(setjmp):
+ addi r6, r0, 1 /* Save the signal mask. */
+ braid C_SYMBOL_NAME(__sigsetjmp)
+ nop
+
+ .globl C_SYMBOL_NAME(_setjmp)
+C_SYMBOL_NAME(_setjmp):
+ add r6, r0, r0 /* Don't save the signal mask. */
+
+ .globl C_SYMBOL_NAME(__sigsetjmp)
+C_SYMBOL_NAME(__sigsetjmp):
+ /* Save registers relative to r5 (arg0)*/
+ swi r1, r5, 0 /* stack pointer */
+ swi r15, r5, 4 /* link register */
+ swi r18, r5, 8 /* assembler temp */
+ swi r19, r5, 12 /* now call-preserved regs */
+ swi r20, r5, 16
+ swi r21, r5, 20
+ swi r22, r5, 24
+ swi r23, r5, 28
+ swi r24, r5, 32
+ swi r25, r5, 36
+ swi r26, r5, 40
+ swi r27, r5, 44
+ swi r28, r5, 48
+ swi r29, r5, 52
+ swi r30, r5, 56
+
+ /* Make a tail call to __sigjmp_save; it takes the same args. */
+ braid C_SYMBOL_NAME(__sigjmp_save)
+ nop
+C_END(setjmp)
--- /dev/null
+/* `ptrace' debugger support interface. Linux/microblaze version.
+ Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_PTRACE_H
+#define _SYS_PTRACE_H 1
+
+#include <features.h>
+
+__BEGIN_DECLS
+
+/* Type of the REQUEST argument to `ptrace.' */
+enum __ptrace_request
+{
+ /* Indicate that the process making this request should be traced.
+ All signals received by this process can be intercepted by its
+ parent, and its parent can use the other `ptrace' requests. */
+ PTRACE_TRACEME = 0,
+#define PT_TRACE_ME PTRACE_TRACEME
+
+ /* Return the word in the process's text space at address ADDR. */
+ PTRACE_PEEKTEXT = 1,
+#define PT_READ_I PTRACE_PEEKTEXT
+
+ /* Return the word in the process's data space at address ADDR. */
+ PTRACE_PEEKDATA = 2,
+#define PT_READ_D PTRACE_PEEKDATA
+
+ /* Return the word in the process's user area at offset ADDR. */
+ PTRACE_PEEKUSER = 3,
+#define PT_READ_U PTRACE_PEEKUSER
+
+ /* Write the word DATA into the process's text space at address ADDR. */
+ PTRACE_POKETEXT = 4,
+#define PT_WRITE_I PTRACE_POKETEXT
+
+ /* Write the word DATA into the process's data space at address ADDR. */
+ PTRACE_POKEDATA = 5,
+#define PT_WRITE_D PTRACE_POKEDATA
+
+ /* Write the word DATA into the process's user area at offset ADDR. */
+ PTRACE_POKEUSER = 6,
+#define PT_WRITE_U PTRACE_POKEUSER
+
+ /* Continue the process. */
+ PTRACE_CONT = 7,
+#define PT_CONTINUE PTRACE_CONT
+
+ /* Kill the process. */
+ PTRACE_KILL = 8,
+#define PT_KILL PTRACE_KILL
+
+ /* Attach to a process that is already running. */
+ PTRACE_ATTACH = 0x10,
+#define PT_ATTACH PTRACE_ATTACH
+
+ /* Detach from a process attached to with PTRACE_ATTACH. */
+ PTRACE_DETACH = 0x11,
+#define PT_DETACH PTRACE_DETACH
+
+ /* Continue and stop at the next (return from) syscall. */
+ PTRACE_SYSCALL = 24
+#define PT_SYSCALL PTRACE_SYSCALL
+};
+
+/* Perform process tracing functions. REQUEST is one of the values
+ above, and determines the action to be taken.
+ For all requests except PTRACE_TRACEME, PID specifies the process to be
+ traced.
+
+ PID and the other arguments described above for the various requests should
+ appear (those that are used for the particular request) as:
+ pid_t PID, void *ADDR, int DATA, void *ADDR2
+ after REQUEST. */
+extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
+
+__END_DECLS
+
+#endif /* _SYS_PTRACE_H */
--- /dev/null
+/* Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_UCONTEXT_H
+#define _SYS_UCONTEXT_H 1
+
+#include <features.h>
+#include <signal.h>
+
+/* We need the signal context definitions even if they are not used
+ included in <signal.h>. */
+#include <bits/sigcontext.h>
+
+typedef struct sigcontext mcontext_t;
+
+/* Userlevel context. */
+typedef struct ucontext
+ {
+ unsigned long int uc_flags;
+ struct ucontext *uc_link;
+ stack_t uc_stack;
+ mcontext_t uc_mcontext;
+ __sigset_t uc_sigmask;
+ } ucontext_t;
+
+#endif /* sys/ucontext.h */
--- /dev/null
+/*
+ * libc/sysdeps/linux/microblaze/syscall.c -- generic syscall function for linux/microblaze
+ *
+ * Copyright (C) 2003 John Williams <jwilliams@itee.uq.edu.au>
+ * Copyright (C) 2002 NEC Corporation
+ * Copyright (C) 2002 Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License. See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ */
+
+#include <errno.h>
+#include <sys/syscall.h>
+
+typedef unsigned long arg_t;
+
+/* Invoke `system call' NUM, passing it the remaining arguments.
+ This is completely system-dependent, and not often useful. */
+long
+syscall (long num, arg_t a1, arg_t a2, arg_t a3, arg_t a4, arg_t a5, arg_t a6)
+{
+ /* We don't know how many arguments are valid, so A5 and A6 are fetched
+ off the stack even for (the majority of) system calls with fewer
+ arguments; hopefully this won't cause any problems. A1-A4 are in
+ registers, so they're OK. */
+ register arg_t a asm (SYSCALL_ARG0) = a1;
+ register arg_t b asm (SYSCALL_ARG1) = a2;
+ register arg_t c asm (SYSCALL_ARG2) = a3;
+ register arg_t d asm (SYSCALL_ARG3) = a4;
+ register arg_t e asm (SYSCALL_ARG4) = a5;
+ register arg_t f asm (SYSCALL_ARG5) = a6;
+ register unsigned long syscall asm (SYSCALL_NUM) = num;
+ register unsigned long ret asm (SYSCALL_RET);
+ unsigned long ret_sav;
+
+ *((unsigned long *)0xFFFF4004) = (unsigned int)('+');
+ asm ("brlid r17, 08x; nop;"
+ : "=r" (ret)
+ : "r" (syscall), "r" (a), "r" (b), "r" (c), "r" (d), "r" (e), "r" (f)
+ : SYSCALL_CLOBBERS);
+
+ ret_sav=ret;
+ *((unsigned long *)0xFFFF4004) = (unsigned int)('-');
+
+
+
+ __syscall_return (long, ret);
+}
--- /dev/null
+/*
+ * libc/sysdeps/linux/microblaze/vfork.S -- `vfork' syscall for linux/microblaze
+ *
+ * Copyright (C) 2003 John Williams <jwilliams@itee.uq.edu.au>
+ * Copyright (C) 2001 NEC Corporation
+ * Copyright (C) 2001 Miles Bader <miles@gnu.org>
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License. See the file COPYING.LIB in the main
+ * directory of this archive for more details.
+ *
+ * Written by Miles Bader <miles@gnu.org>
+ * Microblaze port by John Williams
+ */
+
+#define _ERRNO_H 1
+#include <bits/errno.h>
+#define _SYSCALL_H
+#include <bits/sysnum.h>
+
+#include <clinkage.h>
+
+/* Clone the calling process, but without copying the whole address space.
+ The calling process is suspended until the new process exits or is
+ replaced by a call to `execve'. Return -1 for errors, 0 to the new process,
+ and the process ID of the new process to the old process. */
+
+.global C_SYMBOL_NAME(errno)
+
+C_ENTRY (__vfork):
+ addi r12, r0, SYS_vfork
+ bralid r17, 0x08;
+ nop
+ addi r4, r3, 125 // minimum err value
+ blti r4, 1f // is r3 < -125?
+ rtsd r15, 8 // normal return
+ nop
+1: sub r3, r3, r0 // r3 = -r3
+ swi r3, r0, C_SYMBOL_NAME(errno);
+ rtsd r15, 8 // error return
+ nop
+C_END(__vfork)
+
+.weak C_SYMBOL_NAME(vfork)
+C_SYMBOL_NAME(vfork) = C_SYMBOL_NAME(__vfork)