mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-08 18:30:18 +00:00
Remove CRIS port.
This commit is contained in:
parent
7ae95db5d7
commit
429ee403b8
@ -1,3 +1,8 @@
|
||||
2012-02-21 Joseph Myers <joseph@codesourcery.com>
|
||||
|
||||
* sysdeps/cris: Remove.
|
||||
* sysdeps/unix/sysv/linux/cris: Likewise.
|
||||
|
||||
2011-10-05 Andreas Schwab <schwab@redhat.com>
|
||||
|
||||
* sysdeps/cris/dl-machine.h (elf_machine_rela)
|
||||
|
@ -1,3 +0,0 @@
|
||||
wordsize-32
|
||||
ieee754/flt-32
|
||||
ieee754/dbl-64
|
@ -1,44 +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 Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
# The GNU C Library is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
# Lesser General Public License for more details.
|
||||
|
||||
# You should have received a copy of the GNU Lesser General Public
|
||||
# License along with the GNU C Library; if not, write to the Free
|
||||
# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
# 02111-1307 USA.
|
||||
|
||||
# We don't support long doubles as a distinct type. We don't need to set
|
||||
# this variable; it's here mostly for documentational purposes.
|
||||
|
||||
long-double-fcts = no
|
||||
|
||||
# FIXME: Note that this is a machine-specific stub; profiling is not
|
||||
# implemented.
|
||||
ifeq ($(subdir),gmon)
|
||||
sysdep_routines += _mcount
|
||||
endif
|
||||
|
||||
# FIXME: This test seems generally bogus. Wrong types in function calls
|
||||
# and assumes FE_TONEAREST is defined. Does it work somewhere?
|
||||
# Presumably it does, so let's settle for filtering it out target-wise
|
||||
# until it's agreed what should be done.
|
||||
ifeq ($(subdir),math)
|
||||
tests := $(filter-out test-fenv, $(tests))
|
||||
endif
|
||||
|
||||
# PIC code must be assembled with special options, passed on by gcc when
|
||||
# given the -fpic option.
|
||||
ASFLAGS-.os = -fpic
|
||||
|
||||
# Overflow occurs at 2**15/4 (8192) symbols. Glibc uses about 2000.
|
||||
# So use -fpic: smaller-size relocs; smaller, faster code.
|
||||
pic-ccflag = -fpic
|
@ -1,38 +0,0 @@
|
||||
/* longjmp for CRIS.
|
||||
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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <sysdep.h>
|
||||
#define _SETJMP_H
|
||||
#define _ASM
|
||||
#include <bits/setjmp.h>
|
||||
|
||||
.syntax no_register_prefix
|
||||
|
||||
/* Saving and restoring CCR is meaningless, so we don't do it. */
|
||||
ENTRY (__longjmp)
|
||||
/* Note that r10 = jmp_buf, r11 = retval. */
|
||||
move [r10+16*4],srp
|
||||
test.d r11
|
||||
beq 0f /* Already a 1 in place. */
|
||||
nop
|
||||
/* Offset for r9, the return value (see setjmp). */
|
||||
move.d r11,[r10+6*4]
|
||||
0:
|
||||
movem [r10],pc
|
||||
END (__longjmp)
|
@ -1,36 +0,0 @@
|
||||
/* Machine-specific calling sequence for `mcount' profiling function for CRIS.
|
||||
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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/* FIXME: This isn't implemented yet. This is just a machine-specific
|
||||
stub. Perhaps a real implementation can make use of it. */
|
||||
|
||||
#include <sysdep.h>
|
||||
|
||||
#undef CALL_MCOUNT
|
||||
#define CALL_MCOUNT
|
||||
|
||||
ENTRY (_mcount)
|
||||
SETUP_PIC
|
||||
/* Sorry, isn't implemented yet.
|
||||
Can't call abort; that will recurse. Force SEGV instead. */
|
||||
test.d [99]
|
||||
1:
|
||||
ba 1b
|
||||
nop
|
||||
END (_mcount)
|
@ -1,7 +0,0 @@
|
||||
/* CRIS is little-endian. */
|
||||
|
||||
#ifndef _ENDIAN_H
|
||||
# error "Never use <bits/endian.h> directly; include <endian.h> instead."
|
||||
#endif
|
||||
|
||||
#define __BYTE_ORDER __LITTLE_ENDIAN
|
@ -1,54 +0,0 @@
|
||||
/* Copyright (C) 1997, 1998, 2005 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/* Define the machine-dependent type `jmp_buf', CRIS version. */
|
||||
|
||||
/* Note that saving and restoring CCR has no meaning in user mode, so we
|
||||
don't actually do it; the slot is now reserved.
|
||||
|
||||
jmp_buf[0] - PC
|
||||
jmp_buf[1] - SP (R14)
|
||||
jmp_buf[2] - R13
|
||||
jmp_buf[3] - R12
|
||||
jmp_buf[4] - R11
|
||||
jmp_buf[5] - R10
|
||||
jmp_buf[6] - R9
|
||||
jmp_buf[7] - R8
|
||||
jmp_buf[8] - R7
|
||||
jmp_buf[9] - R6
|
||||
jmp_buf[10] - R5
|
||||
jmp_buf[11] - R4
|
||||
jmp_buf[12] - R3
|
||||
jmp_buf[13] - R2
|
||||
jmp_buf[14] - R1
|
||||
jmp_buf[15] - R0
|
||||
jmp_buf[16] - SRP
|
||||
jmp_buf[17] - CCR */
|
||||
|
||||
#ifndef _ASM
|
||||
typedef unsigned long int __jmp_buf[18];
|
||||
#endif
|
||||
|
||||
#if defined (__USE_MISC) || defined (_ASM)
|
||||
#define JB_SP 1
|
||||
#endif
|
||||
|
||||
/* Test if longjmp to JMPBUF would unwind the frame
|
||||
containing a local variable at ADDRESS. */
|
||||
#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
|
||||
((unsigned long int) (address) < demangle ((jmpbuf)[JB_SP]))
|
@ -1,26 +0,0 @@
|
||||
/* Optimized, inlined string functions. CRIS version.
|
||||
Copyright (C) 1997, 2001 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _STRING_H
|
||||
# error "Never use <bits/string.h> directly; include <string.h> instead."
|
||||
#endif
|
||||
|
||||
/* Currently the only purpose of this file is to tell the generic inline
|
||||
macros that unaligned memory access is possible. */
|
||||
#define _STRING_ARCH_unaligned 1
|
7
sysdeps/cris/configure
vendored
7
sysdeps/cris/configure
vendored
@ -1,7 +0,0 @@
|
||||
# This file is generated from configure.in by Autoconf. DO NOT EDIT!
|
||||
|
||||
libc_cv_asm_line_sep='@'
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define ASM_LINE_SEP $libc_cv_asm_line_sep
|
||||
_ACEOF
|
||||
|
@ -1,5 +0,0 @@
|
||||
GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
|
||||
|
||||
dnl CRIS uses `;' to start comments and `@' for line separator.
|
||||
libc_cv_asm_line_sep='@'
|
||||
AC_DEFINE_UNQUOTED(ASM_LINE_SEP, $libc_cv_asm_line_sep)
|
@ -1,392 +0,0 @@
|
||||
/* Machine-dependent ELF dynamic relocation inline functions. CRIS version.
|
||||
Copyright (C) 1996-2001, 2002, 2003, 2011 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef dl_machine_h
|
||||
#define dl_machine_h
|
||||
|
||||
#define ELF_MACHINE_NAME "CRIS"
|
||||
|
||||
#include <sys/param.h>
|
||||
|
||||
#ifdef __PIC__
|
||||
# define CALL_FN(x) \
|
||||
"move.d $pc,$r9\n\t" \
|
||||
"add.d " #x " - .,$r9\n\t" \
|
||||
"jsr $r9"
|
||||
#else
|
||||
# define CALL_FN(x) "jsr " #x
|
||||
#endif
|
||||
|
||||
/* Return nonzero iff ELF header is compatible with the running host. */
|
||||
|
||||
static inline int
|
||||
elf_machine_matches_host (const Elf32_Ehdr *ehdr)
|
||||
{
|
||||
return ehdr->e_machine == EM_CRIS;
|
||||
}
|
||||
|
||||
/* 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 inline Elf32_Addr
|
||||
elf_machine_dynamic (void)
|
||||
{
|
||||
/* Don't just set this to an asm variable "r0" since that's not logical
|
||||
(like, the variable is uninitialized and the register is fixed) and
|
||||
may make GCC trip over itself doing register allocation. Yes, I'm
|
||||
paranoid. Why do you ask? */
|
||||
Elf32_Addr *got;
|
||||
|
||||
__asm__ ("move.d $r0,%0" : "=rm" (got));
|
||||
return *got;
|
||||
}
|
||||
|
||||
/* Return the run-time load address of the shared object. We do it like
|
||||
m68k and i386, by taking an arbitrary local symbol, forcing a GOT entry
|
||||
for it, and peeking into the GOT table, which is set to the link-time
|
||||
file-relative symbol value (regardless of whether the target is REL or
|
||||
RELA). We subtract this link-time file-relative value from the "local"
|
||||
value we calculate from GOT position and GOT offset. FIXME: Perhaps
|
||||
there's some other symbol we could use, that we don't *have* to force a
|
||||
GOT entry for. */
|
||||
|
||||
static inline Elf32_Addr
|
||||
elf_machine_load_address (void)
|
||||
{
|
||||
Elf32_Addr gotaddr_diff;
|
||||
__asm__ ("sub.d [$r0+_dl_start:GOT16],$r0,%0\n\t"
|
||||
"add.d _dl_start:GOTOFF,%0" : "=r" (gotaddr_diff));
|
||||
return gotaddr_diff;
|
||||
}
|
||||
|
||||
/* Set up the loaded object described by L so its unrelocated PLT
|
||||
entries will jump to the on-demand fixup code in dl-runtime.c. */
|
||||
|
||||
static inline int
|
||||
elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
|
||||
{
|
||||
Elf32_Addr *got;
|
||||
extern void _dl_runtime_resolve (Elf32_Word);
|
||||
extern void _dl_runtime_profile (Elf32_Word);
|
||||
|
||||
if (l->l_info[DT_JMPREL] && lazy)
|
||||
{
|
||||
/* The GOT entries for functions in the PLT have not yet been
|
||||
filled in. Their initial contents will arrange when called
|
||||
to push an offset into the .rela.plt section, push
|
||||
_GLOBAL_OFFSET_TABLE_[1], and then jump to
|
||||
_GLOBAL_OFFSET_TABLE_[2]. */
|
||||
got = (Elf32_Addr *) D_PTR (l, l_info[DT_PLTGOT]);
|
||||
got[1] = (Elf32_Addr) l; /* Identify this shared object. */
|
||||
|
||||
/* The got[2] entry contains the address of a function which gets
|
||||
called to get the address of a so far unresolved function and
|
||||
jump to it. The profiling extension of the dynamic linker allows
|
||||
to intercept the calls to collect information. In this case we
|
||||
don't store the address in the GOT so that all future calls also
|
||||
end in this function. */
|
||||
if (__builtin_expect (profile, 0))
|
||||
{
|
||||
got[2] = (Elf32_Addr) &_dl_runtime_profile;
|
||||
|
||||
if (_dl_name_match_p (GL(dl_profile), l))
|
||||
{
|
||||
/* This is the object we are looking for. Say that we really
|
||||
want profiling and the timers are started. */
|
||||
GL(dl_profile_map) = l;
|
||||
}
|
||||
}
|
||||
else
|
||||
/* This function will get called to fix up the GOT entry indicated by
|
||||
the offset on the stack, and then jump to the resolved address. */
|
||||
got[2] = (Elf32_Addr) &_dl_runtime_resolve;
|
||||
}
|
||||
|
||||
return lazy;
|
||||
}
|
||||
|
||||
/* This code is used in dl-runtime.c to call the `fixup' function
|
||||
and then redirect to the address it returns.
|
||||
|
||||
We get here with the offset into the relocation table pushed on stack,
|
||||
and the link map in MOF. */
|
||||
|
||||
#define TRAMPOLINE_TEMPLATE(tramp_name, fixup_name) \
|
||||
"; Trampoline for " #fixup_name "\n\
|
||||
.globl " #tramp_name "\n\
|
||||
.type " #tramp_name ", @function\n\
|
||||
" #tramp_name ":\n\
|
||||
push $r13\n\
|
||||
push $r12\n\
|
||||
push $r11\n\
|
||||
push $r10\n\
|
||||
push $r9\n\
|
||||
push $srp\n\
|
||||
move.d [$sp+6*4],$r11\n\
|
||||
move $mof,$r10\n\
|
||||
" CALL_FN (fixup_name) "\n\
|
||||
move.d $r10,[$sp+6*4]\n\
|
||||
pop $srp\n\
|
||||
pop $r9\n\
|
||||
pop $r10\n\
|
||||
pop $r11\n\
|
||||
pop $r12\n\
|
||||
pop $r13\n\
|
||||
jump [$sp+]\n\
|
||||
.size " #tramp_name ", . - " #tramp_name "\n"
|
||||
#ifndef PROF
|
||||
#define ELF_MACHINE_RUNTIME_TRAMPOLINE \
|
||||
asm (TRAMPOLINE_TEMPLATE (_dl_runtime_resolve, fixup) \
|
||||
TRAMPOLINE_TEMPLATE (_dl_runtime_profile, profile_fixup));
|
||||
#else
|
||||
#define ELF_MACHINE_RUNTIME_TRAMPOLINE \
|
||||
asm (TRAMPOLINE_TEMPLATE (_dl_runtime_resolve, fixup) \
|
||||
".globl _dl_runtime_profile\n" \
|
||||
".set _dl_runtime_profile, _dl_runtime_resolve");
|
||||
#endif
|
||||
|
||||
|
||||
/* Mask identifying addresses reserved for the user program,
|
||||
where the dynamic linker should not map anything. */
|
||||
#define ELF_MACHINE_USER_ADDRESS_MASK 0xf8000000UL
|
||||
|
||||
/* Initial entry point code for the dynamic linker.
|
||||
The C function `_dl_start' is the real entry point;
|
||||
its return value is the user program's entry point. */
|
||||
|
||||
#define RTLD_START asm ("\
|
||||
.text\n\
|
||||
.globl _start\n\
|
||||
.type _start,@function\n\
|
||||
_start:\n\
|
||||
move.d $sp,$r10\n\
|
||||
" CALL_FN (_dl_start) "\n\
|
||||
/* FALLTHRU */\n\
|
||||
\n\
|
||||
.globl _dl_start_user\n\
|
||||
.type _dl_start_user,@function\n\
|
||||
_dl_start_user:\n\
|
||||
; Save the user entry point address in R1.\n\
|
||||
move.d $r10,$r1\n\
|
||||
; Point R0 at the GOT.\n\
|
||||
move.d $pc,$r0\n\
|
||||
sub.d .:GOTOFF,$r0\n\
|
||||
; See if we were run as a command with the executable file\n\
|
||||
; name as an extra leading argument.\n\
|
||||
move.d [$r0+_dl_skip_args:GOT16],$r13\n\
|
||||
move.d [$r13],$r9\n\
|
||||
; Get the original argument count\n\
|
||||
move.d [$sp],$r11\n\
|
||||
; Subtract _dl_skip_args from it.\n\
|
||||
sub.d $r9,$r11\n\
|
||||
; Adjust the stack pointer to skip _dl_skip_args words.\n\
|
||||
addi $r9.d,$sp\n\
|
||||
; Put the new argc in place as expected by the user entry.\n\
|
||||
move.d $r11,[$sp]\n\
|
||||
; Call _dl_init (struct link_map *main_map, int argc, char **argv, char **env)\n\
|
||||
; env: skip scaled argc and skip stored argc and NULL at end of argv[].\n\
|
||||
move.d $sp,$r13\n\
|
||||
addi $r11.d,$r13\n\
|
||||
addq 8,$r13\n\
|
||||
; argv: skip stored argc.\n\
|
||||
move.d $sp,$r12\n\
|
||||
addq 4,$r12\n\
|
||||
; main_map: at _dl_loaded.\n\
|
||||
move.d [$r0+_rtld_local:GOT16],$r9\n\
|
||||
move.d [$r9],$r10\n\
|
||||
move.d _dl_init_internal:PLTG,$r9\n\
|
||||
add.d $r0,$r9\n\
|
||||
jsr $r9\n\
|
||||
; Pass our finalizer function to the user in R10.\n\
|
||||
move.d [$r0+_dl_fini:GOT16],$r10\n\
|
||||
; Terminate the frame-pointer.\n\
|
||||
moveq 0,$r8\n\
|
||||
; Cause SEGV if user entry returns.\n\
|
||||
move $r8,$srp\n\
|
||||
; Jump to the user's entry point.\n\
|
||||
jump $r1\n\
|
||||
.size _dl_start_user, . - _dl_start_user\n\
|
||||
.previous");
|
||||
|
||||
/* The union of reloc-type-classes where the reloc TYPE is a member.
|
||||
|
||||
TYPE is in the class ELF_RTYPE_CLASS_PLT if it can describe a
|
||||
relocation for a PLT entry, that is, for which a PLT entry should not
|
||||
be allowed to define the value. The GNU linker for CRIS can merge a
|
||||
.got.plt entry (R_CRIS_JUMP_SLOT) with a .got entry (R_CRIS_GLOB_DAT),
|
||||
so we need to match both these reloc types.
|
||||
|
||||
TYPE is in the class ELF_RTYPE_CLASS_NOCOPY if it 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_CRIS_JUMP_SLOT)) \
|
||||
|| ((type) == R_CRIS_GLOB_DAT)) * ELF_RTYPE_CLASS_PLT) \
|
||||
| (((type) == R_CRIS_COPY) * ELF_RTYPE_CLASS_COPY))
|
||||
|
||||
/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */
|
||||
#define ELF_MACHINE_JMP_SLOT R_CRIS_JUMP_SLOT
|
||||
|
||||
/* CRIS never uses Elf32_Rel relocations. */
|
||||
#define ELF_MACHINE_NO_REL 1
|
||||
|
||||
/* We define an initialization functions. This is called very early in
|
||||
_dl_sysdep_start. */
|
||||
#define DL_PLATFORM_INIT dl_platform_init ()
|
||||
|
||||
static inline void __attribute__ ((unused))
|
||||
dl_platform_init (void)
|
||||
{
|
||||
if (GL(dl_platform) != NULL && *GL(dl_platform) == '\0')
|
||||
/* Avoid an empty string which would disturb us. */
|
||||
GL(dl_platform) = NULL;
|
||||
}
|
||||
|
||||
static inline Elf32_Addr
|
||||
elf_machine_fixup_plt (struct link_map *map, lookup_t t,
|
||||
const Elf32_Rela *reloc,
|
||||
Elf32_Addr *reloc_addr, Elf32_Addr value)
|
||||
{
|
||||
return *reloc_addr = value;
|
||||
}
|
||||
|
||||
/* Return the final value of a plt relocation. */
|
||||
static inline Elf32_Addr
|
||||
elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc,
|
||||
Elf32_Addr value)
|
||||
{
|
||||
return value + reloc->r_addend;
|
||||
}
|
||||
|
||||
#endif /* !dl_machine_h */
|
||||
|
||||
#ifdef RESOLVE
|
||||
|
||||
/* Perform the relocation specified by RELOC and SYM (which is fully resolved).
|
||||
MAP is the object containing the reloc. */
|
||||
|
||||
static inline void
|
||||
elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
|
||||
const Elf32_Sym *sym, const struct r_found_version *version,
|
||||
void *const reloc_addr_arg, int skip_ifunc)
|
||||
{
|
||||
Elf32_Addr *const reloc_addr = reloc_addr_arg;
|
||||
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
|
||||
|
||||
if (__builtin_expect (r_type == R_CRIS_RELATIVE, 0))
|
||||
*reloc_addr = map->l_addr + reloc->r_addend;
|
||||
else
|
||||
{
|
||||
#ifndef RTLD_BOOTSTRAP
|
||||
const Elf32_Sym *const refsym = sym;
|
||||
#endif
|
||||
Elf32_Addr value;
|
||||
if (sym->st_shndx != SHN_UNDEF
|
||||
&& ELF32_ST_BIND (sym->st_info) == STB_LOCAL)
|
||||
value = map->l_addr;
|
||||
else
|
||||
{
|
||||
value = RESOLVE (&sym, version, r_type);
|
||||
if (sym)
|
||||
value += sym->st_value;
|
||||
}
|
||||
value += reloc->r_addend; /* Assume copy relocs have zero addend. */
|
||||
|
||||
switch (r_type)
|
||||
{
|
||||
#ifndef RTLD_BOOTSTRAP
|
||||
case R_CRIS_COPY:
|
||||
if (sym == NULL)
|
||||
/* This can happen in trace mode if an object could not be
|
||||
found. */
|
||||
break;
|
||||
if (sym->st_size > refsym->st_size
|
||||
|| (GL(dl_verbose) && sym->st_size < refsym->st_size))
|
||||
{
|
||||
const char *strtab;
|
||||
|
||||
strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
|
||||
_dl_error_printf ("\
|
||||
%s: Symbol `%s' has different size in shared object, consider re-linking\n",
|
||||
rtld_progname ?: "<program name unknown>",
|
||||
strtab + refsym->st_name);
|
||||
}
|
||||
memcpy (reloc_addr_arg, (void *) value,
|
||||
MIN (sym->st_size, refsym->st_size));
|
||||
break;
|
||||
|
||||
case R_CRIS_32:
|
||||
#endif
|
||||
case R_CRIS_GLOB_DAT:
|
||||
case R_CRIS_JUMP_SLOT:
|
||||
*reloc_addr = value;
|
||||
break;
|
||||
#ifndef RTLD_BOOTSTRAP
|
||||
case R_CRIS_8:
|
||||
*(char *) reloc_addr = value;
|
||||
break;
|
||||
case R_CRIS_16:
|
||||
*(short *) reloc_addr = value;
|
||||
break;
|
||||
case R_CRIS_8_PCREL:
|
||||
*(char *) reloc_addr
|
||||
= value + reloc->r_addend - (Elf32_Addr) reloc_addr - 1;
|
||||
break;
|
||||
case R_CRIS_16_PCREL:
|
||||
*(short *) reloc_addr
|
||||
= value + reloc->r_addend - (Elf32_Addr) reloc_addr - 2;
|
||||
break;
|
||||
case R_CRIS_32_PCREL:
|
||||
*reloc_addr = value + reloc->r_addend - (Elf32_Addr) reloc_addr - 4;
|
||||
break;
|
||||
#endif
|
||||
case R_CRIS_NONE:
|
||||
break;
|
||||
#if !defined RTLD_BOOTSTRAP || defined _NDEBUG
|
||||
default:
|
||||
_dl_reloc_bad_type (map, r_type, 0);
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static inline void
|
||||
elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
|
||||
void *const reloc_addr_arg)
|
||||
{
|
||||
Elf32_Addr *const reloc_addr = reloc_addr_arg;
|
||||
*reloc_addr = l_addr + reloc->r_addend;
|
||||
}
|
||||
|
||||
static inline void
|
||||
elf_machine_lazy_rel (struct link_map *map,
|
||||
Elf32_Addr l_addr, const Elf32_Rela *reloc,
|
||||
int skip_ifunc)
|
||||
{
|
||||
Elf32_Addr *const reloc_addr = (void *) (l_addr + reloc->r_offset);
|
||||
const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
|
||||
if (__builtin_expect (r_type == R_CRIS_JUMP_SLOT, 1))
|
||||
*reloc_addr += l_addr;
|
||||
else
|
||||
_dl_reloc_bad_type (map, r_type, 1);
|
||||
}
|
||||
|
||||
#endif /* RESOLVE */
|
@ -1,141 +0,0 @@
|
||||
/* Startup code compliant to the ELF CRIS ABI (to-be-written).
|
||||
Copyright (C) 2001, 2002 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
In addition to the permissions in the GNU Lesser General Public
|
||||
License, the Free Software Foundation gives you unlimited
|
||||
permission to link the compiled version of this file with other
|
||||
programs, and to distribute those programs without any restriction
|
||||
coming from the use of this file. (The GNU Lesser General Public
|
||||
License restrictions do apply in other respects; for example, they
|
||||
cover modification of the file, and distribution when not linked
|
||||
into another program.)
|
||||
|
||||
Note that people who make modified versions of this file are not
|
||||
obligated to grant this special exception for their modified
|
||||
versions; it is their choice whether to do so. The GNU Lesser
|
||||
General Public License gives permission to release a modified
|
||||
version without this exception; this exception also makes it
|
||||
possible to release a modified version which carries forward this
|
||||
exception.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <sysdep.h>
|
||||
|
||||
/* This is the canonical entry point, usually the first thing in the text
|
||||
segment. When the entry point runs, most registers' values are
|
||||
unspecified, except for:
|
||||
|
||||
R10 Contains a function pointer to be registered with `atexit'.
|
||||
This is how the dynamic linker arranges to have DT_FINI
|
||||
functions called for shared libraries that have been loaded
|
||||
before this code runs.
|
||||
|
||||
SP The stack contains the arguments and environment:
|
||||
[SP] argc
|
||||
[SP+4] argv[0]
|
||||
...
|
||||
[SP+4*argc] NULL
|
||||
[SP+4*(argc+1)] envp[0]
|
||||
...
|
||||
NULL
|
||||
*/
|
||||
|
||||
.syntax no_register_prefix
|
||||
|
||||
.text
|
||||
.globl _start
|
||||
.type _start,@function
|
||||
_start:
|
||||
/* Clear the frame pointer, to mark the outermost frame. */
|
||||
moveq 0,r8
|
||||
|
||||
/* Move the shared library termination function to the right place
|
||||
for __libc_main. */
|
||||
move.d r10,r9
|
||||
|
||||
/* Extract the arguments as encoded on the stack and set up the
|
||||
arguments for `main': argc, argv. envp will be determined
|
||||
later in __libc_start_main. */
|
||||
|
||||
/* Get the argument count. */
|
||||
move.d [sp],r11
|
||||
|
||||
/* Store the stack pointer as end of stack. We overwrite
|
||||
the incoming argc. */
|
||||
move.d sp,[sp]
|
||||
|
||||
/* The argument vector starts just after the argument count. */
|
||||
move.d sp,r12
|
||||
addq 4,r12
|
||||
|
||||
/* There are seven arguments to __libc_start_main:
|
||||
r10: main - Address of it.
|
||||
r11: argc
|
||||
r12: argv
|
||||
r13: init - Function to call.
|
||||
|
||||
[sp]: fini - Function to register with atexit.
|
||||
[sp+4]: rtld_fini - Another function to register with atexit.
|
||||
[sp+8]: stack_end - Top of stack (actually same as argv).
|
||||
|
||||
The last two are passed on stack. */
|
||||
|
||||
/* Store the fini function coming from the dynamic loader. */
|
||||
push r9
|
||||
|
||||
/* Get the addresses of our own entry points to `.fini' and
|
||||
`.init'. */
|
||||
|
||||
#ifdef __PIC__
|
||||
/* If for some reason this program is compiled as PIC, set up R0. */
|
||||
move.d pc,r0
|
||||
sub.d .:GOTOFF,r0
|
||||
|
||||
move.d __libc_csu_init:PLTG,r13
|
||||
add.d r0,r13
|
||||
move.d __libc_csu_fini:PLTG,r9
|
||||
add.d r0,r9
|
||||
move.d main:PLTG,r10
|
||||
add.d r0,r10
|
||||
#else
|
||||
move.d __libc_csu_init,r13
|
||||
move.d __libc_csu_fini,r9
|
||||
move.d main,r10
|
||||
#endif
|
||||
push r9
|
||||
|
||||
/* Call the user's main function, and exit with its value. But
|
||||
let the libc call main. */
|
||||
PLTCALL (__libc_start_main)
|
||||
|
||||
/* Crash if somehow `exit' does return. We have at least 8192
|
||||
invalid addresses to choose from. */
|
||||
test.d [6502]
|
||||
|
||||
/* Stop the unstoppable. */
|
||||
0:
|
||||
ba 0b
|
||||
nop
|
||||
|
||||
/* 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
|
@ -1,28 +0,0 @@
|
||||
/* PowerPC-specific implementation of profiling support.
|
||||
Copyright (C) 1997, 2001 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
void __mcount_internal (unsigned long frompc, unsigned long selfpc);
|
||||
|
||||
#define _MCOUNT_DECL(frompc, selfpc) \
|
||||
void __mcount_internal (unsigned long frompc, unsigned long selfpc)
|
||||
|
||||
|
||||
/* Define MCOUNT as empty since we have the implementation in another
|
||||
file. FIXME: Just stubs, currently. */
|
||||
#define MCOUNT
|
@ -1,57 +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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <sysdeps/generic/memcopy.h>
|
||||
|
||||
/* We override the word-copying macros, partly because misalignment in one
|
||||
pointer isn't cause for a special function, partly because we want to
|
||||
get rid of wordcopy.c; these macros are only used in memmove.c (and
|
||||
it's sibling bcopy) since we have arch-specific mempcpy, memcpy and
|
||||
memset. */
|
||||
|
||||
#undef OP_T_THRES
|
||||
#define OP_T_THRES OPSIZ
|
||||
|
||||
#define WORD_COPY_FWD(dst_bp, src_bp, nbytes_left, nbytes) \
|
||||
do \
|
||||
{ \
|
||||
unsigned long enddst_bp = dst_bp + nbytes - (nbytes % OPSIZ); \
|
||||
nbytes_left = (nbytes % OPSIZ); \
|
||||
while (dst_bp < (unsigned long) enddst_bp) \
|
||||
{ \
|
||||
op_t x = *(op_t *) src_bp; \
|
||||
src_bp += sizeof x; \
|
||||
*(op_t *) dst_bp = x; \
|
||||
dst_bp += sizeof x; \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define WORD_COPY_BWD(dst_bp, src_bp, nbytes_left, nbytes) \
|
||||
do \
|
||||
{ \
|
||||
unsigned long enddst_bp = dst_bp - nbytes + (nbytes % OPSIZ); \
|
||||
nbytes_left = (nbytes % OPSIZ); \
|
||||
while (dst_bp > enddst_bp) \
|
||||
{ \
|
||||
op_t x; \
|
||||
src_bp -= sizeof x; \
|
||||
x = *(op_t *) src_bp; \
|
||||
dst_bp -= sizeof x; \
|
||||
*(op_t *) dst_bp = x; \
|
||||
} \
|
||||
} while (0)
|
@ -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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/* No asm variables, just for reasons of solid healthy paranoia. */
|
||||
#define GETSP() \
|
||||
({ \
|
||||
uintptr_t stack_ptr; \
|
||||
__asm__ ("move.d $sp,%0" : "=rm" (stack_ptr)); \
|
||||
stack_ptr; \
|
||||
})
|
||||
|
||||
#include <sysdeps/generic/memusage.h>
|
@ -1,66 +0,0 @@
|
||||
/* setjmp for CRIS.
|
||||
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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <sysdep.h>
|
||||
#define _SETJMP_H
|
||||
#define _ASM
|
||||
#include <bits/setjmp.h>
|
||||
|
||||
.syntax no_register_prefix
|
||||
|
||||
ENTRY (__sigsetjmp)
|
||||
.Local__sigsetjmp:
|
||||
moveq 1,r9
|
||||
movem sp,[r10+1*4]
|
||||
#ifdef __PIC__
|
||||
move.d pc,r9
|
||||
addq 0f-.,r9
|
||||
#else
|
||||
move.d 0f,r9
|
||||
#endif
|
||||
move.d r9,[r10]
|
||||
move srp,[r10+16*4]
|
||||
move ccr,[r10+17*4]
|
||||
PLTJUMP (__sigjmp_save)
|
||||
0: /* This is where longjmp returns. (Don't use "ret" - it's a macro. */
|
||||
Ret
|
||||
move.d r9,r10
|
||||
END (__sigsetjmp)
|
||||
|
||||
/* Binary compatibility entry points. Having these in separate files
|
||||
is not meaningful and just adds library overhead. */
|
||||
|
||||
ENTRY (__setjmp)
|
||||
ba .Local__sigsetjmp
|
||||
moveq 0,r11
|
||||
END (__setjmp)
|
||||
|
||||
ENTRY (_setjmp)
|
||||
ba .Local__sigsetjmp
|
||||
moveq 0,r11
|
||||
END (_setjmp)
|
||||
|
||||
ENTRY (setjmp)
|
||||
ba .Local__sigsetjmp
|
||||
moveq 1,r11
|
||||
END (setjmp)
|
||||
|
||||
weak_extern (__setjmp)
|
||||
weak_extern (_setjmp)
|
||||
weak_extern (setjmp)
|
@ -1,28 +0,0 @@
|
||||
/* Copyright (C) 2002 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
/* This file contains a bit of information about the stack allocation
|
||||
of the processor. */
|
||||
|
||||
#ifndef _STACKINFO_H
|
||||
#define _STACKINFO_H 1
|
||||
|
||||
/* On cris the stack grows down. */
|
||||
#define _STACK_GROWS_DOWN 1
|
||||
|
||||
#endif /* stackinfo.h */
|
@ -1,114 +0,0 @@
|
||||
/* Assembler macros for CRIS.
|
||||
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 Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <sysdeps/generic/sysdep.h>
|
||||
|
||||
#ifndef HAVE_ELF
|
||||
# error ELF is assumed. Generalize the code and retry.
|
||||
#endif
|
||||
|
||||
#ifndef NO_UNDERSCORES
|
||||
# error User-label prefix (underscore) assumed absent. Generalize the code and retry.
|
||||
#endif
|
||||
|
||||
#ifdef __ASSEMBLER__
|
||||
|
||||
/* Syntactic details of assembly-code. */
|
||||
|
||||
/* It is *not* generally true that "ELF uses byte-counts for .align, most
|
||||
others use log2 of count of bytes", like some neighboring configs say.
|
||||
See "align" in gas/read.c which is not overridden by
|
||||
gas/config/obj-elf.c. It takes a log2 argument. *Some* targets
|
||||
override it to take a byte argument. People should read source instead
|
||||
of relying on hearsay. */
|
||||
# define ALIGNARG(log2) log2
|
||||
|
||||
# define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg
|
||||
# define ASM_SIZE_DIRECTIVE(name) .size name,.-name
|
||||
|
||||
/* The non-PIC jump is preferred, since it does not stall, and does not
|
||||
invoke generation of a PLT. These macros assume that $r0 is set up as
|
||||
GOT register. */
|
||||
# ifdef __PIC__
|
||||
# define PLTJUMP(_x) \
|
||||
add.d C_SYMBOL_NAME (_x):PLT,$pc
|
||||
|
||||
# define PLTCALL(_x) \
|
||||
move.d C_SYMBOL_NAME (_x):PLTG,$r9 @ \
|
||||
add.d $r0,$r9 @ \
|
||||
jsr $r9
|
||||
|
||||
# define SETUP_PIC \
|
||||
push $r0 @ \
|
||||
move.d $pc,$r0 @ \
|
||||
sub.d .:GOTOFF,$r0
|
||||
|
||||
# define TEARDOWN_PIC pop $r0
|
||||
# else
|
||||
# define PLTJUMP(_x) jump C_SYMBOL_NAME (_x)
|
||||
# define PLTCALL(_x) jsr C_SYMBOL_NAME (_x)
|
||||
# define SETUP_PIC
|
||||
# define TEARDOWN_PIC
|
||||
# endif
|
||||
|
||||
/* Define an entry point visible from C. */
|
||||
# define ENTRY(name) \
|
||||
.text @ \
|
||||
ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME (name) @ \
|
||||
ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME (name), function) @ \
|
||||
.align ALIGNARG (2) @ \
|
||||
C_LABEL(name) @ \
|
||||
CALL_MCOUNT
|
||||
|
||||
# undef END
|
||||
# define END(name) \
|
||||
ASM_SIZE_DIRECTIVE (C_SYMBOL_NAME (name))
|
||||
|
||||
/* If compiled for profiling, call `mcount' at the start of each function.
|
||||
FIXME: Note that profiling is not actually implemented. This is just
|
||||
example code which might not even compile, though it is believed to be
|
||||
correct. */
|
||||
# ifdef PROF
|
||||
# define CALL_MCOUNT \
|
||||
push $srp @ \
|
||||
push $r9 @ \
|
||||
push $r10 @ \
|
||||
push $r11 @ \
|
||||
push $r12 @ \
|
||||
push $r13 @ \
|
||||
SETUP_PIC @ \
|
||||
PLTCALL (mcount) @ \
|
||||
TEARDOWN_PIC @ \
|
||||
pop $r13 @ \
|
||||
pop $r12 @ \
|
||||
pop $r11 @ \
|
||||
pop $r10 @ \
|
||||
pop $r9 @ \
|
||||
pop $srp
|
||||
# else
|
||||
# define CALL_MCOUNT /* Do nothing. */
|
||||
# endif
|
||||
|
||||
/* Since C identifiers are not normally prefixed with an underscore
|
||||
on this system, the asm identifier `syscall_error' intrudes on the
|
||||
C name space. Make sure we use an innocuous name. */
|
||||
# define syscall_error __syscall_error
|
||||
# define mcount _mcount
|
||||
|
||||
#endif /* __ASSEMBLER__ */
|
@ -1 +0,0 @@
|
||||
/* Empty; not needed. */
|
@ -1,106 +0,0 @@
|
||||
/* This file is needed by libio to define various configuration parameters.
|
||||
These are always the same in the GNU C library. */
|
||||
|
||||
/* We have to keep a separate copy for CRIS, because we don't use thunks,
|
||||
and libstdc++-v2 (which we currently use) cares. The C++ ABI is
|
||||
changed totally with GCC 3.0, where we should not need a separate file. */
|
||||
|
||||
#ifndef _G_config_h
|
||||
#define _G_config_h 1
|
||||
|
||||
/* Define types for libio in terms of the standard internal type names. */
|
||||
|
||||
#include <bits/types.h>
|
||||
#define __need_size_t
|
||||
#define __need_wchar_t
|
||||
#define __need_wint_t
|
||||
#define __need_NULL
|
||||
#include <stddef.h>
|
||||
#ifndef _WINT_T
|
||||
/* Integral type unchanged by default argument promotions that can
|
||||
hold any value corresponding to members of the extended character
|
||||
set, as well as at least one value that does not correspond to any
|
||||
member of the extended character set. */
|
||||
# define _WINT_T
|
||||
typedef unsigned int wint_t;
|
||||
#endif
|
||||
#define __need_mbstate_t
|
||||
#include <wchar.h>
|
||||
#define _G_size_t size_t
|
||||
typedef struct
|
||||
{
|
||||
__off_t __pos;
|
||||
__mbstate_t __state;
|
||||
} _G_fpos_t;
|
||||
typedef struct
|
||||
{
|
||||
__off64_t __pos;
|
||||
__mbstate_t __state;
|
||||
} _G_fpos64_t;
|
||||
#define _G_ssize_t __ssize_t
|
||||
#define _G_off_t __off_t
|
||||
#define _G_off64_t __off64_t
|
||||
#define _G_pid_t __pid_t
|
||||
#define _G_uid_t __uid_t
|
||||
#define _G_wchar_t wchar_t
|
||||
#define _G_wint_t wint_t
|
||||
#define _G_stat64 stat64
|
||||
#include <gconv.h>
|
||||
typedef union
|
||||
{
|
||||
struct __gconv_info __cd;
|
||||
struct
|
||||
{
|
||||
struct __gconv_info __cd;
|
||||
struct __gconv_step_data __data;
|
||||
} __combined;
|
||||
} _G_iconv_t;
|
||||
|
||||
typedef int _G_int16_t __attribute__ ((__mode__ (__HI__)));
|
||||
typedef int _G_int32_t __attribute__ ((__mode__ (__SI__)));
|
||||
typedef unsigned int _G_uint16_t __attribute__ ((__mode__ (__HI__)));
|
||||
typedef unsigned int _G_uint32_t __attribute__ ((__mode__ (__SI__)));
|
||||
|
||||
#define _G_HAVE_BOOL 1
|
||||
|
||||
|
||||
/* These library features are always available in the GNU C library. */
|
||||
#define _G_HAVE_ATEXIT 1
|
||||
#define _G_HAVE_SYS_CDEFS 1
|
||||
#define _G_HAVE_SYS_WAIT 1
|
||||
#define _G_NEED_STDARG_H 1
|
||||
#define _G_va_list __gnuc_va_list
|
||||
|
||||
#define _G_HAVE_PRINTF_FP 1
|
||||
#define _G_HAVE_MMAP 1
|
||||
#define _G_HAVE_LONG_DOUBLE_IO 1
|
||||
#define _G_HAVE_IO_FILE_OPEN 1
|
||||
#define _G_HAVE_IO_GETLINE_INFO 1
|
||||
|
||||
#define _G_IO_IO_FILE_VERSION 0x20001
|
||||
|
||||
#define _G_OPEN64 __open64
|
||||
#define _G_LSEEK64 __lseek64
|
||||
#define _G_MMAP64 __mmap64
|
||||
#define _G_FSTAT64(fd,buf) __fxstat64 (_STAT_VER, fd, buf)
|
||||
|
||||
/* This is defined by <bits/stat.h> if `st_blksize' exists. */
|
||||
#define _G_HAVE_ST_BLKSIZE defined (_STATBUF_ST_BLKSIZE)
|
||||
|
||||
#define _G_BUFSIZ 8192
|
||||
|
||||
/* These are the vtbl details for ELF. */
|
||||
#define _G_NAMES_HAVE_UNDERSCORE 0
|
||||
#define _G_VTABLE_LABEL_HAS_LENGTH 1
|
||||
#undef _G_USING_THUNKS
|
||||
#define _G_VTABLE_LABEL_PREFIX "_vt."
|
||||
#define _G_VTABLE_LABEL_PREFIX_ID _vt.
|
||||
|
||||
|
||||
#if defined __cplusplus || defined __STDC__
|
||||
# define _G_ARGS(ARGLIST) ARGLIST
|
||||
#else
|
||||
# define _G_ARGS(ARGLIST) ()
|
||||
#endif
|
||||
|
||||
#endif /* _G_config.h */
|
@ -1,191 +0,0 @@
|
||||
/* O_*, F_*, FD_* bit values for Linux.
|
||||
Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _FCNTL_H
|
||||
# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
|
||||
#endif
|
||||
|
||||
|
||||
#include <sys/types.h>
|
||||
|
||||
/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
|
||||
located on an ext2 file system */
|
||||
#define O_ACCMODE 0003
|
||||
#define O_RDONLY 00
|
||||
#define O_WRONLY 01
|
||||
#define O_RDWR 02
|
||||
#define O_CREAT 0100 /* not fcntl */
|
||||
#define O_EXCL 0200 /* not fcntl */
|
||||
#define O_NOCTTY 0400 /* not fcntl */
|
||||
#define O_TRUNC 01000 /* not fcntl */
|
||||
#define O_APPEND 02000
|
||||
#define O_NONBLOCK 04000
|
||||
#define O_NDELAY O_NONBLOCK
|
||||
#define O_SYNC 010000
|
||||
#define O_FSYNC O_SYNC
|
||||
#define O_ASYNC 020000
|
||||
|
||||
#ifdef __USE_GNU
|
||||
# define O_DIRECT 040000 /* Direct disk access. */
|
||||
# define O_DIRECTORY 0200000 /* Must be a directory. */
|
||||
# define O_NOFOLLOW 0400000 /* Do not follow links. */
|
||||
# define O_NOATIME 01000000 /* Do not set atime. */
|
||||
#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_UNIX98
|
||||
# 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. */
|
||||
#endif
|
||||
|
||||
/* For F_[GET|SET]FD. */
|
||||
#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
|
||||
|
||||
/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
|
||||
#define F_RDLCK 0 /* Read lock. */
|
||||
#define F_WRLCK 1 /* Write lock. */
|
||||
#define F_UNLCK 2 /* Remove lock. */
|
||||
|
||||
/* For old implementation of bsd flock(). */
|
||||
#define F_EXLCK 4 /* or 3 */
|
||||
#define F_SHLCK 8 /* or 4 */
|
||||
|
||||
#ifdef __USE_BSD
|
||||
/* Operations for bsd flock(), also used by the kernel implementation. */
|
||||
# define LOCK_SH 1 /* shared lock */
|
||||
# define LOCK_EX 2 /* exclusive lock */
|
||||
# define LOCK_NB 4 /* or'd with one of the above to prevent
|
||||
blocking */
|
||||
# define LOCK_UN 8 /* remove lock */
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
# define LOCK_MAND 32 /* This is a mandatory flock: */
|
||||
# define LOCK_READ 64 /* ... which allows concurrent read operations. */
|
||||
# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */
|
||||
# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */
|
||||
#endif
|
||||
|
||||
#ifdef __USE_GNU
|
||||
/* Types of directory notifications that may be requested with F_NOTIFY. */
|
||||
# define DN_ACCESS 0x00000001 /* File accessed. */
|
||||
# define DN_MODIFY 0x00000002 /* File modified. */
|
||||
# define DN_CREATE 0x00000004 /* File created. */
|
||||
# define DN_DELETE 0x00000008 /* File removed. */
|
||||
# define DN_RENAME 0x00000010 /* File renamed. */
|
||||
# define DN_ATTRIB 0x00000020 /* File changed attibutes. */
|
||||
# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */
|
||||
#endif
|
||||
|
||||
struct flock
|
||||
{
|
||||
short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
|
||||
short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
|
||||
#ifndef __USE_FILE_OFFSET64
|
||||
__off_t l_start; /* Offset where the lock begins. */
|
||||
__off_t l_len; /* Size of the locked area; zero means until EOF. */
|
||||
#else
|
||||
__off64_t l_start; /* Offset where the lock begins. */
|
||||
__off64_t l_len; /* Size of the locked area; zero means until EOF. */
|
||||
#endif
|
||||
__pid_t l_pid; /* Process holding the lock. */
|
||||
};
|
||||
|
||||
#ifdef __USE_LARGEFILE64
|
||||
struct flock64
|
||||
{
|
||||
short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
|
||||
short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
|
||||
__off64_t l_start; /* Offset where the lock begins. */
|
||||
__off64_t l_len; /* Size of the locked area; zero means until EOF. */
|
||||
__pid_t l_pid; /* Process holding the lock. */
|
||||
};
|
||||
#endif
|
||||
|
||||
/* Define some more compatibility macros to be backward compatible with
|
||||
BSD systems which did not managed to hide these kernel macros. */
|
||||
#ifdef __USE_BSD
|
||||
# define FAPPEND O_APPEND
|
||||
# define FFSYNC O_FSYNC
|
||||
# define FASYNC O_ASYNC
|
||||
# define FNONBLOCK O_NONBLOCK
|
||||
# define FNDELAY O_NDELAY
|
||||
#endif /* Use BSD. */
|
||||
|
||||
/* Advise to `posix_fadvise'. */
|
||||
#ifdef __USE_XOPEN2K
|
||||
# define POSIX_FADV_NORMAL 0 /* No further special treatment. */
|
||||
# define POSIX_FADV_RANDOM 1 /* Expect random page references. */
|
||||
# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */
|
||||
# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */
|
||||
# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
|
||||
# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Provide kernel hint to read ahead. */
|
||||
extern ssize_t readahead (int __fd, __off64_t __offset, size_t __count)
|
||||
__THROW;
|
||||
|
||||
__END_DECLS
|
@ -1,97 +0,0 @@
|
||||
/* Definitions for POSIX memory map interface. Linux/CRIS version.
|
||||
Copyright (C) 1997, 2000, 2001, 2003 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_MMAN_H
|
||||
# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
|
||||
#endif
|
||||
|
||||
/* The following definitions basically come from the kernel headers.
|
||||
But the kernel header is not namespace clean. */
|
||||
|
||||
|
||||
/* Protections are chosen from these bits, OR'd together. The
|
||||
implementation does not necessarily support PROT_EXEC or PROT_WRITE
|
||||
without PROT_READ. The only guarantees are that no writing will be
|
||||
allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
|
||||
|
||||
#define PROT_READ 0x1 /* Page can be read. */
|
||||
#define PROT_WRITE 0x2 /* Page can be written. */
|
||||
#define PROT_EXEC 0x4 /* Page can be executed. */
|
||||
#define PROT_NONE 0x0 /* Page can not be accessed. */
|
||||
#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
|
||||
growsdown vma (mprotect only). */
|
||||
#define PROT_GROWSUP 0x02000000 /* Extend change to start of
|
||||
growsup vma (mprotect only). */
|
||||
|
||||
/* Sharing types (must choose one and only one of these). */
|
||||
#define MAP_SHARED 0x01 /* Share changes. */
|
||||
#define MAP_PRIVATE 0x02 /* Changes are private. */
|
||||
#ifdef __USE_MISC
|
||||
# define MAP_TYPE 0x0f /* Mask for type of mapping. */
|
||||
#endif
|
||||
|
||||
/* Other flags. */
|
||||
#define MAP_FIXED 0x10 /* Interpret addr exactly. */
|
||||
#ifdef __USE_MISC
|
||||
# define MAP_FILE 0
|
||||
# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
|
||||
# define MAP_ANON MAP_ANONYMOUS
|
||||
#endif
|
||||
|
||||
/* These are Linux-specific. */
|
||||
#ifdef __USE_MISC
|
||||
# define MAP_GROWSDOWN 0x0100 /* Stack-like segment. */
|
||||
# define MAP_DENYWRITE 0x0800 /* ETXTBSY */
|
||||
# define MAP_EXECUTABLE 0x1000 /* Mark it as an executable. */
|
||||
# define MAP_LOCKED 0x2000 /* Lock the mapping. */
|
||||
# define MAP_NORESERVE 0x4000 /* Don't check for reservations. */
|
||||
#endif
|
||||
|
||||
/* Flags to `msync'. */
|
||||
#define MS_ASYNC 1 /* Sync memory asynchronously. */
|
||||
#define MS_SYNC 4 /* Synchronous memory sync. */
|
||||
#define MS_INVALIDATE 2 /* Invalidate the caches. */
|
||||
|
||||
/* Flags for `mlockall'. */
|
||||
#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
|
||||
#define MCL_FUTURE 2 /* Lock all additions to address
|
||||
space. */
|
||||
|
||||
/* Flags for `mremap'. */
|
||||
#ifdef __USE_GNU
|
||||
# define MREMAP_MAYMOVE 1
|
||||
#endif
|
||||
|
||||
/* Advice to `madvise'. */
|
||||
#ifdef __USE_BSD
|
||||
# define MADV_NORMAL 0 /* No further special treatment. */
|
||||
# define MADV_RANDOM 1 /* Expect random page references. */
|
||||
# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
|
||||
# define MADV_WILLNEED 3 /* Will need these pages. */
|
||||
# define MADV_DONTNEED 4 /* Don't need these pages. */
|
||||
#endif
|
||||
|
||||
/* The POSIX people had to invent similar names for the same things. */
|
||||
#ifdef __USE_XOPEN2K
|
||||
# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
|
||||
# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
|
||||
# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
|
||||
# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
|
||||
# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
|
||||
#endif
|
@ -1,44 +0,0 @@
|
||||
/* brk system call for Linux/CRIS.
|
||||
Copyright (C) 1995, 1996, 2001 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <sysdep.h>
|
||||
|
||||
/* This must be initialized data because commons can't have aliases. */
|
||||
void *__curbrk = 0;
|
||||
|
||||
int
|
||||
__brk (void *addr)
|
||||
{
|
||||
unsigned char *newbrk;
|
||||
|
||||
newbrk = (unsigned char *) INLINE_SYSCALL (brk, 1, addr);
|
||||
|
||||
__curbrk = newbrk;
|
||||
|
||||
if (newbrk < (unsigned char *) addr)
|
||||
{
|
||||
__set_errno (ENOMEM);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
weak_alias (__brk, brk)
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/m68k/chown.c>
|
@ -1,88 +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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <sysdep.h>
|
||||
#define _ERRNO_H 1
|
||||
#include <bits/errno.h>
|
||||
|
||||
/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
|
||||
|
||||
.syntax no_register_prefix
|
||||
|
||||
.text
|
||||
ENTRY (__clone)
|
||||
/* Sanity check arguments: No NULL function pointers. Allow a NULL
|
||||
stack pointer though; it makes the kernel allocate stack. */
|
||||
test.d r10
|
||||
beq 1f
|
||||
nop
|
||||
|
||||
/* We need to muck with a few registers. */
|
||||
movem r1,[sp=sp-8]
|
||||
|
||||
/* Save the function pointer and argument. We can't save them
|
||||
onto the new stack since it can be NULL. */
|
||||
move.d r10,r0
|
||||
move.d r13,r1
|
||||
|
||||
/* Move the other arguments into place for the system call. */
|
||||
move.d r11,r10
|
||||
move.d r12,r11
|
||||
|
||||
/* Do the system call. */
|
||||
movu.w SYS_ify (clone),r9
|
||||
break 13
|
||||
test.d r10
|
||||
beq .Lthread_start
|
||||
nop
|
||||
|
||||
/* Jump to error handler if we get (unsigned) -4096 .. 0xffffffff. */
|
||||
cmps.w -4096,r10
|
||||
bhs 0f
|
||||
movem [sp+],r1
|
||||
|
||||
/* In parent, successful return. (Avoid using "ret" - it's a macro.) */
|
||||
Ret
|
||||
nop
|
||||
|
||||
.Lthread_start:
|
||||
/* Terminate frame pointers here. */
|
||||
moveq 0,r8
|
||||
|
||||
/* I've told you once. */
|
||||
move.d r1,r10
|
||||
jsr r0
|
||||
|
||||
SETUP_PIC
|
||||
PLTCALL (_exit)
|
||||
|
||||
/* Die horribly. */
|
||||
test.d [6809]
|
||||
|
||||
/* Stop the unstoppable. */
|
||||
9:
|
||||
ba 9b
|
||||
nop
|
||||
|
||||
/* Local error handler. */
|
||||
1:
|
||||
movs.w -EINVAL,r10
|
||||
/* Drop through into the ordinary error handler. */
|
||||
PSEUDO_END (__clone)
|
||||
|
||||
weak_alias (__clone, clone)
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/fchown.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/fcntl.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/fxstat.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/getegid.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/geteuid.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/getgid.c>
|
@ -1,2 +0,0 @@
|
||||
/* We also have to rewrite the kernel gid_t to the user land type. */
|
||||
#include <sysdeps/unix/sysv/linux/i386/getgroups.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/getresgid.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/getresuid.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/getrlimit.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/getrlimit64.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/getuid.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/lchown.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/lockf64.c>
|
@ -1,2 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/lxstat.c>
|
||||
|
@ -1,68 +0,0 @@
|
||||
/* Copyright (C) 1995, 96, 97, 98, 99, 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 Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <sysdep.h>
|
||||
|
||||
#include "kernel-features.h"
|
||||
|
||||
#include <asm/errno.h>
|
||||
|
||||
/* Rather than dragging in yet another kernel file, <asm/page.h>, we
|
||||
define it here. Provide for easy override. */
|
||||
#ifndef PAGE_SHIFT
|
||||
#define PAGE_SHIFT 13
|
||||
#endif
|
||||
|
||||
.syntax no_register_prefix
|
||||
|
||||
/* This is __ptr_t
|
||||
__mmap (__ptr_t addr, size_t len, int prot, int flags, int fd, off_t offset) */
|
||||
|
||||
ENTRY (__mmap)
|
||||
|
||||
/* Only accept a offset (and address) being a multiple of PAGE_SIZE,
|
||||
since we only pass the page part in the system call. */
|
||||
move.d [sp+4],r9
|
||||
btstq (PAGE_SHIFT - 1),r9
|
||||
bne 1f
|
||||
btstq (PAGE_SHIFT - 1),r10
|
||||
|
||||
bne 1f
|
||||
lsrq PAGE_SHIFT,r9
|
||||
|
||||
move [sp],mof
|
||||
move srp,[sp]
|
||||
move r9,srp
|
||||
|
||||
movu.b SYS_ify (mmap2),r9
|
||||
break 13
|
||||
|
||||
cmps.w -4096,r10
|
||||
bhs 0f
|
||||
move [sp],srp
|
||||
|
||||
Ret
|
||||
nop
|
||||
|
||||
/* Local error handler. */
|
||||
1:
|
||||
movs.w -EINVAL,r10
|
||||
/* Drop through into the ordinary error handler. */
|
||||
PSEUDO_END (__mmap)
|
||||
|
||||
weak_alias (__mmap, mmap)
|
@ -1,91 +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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <sysdep.h>
|
||||
|
||||
#include "kernel-features.h"
|
||||
|
||||
#include <asm/errno.h>
|
||||
|
||||
/* Rather than dragging in yet another kernel file, <asm/page.h>, we
|
||||
define it here. Provide for easy override. */
|
||||
#ifndef PAGE_SHIFT
|
||||
#define PAGE_SHIFT 13
|
||||
#endif
|
||||
|
||||
/* This is: __ptr_t
|
||||
__mmap64 (__ptr_t addr, size_t len, int prot, int flags, int fd,
|
||||
off64_t offset); */
|
||||
|
||||
/* This was done in C, but the resulting code didn't look anywhere near
|
||||
nice, and mmap64 is important enough to have fast code. Rather than
|
||||
fixing (the generic bits in) gcc, we make sure not to depend on it by
|
||||
writing code that GCC cannot reasonably generate. */
|
||||
|
||||
.syntax no_register_prefix
|
||||
|
||||
ENTRY (__mmap64)
|
||||
|
||||
move [sp],mof
|
||||
move.d [sp+4],r9
|
||||
|
||||
/* Only accept an offset being a multiple of PAGE_SIZE, ditto address. */
|
||||
btstq (PAGE_SHIFT - 1),r9
|
||||
bne 1f
|
||||
lsrq PAGE_SHIFT,r9
|
||||
|
||||
btstq (PAGE_SHIFT - 1),r10
|
||||
bne 1f
|
||||
move.d r9,[sp]
|
||||
|
||||
/* We have to store the adjusted part somewhere we can "or" from.
|
||||
No registers available, so let's re-use the incoming low-part
|
||||
parameter location. */
|
||||
move.d [sp+8],r9
|
||||
|
||||
swapwbr r9
|
||||
/* Check if the highest bits (now the lowest bits) are zero. They
|
||||
must be, since we're actually calling a system function
|
||||
specifying the size in *pages* in a single dword. Thus you can
|
||||
mmap64 PAGE_SIZE * 4 Gbyte. */
|
||||
btstq (PAGE_SHIFT - 1),r9
|
||||
bne 1f
|
||||
swapwbr r9
|
||||
|
||||
lslq (32 - PAGE_SHIFT),r9
|
||||
or.d [sp],r9
|
||||
move srp,[sp]
|
||||
move r9,srp
|
||||
|
||||
movu.b SYS_ify (mmap2),r9
|
||||
break 13
|
||||
|
||||
cmps.w -4096,r10
|
||||
bhs 0f
|
||||
move [sp],srp
|
||||
|
||||
Ret
|
||||
nop
|
||||
|
||||
/* Local error handler. */
|
||||
1:
|
||||
movs.w -EINVAL,r10
|
||||
/* Drop through into the ordinary error handler. */
|
||||
PSEUDO_END (__mmap64)
|
||||
|
||||
weak_alias (__mmap64, mmap64)
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/msgctl.c>
|
@ -1,26 +0,0 @@
|
||||
/* Low-level statistical profiling support function. Linux/CRIS version.
|
||||
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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <signal.h>
|
||||
|
||||
static void
|
||||
profil_counter (int signo, struct sigcontext *scp)
|
||||
{
|
||||
profil_count ((void *) scp->regs.irp);
|
||||
}
|
@ -1,117 +0,0 @@
|
||||
/* Dump registers.
|
||||
Copyright (C) 1998, 2001 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <stddef.h>
|
||||
#include <sys/uio.h>
|
||||
#include <stdio-common/_itoa.h>
|
||||
|
||||
/* We will print the register dump in this format:
|
||||
|
||||
R0: XXXXXXXX R1: XXXXXXXX R2: XXXXXXXX R3: XXXXXXXX
|
||||
R4: XXXXXXXX R5: XXXXXXXX R6: XXXXXXXX R7: XXXXXXXX
|
||||
R8: XXXXXXXX R9: XXXXXXXX R10: XXXXXXXX R11: XXXXXXXX
|
||||
R12: XXXXXXXX R13: XXXXXXXX SP: XXXXXXXX PC: XXXXXXXX
|
||||
DCCR: XXXXXXXX SRP: XXXXXXXX */
|
||||
|
||||
static void
|
||||
hexvalue (unsigned long int value, char *buf, size_t len)
|
||||
{
|
||||
char *cp = _itoa_word (value, buf + len, 16, 0);
|
||||
while (cp > buf)
|
||||
*--cp = '0';
|
||||
}
|
||||
|
||||
static void register_dump (int fd, struct sigcontext *ctx)
|
||||
{
|
||||
char regs[18][8];
|
||||
struct iovec iov[36], *next_iov = iov;
|
||||
struct pt_regs *rx = &ctx->regs;
|
||||
|
||||
#define ADD_STRING(str) \
|
||||
next_iov->iov_base = (char *) (str); \
|
||||
next_iov->iov_len = strlen (str); \
|
||||
++next_iov
|
||||
#define ADD_MEM(str, len) \
|
||||
next_iov->iov_base = (str); \
|
||||
next_iov->iov_len = (len); \
|
||||
++next_iov
|
||||
|
||||
/* Generate strings of register contents. */
|
||||
hexvalue (rx->r0, regs[0], 8);
|
||||
hexvalue (rx->r1, regs[1], 8);
|
||||
hexvalue (rx->r2, regs[2], 8);
|
||||
hexvalue (rx->r3, regs[3], 8);
|
||||
hexvalue (rx->r4, regs[4], 8);
|
||||
hexvalue (rx->r5, regs[5], 8);
|
||||
hexvalue (rx->r6, regs[6], 8);
|
||||
hexvalue (rx->r7, regs[7], 8);
|
||||
hexvalue (rx->r8, regs[8], 8);
|
||||
hexvalue (rx->r9, regs[9], 8);
|
||||
hexvalue (rx->r10, regs[10], 8);
|
||||
hexvalue (rx->r11, regs[11], 8);
|
||||
hexvalue (rx->r12, regs[12], 8);
|
||||
hexvalue (rx->r13, regs[13], 8);
|
||||
hexvalue (ctx->usp, regs[14], 8);
|
||||
hexvalue (rx->irp, regs[17], 8);
|
||||
hexvalue (rx->dccr, regs[15], 8);
|
||||
hexvalue (rx->srp, regs[16], 8);
|
||||
|
||||
/* Generate the output. */
|
||||
ADD_STRING ("Register dump:\n\n R0: ");
|
||||
ADD_MEM (regs[0], 8);
|
||||
ADD_STRING (" R1: ");
|
||||
ADD_MEM (regs[1], 8);
|
||||
ADD_STRING (" R2: ");
|
||||
ADD_MEM (regs[2], 8);
|
||||
ADD_STRING (" R3: ");
|
||||
ADD_MEM (regs[3], 8);
|
||||
ADD_STRING ("\n R4: ");
|
||||
ADD_MEM (regs[4], 8);
|
||||
ADD_STRING (" R5: ");
|
||||
ADD_MEM (regs[5], 8);
|
||||
ADD_STRING (" R6: ");
|
||||
ADD_MEM (regs[6], 8);
|
||||
ADD_STRING (" R7: ");
|
||||
ADD_MEM (regs[7], 8);
|
||||
ADD_STRING ("\n R8: ");
|
||||
ADD_MEM (regs[8], 8);
|
||||
ADD_STRING (" R9: ");
|
||||
ADD_MEM (regs[9], 8);
|
||||
ADD_STRING (" R10: ");
|
||||
ADD_MEM (regs[10], 8);
|
||||
ADD_STRING (" R11: ");
|
||||
ADD_MEM (regs[11], 8);
|
||||
ADD_STRING ("\n R12: ");
|
||||
ADD_MEM (regs[12], 8);
|
||||
ADD_STRING (" R13: ");
|
||||
ADD_MEM (regs[13], 8);
|
||||
ADD_STRING (" SP: ");
|
||||
ADD_MEM (regs[14], 8);
|
||||
ADD_STRING (" PC: ");
|
||||
ADD_MEM (regs[17], 8);
|
||||
ADD_STRING ("\nDCCR: ");
|
||||
ADD_MEM (regs[15], 8);
|
||||
ADD_STRING (" SRP: ");
|
||||
ADD_MEM (regs[16], 4);
|
||||
|
||||
/* Write the stuff out. */
|
||||
writev (fd, iov, next_iov - iov);
|
||||
}
|
||||
|
||||
#define REGISTER_DUMP register_dump (fd, ctx)
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/semctl.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/setegid.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/seteuid.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/setfsgid.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/setfsuid.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/setgid.c>
|
@ -1,2 +0,0 @@
|
||||
/* We also have to rewrite the kernel gid_t to the user land type. */
|
||||
#include <sysdeps/unix/sysv/linux/i386/setgroups.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/setregid.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/setresgid.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/setresuid.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/setreuid.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/setrlimit.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/setuid.c>
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/shmctl.c>
|
@ -1,96 +0,0 @@
|
||||
/* Copyright (C) 1995, 1996, 1997, 1999, 2001 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <sysdep.h>
|
||||
#include <socketcall.h>
|
||||
|
||||
#define P(a, b) P2(a, b)
|
||||
#define P2(a, b) a##b
|
||||
|
||||
/* The socket-oriented system calls are handled unusally in Linux.
|
||||
They are all gated through the single `socketcall' system call number.
|
||||
`socketcall' takes two arguments: the first is the subcode, specifying
|
||||
which socket function is being called; and the second is a pointer to
|
||||
the arguments to the specific function.
|
||||
|
||||
The .S files for the other calls just #define socket and #include this.
|
||||
They also #define a 'number-of-arguments' word in NARGS, which
|
||||
defaults to 3. */
|
||||
|
||||
#ifndef NARGS
|
||||
#ifdef socket
|
||||
#error NARGS not defined
|
||||
#endif
|
||||
#define NARGS 3
|
||||
#endif
|
||||
|
||||
.syntax no_register_prefix
|
||||
|
||||
#ifndef __socket
|
||||
#define __socket P(__,socket)
|
||||
#endif
|
||||
|
||||
ENTRY(__socket)
|
||||
subq NARGS*4,sp
|
||||
|
||||
#if NARGS >= 2
|
||||
move.d sp,r9
|
||||
move.d r10,[r9+]
|
||||
#else
|
||||
move.d r10,[sp]
|
||||
#endif
|
||||
#if NARGS >= 2
|
||||
move.d r11,[r9+]
|
||||
#endif
|
||||
#if NARGS >= 3
|
||||
move.d r12,[r9+]
|
||||
#endif
|
||||
#if NARGS >= 4
|
||||
move.d r13,[r9+]
|
||||
#endif
|
||||
#if NARGS >= 5
|
||||
move.d [sp+NARGS*4],r13
|
||||
move.d r13,[r9+]
|
||||
#endif
|
||||
#if NARGS >= 6
|
||||
move.d [sp+NARGS*4+4],r13
|
||||
move.d r13,[r9+]
|
||||
#endif
|
||||
#if NARGS >= 7
|
||||
move.d [sp+NARGS*4+8],r13
|
||||
move.d r13,[r9+]
|
||||
#endif
|
||||
#if NARGS >= 8
|
||||
move.d [sp+NARGS*4+12],r13
|
||||
move.d r13,[r9+]
|
||||
#endif
|
||||
#if NARGS >= 9
|
||||
#error Too many arguments!
|
||||
#endif
|
||||
moveq P(SOCKOP_,socket),r10
|
||||
move.d sp,r11
|
||||
movu.w SYS_ify(socketcall),r9
|
||||
break 13
|
||||
cmps.w -4096,r10
|
||||
bhs 0f
|
||||
addq NARGS*4,sp
|
||||
Ret
|
||||
nop
|
||||
PSEUDO_END (__socket)
|
||||
|
||||
weak_alias (__socket, socket)
|
@ -1,56 +0,0 @@
|
||||
/* Copyright (C) 1998, 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 Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#ifndef _SYS_UCONTEXT_H
|
||||
#define _SYS_UCONTEXT_H 1
|
||||
|
||||
#include <features.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include <bits/sigcontext.h>
|
||||
|
||||
|
||||
/* Type for general register. */
|
||||
typedef long int greg_t;
|
||||
|
||||
/* Number of general registers. */
|
||||
#define NGREG 20
|
||||
|
||||
/* Container for all general registers. */
|
||||
typedef greg_t gregset_t[NGREG];
|
||||
|
||||
/* A placeholder type for floating-point register. */
|
||||
typedef long int fpreg_t;
|
||||
|
||||
/* A placeholder; CRIS does not have any fp regs. */
|
||||
typedef unsigned long fpregset_t;
|
||||
|
||||
/* A machine context is exactly a sigcontext. */
|
||||
typedef struct sigcontext mcontext_t;
|
||||
|
||||
/* Userlevel context. */
|
||||
typedef struct ucontext
|
||||
{
|
||||
unsigned long int uc_flags;
|
||||
struct ucontext *uc_link;
|
||||
stack_t uc_stack;
|
||||
mcontext_t uc_mcontext;
|
||||
__sigset_t uc_sigmask;
|
||||
} ucontext_t;
|
||||
|
||||
#endif /* sys/ucontext.h */
|
@ -1,40 +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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <sysdep.h>
|
||||
|
||||
.syntax no_register_prefix
|
||||
|
||||
/* Make syscall (callno, ...) into a system call. */
|
||||
|
||||
ENTRY (syscall)
|
||||
move.d r10,r9
|
||||
move.d r11,r10
|
||||
move.d r12,r11
|
||||
move.d r13,r12
|
||||
move.d [sp],r13
|
||||
move srp,[sp]
|
||||
move [sp+4],mof
|
||||
move [sp+8],srp
|
||||
break 13
|
||||
cmps.w -4096,r10
|
||||
bhs 0f
|
||||
move [sp],srp
|
||||
Ret
|
||||
nop
|
||||
PSEUDO_END (syscall)
|
@ -1,66 +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, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <sysdep.h>
|
||||
|
||||
/* The syscall stubs jump here when they detect an error, bot for PIC and
|
||||
non-PIC. */
|
||||
|
||||
.syntax no_register_prefix
|
||||
|
||||
ENTRY (__syscall_error)
|
||||
neg.d r10,r10
|
||||
|
||||
#ifdef _LIBC_REENTRANT
|
||||
push r10
|
||||
push srp
|
||||
|
||||
/* Note that __syscall_error is only visible within this library,
|
||||
and no-one passes it on as a pointer, so can assume that R0 (GOT
|
||||
pointer) is correctly set up. */
|
||||
PLTCALL (__errno_location)
|
||||
|
||||
pop srp
|
||||
pop r11
|
||||
move.d r11,[r10]
|
||||
|
||||
#else /* not _LIBC_REENTRANT */
|
||||
# ifdef __PIC__
|
||||
move.d [r0+C_SYMBOL_NAME(errno:GOT)],r9
|
||||
move.d r10,[r9]
|
||||
# else
|
||||
move.d r10,[C_SYMBOL_NAME(errno)]
|
||||
# endif
|
||||
#endif /* _LIBC_REENTRANT */
|
||||
|
||||
#ifdef __PIC__
|
||||
/* PIC callers are supposed to have R0 on stack, ready for us to restore.
|
||||
Callers are only allowed from within this DSO, so the GOT in r0 is the
|
||||
one we want to use.
|
||||
|
||||
(Don't use "ret" - it's a macro). */
|
||||
|
||||
moveq -1,r10
|
||||
Ret
|
||||
pop r0
|
||||
#else
|
||||
Ret
|
||||
moveq -1,r10
|
||||
#endif
|
||||
|
||||
END (__syscall_error)
|
@ -1,226 +0,0 @@
|
||||
/* Assembler macros for CRIS.
|
||||
Copyright (C) 1999, 2001, 2003 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <asm/unistd.h>
|
||||
#include <sysdeps/cris/sysdep.h>
|
||||
#include <sys/syscall.h>
|
||||
#include "config.h"
|
||||
|
||||
#undef SYS_ify
|
||||
#define SYS_ify(syscall_name) (__NR_##syscall_name)
|
||||
|
||||
|
||||
#ifdef __ASSEMBLER__
|
||||
|
||||
/* For Linux we can use the system call table in the header file
|
||||
/usr/include/asm/unistd.h
|
||||
of the kernel. But these symbols do not follow the SYS_* syntax
|
||||
so we have to redefine the `SYS_ify' macro here. */
|
||||
#undef SYS_ify
|
||||
#define SYS_ify(syscall_name) __NR_##syscall_name
|
||||
|
||||
/* ELF-like local names start with `.L'. */
|
||||
#undef L
|
||||
#define L(name) .L##name
|
||||
|
||||
/* Linux uses a negative return value to indicate syscall errors,
|
||||
unlike most Unices, which use the condition codes' carry flag.
|
||||
|
||||
Since version 2.1 the return value of a system call might be
|
||||
negative even if the call succeeded. E.g., the `lseek' system call
|
||||
might return a large offset. Therefore we must not anymore test
|
||||
for < 0, but test for a real error by making sure the value in %eax
|
||||
is a real error number. Linus said he will make sure the no syscall
|
||||
returns a value in -1 .. -4095 as a valid result so we can safely
|
||||
test with -4095. */
|
||||
|
||||
/* Syscall wrappers consist of
|
||||
#include <sysdep.h>
|
||||
PSEUDO (...)
|
||||
ret
|
||||
PSEUDO_END (...)
|
||||
|
||||
which expand to the following. */
|
||||
|
||||
/* Linux takes system call arguments in registers:
|
||||
syscall number R9
|
||||
arg 1 R10
|
||||
arg 2 R11
|
||||
arg 3 R12
|
||||
arg 4 R13
|
||||
arg 5 MOF
|
||||
arg 6 SRP
|
||||
|
||||
The compiler calls us by the C convention:
|
||||
syscall number in the DO_CALL macro
|
||||
arg 1 R10
|
||||
arg 2 R11
|
||||
arg 3 R12
|
||||
arg 4 R13
|
||||
arg 5 [SP]
|
||||
arg 6 [SP + 4]
|
||||
*/
|
||||
|
||||
/* Note that we use "bhs", since we want to match
|
||||
(unsigned) -4096 .. 0xffffffff. Using "ble" would match
|
||||
-4096 .. -2**31. */
|
||||
#define PSEUDO(name, syscall_name, args) \
|
||||
ENTRY (name) @ \
|
||||
DOARGS_##args @ \
|
||||
movu.w SYS_ify (syscall_name),$r9 @ \
|
||||
break 13 @ \
|
||||
cmps.w -4096,$r10 @ \
|
||||
bhs 0f @ \
|
||||
nop @ \
|
||||
UNDOARGS_return_##args
|
||||
|
||||
/* Ouch! We have to remember not to use "ret" in assembly-code.
|
||||
("Luckily", mnemonics are case-insensitive.)
|
||||
Note that we assume usage is exactly:
|
||||
PSEUDO (...)
|
||||
ret
|
||||
PSEUDO_END (...)
|
||||
so we can put all payload into PSEUDO (except for error handling). */
|
||||
|
||||
#define ret
|
||||
|
||||
#define PSEUDO_END(name) \
|
||||
0: @ \
|
||||
SETUP_PIC @ \
|
||||
PLTJUMP (syscall_error) @ \
|
||||
END (name)
|
||||
|
||||
#define PSEUDO_NOERRNO(name, syscall_name, args) \
|
||||
ENTRY (name) @ \
|
||||
DOARGS_##args @ \
|
||||
movu.w SYS_ify (syscall_name),$r9 @ \
|
||||
break 13 @ \
|
||||
UNDOARGS_return_##args
|
||||
|
||||
#define ret_NOERRNO
|
||||
|
||||
#define PSEUDO_END_NOERRNO(name) \
|
||||
END (name)
|
||||
|
||||
#define DOARGS_0
|
||||
#define DOARGS_1
|
||||
#define DOARGS_2
|
||||
#define DOARGS_3
|
||||
#define DOARGS_4
|
||||
#define DOARGS_5 \
|
||||
move [$sp],$mof
|
||||
|
||||
/* To avoid allocating stack-space, we re-use the arg 5 (MOF) entry by
|
||||
storing SRP into it. If called with too-few arguments, we will crash,
|
||||
but that will happen in the general case too. */
|
||||
#define DOARGS_6 \
|
||||
DOARGS_5 @ \
|
||||
move $srp,[$sp] @ \
|
||||
move [$sp+4],$srp
|
||||
|
||||
#define UNDOARGS_return_0 \
|
||||
Ret @ \
|
||||
nop
|
||||
|
||||
#define UNDOARGS_return_1 UNDOARGS_return_0
|
||||
#define UNDOARGS_return_2 UNDOARGS_return_0
|
||||
#define UNDOARGS_return_3 UNDOARGS_return_0
|
||||
#define UNDOARGS_return_4 UNDOARGS_return_0
|
||||
#define UNDOARGS_return_5 UNDOARGS_return_0
|
||||
|
||||
/* We assume the following code will be "ret" and "PSEUDO_END". */
|
||||
#define UNDOARGS_return_return_6 \
|
||||
jump [$sp]
|
||||
|
||||
#else /* not __ASSEMBLER__ */
|
||||
|
||||
#undef INLINE_SYSCALL
|
||||
#define INLINE_SYSCALL(name, nr, args...) \
|
||||
({ \
|
||||
unsigned long __sys_res; \
|
||||
register unsigned long __res asm ("r10"); \
|
||||
LOAD_ARGS_c_##nr (args) \
|
||||
register unsigned long __callno asm ("r9") \
|
||||
= SYS_ify (name); \
|
||||
asm volatile (LOAD_ARGS_asm_##nr (args) \
|
||||
"break 13" \
|
||||
: "=r" (__res) \
|
||||
: ASM_ARGS_##nr (args) \
|
||||
: ASM_CLOBBER_##nr); \
|
||||
__sys_res = __res; \
|
||||
\
|
||||
if (__sys_res >= (unsigned long) -4096) \
|
||||
{ \
|
||||
__set_errno (- __sys_res); \
|
||||
__sys_res = (unsigned long) -1; \
|
||||
} \
|
||||
(long int) __sys_res; \
|
||||
})
|
||||
|
||||
#define LOAD_ARGS_c_0()
|
||||
#define LOAD_ARGS_asm_0()
|
||||
#define ASM_CLOBBER_0 "memory"
|
||||
#define ASM_ARGS_0() "r" (__callno)
|
||||
|
||||
#define LOAD_ARGS_c_1(r10) \
|
||||
LOAD_ARGS_c_0() \
|
||||
register unsigned long __r10 __asm__ ("r10") = (unsigned long) (r10);
|
||||
#define LOAD_ARGS_asm_1(r10) LOAD_ARGS_asm_0 ()
|
||||
#define ASM_CLOBBER_1 ASM_CLOBBER_0
|
||||
#define ASM_ARGS_1(r10) ASM_ARGS_0 (), "0" (__r10)
|
||||
|
||||
#define LOAD_ARGS_c_2(r10, r11) \
|
||||
LOAD_ARGS_c_1(r10) \
|
||||
register unsigned long __r11 __asm__ ("r11") = (unsigned long) (r11);
|
||||
#define LOAD_ARGS_asm_2(r10, r11) LOAD_ARGS_asm_1 (r10)
|
||||
#define ASM_CLOBBER_2 ASM_CLOBBER_1
|
||||
#define ASM_ARGS_2(r10, r11) ASM_ARGS_1 (r10), "r" (__r11)
|
||||
|
||||
#define LOAD_ARGS_c_3(r10, r11, r12) \
|
||||
LOAD_ARGS_c_2(r10, r11) \
|
||||
register unsigned long __r12 __asm__ ("r12") = (unsigned long) (r12);
|
||||
#define LOAD_ARGS_asm_3(r10, r11, r12) LOAD_ARGS_asm_2 (r10, r11)
|
||||
#define ASM_CLOBBER_3 ASM_CLOBBER_2
|
||||
#define ASM_ARGS_3(r10, r11, r12) ASM_ARGS_2 (r10, r11), "r" (__r12)
|
||||
|
||||
#define LOAD_ARGS_c_4(r10, r11, r12, r13) \
|
||||
LOAD_ARGS_c_3(r10, r11, r12) \
|
||||
register unsigned long __r13 __asm__ ("r13") = (unsigned long) (r13);
|
||||
#define LOAD_ARGS_asm_4(r10, r11, r12, r13) LOAD_ARGS_asm_3 (r10, r11, r12)
|
||||
#define ASM_CLOBBER_4 ASM_CLOBBER_3
|
||||
#define ASM_ARGS_4(r10, r11, r12, r13) ASM_ARGS_3 (r10, r11, r12), "r" (__r13)
|
||||
|
||||
#define LOAD_ARGS_c_5(r10, r11, r12, r13, mof) \
|
||||
LOAD_ARGS_c_4(r10, r11, r12, r13)
|
||||
#define LOAD_ARGS_asm_5(r10, r11, r12, r13, mof) \
|
||||
LOAD_ARGS_asm_4 (r10, r11, r12, r13) "move %6,$mof\n\t"
|
||||
#define ASM_CLOBBER_5 ASM_CLOBBER_4
|
||||
#define ASM_ARGS_5(r10, r11, r12, r13, mof) \
|
||||
ASM_ARGS_4 (r10, r11, r12, r13), "g" (mof)
|
||||
|
||||
#define LOAD_ARGS_c_6(r10, r11, r12, r13, mof, srp) \
|
||||
LOAD_ARGS_c_5(r10, r11, r12, r13, mof)
|
||||
#define LOAD_ARGS_asm_6(r10, r11, r12, r13, mof, srp) \
|
||||
LOAD_ARGS_asm_5(r10, r11, r12, r13, mof) \
|
||||
"move %7,$srp\n\t"
|
||||
#define ASM_CLOBBER_6 ASM_CLOBBER_5, "srp"
|
||||
#define ASM_ARGS_6(r10, r11, r12, r13, mof, srp) \
|
||||
ASM_ARGS_5 (r10, r11, r12, r13, mof), "g" (srp)
|
||||
|
||||
#endif /* not __ASSEMBLER__ */
|
@ -1,27 +0,0 @@
|
||||
/* Copyright (C) 1999, 2001, 2002 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
|
||||
The GNU C Library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
The GNU C Library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public
|
||||
License along with the GNU C Library; if not, write to the Free
|
||||
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
|
||||
02111-1307 USA. */
|
||||
|
||||
#include <sysdep.h>
|
||||
|
||||
PSEUDO (__vfork, vfork, 0)
|
||||
Ret
|
||||
nop
|
||||
PSEUDO_END (__vfork)
|
||||
libc_hidden_def (__vfork)
|
||||
|
||||
weak_alias (__vfork, vfork)
|
@ -1 +0,0 @@
|
||||
#include <sysdeps/unix/sysv/linux/i386/xstat.c>
|
Loading…
Reference in New Issue
Block a user