From 2fbe1ee66ad2107866d3fddd014c1349d135b424 Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Mon, 30 Mar 2015 03:48:56 -0500 Subject: remove sh64 support No real hardware available. The project for sh64 with sh5 seems dead since 10 years. Gcc will remove support for it soon. --- Rules.mak | 6 - extra/Configs/Config.in | 8 - extra/Configs/Config.sh64 | 33 -- extra/Configs/defconfigs/sh64/defconfig | 1 - ldso/ldso/sh64/dl-debug.h | 79 ----- ldso/ldso/sh64/dl-startup.h | 118 ------- ldso/ldso/sh64/dl-syscalls.h | 18 -- ldso/ldso/sh64/dl-sysdep.h | 168 ---------- ldso/ldso/sh64/elfinterp.c | 345 --------------------- ldso/ldso/sh64/resolve.S | 95 ------ libc/string/sh64/Makefile | 13 - libc/string/sh64/memcpy.S | 205 ------------ libc/string/sh64/memset.S | 97 ------ libc/string/sh64/strcpy.S | 102 ------ libc/string/sh64/strlen.S | 63 ---- libc/sysdeps/linux/sh64/Makefile | 15 - libc/sysdeps/linux/sh64/Makefile.arch | 10 - libc/sysdeps/linux/sh64/__init_brk.c | 26 -- libc/sysdeps/linux/sh64/__longjmp.S | 140 --------- libc/sysdeps/linux/sh64/bits/endian.h | 20 -- libc/sysdeps/linux/sh64/bits/fcntl.h | 218 ------------- libc/sysdeps/linux/sh64/bits/kernel_stat.h | 55 ---- libc/sysdeps/linux/sh64/bits/kernel_types.h | 58 ---- libc/sysdeps/linux/sh64/bits/setjmp.h | 46 --- libc/sysdeps/linux/sh64/bits/shm.h | 102 ------ libc/sysdeps/linux/sh64/bits/stackinfo.h | 27 -- libc/sysdeps/linux/sh64/bits/syscalls.h | 126 -------- .../sysdeps/linux/sh64/bits/uClibc_arch_features.h | 41 --- libc/sysdeps/linux/sh64/bits/wordsize.h | 12 - libc/sysdeps/linux/sh64/brk.c | 27 -- libc/sysdeps/linux/sh64/crt1.S | 82 ----- libc/sysdeps/linux/sh64/crti.S | 42 --- libc/sysdeps/linux/sh64/crtn.S | 31 -- libc/sysdeps/linux/sh64/sbrk.c | 25 -- libc/sysdeps/linux/sh64/setjmp.S | 139 --------- libc/sysdeps/linux/sh64/sys/procfs.h | 125 -------- libc/sysdeps/linux/sh64/sys/ucontext.h | 204 ------------ libc/sysdeps/linux/sh64/syscall.c | 24 -- .../linuxthreads.old/sysdeps/sh64/Makefile.arch | 30 -- .../linuxthreads.old/sysdeps/sh64/pt-machine.c | 46 --- .../linuxthreads.old/sysdeps/sh64/pt-machine.h | 38 --- 41 files changed, 3060 deletions(-) delete mode 100644 extra/Configs/Config.sh64 delete mode 100644 extra/Configs/defconfigs/sh64/defconfig delete mode 100644 ldso/ldso/sh64/dl-debug.h delete mode 100644 ldso/ldso/sh64/dl-startup.h delete mode 100644 ldso/ldso/sh64/dl-syscalls.h delete mode 100644 ldso/ldso/sh64/dl-sysdep.h delete mode 100644 ldso/ldso/sh64/elfinterp.c delete mode 100644 ldso/ldso/sh64/resolve.S delete mode 100644 libc/string/sh64/Makefile delete mode 100644 libc/string/sh64/memcpy.S delete mode 100644 libc/string/sh64/memset.S delete mode 100644 libc/string/sh64/strcpy.S delete mode 100644 libc/string/sh64/strlen.S delete mode 100644 libc/sysdeps/linux/sh64/Makefile delete mode 100644 libc/sysdeps/linux/sh64/Makefile.arch delete mode 100644 libc/sysdeps/linux/sh64/__init_brk.c delete mode 100644 libc/sysdeps/linux/sh64/__longjmp.S delete mode 100644 libc/sysdeps/linux/sh64/bits/endian.h delete mode 100644 libc/sysdeps/linux/sh64/bits/fcntl.h delete mode 100644 libc/sysdeps/linux/sh64/bits/kernel_stat.h delete mode 100644 libc/sysdeps/linux/sh64/bits/kernel_types.h delete mode 100644 libc/sysdeps/linux/sh64/bits/setjmp.h delete mode 100644 libc/sysdeps/linux/sh64/bits/shm.h delete mode 100644 libc/sysdeps/linux/sh64/bits/stackinfo.h delete mode 100644 libc/sysdeps/linux/sh64/bits/syscalls.h delete mode 100644 libc/sysdeps/linux/sh64/bits/uClibc_arch_features.h delete mode 100644 libc/sysdeps/linux/sh64/bits/wordsize.h delete mode 100644 libc/sysdeps/linux/sh64/brk.c delete mode 100644 libc/sysdeps/linux/sh64/crt1.S delete mode 100644 libc/sysdeps/linux/sh64/crti.S delete mode 100644 libc/sysdeps/linux/sh64/crtn.S delete mode 100644 libc/sysdeps/linux/sh64/sbrk.c delete mode 100644 libc/sysdeps/linux/sh64/setjmp.S delete mode 100644 libc/sysdeps/linux/sh64/sys/procfs.h delete mode 100644 libc/sysdeps/linux/sh64/sys/ucontext.h delete mode 100644 libc/sysdeps/linux/sh64/syscall.c delete mode 100644 libpthread/linuxthreads.old/sysdeps/sh64/Makefile.arch delete mode 100644 libpthread/linuxthreads.old/sysdeps/sh64/pt-machine.c delete mode 100644 libpthread/linuxthreads.old/sysdeps/sh64/pt-machine.h diff --git a/Rules.mak b/Rules.mak index fdaf4560b..973a890bb 100644 --- a/Rules.mak +++ b/Rules.mak @@ -430,12 +430,6 @@ else endif endif -ifeq ($(TARGET_ARCH),sh64) - CPU_CFLAGS-$(ARCH_LITTLE_ENDIAN):=-ml - CPU_CFLAGS-$(ARCH_BIG_ENDIAN):=-mb - CPU_CFLAGS-$(CONFIG_SH5)+=-m5-32media -endif - ifeq ($(TARGET_ARCH),h8300) CPU_CFLAGS-$(CONFIG_H8300H) += -mh -mint32 CPU_CFLAGS-$(CONFIG_H8S) += -ms -mint32 diff --git a/extra/Configs/Config.in b/extra/Configs/Config.in index f3f573d3c..dc7159d0a 100644 --- a/extra/Configs/Config.in +++ b/extra/Configs/Config.in @@ -38,7 +38,6 @@ choice default TARGET_or1k if DESIRED_TARGET_ARCH = "or1k" default TARGET_powerpc if DESIRED_TARGET_ARCH = "powerpc" default TARGET_sh if DESIRED_TARGET_ARCH = "sh" - default TARGET_sh64 if DESIRED_TARGET_ARCH = "sh64" default TARGET_sparc if DESIRED_TARGET_ARCH = "sparc" default TARGET_v850 if DESIRED_TARGET_ARCH = "v850" default TARGET_vax if DESIRED_TARGET_ARCH = "vax" @@ -121,9 +120,6 @@ config TARGET_powerpc config TARGET_sh bool "superh" -#config TARGET_sh64 -# bool "sh64" - config TARGET_sparc bool "sparc" @@ -232,10 +228,6 @@ if TARGET_sh source "extra/Configs/Config.sh" endif -if TARGET_sh64 -source "extra/Configs/Config.sh64" -endif - if TARGET_sparc source "extra/Configs/Config.sparc" endif diff --git a/extra/Configs/Config.sh64 b/extra/Configs/Config.sh64 deleted file mode 100644 index a617510ac..000000000 --- a/extra/Configs/Config.sh64 +++ /dev/null @@ -1,33 +0,0 @@ -# -# For a description of the syntax of this configuration file, -# see extra/config/Kconfig-language.txt -# - -config TARGET_ARCH - string - default "sh64" - -config FORCE_OPTIONS_FOR_ARCH - bool - default y - select ARCH_ANY_ENDIAN - select ARCH_HAS_DEPRECATED_SYSCALLS - -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" SuperH SH-5 101, 103 - -config CONFIG_SH5 - select ARCH_HAS_MMU - select UCLIBC_HAS_LFS - bool "SH5" - -endchoice diff --git a/extra/Configs/defconfigs/sh64/defconfig b/extra/Configs/defconfigs/sh64/defconfig deleted file mode 100644 index 4f23a5402..000000000 --- a/extra/Configs/defconfigs/sh64/defconfig +++ /dev/null @@ -1 +0,0 @@ -TARGET_sh64=y diff --git a/ldso/ldso/sh64/dl-debug.h b/ldso/ldso/sh64/dl-debug.h deleted file mode 100644 index 6d861e5b4..000000000 --- a/ldso/ldso/sh64/dl-debug.h +++ /dev/null @@ -1,79 +0,0 @@ -/* vi: set sw=8 ts=8: */ -/* - * ldso/ldso/sh64/elfinterp.c - * - * SuperH (sh64) ELF shared library loader suppport - * - * Copyright (C) 2003, 2004, 2005 Paul Mundt - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. The name of the above contributors may not be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -static const char * const _dl_reltypes_tab[] = { - /* SHcompact relocs */ - [0] = "R_SH_NONE", "R_SH_DIR32", - "R_SH_REL32", "R_SH_DIR8WPN", - [4] = "R_SH_IND12W", "R_SH_DIR8WPL", - "R_SH_DIR8WPZ", "R_SH_DIR8BP", - [8] = "R_SH_DIR8W", "R_SH_DIR8L", - [25] = "R_SH_SWITCH16", "R_SH_SWITCH32", - "R_SH_USES", "R_SH_COUNT", - [29] = "R_SH_ALIGN", "R_SH_CODE", - "R_SH_DATA", "R_SH_LABEL", - [33] = "R_SH_SWITCH8", "R_SH_GNU_VTINHERIT", - "R_SH_GNU_VTENTRY", - [160] = "R_SH_GOT32", "R_SH_PLT32", - "R_SH_COPY", "R_SH_GLOB_DAT", - [164] = "R_SH_JMP_SLOT", "R_SH_RELATIVE", - "R_SH_GOTOFF", "R_SH_GOTPC", - - /* SHmedia relocs */ - [45] = "R_SH_DIR5U", "R_SH_DIR6U", - "R_SH_DIR6S", "R_SH_DIR10S", - [49] = "R_SH_DIR10SW", "R_SH_DIR10SL", - "R_SH_DIR10SQ", - [169] = "R_SH_GOT_LOW16", "R_SH_GOT_MEDLOW16", - "R_SH_GOT_MEDHI16", "R_SH_GOT_HI16", - [173] = "R_SH_GOTPLT_LOW16", "R_SH_GOTPLT_MEDLOW16", - "R_SH_GOTPLT_MEDHI16", "R_SH_GOTPLT_HI16", - [177] = "R_SH_PLT_LOW16", "R_SH_PLT_MEDLOW16", - "R_SH_PLT_MEDHI16", "R_SH_PLT_HI16", - [181] = "R_SH_GOTOFF_LOW16", "R_SH_GOTOFF_MEDLOW16", - "R_SH_GOTOFF_MEDHI16", "R_SH_GOTOFF_HI16", - [185] = "R_SH_GOTPC_LOW16", "R_SH_GOTPC_MEDLOW16", - "R_SH_GOTPC_MEDHI16", "R_SH_GOTPC_HI16", - [189] = "R_SH_GOT10BY4", "R_SH_GOTPLT10BY4", - "R_SH_GOT10BY8", "R_SH_GOTPLT10BY8", - [193] = "R_SH_COPY64", "R_SH_GLOB_DAT64", - "R_SH_JMP_SLOT64", "R_SH_RELATIVE64", - [197] = "R_SH_RELATIVE_LOW16", "R_SH_RELATIVE_MEDLOW16", - "R_SH_RELATIVE_MEDHI16","R_SH_RELATIVE_HI16", - [242] = "R_SH_SHMEDIA_CODE", "R_SH_PT_16", - "R_SH_IMMS16", "R_SH_IMMU16", - [246] = "R_SH_IMM_LOW16", "R_SH_IMM_LOW16_PCREL", - "R_SH_IMM_MEDLOW16", "R_SH_IMM_MEDLOW16_PCREL", - [250] = "R_SH_IMM_MEDHI16", "R_SH_IMM_MEDHI16_PCREL", - "R_SH_IMM_HI16", "R_SH_IMM_HI16_PCREL", - [254] = "R_SH_64", "R_SH_64_PCREL", -}; diff --git a/ldso/ldso/sh64/dl-startup.h b/ldso/ldso/sh64/dl-startup.h deleted file mode 100644 index 9dac5ef2c..000000000 --- a/ldso/ldso/sh64/dl-startup.h +++ /dev/null @@ -1,118 +0,0 @@ -/* Any assembly language/system dependent hacks needed to setup boot1.c so it - * will work as expected and cope with whatever platform specific wierdness is - * needed for this architecture. - */ - -__asm__("" \ -" .section .text..SHmedia32,\"ax\"\n" \ -" .globl _start\n" \ -" .type _start, @function\n" \ -" .hidden _start\n" \ -" .align 5\n" \ -"_start:\n" \ -" ! Set r12 to point to GOT\n" \ -" movi (((datalabel _GLOBAL_OFFSET_TABLE_-(.LZZZ3-.)) >> 16) & 0xffff), r12\n" \ -" shori ((datalabel _GLOBAL_OFFSET_TABLE_-(.LZZZ3-.)) & 0xffff), r12\n" \ -".LZZZ3:\n" \ -" ptrel/u r12, tr0\n" \ -" gettr tr0, r12 ! GOT address\n" \ -" add r18, r63, r11 ! save return address - needed?\n" \ -" add r15, r63, r2 ! arg = stack pointer\n" \ -" pt _dl_start, tr0 ! should work even if PIC\n" \ -" blink tr0, r18 ! call _dl_start - user EP is in r2\n" \ -" add r2, r63, r28\n" \ -" movi (((_dl_fini@GOT) >> 16) & 0xffff), r1\n" \ -" shori ((_dl_fini@GOT) & 0xffff), r1\n" \ -" ldx.l r1, r12, r2\n" \ -" add r11, r63, r18\n" \ -" ptabs/l r28, tr0\n" \ -" blink tr0, r63\n" \ -" .size _start,.-_start\n" -" .previous\n" -); - -/* - * Get a pointer to the argv array. On many platforms this can be just - * the address of the first argument, on other platforms we need to - * do something a little more subtle here. - */ -#define GET_ARGV(ARGVP, ARGS) ARGVP = (((unsigned long *)ARGS)+1) - -/* - * Here is a macro to perform a relocation. This is only used when - * bootstrapping the dynamic loader. RELP is the relocation that we - * are performing, REL is the pointer to the address we are relocating. - * SYMBOL is the symbol involved in the relocation, and LOAD is the - * load address. - */ - -#include - -#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) \ - const unsigned int r_type = ELF_R_TYPE((RELP)->r_info); \ - int lsb = !!((SYMTAB)->st_other & STO_SH5_ISA32); \ - \ - switch (r_type) { \ - case R_SH_REL32: \ - *(REL) = (SYMBOL) + (RELP)->r_addend \ - - (unsigned long)(REL); \ - break; \ - case R_SH_DIR32: \ - case R_SH_GLOB_DAT: \ - case R_SH_JMP_SLOT: \ - *(REL) = ((SYMBOL) + (RELP)->r_addend) | lsb; \ - break; \ - case R_SH_RELATIVE: \ - *(REL) = (LOAD) + (RELP)->r_addend; \ - break; \ - case R_SH_RELATIVE_LOW16: \ - case R_SH_RELATIVE_MEDLOW16: \ - { \ - unsigned long word, value; \ - \ - word = (unsigned long)(REL) & ~0x3fffc00; \ - value = (LOAD) + (RELP)->r_addend; \ - \ - if (r_type == R_SH_RELATIVE_MEDLOW16) \ - value >>= 16; \ - \ - word |= (value & 0xffff) << 10; \ - *(REL) = word; \ - break; \ - } \ - case R_SH_IMM_LOW16: \ - case R_SH_IMM_MEDLOW16: \ - { \ - unsigned long word, value; \ - \ - word = (unsigned long)(REL) & ~0x3fffc00; \ - value = ((SYMBOL) + (RELP)->r_addend) | lsb; \ - \ - if (r_type == R_SH_IMM_MEDLOW16) \ - value >>= 16; \ - \ - word |= (value & 0xffff) << 10; \ - *(REL) = word; \ - break; \ - } \ - case R_SH_IMM_LOW16_PCREL: \ - case R_SH_IMM_MEDLOW16_PCREL: \ - { \ - unsigned long word, value; \ - \ - word = (unsigned long)(REL) & ~0x3fffc00; \ - value = (SYMBOL) + (RELP)->r_addend \ - - (unsigned long)(REL); \ - \ - if (r_type == R_SH_IMM_MEDLOW16_PCREL) \ - value >>= 16; \ - \ - word |= (value & 0xffff) << 10; \ - *(REL) = word; \ - break; \ - } \ - case R_SH_NONE: \ - break; \ - default: \ - _dl_exit(1); \ - } diff --git a/ldso/ldso/sh64/dl-syscalls.h b/ldso/ldso/sh64/dl-syscalls.h deleted file mode 100644 index 2ea4bb7d0..000000000 --- a/ldso/ldso/sh64/dl-syscalls.h +++ /dev/null @@ -1,18 +0,0 @@ -#undef __syscall_return -#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)) { \ - _dl_errno = -(res); \ - __sr2 = -1; \ - } \ - return (type)(__sr2); \ -} while (0) - diff --git a/ldso/ldso/sh64/dl-sysdep.h b/ldso/ldso/sh64/dl-sysdep.h deleted file mode 100644 index 043413931..000000000 --- a/ldso/ldso/sh64/dl-sysdep.h +++ /dev/null @@ -1,168 +0,0 @@ -/* vi: set sw=8 ts=8: */ -/* - * Various assembly language/system dependent hacks that are required - * so that we can minimize the amount of platform specific code. - */ - -/* Define this if the system uses RELOCA. */ -#define ELF_USES_RELOCA -#include -/* - * Initialization sequence for a GOT. - */ -#define INIT_GOT(GOT_BASE,MODULE) \ -{ \ - GOT_BASE[2] = (unsigned long)_dl_linux_resolve; \ - GOT_BASE[1] = (unsigned long)(MODULE); \ -} - -/* Here we define the magic numbers that this dynamic loader should accept */ -#define MAGIC1 EM_SH -#undef MAGIC2 - -/* Used for error messages */ -#define ELF_TARGET "sh64" - -/* Need bootstrap relocations */ -#define ARCH_NEEDS_BOOTSTRAP_RELOCS - -struct elf_resolve; -extern unsigned long _dl_linux_resolver(struct elf_resolve * tpnt, int reloc_entry); - -/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry or - TLS variable, so undefined references should not be allowed to - define the value. - ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one - of the main executable's symbols, as for a COPY reloc. */ -#define elf_machine_type_class(type) \ - ((((type) == R_SH_JMP_SLOT) * ELF_RTYPE_CLASS_PLT) \ - | (((type) == R_SH_COPY) * ELF_RTYPE_CLASS_COPY)) - -/* Return the link-time address of _DYNAMIC. Conveniently, this is the - first element of the GOT. This must be inlined in a function which - uses global data. */ -static __always_inline Elf32_Addr elf_machine_dynamic(void) -{ - register Elf32_Addr *got; - - /* - * The toolchain adds 32768 to the GOT address, we compensate for - * that in the movi/sub pair. - * - * XXX: If this is cleaned up in the toolchain, we can end up - * saving 2 instructions and subsequently free up r1 from the - * clobber list.. - */ - __asm__ ( - "movi\t(((datalabel _GLOBAL_OFFSET_TABLE_-(.LZZZ1-.)) >> 16) & 0xffff), r2\n\t" - "shori\t((datalabel _GLOBAL_OFFSET_TABLE_-(.LZZZ1-.)) & 0xffff), r2\n\t" - ".LZZZ1:\tptrel/u r2, tr0\n\t" - "movi\t32768, r1\n\t" - "gettr\ttr0, r2\n\t" - "sub\tr2, r1, %0\n\t" - : "=r" (got) - : /* no inputs */ - : "r1", "r2", "tr0" - ); - - return *got; -} - -/* Return the run-time load address of the shared object. */ -static __always_inline Elf32_Addr elf_machine_load_address(void) -{ - Elf32_Addr addr; - - __asm__ ( - "movi\t(((datalabel _GLOBAL_OFFSET_TABLE_-(.LZZZ2-.)) >> 16) & 0xffff), r0\n\t" - "shori\t((datalabel _GLOBAL_OFFSET_TABLE_-(.LZZZ2-.)) & 0xffff), r0\n\t" - ".LZZZ2:\tptrel/u r0, tr0\n\t" - "movi\t(((_dl_start@GOTOFF) >> 16) & 0xffff), r2\n\t" - "shori\t((_dl_start@GOTOFF) & 0xffff), r2\n\t" - "gettr\ttr0, r0\n\t" - "add\tr2, r0, r2\n\t" - "movi\t(((_dl_start@GOT) >> 16) & 0xffff), r1\n\t" - "shori\t((_dl_start@GOT) & 0xffff), r1\n\t" - "ldx.l\tr1, r0, r1\n\t" - "sub\tr2, r1, %0\n\t" - : "=r" (addr) - : /* no inputs */ - : "r0", "r1", "r2", "tr0" - ); - - return addr; -} - -/* - * XXX: As we don't need to worry about r25 clobbering, we could probably - * get away with inlining {st,ld}{x,}.l and friends here instead and - * forego gcc's idea of code generation. - */ -#define COPY_UNALIGNED_WORD(swp, twp, align) \ -{ \ - void *__s = (swp), *__t = (twp); \ - unsigned char *__s1 = __s, *__t1 = __t; \ - unsigned short *__s2 = __s, *__t2 = __t; \ - unsigned long *__s4 = __s, *__t4 = __t; \ - \ - switch ((align)) { \ - case 0: \ - *__t4 = *__s4; \ - break; \ - case 2: \ - *__t2++ = *__s2++; \ - *__t2 = *__s2; \ - break; \ - default: \ - *__t1++ = *__s1++; \ - *__t1++ = *__s1++; \ - *__t1++ = *__s1++; \ - *__t1 = *__s1; \ - break; \ - } \ -} - -static __always_inline void -elf_machine_relative(Elf32_Addr load_off, const Elf32_Addr rel_addr, - Elf32_Word relative_count) -{ - Elf32_Addr value, word; - Elf32_Rela *rpnt = (void *)rel_addr; - int reloc_type = ELF_R_TYPE(rpnt->r_info); - - do { - Elf32_Addr *const reloc_addr = - (void *)(load_off + rpnt->r_offset); - int align = (int)reloc_addr & 3; - - switch (reloc_type) { - case R_SH_RELATIVE_LOW16: - COPY_UNALIGNED_WORD(reloc_addr, &word, align); - word &= ~0x3fffc00; - value = (rpnt->r_addend + load_off); - word |= (value & 0xffff) << 10; - COPY_UNALIGNED_WORD(&word, reloc_addr, align); - break; - case R_SH_RELATIVE_MEDLOW16: - COPY_UNALIGNED_WORD(reloc_addr, &word, align); - word &= ~0x3fffc00; - value = (rpnt->r_addend + load_off) >> 16; - word |= (value & 0xffff) << 10; - COPY_UNALIGNED_WORD(&word, reloc_addr, align); - break; - default: - if (rpnt->r_addend) { - value = load_off + rpnt->r_addend; - } else { - COPY_UNALIGNED_WORD(reloc_addr, &value, align); - value += load_off; - } - - COPY_UNALIGNED_WORD(&value, reloc_addr, align); - break; - } - - rpnt++; - } while (--relative_count); -#undef COPY_UNALIGNED_WORD -} diff --git a/ldso/ldso/sh64/elfinterp.c b/ldso/ldso/sh64/elfinterp.c deleted file mode 100644 index 3a59bc4be..000000000 --- a/ldso/ldso/sh64/elfinterp.c +++ /dev/null @@ -1,345 +0,0 @@ -/* vi: set sw=8 ts=8: */ -/* - * ldso/ldso/sh64/elfinterp.c - * - * SuperH (sh64) ELF shared library loader suppport - * - * Copyright (C) 2003, 2004, 2005 Paul Mundt - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. The name of the above contributors may not be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -/* Program to load an ELF binary on a linux system, and run it. - References to symbols in sharable libraries can be resolved by either - an ELF sharable library or a linux style of shared library. */ - -/* Disclaimer: I have never seen any AT&T source code for SVr4, nor have - I ever taken any courses on internals. This program was developed using - information available through the book "UNIX SYSTEM V RELEASE 4, - Programmers guide: Ansi C and Programming Support Tools", which did - a more than adequate job of explaining everything required to get this - working. */ - -#include "ldso.h" - -extern int _dl_linux_resolve(void); - -unsigned long _dl_linux_resolver(struct elf_resolve *tpnt, int reloc_entry) -{ - ELF_RELOC *this_reloc; - char *strtab; - ElfW(Sym) *symtab; - int symtab_index; - char *rel_addr; - char *new_addr; - char **got_addr; - unsigned long instr_addr; - char *symname; - - rel_addr = (char *)tpnt->dynamic_info[DT_JMPREL]; - - this_reloc = (ELF_RELOC *)(intptr_t)(rel_addr + reloc_entry); - symtab_index = ELF_R_SYM(this_reloc->r_info); - - symtab = (ElfW(Sym) *)(intptr_t)tpnt->dynamic_info[DT_SYMTAB]; - strtab = (char *)tpnt->dynamic_info[DT_STRTAB]; - symname = strtab + symtab[symtab_index].st_name; - - /* Address of jump instruction to fix up */ - instr_addr = ((unsigned long)this_reloc->r_offset + - (unsigned long)tpnt->loadaddr); - got_addr = (char **)instr_addr; - - - /* Get the address of the GOT entry */ - new_addr = _dl_find_hash(symname, &_dl_loaded_modules->symbol_scope, tpnt, ELF_RTYPE_CLASS_PLT, NULL); - if (unlikely(!new_addr)) { - _dl_dprintf(2, "%s: can't resolve symbol '%s'\n", - _dl_progname, symname); - _dl_exit(1); - } - -#ifdef __SUPPORT_LD_DEBUG__ - if ((unsigned long)got_addr < 0x20000000) { - if (_dl_debug_bindings) { - _dl_dprintf(_dl_debug_file, "\nresolve function: %s", - symname); - - if (_dl_debug_detail) - _dl_dprintf(_dl_debug_file, - "\n\tpatched %x ==> %x @ %x\n", - *got_addr, new_addr, got_addr); - } - } - - if (!_dl_debug_nofixups) - *got_addr = new_addr; -#else - *got_addr = new_addr; -#endif - - return (unsigned long)new_addr; -} - -static int _dl_parse(struct elf_resolve *tpnt, struct r_scope_elem *scope, - unsigned long rel_addr, unsigned long rel_size, - int (*reloc_fnc)(struct elf_resolve *tpnt, - struct r_scope_elem *scope, - ELF_RELOC *rpnt, ElfW(Sym) *symtab, - char *strtab)) -{ - unsigned int i; - char *strtab; - ElfW(Sym) *symtab; - ELF_RELOC *rpnt; - int symtab_index; - - /* Now parse the relocation information */ - rpnt = (ELF_RELOC *)(intptr_t)rel_addr; - rel_size = rel_size / sizeof(ELF_RELOC); - - symtab = (ElfW(Sym) *)(intptr_t)tpnt->dynamic_info[DT_SYMTAB]; - strtab = (char *)tpnt->dynamic_info[DT_STRTAB]; - - for (i = 0; i < rel_size; i++, rpnt++) { - int res; - - symtab_index = ELF_R_SYM(rpnt->r_info); - debug_sym(symtab,strtab,symtab_index); - debug_reloc(symtab,strtab,rpnt); - - res = reloc_fnc (tpnt, scope, rpnt, symtab, strtab); - if (res == 0) - continue; - - _dl_dprintf(2, "\n%s: ",_dl_progname); - - if (symtab_index) - _dl_dprintf(2, "symbol '%s': ", - strtab + symtab[symtab_index].st_name); - - if (unlikely(res < 0)) { - int reloc_type = ELF_R_TYPE(rpnt->r_info); - - _dl_dprintf(2, "can't handle reloc type " -#ifdef __SUPPORT_LD_DEBUG__ - "%s\n", _dl_reltypes(reloc_type) -#else - "%x\n", reloc_type -#endif - ); - - _dl_exit(-res); - } - if (unlikely(res > 0)) { - _dl_dprintf(2, "can't resolve symbol\n"); - - return res; - } - } - - return 0; -} - -static int _dl_do_reloc(struct elf_resolve *tpnt,struct r_scope_elem *scope, - ELF_RELOC *rpnt, ElfW(Sym) *symtab, char *strtab) -{ - int reloc_type; - int symtab_index, lsb; - char *symname; - unsigned long *reloc_addr; - unsigned long symbol_addr; -#ifdef __SUPPORT_LD_DEBUG__ - unsigned long old_val; -#endif - struct symbol_ref sym_ref; - - reloc_type = ELF_R_TYPE(rpnt->r_info); - symtab_index = ELF_R_SYM(rpnt->r_info); - symbol_addr = 0; - lsb = !!(symtab[symtab_index].st_other & STO_SH5_ISA32); - sym_ref.sym = &symtab[symtab_index]; - sym_ref.tpnt = NULL; - symname = strtab + symtab[symtab_index].st_name; - reloc_addr = (unsigned long *)(intptr_t) - (tpnt->loadaddr + (unsigned long)rpnt->r_offset); - - if (symtab_index) { - int stb; - - symbol_addr = (unsigned long)_dl_find_hash(symname, scope, tpnt, - elf_machine_type_class(reloc_type), &sym_ref); - - /* - * We want to allow undefined references to weak symbols - this - * might have been intentional. We should not be linking local - * symbols here, so all bases should be covered. - */ - stb = ELF_ST_BIND(symtab[symtab_index].st_info); - - if (stb != STB_WEAK && !symbol_addr) { - _dl_dprintf (2, "%s: can't resolve symbol '%s'\n", - _dl_progname, symname); - _dl_exit (1); - } - if (_dl_trace_prelink) { - _dl_debug_lookup (symname, tpnt, &symtab[symtab_index], - &sym_ref, elf_machine_type_class(reloc_type)); - } - } - -#ifdef __SUPPORT_LD_DEBUG__ - old_val = *reloc_addr; -#endif - - switch (reloc_type) { - case R_SH_NONE: - break; - case R_SH_COPY: - _dl_memcpy((char *)reloc_addr, - (char *)symbol_addr, symtab[symtab_index].st_size); - break; - case R_SH_DIR32: - case R_SH_GLOB_DAT: - case R_SH_JMP_SLOT: - *reloc_addr = (symbol_addr + rpnt->r_addend) | lsb; - break; - case R_SH_REL32: - *reloc_addr = symbol_addr + rpnt->r_addend - - (unsigned long)reloc_addr; - break; - case R_SH_RELATIVE: - *reloc_addr = (unsigned long)tpnt->loadaddr + rpnt->r_addend; - break; - case R_SH_RELATIVE_LOW16: - case R_SH_RELATIVE_MEDLOW16: - { - unsigned long word, value; - - word = (unsigned long)reloc_addr & ~0x3fffc00; - value = (unsigned long)tpnt->loadaddr + rpnt->r_addend; - - if (reloc_type == R_SH_RELATIVE_MEDLOW16) - value >>= 16; - - word |= (value & 0xffff) << 10; - *reloc_addr = word; - - break; - } - case R_SH_IMM_LOW16: - case R_SH_IMM_MEDLOW16: - { - unsigned long word, value; - - word = (unsigned long)reloc_addr & ~0x3fffc00; - value = (symbol_addr + rpnt->r_addend) | lsb; - - if (reloc_type == R_SH_IMM_MEDLOW16) - value >>= 16; - - word |= (value & 0xffff) << 10; - *reloc_addr = word; - - break; - } - case R_SH_IMM_LOW16_PCREL: - case R_SH_IMM_MEDLOW16_PCREL: - { - unsigned long word, value; - - word = (unsigned long)reloc_addr & ~0x3fffc00; - value = symbol_addr + rpnt->r_addend - - (unsigned long)reloc_addr; - - if (reloc_type == R_SH_IMM_MEDLOW16_PCREL) - value >>= 16; - - word |= (value & 0xffff) << 10; - *reloc_addr = word; - - break; - } - default: - return -1; /*call _dl_exit(1) */ - } - -#ifdef __SUPPORT_LD_DEBUG__ - if (_dl_debug_reloc && _dl_debug_detail) - _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x\n", - old_val, *reloc_addr, reloc_addr); -#endif - - return 0; -} - -static int _dl_do_lazy_reloc(struct elf_resolve *tpnt, struct r_scope_elem *scope, - ELF_RELOC *rpnt, ElfW(Sym) *symtab, char *strtab) -{ - int reloc_type, symtab_index, lsb; - unsigned long *reloc_addr; -#ifdef __SUPPORT_LD_DEBUG__ - unsigned long old_val; -#endif - - reloc_type = ELF_R_TYPE(rpnt->r_info); - symtab_index = ELF_R_SYM(rpnt->r_info); - lsb = !!(symtab[symtab_index].st_other & STO_SH5_ISA32); - reloc_addr = (unsigned long *)(intptr_t) - (tpnt->loadaddr + (unsigned long)rpnt->r_offset); - -#ifdef __SUPPORT_LD_DEBUG__ - old_val = *reloc_addr; -#endif - - switch (reloc_type) { - case R_SH_NONE: - break; - case R_SH_JMP_SLOT: - *reloc_addr += (unsigned long)tpnt->loadaddr | lsb; - break; - default: - return -1; /*call _dl_exit(1) */ - } - -#ifdef __SUPPORT_LD_DEBUG__ - if (_dl_debug_reloc && _dl_debug_detail) - _dl_dprintf(_dl_debug_file, "\tpatched: %x ==> %x @ %x\n", - old_val, *reloc_addr, reloc_addr); -#endif - - return 0; -} - -void _dl_parse_lazy_relocation_information(struct dyn_elf *rpnt, - unsigned long rel_addr, unsigned long rel_size) -{ - (void)_dl_parse(rpnt->dyn, NULL, rel_addr, rel_size, _dl_do_lazy_reloc); -} - -int _dl_parse_relocation_information(struct dyn_elf *rpnt, - struct r_scope_elem *scope, unsigned long rel_addr, unsigned long rel_size) -{ - return _dl_parse(rpnt->dyn, scope, rel_addr, rel_size, _dl_do_reloc); -} diff --git a/ldso/ldso/sh64/resolve.S b/ldso/ldso/sh64/resolve.S deleted file mode 100644 index ca915d2ef..000000000 --- a/ldso/ldso/sh64/resolve.S +++ /dev/null @@ -1,95 +0,0 @@ -/* vi: set sw=8 ts=8: */ -/* - * ldso/ldso/sh64/resolve.S - * - * SuperH (sh64) dynamic resolver support - * - * Copyright (C) 2003 Paul Mundt - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. The name of the above contributors may not be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - - .section .text..SHmedia32,"ax" - .globl _dl_linux_resolver - .globl _dl_linux_resolve - .type _dl_linux_resolve, @function - - .balign 16 -_dl_linux_resolve: - addi r15, -72, r15 ! make room on the stack - pt _dl_linux_resolver, tr0 - st.q r15, 0, r2 ! save regs - st.q r15, 8, r3 - st.q r15, 16, r4 - st.q r15, 24, r5 - st.q r15, 32, r6 - st.q r15, 40, r7 - st.q r15, 48, r8 - st.q r15, 56, r9 - st.q r15, 64, r18 - -#ifdef HAVE_FPU - addi r15, -48, r15 ! make room for FP regs - fst.d r15, 0, dr0 ! save FP regs - fst.d r15, 8, dr2 - fst.d r15, 16, dr4 - fst.d r15, 24, dr6 - fst.d r15, 32, dr8 - fst.d r15, 40, dr10 -#endif - - /* - * Args for _dl_linux_resolver(), set in r17/r21 by PLT code - */ - - add r17, r63, r2 ! link map address - add r21, r63, r3 ! GOT offset - blink tr0, r18 ! call _dl_linux_resolver() - ptabs/l r2, tr0 ! save result = addr of function called - -#ifdef HAVE_FPU - fld.d r15, 0, dr0 ! restore FP regs - fld.d r15, 8, dr2 - fld.d r15, 16, dr4 - fld.d r15, 24, dr6 - fld.d r15, 32, dr8 - fld.d r15, 40, dr10 - addi r15, 48, r15 -#endif - - ld.q r15, 0, r2 ! restore regs - ld.q r15, 8, r3 - ld.q r15, 16, r4 - ld.q r15, 24, r5 - ld.q r15, 32, r6 - ld.q r15, 40, r7 - ld.q r15, 48, r8 - ld.q r15, 56, r9 - ld.q r15, 64, r18 - - addi r15, 72, r15 - blink tr0, r63 ! jump to function address - - .size _dl_linux_resolve, . - _dl_linux_resolve - diff --git a/libc/string/sh64/Makefile b/libc/string/sh64/Makefile deleted file mode 100644 index 0a95346fd..000000000 --- a/libc/string/sh64/Makefile +++ /dev/null @@ -1,13 +0,0 @@ -# Makefile for uClibc -# -# Copyright (C) 2000-2005 Erik Andersen -# -# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. -# - -top_srcdir:=../../../ -top_builddir:=../../../ -all: objs -include $(top_builddir)Rules.mak -include ../Makefile.in -include $(top_srcdir)Makerules diff --git a/libc/string/sh64/memcpy.S b/libc/string/sh64/memcpy.S deleted file mode 100644 index 470784ecd..000000000 --- a/libc/string/sh64/memcpy.S +++ /dev/null @@ -1,205 +0,0 @@ -/* Cloned and hacked for uClibc by Paul Mundt, December 2003 */ -/* Modified by SuperH, Inc. September 2003 */ -! -! Fast SH memcpy -! -! by Toshiyasu Morita (tm@netcom.com) -! hacked by J"orn Rernnecke (joern.rennecke@superh.com) ("o for o-umlaut) -! SH5 code Copyright 2002 SuperH Ltd. -! -! Entry: ARG0: destination pointer -! ARG1: source pointer -! ARG2: byte count -! -! Exit: RESULT: destination pointer -! any other registers in the range r0-r7: trashed -! -! Notes: Usually one wants to do small reads and write a longword, but -! unfortunately it is difficult in some cases to concatanate bytes -! into a longword on the SH, so this does a longword read and small -! writes. -! -! This implementation makes two assumptions about how it is called: -! -! 1.: If the byte count is nonzero, the address of the last byte to be -! copied is unsigned greater than the address of the first byte to -! be copied. This could be easily swapped for a signed comparison, -! but the algorithm used needs some comparison. -! -! 2.: When there are two or three bytes in the last word of an 11-or-more -! bytes memory chunk to b copied, the rest of the word can be read -! without side effects. -! This could be easily changed by increasing the minumum size of -! a fast memcpy and the amount subtracted from r7 before L_2l_loop be 2, -! however, this would cost a few extra cyles on average. -! For SHmedia, the assumption is that any quadword can be read in its -! enirety if at least one byte is included in the copy. -! - -#include - - .section .text..SHmedia32,"ax" - .globl memcpy - .type memcpy, @function - .align 5 - -memcpy: - -#define LDUAQ(P,O,D0,D1) ldlo.q P,O,D0; ldhi.q P,O+7,D1 -#define STUAQ(P,O,D0,D1) stlo.q P,O,D0; sthi.q P,O+7,D1 -#define LDUAL(P,O,D0,D1) ldlo.l P,O,D0; ldhi.l P,O+3,D1 -#define STUAL(P,O,D0,D1) stlo.l P,O,D0; sthi.l P,O+3,D1 - - ld.b r3,0,r63 - pta/l Large,tr0 - movi 25,r0 - bgeu/u r4,r0,tr0 - nsb r4,r0 - shlli r0,5,r0 - movi (L1-L0+63*32 + 1) & 0xffff,r1 - sub r1, r0, r0 -L0: ptrel r0,tr0 - add r2,r4,r5 - ptabs r18,tr1 - add r3,r4,r6 - blink tr0,r63 - -/* Rearranged to make cut2 safe */ - .balign 8 -L4_7: /* 4..7 byte memcpy cntd. */ - stlo.l r2, 0, r0 - or r6, r7, r6 - sthi.l r5, -1, r6 - stlo.l r5, -4, r6 - blink tr1,r63 - - .balign 8 -L1: /* 0 byte memcpy */ - nop - blink tr1,r63 - nop - nop - nop - nop - -L2_3: /* 2 or 3 byte memcpy cntd. */ - st.b r5,-1,r6 - blink tr1,r63 - - /* 1 byte memcpy */ - ld.b r3,0,r0 - st.b r2,0,r0 - blink tr1,r63 - -L8_15: /* 8..15 byte memcpy cntd. */ - stlo.q r2, 0, r0 - or r6, r7, r6 - sthi.q r5, -1, r6 - stlo.q r5, -8, r6 - blink tr1,r63 - - /* 2 or 3 byte memcpy */ - ld.b r3,0,r0 - ld.b r2,0,r63 - ld.b r3,1,r1 - st.b r2,0,r0 - pta/l L2_3,tr0 - ld.b r6,-1,r6 - st.b r2,1,r1 - blink tr0, r63 - - /* 4 .. 7 byte memcpy */ - LDUAL (r3, 0, r0, r1) - pta L4_7, tr0 - ldlo.l r6, -4, r7 - or r0, r1, r0 - sthi.l r2, 3, r0 - ldhi.l r6, -1, r6 - blink tr0, r63 - - /* 8 .. 15 byte memcpy */ - LDUAQ (r3, 0, r0, r1) - pta L8_15, tr0 - ldlo.q r6, -8, r7 - or r0, r1, r0 - sthi.q r2, 7, r0 - ldhi.q r6, -1, r6 - blink tr0, r63 - - /* 16 .. 24 byte memcpy */ - LDUAQ (r3, 0, r0, r1) - LDUAQ (r3, 8, r8, r9) - or r0, r1, r0 - sthi.q r2, 7, r0 - or r8, r9, r8 - sthi.q r2, 15, r8 - ldlo.q r6, -8, r7 - ldhi.q r6, -1, r6 - stlo.q r2, 8, r8 - stlo.q r2, 0, r0 - or r6, r7, r6 - sthi.q r5, -1, r6 - stlo.q r5, -8, r6 - blink tr1,r63 - -Large: - ld.b r2, 0, r63 - pta/l Loop_ua, tr1 - ori r3, -8, r7 - sub r2, r7, r22 - sub r3, r2, r6 - add r2, r4, r5 - ldlo.q r3, 0, r0 - addi r5, -16, r5 - movi 64+8, r27 /* could subtract r7 from that. */ - stlo.q r2, 0, r0 - sthi.q r2, 7, r0 - ldx.q r22, r6, r0 - bgtu/l r27, r4, tr1 - - addi r5, -48, r27 - pta/l Loop_line, tr0 - addi r6, 64, r36 - addi r6, -24, r19 - addi r6, -16, r20 - addi r6, -8, r21 - -Loop_line: - ldx.q r22, r36, r63 - alloco r22, 32 - addi r22, 32, r22 - ldx.q r22, r19, r23 - sthi.q r22, -25, r0 - ldx.q r22, r20, r24 - ldx.q r22, r21, r25 - stlo.q r22, -32, r0 - ldx.q r22, r6, r0 - sthi.q r22, -17, r23 - sthi.q r22, -9, r24 - sthi.q r22, -1, r25 - stlo.q r22, -24, r23 - stlo.q r22, -16, r24 - stlo.q r22, -8, r25 - bgeu r27, r22, tr0 - -Loop_ua: - addi r22, 8, r22 - sthi.q r22, -1, r0 - stlo.q r22, -8, r0 - ldx.q r22, r6, r0 - bgtu/l r5, r22, tr1 - - add r3, r4, r7 - ldlo.q r7, -8, r1 - sthi.q r22, 7, r0 - ldhi.q r7, -1, r7 - ptabs r18,tr1 - stlo.q r22, 0, r0 - or r1, r7, r1 - sthi.q r5, 15, r1 - stlo.q r5, 8, r1 - blink tr1, r63 - - .size memcpy,.-memcpy - -libc_hidden_def(memcpy) diff --git a/libc/string/sh64/memset.S b/libc/string/sh64/memset.S deleted file mode 100644 index 1b8812cd6..000000000 --- a/libc/string/sh64/memset.S +++ /dev/null @@ -1,97 +0,0 @@ -/* Cloned and hacked for uClibc by Paul Mundt, December 2003 */ -/* Modified by SuperH, Inc. September 2003 */ -! -! Fast SH memset -! -! by Toshiyasu Morita (tm@netcom.com) -! -! SH5 code by J"orn Rennecke (joern.rennecke@superh.com) -! Copyright 2002 SuperH Ltd. -! - -#include -#include - -#if __BYTE_ORDER == __LITTLE_ENDIAN -#define SHHI shlld -#define SHLO shlrd -#else -#define SHHI shlrd -#define SHLO shlld -#endif - - .section .text..SHmedia32,"ax" - .globl memset - .type memset, @function - - .align 5 - -memset: - pta/l multiquad, tr0 - andi r2, 7, r22 - ptabs r18, tr2 - mshflo.b r3,r3,r3 - add r4, r22, r23 - mperm.w r3, r63, r3 /* Fill pattern now in every byte of r3 */ - - movi 8, r9 - bgtu/u r23, r9, tr0 /* multiquad */ - - beqi/u r4, 0, tr2 /* Return with size 0 - ensures no mem accesses */ - ldlo.q r2, 0, r7 - shlli r4, 2, r4 - movi -1, r8 - SHHI r8, r4, r8 - SHHI r8, r4, r8 - mcmv r7, r8, r3 - stlo.q r2, 0, r3 - blink tr2, r63 - -multiquad: - pta/l lastquad, tr0 - stlo.q r2, 0, r3 - shlri r23, 3, r24 - add r2, r4, r5 - beqi/u r24, 1, tr0 /* lastquad */ - pta/l loop, tr1 - sub r2, r22, r25 - andi r5, -8, r20 /* calculate end address and */ - addi r20, -7*8, r8 /* loop end address; This might overflow, so we need - to use a different test before we start the loop - */ - bge/u r24, r9, tr1 /* loop */ - st.q r25, 8, r3 - st.q r20, -8, r3 - shlri r24, 1, r24 - beqi/u r24, 1, tr0 /* lastquad */ - st.q r25, 16, r3 - st.q r20, -16, r3 - beqi/u r24, 2, tr0 /* lastquad */ - st.q r25, 24, r3 - st.q r20, -24, r3 -lastquad: - sthi.q r5, -1, r3 - blink tr2,r63 - -loop: -!!! alloco r25, 32 /* QQQ comment out for short-term fix to SHUK #3895. - QQQ commenting out is locically correct, but sub-optimal - QQQ Sean McGoogan - 4th April 2003. */ - st.q r25, 8, r3 - st.q r25, 16, r3 - st.q r25, 24, r3 - st.q r25, 32, r3 - addi r25, 32, r25 - bgeu/l r8, r25, tr1 /* loop */ - - st.q r20, -40, r3 - st.q r20, -32, r3 - st.q r20, -24, r3 - st.q r20, -16, r3 - st.q r20, -8, r3 - sthi.q r5, -1, r3 - blink tr2,r63 - - .size memset,.-memset - -libc_hidden_def(memset) diff --git a/libc/string/sh64/strcpy.S b/libc/string/sh64/strcpy.S deleted file mode 100644 index f317707b7..000000000 --- a/libc/string/sh64/strcpy.S +++ /dev/null @@ -1,102 +0,0 @@ -/* Cloned and hacked for uClibc by Paul Mundt, December 2003 */ -/* Modified by SuperH, Inc. September 2003 */ -! Entry: arg0: destination -! arg1: source -! Exit: result: destination -! -! SH5 code Copyright 2002 SuperH Ltd. - -#include -#include - -#if __BYTE_ORDER == __LITTLE_ENDIAN -#define SHHI shlld -#define SHLO shlrd -#else -#define SHHI shlrd -#define SHLO shlld -#endif - - .section .text..SHmedia32,"ax" - .globl strcpy - .type strcpy, @function - .align 5 - -strcpy: - - pta/l shortstring,tr1 - ldlo.q r3,0,r4 - ptabs r18,tr4 - shlli r3,3,r7 - addi r2, 8, r0 - mcmpeq.b r4,r63,r6 - SHHI r6,r7,r6 - bnei/u r6,0,tr1 /* shortstring */ - pta/l no_lddst, tr2 - ori r3,-8,r23 - sub r2, r23, r0 - sub r3, r2, r21 - addi r21, 8, r20 - ldx.q r0, r21, r5 - pta/l loop, tr0 - ori r2,-8,r22 - mcmpeq.b r5, r63, r6 - bgt/u r22, r23, tr2 /* no_lddst */ - - /* r22 < r23 : Need to do a load from the destination. */ - /* r22 == r23 : Doesn't actually need to load from destination, */ - /* but still can be handled here. */ - ldlo.q r2, 0, r9 - movi -1, r8 - SHLO r8, r7, r8 - mcmv r4, r8, r9 - stlo.q r2, 0, r9 - beqi/l r6, 0, tr0 /* loop */ - - add r5, r63, r4 - addi r0, 8, r0 - blink tr1, r63 /* shortstring */ -no_lddst: - /* r22 > r23: note that for r22 == r23 the sthi.q would clobber */ - /* bytes before the destination region. */ - stlo.q r2, 0, r4 - SHHI r4, r7, r4 - sthi.q r0, -1, r4 - beqi/l r6, 0, tr0 /* loop */ - - add r5, r63, r4 - addi r0, 8, r0 -shortstring: -#if __BYTE_ORDER != __LITTLE_ENDIAN - pta/l shortstring2,tr1 - byterev r4,r4 -#endif -shortstring2: - st.b r0,-8,r4 - andi r4,0xff,r5 - shlri r4,8,r4 - addi r0,1,r0 - bnei/l r5,0,tr1 - blink tr4,r63 /* return */ - - .balign 8 -loop: - stlo.q r0, 0, r5 - ldx.q r0, r20, r4 - addi r0, 16, r0 - sthi.q r0, -9, r5 - mcmpeq.b r4, r63, r6 - bnei/u r6, 0, tr1 /* shortstring */ - ldx.q r0, r21, r5 - stlo.q r0, -8, r4 - sthi.q r0, -1, r4 - mcmpeq.b r5, r63, r6 - beqi/l r6, 0, tr0 /* loop */ - - add r5, r63, r4 - addi r0, 8, r0 - blink tr1, r63 /* shortstring */ - - .size strcpy,.-strcpy - -libc_hidden_def(strcpy) diff --git a/libc/string/sh64/strlen.S b/libc/string/sh64/strlen.S deleted file mode 100644 index 18f4164ff..000000000 --- a/libc/string/sh64/strlen.S +++ /dev/null @@ -1,63 +0,0 @@ -/* vi: set sw=8 ts=8: */ -/* - * libc/string/sh64/strlen.S - * - * Simplistic strlen() implementation for SHmedia. - * - * Copyright (C) 2003 Paul Mundt - * - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. The name of the above contributors may not be - * used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#include - - .section .text..SHmedia32,"ax" - .globl strlen - .type strlen,@function - - .balign 16 -strlen: - ptabs r18, tr4 - - /* - * Note: We could easily deal with the NULL case here with a simple - * sanity check, though it seems that the behavior we want is to fault - * in the event that r2 == NULL, so we don't bother. - */ -/* beqi r2, 0, tr4 */ ! Sanity check - - movi -1, r0 - pta/l loop, tr0 -loop: - ld.b r2, 0, r1 - addi r2, 1, r2 - addi r0, 1, r0 - bnei/l r1, 0, tr0 - - or r0, r63, r2 - blink tr4, r63 - - .size strlen,.-strlen - -libc_hidden_def(strlen) diff --git a/libc/sysdeps/linux/sh64/Makefile b/libc/sysdeps/linux/sh64/Makefile deleted file mode 100644 index ecbf14228..000000000 --- a/libc/sysdeps/linux/sh64/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -# Makefile for uClibc -# -# Copyright (C) 2001 SuperH (UK) Ltd. -# Copyright (C) 2003 Paul Mundt -# -# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. - -top_srcdir=../../../../ -top_builddir=../../../../ -all: objs -include $(top_builddir)Rules.mak -include Makefile.arch -include $(top_srcdir)Makerules -TOPDIR=../../../../ -include $(TOPDIR)Rules.mak diff --git a/libc/sysdeps/linux/sh64/Makefile.arch b/libc/sysdeps/linux/sh64/Makefile.arch deleted file mode 100644 index 02fcd0b18..000000000 --- a/libc/sysdeps/linux/sh64/Makefile.arch +++ /dev/null @@ -1,10 +0,0 @@ -# Makefile for uClibc -# -# Copyright (C) 2008 Paul Mundt -# -# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. -# - -CSRC-y := __init_brk.c brk.c sbrk.c syscall.c - -SSRC-y := setjmp.S __longjmp.S diff --git a/libc/sysdeps/linux/sh64/__init_brk.c b/libc/sysdeps/linux/sh64/__init_brk.c deleted file mode 100644 index 8a41eb3c4..000000000 --- a/libc/sysdeps/linux/sh64/__init_brk.c +++ /dev/null @@ -1,26 +0,0 @@ -/* From libc-5.3.12 */ - -#include -#include -#include - -void * __curbrk attribute_hidden = 0; - -#define __NR__brk __NR_brk -attribute_hidden _syscall1(void *, _brk, void *, ptr) - -extern int __init_brk (void) attribute_hidden; -int -__init_brk (void) -{ - if (__curbrk == 0) - { - __curbrk = _brk(0); - if (__curbrk == 0) - { - __set_errno(ENOMEM); - return -1; - } - } - return 0; -} diff --git a/libc/sysdeps/linux/sh64/__longjmp.S b/libc/sysdeps/linux/sh64/__longjmp.S deleted file mode 100644 index 84343d1bf..000000000 --- a/libc/sysdeps/linux/sh64/__longjmp.S +++ /dev/null @@ -1,140 +0,0 @@ -/* __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, - see . */ - - -#define _SETJMP_H -#define _ASM -#include - - -#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 - -libc_hidden_def(__longjmp) diff --git a/libc/sysdeps/linux/sh64/bits/endian.h b/libc/sysdeps/linux/sh64/bits/endian.h deleted file mode 100644 index ae7e3bb2d..000000000 --- a/libc/sysdeps/linux/sh64/bits/endian.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - * 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 directly; include instead." -#endif - -#ifdef __LITTLE_ENDIAN__ -# define __BYTE_ORDER __LITTLE_ENDIAN -#else -# define __BYTE_ORDER __BIG_ENDIAN -#endif - diff --git a/libc/sysdeps/linux/sh64/bits/fcntl.h b/libc/sysdeps/linux/sh64/bits/fcntl.h deleted file mode 100644 index b319e8bcd..000000000 --- a/libc/sysdeps/linux/sh64/bits/fcntl.h +++ /dev/null @@ -1,218 +0,0 @@ -/* 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, see - . */ - -#ifndef _FCNTL_H -# error "Never use directly; include instead." -#endif - - -#include - -/* 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_NOATIME 01000000 /* Do not set atime. */ -# define O_CLOEXEC 02000000 /* set close_on_exec */ -#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 - -#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. */ -# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with - close-on-exit set on new fd. */ -# define F_SETPIPE_SZ 1031 /* Set pipe page size array. */ -# define F_GETPIPE_SZ 1032 /* Get pipe page size array. */ -#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 - - -#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ -/* Flags for SYNC_FILE_RANGE. */ -# define SYNC_FILE_RANGE_WAIT_BEFORE 1 /* Wait upon writeout of all pages - in the range before performing the - write. */ -# define SYNC_FILE_RANGE_WRITE 2 /* Initiate writeout of all those - dirty pages in the range which are - not presently under writeback. */ -# define SYNC_FILE_RANGE_WAIT_AFTER 4 /* Wait upon writeout of all pages in - the range after performing the - write. */ - -/* Flags for SPLICE and VMSPLICE. */ -# define SPLICE_F_MOVE 1 /* Move pages instead of copying. */ -# define SPLICE_F_NONBLOCK 2 /* Don't block on the pipe splicing - (but we may still block on the fd - we splice from/to). */ -# define SPLICE_F_MORE 4 /* Expect more data. */ -# define SPLICE_F_GIFT 8 /* Pages passed in are a gift. */ -#endif - -__BEGIN_DECLS - -#if defined __USE_GNU && defined __UCLIBC_LINUX_SPECIFIC__ - -/* Provide kernel hint to read ahead. */ -extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count) - __THROW; - - -/* Selective file content synch'ing. */ -extern int sync_file_range (int __fd, __off64_t __from, __off64_t __to, - unsigned int __flags); - -/* Splice address range into a pipe. */ -extern ssize_t vmsplice (int __fdout, const struct iovec *__iov, - size_t __count, unsigned int __flags); - -/* Splice two files together. */ -extern ssize_t splice (int __fdin, __off64_t *__offin, int __fdout, - __off64_t *__offout, size_t __len, - unsigned int __flags); - -/* In-kernel implementation of tee for pipe buffers. */ -extern ssize_t tee (int __fdin, int __fdout, size_t __len, - unsigned int __flags); - -#endif -__END_DECLS - diff --git a/libc/sysdeps/linux/sh64/bits/kernel_stat.h b/libc/sysdeps/linux/sh64/bits/kernel_stat.h deleted file mode 100644 index 1a29433e1..000000000 --- a/libc/sysdeps/linux/sh64/bits/kernel_stat.h +++ /dev/null @@ -1,55 +0,0 @@ -/* 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; - struct timespec st_atim; - struct timespec st_mtim; - struct timespec st_ctim; - 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 */ - - struct timespec st_atim; - struct timespec st_mtim; - struct timespec st_ctim; - - unsigned long __unused1; - unsigned long __unused2; -}; - -#endif /* _BITS_STAT_STRUCT_H */ - diff --git a/libc/sysdeps/linux/sh64/bits/kernel_types.h b/libc/sysdeps/linux/sh64/bits/kernel_types.h deleted file mode 100644 index 8cc6c6184..000000000 --- a/libc/sysdeps/linux/sh64/bits/kernel_types.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 __kernel_dev_t __kernel_old_dev_t; -typedef long __kernel_long_t; -typedef unsigned long __kernel_ulong_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 */ diff --git a/libc/sysdeps/linux/sh64/bits/setjmp.h b/libc/sysdeps/linux/sh64/bits/setjmp.h deleted file mode 100644 index 5d13b883c..000000000 --- a/libc/sysdeps/linux/sh64/bits/setjmp.h +++ /dev/null @@ -1,46 +0,0 @@ -/* 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 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, see - . */ - -/* Define the machine-dependent type `jmp_buf'. SH-5 version. */ -#ifndef _BITS_SETJMP_H -#define _BITS_SETJMP_H 1 - -#if !defined _SETJMP_H && !defined _PTHREAD_H -# error "Never include directly; use 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) - -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 /* bits/setjmp.h */ diff --git a/libc/sysdeps/linux/sh64/bits/shm.h b/libc/sysdeps/linux/sh64/bits/shm.h deleted file mode 100644 index 274f36a78..000000000 --- a/libc/sysdeps/linux/sh64/bits/shm.h +++ /dev/null @@ -1,102 +0,0 @@ -/* Copyright (C) 1995,1996,1997,2000,2002,2004 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, see - . */ - -#ifndef _SYS_SHM_H -# error "Never include directly; use instead." -#endif - -#include - -/* Permission flag for shmget. */ -#define SHM_R 0400 /* or S_IRUGO from */ -#define SHM_W 0200 /* or S_IWUGO from */ - -/* Flags for `shmat'. */ -#define SHM_RDONLY 010000 /* attach read-only else read-write */ -#define SHM_RND 020000 /* round attach address to SHMLBA */ -#define SHM_REMAP 040000 /* take-over region on attach */ - -/* Commands for `shmctl'. */ -#define SHM_LOCK 11 /* lock segment (root only) */ -#define SHM_UNLOCK 12 /* unlock segment (root only) */ - -__BEGIN_DECLS - -/* Segment low boundary address multiple. */ -#define SHMLBA (__getpagesize() << 2) -extern int __getpagesize (void) __THROW __attribute__ ((__const__)); - - -/* Type to count number of attaches. */ -typedef unsigned long int shmatt_t; - -/* Data structure describing a set of semaphores. */ -struct shmid_ds - { - struct ipc_perm shm_perm; /* operation permission struct */ - size_t shm_segsz; /* size of segment in bytes */ - __time_t shm_atime; /* time of last shmat() */ - unsigned long int __unused1; - __time_t shm_dtime; /* time of last shmdt() */ - unsigned long int __unused2; - __time_t shm_ctime; /* time of last change by shmctl() */ - unsigned long int __unused3; - __pid_t shm_cpid; /* pid of creator */ - __pid_t shm_lpid; /* pid of last shmop */ - shmatt_t shm_nattch; /* number of current attaches */ - unsigned long int __unused4; - unsigned long int __unused5; - }; - -#ifdef __USE_MISC - -/* ipcs ctl commands */ -# define SHM_STAT 13 -# define SHM_INFO 14 - -/* shm_mode upper byte flags */ -# define SHM_DEST 01000 /* segment will be destroyed on last detach */ -# define SHM_LOCKED 02000 /* segment will not be swapped */ -# define SHM_HUGETLB 04000 /* segment is mapped via hugetlb */ -# define SHM_NORESERVE 010000 /* don't check for reservations */ - -struct shminfo - { - unsigned long int shmmax; - unsigned long int shmmin; - unsigned long int shmmni; - unsigned long int shmseg; - unsigned long int shmall; - unsigned long int __unused1; - unsigned long int __unused2; - unsigned long int __unused3; - unsigned long int __unused4; - }; - -struct shm_info - { - int used_ids; - unsigned long int shm_tot; /* total allocated shm */ - unsigned long int shm_rss; /* total resident shm */ - unsigned long int shm_swp; /* total swapped shm */ - unsigned long int swap_attempts; - unsigned long int swap_successes; - }; - -#endif /* __USE_MISC */ - -__END_DECLS diff --git a/libc/sysdeps/linux/sh64/bits/stackinfo.h b/libc/sysdeps/linux/sh64/bits/stackinfo.h deleted file mode 100644 index c52e7d7b7..000000000 --- a/libc/sysdeps/linux/sh64/bits/stackinfo.h +++ /dev/null @@ -1,27 +0,0 @@ -/* 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 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, see - . */ - -/* This file contains a bit of information about the stack allocation - of the processor. */ - -#ifndef _STACKINFO_H -#define _STACKINFO_H 1 - -/* On SH the stack grows down. */ -#define _STACK_GROWS_DOWN 1 - -#endif /* stackinfo.h */ diff --git a/libc/sysdeps/linux/sh64/bits/syscalls.h b/libc/sysdeps/linux/sh64/bits/syscalls.h deleted file mode 100644 index 84877d042..000000000 --- a/libc/sysdeps/linux/sh64/bits/syscalls.h +++ /dev/null @@ -1,126 +0,0 @@ -#ifndef _BITS_SYSCALLS_H -#define _BITS_SYSCALLS_H -#ifndef _SYSCALL_H -# error "Never use directly; include instead." -#endif - -#ifndef __ASSEMBLER__ - -#include - -#define SYS_ify(syscall_name) (__NR_##syscall_name) - -/* user-visible error numbers are in the range -1 - -125: see */ -#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 */ - diff --git a/libc/sysdeps/linux/sh64/bits/uClibc_arch_features.h b/libc/sysdeps/linux/sh64/bits/uClibc_arch_features.h deleted file mode 100644 index e2091b5da..000000000 --- a/libc/sysdeps/linux/sh64/bits/uClibc_arch_features.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Track misc arch-specific features that aren't config options - */ - -#ifndef _BITS_UCLIBC_ARCH_FEATURES_H -#define _BITS_UCLIBC_ARCH_FEATURES_H - -/* instruction used when calling abort() to kill yourself */ -#define __UCLIBC_ABORT_INSTRUCTION__ "movi 0x10, r9; shori 0xff, r9; trapa r9" - -/* can your target use syscall6() for mmap ? */ -#undef __UCLIBC_MMAP_HAS_6_ARGS__ - -/* does your target align 64bit values in register pairs ? (32bit arches only) */ -#undef __UCLIBC_SYSCALL_ALIGN_64BIT__ - -/* does your target have a broken create_module() ? */ -#undef __UCLIBC_BROKEN_CREATE_MODULE__ - -/* does your target have to worry about older [gs]etrlimit() ? */ -#undef __UCLIBC_HANDLE_OLDER_RLIMIT__ - -/* does your target have an asm .set ? */ -#define __UCLIBC_HAVE_ASM_SET_DIRECTIVE__ - -/* define if target supports .weak */ -#define __UCLIBC_HAVE_ASM_WEAK_DIRECTIVE__ - -/* define if target supports .weakext */ -#undef __UCLIBC_HAVE_ASM_WEAKEXT_DIRECTIVE__ - -/* define if target supports CFI pseudo ops */ -#undef __UCLIBC_HAVE_ASM_CFI_DIRECTIVES__ - -/* define if target supports IEEE signed zero floats */ -#define __UCLIBC_HAVE_SIGNED_ZERO__ - -/* only weird assemblers generally need this */ -#undef __UCLIBC_ASM_LINE_SEP__ - -#endif /* _BITS_UCLIBC_ARCH_FEATURES_H */ diff --git a/libc/sysdeps/linux/sh64/bits/wordsize.h b/libc/sysdeps/linux/sh64/bits/wordsize.h deleted file mode 100644 index 7c2723be4..000000000 --- a/libc/sysdeps/linux/sh64/bits/wordsize.h +++ /dev/null @@ -1,12 +0,0 @@ -/* - * 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 - diff --git a/libc/sysdeps/linux/sh64/brk.c b/libc/sysdeps/linux/sh64/brk.c deleted file mode 100644 index a98cd5446..000000000 --- a/libc/sysdeps/linux/sh64/brk.c +++ /dev/null @@ -1,27 +0,0 @@ -/* From libc-5.3.12 */ -/* - * Copyright (C) 2000-2006 Erik Andersen - * - * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. - */ - -#include -#include -#include - -extern void * __curbrk attribute_hidden; -extern int __init_brk (void) attribute_hidden; -extern void *_brk(void *ptr) attribute_hidden; - -int brk(void * end_data_seg) -{ - if (__init_brk () == 0) - { - __curbrk = _brk(end_data_seg); - if (__curbrk == end_data_seg) - return 0; - __set_errno(ENOMEM); - } - return -1; -} -libc_hidden_def(brk) diff --git a/libc/sysdeps/linux/sh64/crt1.S b/libc/sysdeps/linux/sh64/crt1.S deleted file mode 100644 index 6cc3773b7..000000000 --- a/libc/sysdeps/linux/sh64/crt1.S +++ /dev/null @@ -1,82 +0,0 @@ -/* 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, - see . */ - -/* 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 "crt1.S" - - .globl _start - .type _start,%function - .type main,%function - - .section .text64,"xa" - .align 2 /* 2^2 = 4 */ - -_start: - /* __uClibc_main (main, argc, argv, init, fini) */ - movi __main, r18 - or r2, r63, r18 - - /* Pop argc off the stack and save a pointer to argv */ - ld.l r15, 0, r3 /* argc */ - addi r15, 4, r4 /* argv */ - - movi _init, r5 - movi _fini, r6 - - /* call main() */ - movi __uClibc_main, r17 - ptabs/l r17, tr0 - blink tr0, r18 - - /* should never get here....*/ - movi abort, 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: - movi main, r18 - ptabs/l r18, tr0 - blink tr0, r63 - -/* Define a symbol for the first piece of initialized data. */ - .data - .globl __data_start -__data_start: - .long 0 - .weak data_start - data_start = __data_start diff --git a/libc/sysdeps/linux/sh64/crti.S b/libc/sysdeps/linux/sh64/crti.S deleted file mode 100644 index 597be363d..000000000 --- a/libc/sysdeps/linux/sh64/crti.S +++ /dev/null @@ -1,42 +0,0 @@ - .file "initfini.c" - .section .text..SHmedia32,"ax" - .little - - .section .init - .hidden _init - .align 2 - .global _init - .type _init, @function -_init: - addi.l r15, -16, r15 - st.l r15, 4, r12 - movi (((datalabel _GLOBAL_OFFSET_TABLE_-(.LPCS0-.)) >> 16) & 65535), r12 - shori ((datalabel _GLOBAL_OFFSET_TABLE_-(.LPCS0-.)) & 65535), r12 - .LPCS0: ptrel/u r12, tr0 - st.l r15, 8, r14 - st.l r15, 12, r18 - add.l r15, r63, r14 - gettr tr0, r12 - - .align 2 - - - .section .fini - .hidden _fini - .align 2 - .global _fini - .type _fini, @function -_fini: - addi.l r15, -16, r15 - st.l r15, 4, r12 - movi (((datalabel _GLOBAL_OFFSET_TABLE_-(.LPCS1-.)) >> 16) & 65535), r12 - shori ((datalabel _GLOBAL_OFFSET_TABLE_-(.LPCS1-.)) & 65535), r12 - .LPCS1: ptrel/u r12, tr0 - st.l r15, 8, r14 - st.l r15, 12, r18 - add.l r15, r63, r14 - gettr tr0, r12 - .align 2 - - - .ident "GCC: (GNU) 3.3.2" diff --git a/libc/sysdeps/linux/sh64/crtn.S b/libc/sysdeps/linux/sh64/crtn.S deleted file mode 100644 index 501fe9167..000000000 --- a/libc/sysdeps/linux/sh64/crtn.S +++ /dev/null @@ -1,31 +0,0 @@ - .file "initfini.c" - .section .text..SHmedia32,"ax" - .little - - .section .init - .hidden _init - .align 2 - .global _init - .type _init, @function - add.l r14, r63, r15 - ld.l r15, 12, r18 - ld.l r15, 4, r12 - ld.l r15, 8, r14 - ptabs r18, tr0 - addi.l r15, 16, r15 - blink tr0, r63 - - .section .fini - .hidden _fini - .align 2 - .global _fini - .type _fini, @function - add.l r14, r63, r15 - ld.l r15, 12, r18 - ld.l r15, 4, r12 - ld.l r15, 8, r14 - ptabs r18, tr0 - addi.l r15, 16, r15 - blink tr0, r63 - - .ident "GCC: (GNU) 3.3.2" diff --git a/libc/sysdeps/linux/sh64/sbrk.c b/libc/sysdeps/linux/sh64/sbrk.c deleted file mode 100644 index 2dc719a16..000000000 --- a/libc/sysdeps/linux/sh64/sbrk.c +++ /dev/null @@ -1,25 +0,0 @@ -/* From libc-5.3.12 */ - -#include -#include -#include - -extern void * __curbrk attribute_hidden; -extern int __init_brk (void) attribute_hidden; -extern void *_brk(void *ptr) attribute_hidden; - -void * -sbrk(intptr_t increment) -{ - if (__init_brk () == 0) - { - char * tmp = (char*)__curbrk+increment; - __curbrk = _brk(tmp); - if (__curbrk == tmp) - return tmp-increment; - __set_errno(ENOMEM); - return ((void *) -1); - } - return ((void *) -1); -} -libc_hidden_def(sbrk) diff --git a/libc/sysdeps/linux/sh64/setjmp.S b/libc/sysdeps/linux/sh64/setjmp.S deleted file mode 100644 index f81961c17..000000000 --- a/libc/sysdeps/linux/sh64/setjmp.S +++ /dev/null @@ -1,139 +0,0 @@ -/* 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, - see . */ - - -#define _SETJMP_H -#define _ASM -#include - - -#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 - diff --git a/libc/sysdeps/linux/sh64/sys/procfs.h b/libc/sysdeps/linux/sh64/sys/procfs.h deleted file mode 100644 index 5fc4c579c..000000000 --- a/libc/sysdeps/linux/sh64/sys/procfs.h +++ /dev/null @@ -1,125 +0,0 @@ -/* Copyright (C) 1996, 1997, 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 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, see - . */ - -#ifndef _SYS_PROCFS_H -#define _SYS_PROCFS_H 1 - -/* This is somehow modelled after the file of the same name on SysVr4 - systems. It provides a definition of the core file format for ELF - used on Linux. */ - -#include -#include -#include -#include -#include -#include - -__BEGIN_DECLS - -/* - * ELF register definitions... - */ -typedef unsigned long elf_greg_t; - -#define ELF_NGREG (sizeof (struct pt_regs) / sizeof(elf_greg_t)) -typedef elf_greg_t elf_gregset_t[ELF_NGREG]; - -typedef struct user_fpu_struct elf_fpregset_t; - -struct elf_siginfo - { - int si_signo; /* Signal number. */ - int si_code; /* Extra code. */ - int si_errno; /* Errno. */ - }; - - -/* Definitions to generate Intel SVR4-like core files. These mostly - have the same names as the SVR4 types with "elf_" tacked on the - front to prevent clashes with linux definitions, and the typedef - forms have been avoided. This is mostly like the SVR4 structure, - but more Linuxy, with things that Linux does not support and which - gdb doesn't really use excluded. Fields present but not used are - marked with "XXX". */ -struct elf_prstatus - { -#if 0 - long int pr_flags; /* XXX Process flags. */ - short int pr_why; /* XXX Reason for process halt. */ - short int pr_what; /* XXX More detailed reason. */ -#endif - struct elf_siginfo pr_info; /* Info associated with signal. */ - short int pr_cursig; /* Current signal. */ - unsigned long int pr_sigpend; /* Set of pending signals. */ - unsigned long int pr_sighold; /* Set of held signals. */ -#if 0 - struct sigaltstack pr_altstack; /* Alternate stack info. */ - struct sigaction pr_action; /* Signal action for current sig. */ -#endif - __pid_t pr_pid; - __pid_t pr_ppid; - __pid_t pr_pgrp; - __pid_t pr_sid; - struct timeval pr_utime; /* User time. */ - struct timeval pr_stime; /* System time. */ - struct timeval pr_cutime; /* Cumulative user time. */ - struct timeval pr_cstime; /* Cumulative system time. */ -#if 0 - long int pr_instr; /* Current instruction. */ -#endif - elf_gregset_t pr_reg; /* GP registers. */ - int pr_fpvalid; /* True if math copro being used. */ - }; - - -#define ELF_PRARGSZ (80) /* Number of chars for args */ - -struct elf_prpsinfo - { - char pr_state; /* Numeric process state. */ - char pr_sname; /* Char for pr_state. */ - char pr_zomb; /* Zombie. */ - char pr_nice; /* Nice val. */ - unsigned long int pr_flag; /* Flags. */ - long pr_uid; - long pr_gid; - int pr_pid, pr_ppid, pr_pgrp, pr_sid; - /* Lots missing */ - char pr_fname[16]; /* Filename of executable. */ - char pr_psargs[ELF_PRARGSZ]; /* Initial part of arg list. */ - }; - - -/* Addresses. */ -typedef void *psaddr_t; - -/* Register sets. Linux has different names. */ -typedef elf_gregset_t prgregset_t; -typedef elf_fpregset_t prfpregset_t; - -/* We don't have any differences between processes and threads, - therefore habe only ine PID type. */ -typedef __pid_t lwpid_t; - - -typedef struct elf_prstatus prstatus_t; -typedef struct elf_prpsinfo prpsinfo_t; - -__END_DECLS - -#endif /* sys/procfs.h */ diff --git a/libc/sysdeps/linux/sh64/sys/ucontext.h b/libc/sysdeps/linux/sh64/sys/ucontext.h deleted file mode 100644 index 73695592a..000000000 --- a/libc/sysdeps/linux/sh64/sys/ucontext.h +++ /dev/null @@ -1,204 +0,0 @@ -/* 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, - see . */ - -/* Where is System V/SH ABI? */ - -#ifndef _SYS_UCONTEXT_H -#define _SYS_UCONTEXT_H 1 - -#include -#include - -/* We need the signal context definitions even if they are not used - included in . */ -#include - - -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 */ diff --git a/libc/sysdeps/linux/sh64/syscall.c b/libc/sysdeps/linux/sh64/syscall.c deleted file mode 100644 index a6c55ebe9..000000000 --- a/libc/sysdeps/linux/sh64/syscall.c +++ /dev/null @@ -1,24 +0,0 @@ - - -#include -#include -#include -#include - -long syscall(long sysnum, - long arg1, long arg2, long arg3, - long arg4, long arg5, long arg6) -{ -register long __sc0 __asm__ ("r9") = ((0x16 << 16) | sysnum); -register long __sc2 __asm__ ("r2") = (long) arg1; -register long __sc3 __asm__ ("r3") = (long) arg2; -register long __sc4 __asm__ ("r4") = (long) arg3; -register long __sc5 __asm__ ("r5") = (long) arg4; -register long __sc6 __asm__ ("r6") = (long) arg5; -register long __sc7 __asm__ ("r7") = (long) arg6; -__asm__ __volatile__ ("trapa %1" \ - : "=r" (__sc0) \ - : "r" (__sc0), "r" (__sc2), "r" (__sc3), "r" (__sc4), "r" (__sc5), \ - "r" (__sc6), "r" (__sc7)); -__syscall_return(long,__sc0); -} diff --git a/libpthread/linuxthreads.old/sysdeps/sh64/Makefile.arch b/libpthread/linuxthreads.old/sysdeps/sh64/Makefile.arch deleted file mode 100644 index ddb56645c..000000000 --- a/libpthread/linuxthreads.old/sysdeps/sh64/Makefile.arch +++ /dev/null @@ -1,30 +0,0 @@ -# Makefile for uClibc -# -# Copyright (C) 2003 Paul Mundt -# Copyright (C) 2000-2008 Erik Andersen -# -# Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. -# - -libpthread_ARCH_DIR:=$(top_srcdir)libpthread/linuxthreads.old/sysdeps/sh64 -libpthread_ARCH_OUT:=$(top_builddir)libpthread/linuxthreads.old/sysdeps/sh64 - -libpthread_ARCH_SRC:=$(wildcard $(libpthread_ARCH_DIR)/*.c) -libpthread_ARCH_OBJ:=$(patsubst $(libpthread_ARCH_DIR)/%.c,$(libpthread_ARCH_OUT)/%.o,$(libpthread_ARCH_SRC)) - -libpthread-a-y+=$(libpthread_ARCH_OBJ) -libpthread-so-y+=$(libpthread_ARCH_OBJ:.o=.os) - -libpthread-multi-y+=$(libpthread_ARCH_SRC) - -objclean-y += CLEAN_$($(top_builddir),,$(libpthread_ARCH_OUT)) - -# We need to build as SHcompact for tas.. -$(libpthread_ARCH_OBJ): %.o : %.c - $(compile.c:32media=compact) - -$(libpthread_ARCH_OBJ:.o=.os): %.os : %.c - $(compile.c:32media=compact) - -CLEAN_$($(top_builddir),,$(libpthread_ARCH_OUT)): - $(do_rm) $(addprefix $(libpthread_ARCH_OUT)/*., o os) diff --git a/libpthread/linuxthreads.old/sysdeps/sh64/pt-machine.c b/libpthread/linuxthreads.old/sysdeps/sh64/pt-machine.c deleted file mode 100644 index 1c187c85c..000000000 --- a/libpthread/linuxthreads.old/sysdeps/sh64/pt-machine.c +++ /dev/null @@ -1,46 +0,0 @@ -/* Cloned for uClibc by Paul Mundt, December 2003 */ -/* Modified by SuperH, Inc. September 2003 */ - -/* Machine-dependent pthreads configuration and inline functions. - SH5 version. - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Niibe Yutaka . - - 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, - see . */ - -#include "pt-machine.h" - -/* Spinlock implementation; required. */ - -/* The SH5 does not have a suitable test-and-set instruction (SWAP only - operates on an aligned quad word). So we use the SH4 version instead. - This must be seperately compiled in SHcompact mode, so it cannot be - inline. */ - -long int testandset (int *spinlock) -{ - int ret; - - __asm__ __volatile__( - "tas.b @%1\n\t" - "movt %0" - : "=r" (ret) - : "r" (spinlock) - : "memory", "cc"); - - return (ret == 0); -} - diff --git a/libpthread/linuxthreads.old/sysdeps/sh64/pt-machine.h b/libpthread/linuxthreads.old/sysdeps/sh64/pt-machine.h deleted file mode 100644 index 9b1fc74cd..000000000 --- a/libpthread/linuxthreads.old/sysdeps/sh64/pt-machine.h +++ /dev/null @@ -1,38 +0,0 @@ -/* Cloned for uClibc by Paul Mundt, December 2003 */ -/* Modified by SuperH, Inc. September 2003 */ - -/* Machine-dependent pthreads configuration and inline functions. - SuperH version. - Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Niibe Yutaka . - - 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, - see . */ - -#ifndef _PT_MACHINE_H -#define _PT_MACHINE_H 1 - -#include - -#ifndef PT_EI -# define PT_EI __extern_always_inline -#endif - -/* Get some notion of the current stack. Need not be exactly the top - of the stack, just something somewhere in the current frame. */ -#define CURRENT_STACK_FRAME stack_pointer -register char * stack_pointer __asm__ ("r15"); - -#endif /* pt-machine.h */ -- cgit v1.2.3