CPU_CFLAGS-$(CONFIG_SH2)+="-m2"
CPU_CFLAGS-$(CONFIG_SH3)+="-m3"
CPU_CFLAGS-$(CONFIG_SH4)+="-m4"
- CPU_CFLAGS-$(CONFIG_SH5)+="-m5"
+endif
+
+ifeq ($(strip $(TARGET_ARCH)),sh64)
+ OPTIMIZATION+=-fstrict-aliasing
+ CPU_LDFLAGS-$(ARCH_LITTLE_ENDIAN):="-EL"
+ CPU_LDFLAGS-$(ARCH_BIG_ENDIAN):="-EB"
+ CPU_CFLAGS-$(ARCH_LITTLE_ENDIAN):="-ml"
+ CPU_CFLAGS-$(ARCH_BIG_ENDIAN):="-mb"
+ CPU_CFLAGS-$(CONFIG_SH5)+="-m5-32media"
endif
ifeq ($(strip $(TARGET_ARCH)),h8300)
- "SH2" Hitachi SH2
- "SH3" Hitachi SH3
- "SH4" Hitachi SH4
- - "SH5" Hitachi SH5
config CONFIG_SH2
bool "SH2"
config CONFIG_SH4
bool "SH4"
-config CONFIG_SH5
- bool "SH5"
-
endchoice
choice
# CONFIG_SH2 is not set
# CONFIG_SH3 is not set
CONFIG_SH4=y
-# CONFIG_SH5 is not set
ARCH_LITTLE_ENDIAN=y
# ARCH_BIG_ENDIAN is not set
UCLIBC_HAS_MMU=y
--- /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 HAVE_ELF
+ bool
+ default y
+
+config ARCH_CFLAGS
+ string
+
+config ARCH_LDFLAGS
+ string
+
+config LIBGCC_CFLAGS
+ string
+
+choice
+ prompt "Target Processor Type"
+ default CONFIG_SH5
+ help
+ This is the processor type of your CPU. This information is used for
+ optimizing purposes, as well as to determine if your CPU has an MMU,
+ an FPU, etc. If you pick the wrong CPU type, there is no guarantee
+ that uClibc will work at all....
+
+ Here are the available choices:
+ - "SH5" SH-5 101, 103
+
+config CONFIG_SH5
+ bool "SH5"
+
+endchoice
+
+choice
+ prompt "Target Processor Endianness"
+ default ARCH_LITTLE_ENDIAN
+ help
+ This is the endianness you wish to build use. Choose either Big
+ Endian, or Little Endian.
+
+config ARCH_LITTLE_ENDIAN
+ bool "Little Endian"
+
+config ARCH_BIG_ENDIAN
+ bool "Big Endian"
+
+endchoice
+
+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
+CONFIG_SH5=y
+ARCH_LITTLE_ENDIAN=y
+# ARCH_BIG_ENDIAN is not set
+UCLIBC_HAS_MMU=y
+UCLIBC_HAS_FLOATS=y
+HAS_FPU=y
+# DO_C99_MATH is not set
+WARNINGS="-Wall"
+KERNEL_SOURCE="/usr/src/linux"
+C_SYMBOL_PREFIX=""
+HAVE_DOT_CONFIG=y
+
+#
+# General Library Settings
+#
+# DOPIC is not set
+UCLIBC_CTOR_DTOR=y
+UCLIBC_PROFILING=y
+# UCLIBC_HAS_THREADS is not set
+UCLIBC_HAS_LFS=y
+# MALLOC is not set
+MALLOC_930716=y
+UCLIBC_DYNAMIC_ATEXIT=y
+HAS_SHADOW=y
+UCLIBC_HAS_REGEX=y
+UNIX98PTY_ONLY=y
+ASSUME_DEVPTS=y
+UCLIBC_HAS_TM_EXTENSIONS=y
+UCLIBC_HAS_TZ_CACHING=y
+UCLIBC_HAS_TZ_FILE=y
+UCLIBC_HAS_TZ_FILE_READ_MANY=y
+UCLIBC_TZ_FILE_PATH="/etc/TZ"
+
+#
+# Networking Support
+#
+# UCLIBC_HAS_IPV6 is not set
+# UCLIBC_HAS_RPC is not set
+
+#
+# String and Stdio Support
+#
+UCLIBC_HAS_CTYPE_SIGNED=y
+UCLIBC_HAS_CTYPE_UNSAFE=y
+# UCLIBC_HAS_CTYPE_CHECKED is not set
+# UCLIBC_HAS_CTYPE_ENFORCED is not set
+# UCLIBC_HAS_WCHAR is not set
+# UCLIBC_HAS_HEXADECIMAL_FLOATS is not set
+# UCLIBC_HAS_GLIBC_CUSTOM_PRINTF is not set
+# USE_OLD_VFPRINTF is not set
+UCLIBC_PRINTF_SCANF_POSITIONAL_ARGS=9
+# UCLIBC_HAS_SCANF_GLIBC_A_FLAG is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_NONE is not set
+UCLIBC_HAS_STDIO_BUFSIZ_256=y
+# UCLIBC_HAS_STDIO_BUFSIZ_512 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_1024 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_2048 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_4096 is not set
+# UCLIBC_HAS_STDIO_BUFSIZ_8192 is not set
+UCLIBC_HAS_STDIO_BUILTIN_BUFFER_NONE=y
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_4 is not set
+# UCLIBC_HAS_STDIO_BUILTIN_BUFFER_8 is not set
+UCLIBC_HAS_STDIO_GETC_MACRO=y
+UCLIBC_HAS_STDIO_PUTC_MACRO=y
+UCLIBC_HAS_STDIO_AUTO_RW_TRANSITION=y
+# UCLIBC_HAS_FOPEN_LARGEFILE_MODE is not set
+# UCLIBC_HAS_FOPEN_EXCLUSIVE_MODE is not set
+# UCLIBC_HAS_GLIBC_CUSTOM_STREAMS is not set
+# UCLIBC_HAS_PRINTF_M_SPEC is not set
+UCLIBC_HAS_ERRNO_MESSAGES=y
+# UCLIBC_HAS_SYS_ERRLIST is not set
+UCLIBC_HAS_SIGNUM_MESSAGES=y
+# UCLIBC_HAS_SYS_SIGLIST is not set
+
+#
+# Library Installation Options
+#
+DEVEL_PREFIX="/usr/$(TARGET_ARCH)-linux-uclibc"
+SYSTEM_DEVEL_PREFIX="$(DEVEL_PREFIX)"
+DEVEL_TOOL_PREFIX="$(DEVEL_PREFIX)/usr"
+
+#
+# uClibc development/debugging options
+#
+# DODEBUG is not set
+# DOASSERTS is not set
+# UCLIBC_MJN3_ONLY is not set
include $(TOPDIR)Rules.mak
DIRS = common $(TARGET_ARCH)
-ALL_SUBDIRS = arm common cris h8300 i386 m68k mips powerpc sh sparc v850
+ALL_SUBDIRS = arm common cris h8300 i386 m68k mips powerpc sh sh64 sparc v850
all: subdirs
# define HIDDEN(func)
#endif
-#if defined(__sh__)
+#if defined(__sh__) && !defined(__SH5__)
/* The macro insert this sh specific stuff:
@_SH_GLB_BEGINS
bra 1f
--- /dev/null
+# Makefile for uClibc
+#
+# Copyright (C) 2001 SuperH (UK) Ltd.
+# Copyright (C) 2003 Paul Mundt <lethal@linux-sh.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
+SOBJS = $(patsubst %.S,%.o, $(SSRC))
+
+CSRC = fork.c __init_brk.c brk.c sbrk.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
+/* From libc-5.3.12 */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+void * ___brk_addr = 0;
+
+#define __NR__brk __NR_brk
+_syscall1(void *, _brk, void *, ptr);
+
+int
+__init_brk (void)
+{
+ if (___brk_addr == 0)
+ {
+ ___brk_addr = _brk(0);
+ if (___brk_addr == 0)
+ {
+ __set_errno(ENOMEM);
+ return -1;
+ }
+ }
+ return 0;
+}
--- /dev/null
+/*
+ * libc/sysdeps/linux/sh64/bits/endian.h
+ *
+ * Copyright (C) 2003 Paul Mundt
+ *
+ * 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 _ENDIAN_H
+# error "Never use <bits/endian.h> directly; include <endian.h> instead."
+#endif
+
+#ifdef __LITTLE_ENDIAN__
+# define __BYTE_ORDER __LITTLE_ENDIAN
+#else
+# define __BYTE_ORDER __BIG_ENDIAN
+#endif
+
--- /dev/null
+/* O_*, F_*, FD_* bit values for Linux.
+ Copyright (C) 1995, 1996, 1997, 1998, 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_DIRECT 040000 /* Direct disk access. */
+# define O_DIRECTORY 0200000 /* Must be a directory. */
+# define O_NOFOLLOW 0400000 /* Do not follow links. */
+# 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 0100000
+#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
+
+/* 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
+
+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/sh64 */
+
+#ifndef _BITS_STAT_STRUCT_H
+#define _BITS_STAT_STRUCT_H
+
+struct kernel_stat {
+ unsigned short st_dev;
+ unsigned short __pad1;
+ unsigned long st_ino;
+ unsigned short st_mode;
+ unsigned short st_nlink;
+ unsigned short st_uid;
+ unsigned short st_gid;
+ unsigned short st_rdev;
+ unsigned short __pad2;
+ unsigned long 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 {
+ unsigned short st_dev;
+ unsigned char __pad0[10];
+
+ unsigned long st_ino;
+ unsigned int st_mode;
+ unsigned int st_nlink;
+
+ unsigned long st_uid;
+ unsigned long st_gid;
+
+ unsigned short st_rdev;
+ unsigned char __pad3[10];
+
+ long long st_size;
+ unsigned long st_blksize;
+
+ unsigned long st_blocks; /* Number 512-byte blocks allocated. */
+ unsigned long __pad4; /* future possible st_blocks high bits */
+
+ unsigned long st_atime;
+ unsigned long __pad5;
+
+ unsigned long st_mtime;
+ unsigned long __pad6;
+
+ unsigned long st_ctime;
+ unsigned long __pad7; /* will be high 32 bits of ctime someday */
+
+ unsigned long __unused1;
+ unsigned long __unused2;
+};
+
+#endif /* _BITS_STAT_STRUCT_H */
+
--- /dev/null
+/*
+ * sysdeps/linux/sh64/bits/kernel_types.h
+ *
+ * Copyright (C) 2000, 2001 Paolo Alberelli
+ * Copyright (C) 2003 Paul Mundt
+ *
+ * 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.
+ */
+
+/*
+ * Note that we use the exact same include guard #define names
+ * as asm/posix_types.h. This will avoid gratuitous conflicts
+ * with the posix_types.h kernel header, and will ensure that
+ * our private content, and not the kernel header, will win.
+ * -Erik
+ */
+#ifndef __ASM_SH64_POSIX_TYPES_H
+#define __ASM_SH64_POSIX_TYPES_H
+
+typedef unsigned short __kernel_dev_t;
+typedef unsigned long __kernel_ino_t;
+typedef unsigned short __kernel_mode_t;
+typedef unsigned short __kernel_nlink_t;
+typedef long __kernel_off_t;
+typedef int __kernel_pid_t;
+typedef unsigned short __kernel_ipc_pid_t;
+typedef unsigned short __kernel_uid_t;
+typedef unsigned short __kernel_gid_t;
+typedef long 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 long long __kernel_loff_t;
+
+typedef struct {
+#ifdef __USE_ALL
+ int val[2];
+#else
+ int __val[2];
+#endif
+} __kernel_fsid_t;
+
+#endif /* __ASM_SH64_POSIX_TYPES_H */
--- /dev/null
+/* Copyright (C) 1999, 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* Define the machine-dependent type `jmp_buf'. SH-5 version. */
+
+#ifndef _SETJMP_H
+# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
+#endif
+
+#define __SETJMP_NUM_INT 31 /* number of integer registers to save */
+#define __SETJMP_NUM_DBL 0 /* 16 */ /* number of double registers to save */
+#define __SETJMP_NUM_TRG 3 /* number of traget registers to save */
+
+#define __SETJMP_INT(x) (x)
+#define __SETJMP_DBL(x) (__SETJMP_NUM_INT+(x))
+#define __SETJMP_TRG(x) (__SETJMP_NUM_INT+__SETJMP_NUM_DBL+(x))
+#define __SETJMP_LR (__SETJMP_NUM_INT+__SETJMP_NUM_DBL+__SETJMP_NUM_TRG)
+
+
+#ifndef _ASM
+typedef struct
+ {
+ /* Callee-saved registers. */
+ unsigned long long __ints[__SETJMP_NUM_INT]; /* integer registers */
+#if __SETJMP_NUM_DBL > 0
+ unsigned long long __dbls[__SETJMP_NUM_DBL]; /* double registers */
+#endif
+ unsigned long long __trgs[__SETJMP_NUM_TRG]; /* traget registers */
+ unsigned long long __lr; /* linkage register */
+ } __jmp_buf[1];
+#endif
+
+
--- /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
+
+/* 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>
+
+#ifndef __set_errno
+# define __set_errno(val) (*__errno_location ()) = (val)
+#endif
+#ifndef SYS_ify
+# define SYS_ify(syscall_name) (__NR_##syscall_name)
+#endif
+
+#ifndef __ASSEMBLER__
+
+/* user-visible error numbers are in the range -1 - -125: see <asm-sh64/errno.h> */
+#define __syscall_return(type, res) \
+do { \
+ /* Note: when returning from kernel the return value is in r9 \
+ ** This prevents conflicts between return value and arg1 \
+ ** when dispatching signal handler, in other words makes \
+ ** life easier in the system call epilogue (see entry.S) \
+ */ \
+ register unsigned long __sr2 __asm__ ("r2") = res; \
+ if ((unsigned long)(res) >= (unsigned long)(-125)) { \
+ errno = -(res); \
+ __sr2 = -1; \
+ } \
+ return (type) (__sr2); \
+} while (0)
+
+/* XXX - _foo needs to be __foo, while __NR_bar could be _NR_bar. */
+
+#define _syscall0(type,name) \
+type name(void) \
+{ \
+register unsigned long __sc0 __asm__ ("r9") = ((0x10 << 16) | __NR_##name); \
+__asm__ __volatile__ ("trapa %1" \
+ : "=r" (__sc0) \
+ : "r" (__sc0) ); \
+__syscall_return(type,__sc0); \
+}
+
+#define _syscall1(type,name,type1,arg1) \
+type name(type1 arg1) \
+{ \
+register unsigned long __sc0 __asm__ ("r9") = ((0x11 << 16) | __NR_##name); \
+register unsigned long __sc2 __asm__ ("r2") = (unsigned long) arg1; \
+__asm__ __volatile__ ("trapa %1" \
+ : "=r" (__sc0) \
+ : "r" (__sc0), "r" (__sc2)); \
+__syscall_return(type,__sc0); \
+}
+
+#define _syscall2(type,name,type1,arg1,type2,arg2) \
+type name(type1 arg1,type2 arg2) \
+{ \
+register unsigned long __sc0 __asm__ ("r9") = ((0x12 << 16) | __NR_##name); \
+register unsigned long __sc2 __asm__ ("r2") = (unsigned long) arg1; \
+register unsigned long __sc3 __asm__ ("r3") = (unsigned long) arg2; \
+__asm__ __volatile__ ("trapa %1" \
+ : "=r" (__sc0) \
+ : "r" (__sc0), "r" (__sc2), "r" (__sc3) ); \
+__syscall_return(type,__sc0); \
+}
+
+#define _syscall3(type,name,type1,arg1,type2,arg2,type3,arg3) \
+type name(type1 arg1,type2 arg2,type3 arg3) \
+{ \
+register unsigned long __sc0 __asm__ ("r9") = ((0x13 << 16) | __NR_##name); \
+register unsigned long __sc2 __asm__ ("r2") = (unsigned long) arg1; \
+register unsigned long __sc3 __asm__ ("r3") = (unsigned long) arg2; \
+register unsigned long __sc4 __asm__ ("r4") = (unsigned long) arg3; \
+__asm__ __volatile__ ("trapa %1" \
+ : "=r" (__sc0) \
+ : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4) ); \
+__syscall_return(type,__sc0); \
+}
+
+#define _syscall4(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4) \
+type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4) \
+{ \
+register unsigned long __sc0 __asm__ ("r9") = ((0x14 << 16) | __NR_##name); \
+register unsigned long __sc2 __asm__ ("r2") = (unsigned long) arg1; \
+register unsigned long __sc3 __asm__ ("r3") = (unsigned long) arg2; \
+register unsigned long __sc4 __asm__ ("r4") = (unsigned long) arg3; \
+register unsigned long __sc5 __asm__ ("r5") = (unsigned long) arg4; \
+__asm__ __volatile__ ("trapa %1" \
+ : "=r" (__sc0) \
+ : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4), "r" (__sc5) );\
+__syscall_return(type,__sc0); \
+}
+
+#define _syscall5(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5) \
+type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
+{ \
+register unsigned long __sc0 __asm__ ("r9") = ((0x15 << 16) | __NR_##name); \
+register unsigned long __sc2 __asm__ ("r2") = (unsigned long) arg1; \
+register unsigned long __sc3 __asm__ ("r3") = (unsigned long) arg2; \
+register unsigned long __sc4 __asm__ ("r4") = (unsigned long) arg3; \
+register unsigned long __sc5 __asm__ ("r5") = (unsigned long) arg4; \
+register unsigned long __sc6 __asm__ ("r6") = (unsigned long) arg5; \
+__asm__ __volatile__ ("trapa %1" \
+ : "=r" (__sc0) \
+ : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4), "r" (__sc5), \
+ "r" (__sc6)); \
+__syscall_return(type,__sc0); \
+}
+
+#define _syscall6(type,name,type1,arg1,type2,arg2,type3,arg3,type4,arg4,type5,arg5, type6, arg6) \
+type name (type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5, type6 arg6) \
+{ \
+register unsigned long __sc0 __asm__ ("r9") = ((0x16 << 16) | __NR_##name); \
+register unsigned long __sc2 __asm__ ("r2") = (unsigned long) arg1; \
+register unsigned long __sc3 __asm__ ("r3") = (unsigned long) arg2; \
+register unsigned long __sc4 __asm__ ("r4") = (unsigned long) arg3; \
+register unsigned long __sc5 __asm__ ("r5") = (unsigned long) arg4; \
+register unsigned long __sc6 __asm__ ("r6") = (unsigned long) arg5; \
+register unsigned long __sc7 __asm__ ("r7") = (unsigned long) arg6; \
+__asm__ __volatile__ ("trapa %1" \
+ : "=r" (__sc0) \
+ : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4), "r" (__sc5), \
+ "r" (__sc6), "r" (__sc7)); \
+__syscall_return(type,__sc0); \
+}
+
+#endif /* __ASSEMBLER__ */
+#endif /* _BITS_SYSCALLS_H */
+
--- /dev/null
+/*
+ * libc/sysdeps/linux/sh64/bits/wordsize.h
+ *
+ * Copyright (C) 2003 Paul Mundt
+ *
+ * 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.
+ */
+
+#define __WORDSIZE 32
+
--- /dev/null
+/* From libc-5.3.12 */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+extern void * ___brk_addr;
+
+extern int __init_brk (void);
+extern void *_brk(void *ptr);
+
+int brk(void * end_data_seg)
+{
+ if (__init_brk () == 0)
+ {
+ ___brk_addr = _brk(end_data_seg);
+ if (___brk_addr == end_data_seg)
+ return 0;
+ __set_errno(ENOMEM);
+ }
+ return -1;
+}
--- /dev/null
+/* Startup code for SH5 & ELF.
+ Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 2001 Hewlett-Packard Australia
+
+ 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* This is the canonical entry point, usually the first thing in the text
+ segment.
+
+ At this entry point, most registers' values are unspecified, except:
+
+ sp The stack contains the arguments and environment:
+ 0(sp) argc
+ 4(sp) argv[0]
+ ...
+ (4*argc)(sp) NULL
+ (4*(argc+1))(sp) envp[0]
+ ...
+ NULL
+*/
+
+ .file "crt0.S"
+
+ .globl _start
+ .globl __main
+
+ .type __uClibc_start_main,@function
+
+ .section .text64,"xa"
+ .align 2 /* 2^2 = 4 */
+
+_start:
+ /* Clear the frame pointer since this is the outermost frame. */
+### mov #0, r14 # qqq
+
+ /* Pop argc off the stack and save a pointer to argv */
+ ld.l r15, 0, r2 /* argc */
+ addi r15, 4, r3 /* argv */
+
+ /* set up the value for the environment pointer r4 = (argc+1)*4+argv */
+ addi r2, 1, r4 /* envp = argc + 1 */
+ shlli r4, 2, r4 /* envp = envp * 4 */
+ add r3, r4, r4 /* envp = envp + argv */
+
+ /* call main() */
+ movi __uClibc_start_main,r17
+ ptabs/l r17,tr0
+ blink tr0,r18
+
+ /* should never get here....*/
+### movi abort@lh,r17
+### shori abort@ll,r17
+ ptabs/l r17,tr0
+ blink tr0,r63 /* call abort() => (r63) do not come back ... */
+
+ /*
+ * The following is a stub to stop the GNU toolchain
+ * from calling its C-RTL initialization routines.
+ */
+__main:
+ ptabs/l r18,tr0
+ blink tr0,r63
+
--- /dev/null
+/* vi: set sw=4 ts=4: */
+/*
+ * fork for uClibc
+ *
+ * Copyright (C) 2000 by Lineo, inc. Written by Erik Andersen
+ * <andersen@lineo.com>, <andersee@debian.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
+ *
+ */
+
+#include <errno.h>
+#include <features.h>
+#include <sys/types.h>
+#include <sys/syscall.h>
+
+#ifndef __HAS_NO_MMU__
+
+//#define __NR_fork 2
+#include <unistd.h>
+_syscall0(pid_t, fork);
+
+#endif
--- /dev/null
+/* longjmp for SH-5.
+ Copyright (C) 1999, 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+
+
+#define INTEGER(reg,offset) ld.q r2, offset*8, reg
+#define DOUBLE(reg,offset) fld.d r2, offset*8, reg
+
+
+ .file "longjmp.S"
+
+ .section .text64,"xa"
+ .align 2
+
+ .global longjmp
+ .type longjmp,@function
+
+longjmp:
+ /*
+ * extern void longjmp(jmp_buf env, int val);
+ *
+ * r2 == env
+ * r3 == val
+ * r4 == temporary
+ */
+
+ /* callee-save registers R10-R16 */
+ INTEGER(r10, __SETJMP_INT(0))
+ INTEGER(r11, __SETJMP_INT(1))
+ INTEGER(r12, __SETJMP_INT(2))
+ INTEGER(r13, __SETJMP_INT(3))
+ INTEGER(r14, __SETJMP_INT(4))
+ INTEGER(r15, __SETJMP_INT(5))
+ INTEGER(r16, __SETJMP_INT(6))
+
+ /* callee-save registers R28-R35 */
+ INTEGER(r28, __SETJMP_INT(7))
+ INTEGER(r29, __SETJMP_INT(8))
+ INTEGER(r30, __SETJMP_INT(9))
+ INTEGER(r31, __SETJMP_INT(10))
+ INTEGER(r32, __SETJMP_INT(11))
+ INTEGER(r33, __SETJMP_INT(12))
+ INTEGER(r34, __SETJMP_INT(13))
+ INTEGER(r35, __SETJMP_INT(14))
+
+ /* callee-save registers R44-R59 */
+ INTEGER(r44, __SETJMP_INT(15))
+ INTEGER(r45, __SETJMP_INT(16))
+ INTEGER(r46, __SETJMP_INT(17))
+ INTEGER(r47, __SETJMP_INT(18))
+ INTEGER(r48, __SETJMP_INT(19))
+ INTEGER(r49, __SETJMP_INT(20))
+ INTEGER(r50, __SETJMP_INT(21))
+ INTEGER(r51, __SETJMP_INT(22))
+ INTEGER(r52, __SETJMP_INT(23))
+ INTEGER(r53, __SETJMP_INT(24))
+ INTEGER(r54, __SETJMP_INT(25))
+ INTEGER(r55, __SETJMP_INT(26))
+ INTEGER(r56, __SETJMP_INT(27))
+ INTEGER(r57, __SETJMP_INT(28))
+ INTEGER(r58, __SETJMP_INT(29))
+ INTEGER(r59, __SETJMP_INT(30))
+
+ #if __SETJMP_NUM_INT != 31
+ #error __SETJMP_NUM_INT does agree with expected value
+ #endif
+
+#if __SETJMP_NUM_DBL > 0
+ /* callee-save registers FR12-FR15 */
+ DOUBLE(d12, __SETJMP_DBL(0))
+ DOUBLE(d14, __SETJMP_DBL(1))
+
+ /* callee-save registers FR36-FR63 */
+ DOUBLE(d36, __SETJMP_DBL(2))
+ DOUBLE(d38, __SETJMP_DBL(3))
+ DOUBLE(d40, __SETJMP_DBL(4))
+ DOUBLE(d42, __SETJMP_DBL(5))
+ DOUBLE(d44, __SETJMP_DBL(6))
+ DOUBLE(d46, __SETJMP_DBL(7))
+ DOUBLE(d48, __SETJMP_DBL(8))
+ DOUBLE(d50, __SETJMP_DBL(9))
+ DOUBLE(d52, __SETJMP_DBL(10))
+ DOUBLE(d54, __SETJMP_DBL(11))
+ DOUBLE(d56, __SETJMP_DBL(12))
+ DOUBLE(d58, __SETJMP_DBL(13))
+ DOUBLE(d60, __SETJMP_DBL(14))
+ DOUBLE(d62, __SETJMP_DBL(15))
+
+ #if __SETJMP_NUM_DBL != 16
+ #error __SETJMP_NUM_DBL does agree with expected value
+ #endif
+
+#endif /* __SETJMP_NUM_DBL > 0 */
+
+ /* callee-save registers TR5-TR7 */
+ INTEGER(r4, __SETJMP_TRG(0))
+ ptabs r4, tr5
+ INTEGER(r4, __SETJMP_TRG(1))
+ ptabs r4, tr6
+ INTEGER(r4, __SETJMP_TRG(2))
+ ptabs r4, tr7
+
+ #if __SETJMP_NUM_TRG != 3
+ #error __SETJMP_NUM_TRG does agree with expected value
+ #endif
+
+ /* restore Linkage Register (LR) for longjmp return */
+ INTEGER(r18, __SETJMP_LR)
+ ptabs/l r18, tr0
+
+ /*
+ * must ensure longjmp() never returns 0.
+ * if 'val' == 0, then return 1.
+ */
+ cmpeq r3, r63, r2 /* r2 = (r3==0) ? 1 : 0; */
+ add.l r3, r2, r2 /* return value */
+
+ /* return to caller */
+ blink tr0, r63
+
--- /dev/null
+/* From libc-5.3.12 */
+
+#include <errno.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+extern void * ___brk_addr;
+
+extern int __init_brk (void);
+extern void *_brk(void *ptr);
+
+void *
+sbrk(intptr_t increment)
+{
+ if (__init_brk () == 0)
+ {
+ char * tmp = (char*)___brk_addr+increment;
+ ___brk_addr = _brk(tmp);
+ if (___brk_addr == tmp)
+ return tmp-increment;
+ __set_errno(ENOMEM);
+ return ((void *) -1);
+ }
+ return ((void *) -1);
+}
--- /dev/null
+/* setjmp for SH-5.
+ Copyright (C) 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+
+#define _SETJMP_H
+#define _ASM
+#include <bits/setjmp.h>
+
+
+#define INTEGER(reg,offset) st.q r2, offset*8, reg
+#define DOUBLE(reg,offset) fst.d r2, offset*8, reg
+
+
+ .file "setjmp.S"
+
+ .section .text64,"xa"
+ .align 2
+
+ .global __sigsetjmp
+ .type __sigsetjmp,@function
+
+__sigsetjmp:
+ /*
+ * extern int __sigsetjmp(jmp_buf env, int savemask);
+ *
+ * r2 == env
+ * r3 == savemask
+ * r4 == temporary
+ */
+
+ /* callee-save registers R10-R16 */
+ INTEGER(r10, __SETJMP_INT(0))
+ INTEGER(r11, __SETJMP_INT(1))
+ INTEGER(r12, __SETJMP_INT(2))
+ INTEGER(r13, __SETJMP_INT(3))
+ INTEGER(r14, __SETJMP_INT(4))
+ INTEGER(r15, __SETJMP_INT(5))
+ INTEGER(r16, __SETJMP_INT(6))
+
+ /* callee-save registers R28-R35 */
+ INTEGER(r28, __SETJMP_INT(7))
+ INTEGER(r29, __SETJMP_INT(8))
+ INTEGER(r30, __SETJMP_INT(9))
+ INTEGER(r31, __SETJMP_INT(10))
+ INTEGER(r32, __SETJMP_INT(11))
+ INTEGER(r33, __SETJMP_INT(12))
+ INTEGER(r34, __SETJMP_INT(13))
+ INTEGER(r35, __SETJMP_INT(14))
+
+ /* callee-save registers R44-R59 */
+ INTEGER(r44, __SETJMP_INT(15))
+ INTEGER(r45, __SETJMP_INT(16))
+ INTEGER(r46, __SETJMP_INT(17))
+ INTEGER(r47, __SETJMP_INT(18))
+ INTEGER(r48, __SETJMP_INT(19))
+ INTEGER(r49, __SETJMP_INT(20))
+ INTEGER(r50, __SETJMP_INT(21))
+ INTEGER(r51, __SETJMP_INT(22))
+ INTEGER(r52, __SETJMP_INT(23))
+ INTEGER(r53, __SETJMP_INT(24))
+ INTEGER(r54, __SETJMP_INT(25))
+ INTEGER(r55, __SETJMP_INT(26))
+ INTEGER(r56, __SETJMP_INT(27))
+ INTEGER(r57, __SETJMP_INT(28))
+ INTEGER(r58, __SETJMP_INT(29))
+ INTEGER(r59, __SETJMP_INT(30))
+
+ #if __SETJMP_NUM_INT != 31
+ #error __SETJMP_NUM_INT does agree with expected value
+ #endif
+
+#if __SETJMP_NUM_DBL > 0
+ /* callee-save registers FR12-FR15 */
+ DOUBLE(d12, __SETJMP_DBL(0))
+ DOUBLE(d14, __SETJMP_DBL(1))
+
+ /* callee-save registers FR36-FR63 */
+ DOUBLE(d36, __SETJMP_DBL(2))
+ DOUBLE(d38, __SETJMP_DBL(3))
+ DOUBLE(d40, __SETJMP_DBL(4))
+ DOUBLE(d42, __SETJMP_DBL(5))
+ DOUBLE(d44, __SETJMP_DBL(6))
+ DOUBLE(d46, __SETJMP_DBL(7))
+ DOUBLE(d48, __SETJMP_DBL(8))
+ DOUBLE(d50, __SETJMP_DBL(9))
+ DOUBLE(d52, __SETJMP_DBL(10))
+ DOUBLE(d54, __SETJMP_DBL(11))
+ DOUBLE(d56, __SETJMP_DBL(12))
+ DOUBLE(d58, __SETJMP_DBL(13))
+ DOUBLE(d60, __SETJMP_DBL(14))
+ DOUBLE(d62, __SETJMP_DBL(15))
+
+ #if __SETJMP_NUM_DBL != 16
+ #error __SETJMP_NUM_DBL does agree with expected value
+ #endif
+
+#endif /* __SETJMP_NUM_DBL > 0 */
+
+ /* callee-save registers TR5-TR7 */
+ gettr tr5, r4
+ INTEGER(r4, __SETJMP_TRG(0))
+ gettr tr6, r4
+ INTEGER(r4, __SETJMP_TRG(1))
+ gettr tr7, r4
+ INTEGER(r4, __SETJMP_TRG(2))
+
+ #if __SETJMP_NUM_TRG != 3
+ #error __SETJMP_NUM_TRG does agree with expected value
+ #endif
+
+ /* save Linkage Register (LR) for longjmp return */
+ INTEGER(r18, __SETJMP_LR)
+
+ /*
+ * return a value of zero if call is __sigsetjmp().
+ * This is so that caller of setjmp() knows
+ * we have retruned via setjmp, and not via longjmp.
+ * R0 is the result register.
+ */
+
+ ptabs/l r18, tr0 /* return to caller */
+ movi 0, r2 /* return value */
+ blink tr0, r63
+
--- /dev/null
+/* Copyright (C) 1999, 2000, 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 Library General Public License as
+ published by the Free Software Foundation; either version 2 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
+ Library General Public License for more details.
+
+ You should have received a copy of the GNU Library General Public
+ License along with the GNU C Library; see the file COPYING.LIB. If not,
+ write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+ Boston, MA 02111-1307, USA. */
+
+/* Where is System V/SH ABI? */
+
+#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 long long greg_t;
+
+/* Number of general registers. */
+#define NGREG 64
+
+/* Container for all general registers. */
+typedef greg_t gregset_t[NGREG];
+
+#ifdef __USE_GNU
+/* Number of each register is the `gregset_t' array. */
+enum
+{
+ R0 = 0,
+#define R0 R0
+ R1 = 1,
+#define R1 R1
+ R2 = 2,
+#define R2 R2
+ R3 = 3,
+#define R3 R3
+ R4 = 4,
+#define R4 R4
+ R5 = 5,
+#define R5 R5
+ R6 = 6,
+#define R6 R6
+ R7 = 7,
+#define R7 R7
+ R8 = 8,
+#define R8 R8
+ R9 = 9,
+#define R9 R9
+ R10 = 10,
+#define R10 R10
+ R11 = 11,
+#define R11 R11
+ R12 = 12,
+#define R12 R12
+ R13 = 13,
+#define R13 R13
+ R14 = 14,
+#define R14 R14
+ R15 = 15,
+#define R15 R15
+ R16 = 16,
+#define R16 R16
+ R17 = 17,
+#define R17 R17
+ R18 = 18,
+#define R18 R18
+ R19 = 19,
+#define R19 R19
+ R20 = 20,
+#define R20 R20
+ R21 = 21,
+#define R21 R21
+ R22 = 22,
+#define R22 R22
+ R23 = 23,
+#define R23 R23
+ R24 = 24,
+#define R24 R24
+ R25 = 25,
+#define R25 R25
+ R26 = 26,
+#define R26 R26
+ R27 = 27,
+#define R27 R27
+ R28 = 28,
+#define R28 R28
+ R29 = 29,
+#define R29 R29
+ R30 = 30,
+#define R30 R30
+ R31 = 31,
+#define R31 R31
+ R32 = 32,
+#define R32 R32
+ R33 = 33,
+#define R33 R33
+ R34 = 34,
+#define R34 R34
+ R35 = 35,
+#define R35 R35
+ R36 = 36,
+#define R36 R36
+ R37 = 37,
+#define R37 R37
+ R38 = 38,
+#define R38 R38
+ R39 = 39,
+#define R39 R39
+ R40 = 40,
+#define R40 R40
+ R41 = 41,
+#define R41 R41
+ R42 = 42,
+#define R42 R42
+ R43 = 43,
+#define R43 R43
+ R44 = 44,
+#define R44 R44
+ R45 = 45,
+#define R45 R45
+ R46 = 46,
+#define R46 R46
+ R47 = 47,
+#define R47 R47
+ R48 = 48,
+#define R48 R48
+ R49 = 49,
+#define R49 R49
+ R50 = 50,
+#define R50 R50
+ R51 = 51,
+#define R51 R51
+ R52 = 52,
+#define R52 R52
+ R53 = 53,
+#define R53 R53
+ R54 = 54,
+#define R54 R54
+ R55 = 55,
+#define R55 R55
+ R56 = 56,
+#define R56 R56
+ R57 = 57,
+#define R57 R57
+ R58 = 58,
+#define R58 R58
+ R59 = 59,
+#define R59 R59
+ R60 = 60,
+#define R60 R60
+ R61 = 61,
+#define R61 R61
+ R62 = 62,
+#define R62 R62
+ R63 = 63,
+#define R63 R63
+};
+#endif
+
+typedef int freg_t;
+
+/* Number of FPU registers. */
+#define NFPREG 32
+
+/* Structure to describe FPU registers. */
+typedef freg_t fpregset_t[NFPREG];
+
+/* Context to describe whole processor state. */
+typedef struct
+ {
+ gregset_t gregs;
+ fpregset_t fpregs;
+ unsigned long long sc_tregs[8];
+ unsigned long long sc_pc;
+ unsigned long long sc_sr;
+ unsigned long long sc_fpscr;
+
+ } 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 */