|
|
c6d234 |
Recreation of this upstream commit:
|
|
|
c6d234 |
|
|
|
c6d234 |
commit 464263cc00549d2597b6d25309d55b1e4a6b1aac
|
|
|
c6d234 |
Author: Joseph Myers <joseph@codesourcery.com>
|
|
|
c6d234 |
Date: Sat Feb 8 00:16:57 2014 +0000
|
|
|
c6d234 |
|
|
|
c6d234 |
Remove am33 port.
|
|
|
c6d234 |
|
|
|
c6d234 |
This patch removes the am33 port (no other port #includes any files
|
|
|
c6d234 |
from it), as previously discussed (see
|
|
|
c6d234 |
<https://sourceware.org/ml/libc-ports/2014-01/msg00046.html>).
|
|
|
c6d234 |
|
|
|
c6d234 |
Git commands used:
|
|
|
c6d234 |
|
|
|
c6d234 |
git rm -r ports/sysdeps/am33
|
|
|
c6d234 |
git rm -r ports/sysdeps/unix/am33
|
|
|
c6d234 |
git rm -r ports/sysdeps/unix/sysv/linux/am33
|
|
|
c6d234 |
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/Implies b/ports/sysdeps/am33/Implies
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 780c4e2467693939..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/Implies
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,3 +0,0 @@
|
|
|
c6d234 |
-wordsize-32
|
|
|
c6d234 |
-ieee754/flt-32
|
|
|
c6d234 |
-ieee754/dbl-64
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/__longjmp.S b/ports/sysdeps/am33/__longjmp.S
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 1d6c29e99f0099f5..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/__longjmp.S
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,60 +0,0 @@
|
|
|
c6d234 |
-/* longjmp for AM33.
|
|
|
c6d234 |
- Copyright 2001 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <sysdep.h>
|
|
|
c6d234 |
-#define _ASM
|
|
|
c6d234 |
-#define _SETJMP_H
|
|
|
c6d234 |
-#include <bits/setjmp.h>
|
|
|
c6d234 |
-#include <asm-syntax.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-ENTRY (__longjmp)
|
|
|
c6d234 |
- mov d0,a0
|
|
|
c6d234 |
- mov (8,a0),d2
|
|
|
c6d234 |
- mov d2,mdr
|
|
|
c6d234 |
- mov (0,a0),d2
|
|
|
c6d234 |
- mov (4,a0),d3
|
|
|
c6d234 |
- mov (12,a0),a2
|
|
|
c6d234 |
- mov (16,a0),a3
|
|
|
c6d234 |
- mov (20,a0),a1
|
|
|
c6d234 |
- mov a1,sp
|
|
|
c6d234 |
- add 24,a0
|
|
|
c6d234 |
- mov (a0+),r4
|
|
|
c6d234 |
- mov (a0+),r5
|
|
|
c6d234 |
- mov (a0+),r6
|
|
|
c6d234 |
- mov (a0+),r7
|
|
|
c6d234 |
-#ifdef __AM33_2__
|
|
|
c6d234 |
- fmov (a0+),fs4
|
|
|
c6d234 |
- fmov (a0+),fs5
|
|
|
c6d234 |
- fmov (a0+),fs6
|
|
|
c6d234 |
- fmov (a0+),fs7
|
|
|
c6d234 |
- fmov (a0+),fs8
|
|
|
c6d234 |
- fmov (a0+),fs9
|
|
|
c6d234 |
- fmov (a0+),fs10
|
|
|
c6d234 |
- fmov (a0+),fs11
|
|
|
c6d234 |
- fmov (a0+),fs12
|
|
|
c6d234 |
- fmov (a0+),fs13
|
|
|
c6d234 |
- fmov (a0+),fs14
|
|
|
c6d234 |
- fmov (a0+),fs15
|
|
|
c6d234 |
- fmov (a0+),fs16
|
|
|
c6d234 |
- fmov (a0+),fs17
|
|
|
c6d234 |
- fmov (a0+),fs18
|
|
|
c6d234 |
- fmov (a0+),fs19
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
- mov d1,d0
|
|
|
c6d234 |
- retf [],0
|
|
|
c6d234 |
-END (__longjmp)
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/atomicity.h b/ports/sysdeps/am33/atomicity.h
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index b0ba43db4b71a7fc..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/atomicity.h
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,86 +0,0 @@
|
|
|
c6d234 |
-/* Low-level functions for atomic operations. AM33 version.
|
|
|
c6d234 |
- Copyright 1999, 2001 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>.
|
|
|
c6d234 |
- Based on ../sparc/sparc32/atomicity.h
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Library General Public License as
|
|
|
c6d234 |
- published by the Free Software Foundation; either version 2 of the
|
|
|
c6d234 |
- License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Library General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Library General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifndef _ATOMICITY_H
|
|
|
c6d234 |
-#define _ATOMICITY_H 1
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <inttypes.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define __acquire_lock(lock) \
|
|
|
c6d234 |
- __asm__ __volatile__("1: bset %1, (%0)\n\t" \
|
|
|
c6d234 |
- " beq 1b" \
|
|
|
c6d234 |
- : : "a" (&(lock)), "d" (1) \
|
|
|
c6d234 |
- : "memory")
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define __release_lock(lock) lock = 0
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-static int
|
|
|
c6d234 |
-__attribute__ ((unused))
|
|
|
c6d234 |
-exchange_and_add (volatile uint32_t *mem, int val)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- static unsigned char lock;
|
|
|
c6d234 |
- int result;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- __acquire_lock (lock);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- result = *mem;
|
|
|
c6d234 |
- *mem += val;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- __release_lock (lock);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- return result;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-static void
|
|
|
c6d234 |
-__attribute__ ((unused))
|
|
|
c6d234 |
-atomic_add (volatile uint32_t *mem, int val)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- static unsigned char lock;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- __acquire_lock (lock);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- *mem += val;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- __release_lock (lock);
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-static int
|
|
|
c6d234 |
-__attribute__ ((unused))
|
|
|
c6d234 |
-compare_and_swap (volatile long int *p, long int oldval, long int newval)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- static unsigned char lock;
|
|
|
c6d234 |
- int ret;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- __acquire_lock (lock);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- if (*p != oldval)
|
|
|
c6d234 |
- ret = 0;
|
|
|
c6d234 |
- else
|
|
|
c6d234 |
- {
|
|
|
c6d234 |
- *p = newval;
|
|
|
c6d234 |
- ret = 1;
|
|
|
c6d234 |
- }
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- __release_lock (lock);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- return ret;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#endif /* atomicity.h */
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/bits/endian.h b/ports/sysdeps/am33/bits/endian.h
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 7423f09570ac1650..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/bits/endian.h
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,7 +0,0 @@
|
|
|
c6d234 |
-/* AM33 is little-endian. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifndef _ENDIAN_H
|
|
|
c6d234 |
-# error "Never use <bits/endian.h> directly; include <endian.h> instead."
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define __BYTE_ORDER __LITTLE_ENDIAN
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/bits/setjmp.h b/ports/sysdeps/am33/bits/setjmp.h
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 6dd87cb65546ad11..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/bits/setjmp.h
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,26 +0,0 @@
|
|
|
c6d234 |
-/* Copyright 2001 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Define the machine-dependent type `jmp_buf'. AM33 version. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifndef _SETJMP_H
|
|
|
c6d234 |
-# error "Never include <bits/setjmp.h> directly; use <setjmp.h> instead."
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifndef _ASM
|
|
|
c6d234 |
-typedef int __jmp_buf[26];
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/bsd-_setjmp.S b/ports/sysdeps/am33/bsd-_setjmp.S
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 9bbfcbbba793502b..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/bsd-_setjmp.S
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-/* _setjmp is in setjmp.S */
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/bsd-setjmp.S b/ports/sysdeps/am33/bsd-setjmp.S
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index b6b239e67db2864c..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/bsd-setjmp.S
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-/* setjmp is in setjmp.S */
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/dl-machine.h b/ports/sysdeps/am33/dl-machine.h
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index d4b321aca094863e..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/dl-machine.h
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,479 +0,0 @@
|
|
|
c6d234 |
-/* Machine-dependent ELF dynamic relocation inline functions. AM33 version.
|
|
|
c6d234 |
- Copyright (C) 1995,96,97,98,99,2000,2001, 2004, 2011
|
|
|
c6d234 |
- Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Library General Public License as
|
|
|
c6d234 |
- published by the Free Software Foundation; either version 2 of the
|
|
|
c6d234 |
- License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Library General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Library General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifndef dl_machine_h
|
|
|
c6d234 |
-#define dl_machine_h
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define ELF_MACHINE_NAME "mn10300"
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <sys/param.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Return nonzero iff ELF header is compatible with the running host. */
|
|
|
c6d234 |
-static inline int __attribute__ ((unused))
|
|
|
c6d234 |
-elf_machine_matches_host (const Elf32_Ehdr *ehdr)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- return ehdr->e_machine == EM_MN10300;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Return the link-time address of _DYNAMIC. Conveniently, this is the
|
|
|
c6d234 |
- first element of the GOT. This must be inlined in a function which
|
|
|
c6d234 |
- uses global data. */
|
|
|
c6d234 |
-static inline Elf32_Addr __attribute__ ((unused))
|
|
|
c6d234 |
-elf_machine_dynamic (void)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- register Elf32_Addr *got asm ("a2");
|
|
|
c6d234 |
- return *got;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Return the run-time load address of the shared object. */
|
|
|
c6d234 |
-static inline Elf32_Addr __attribute__ ((unused))
|
|
|
c6d234 |
-elf_machine_load_address (void)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- register Elf32_Addr gotaddr asm ("a2");
|
|
|
c6d234 |
- Elf32_Addr off, gotval;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- asm ("mov _dl_start@GOTOFF,%0" : "=r" (off));
|
|
|
c6d234 |
- asm ("mov (_dl_start@GOT,%1),%0" : "=r" (gotval) : "r" (gotaddr));
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- return off + gotaddr - gotval;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifndef PROF
|
|
|
c6d234 |
-/* We add a declaration of this function here so that in dl-runtime.c
|
|
|
c6d234 |
- the ELF_MACHINE_RUNTIME_TRAMPOLINE macro really can pass the parameters
|
|
|
c6d234 |
- in registers.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- We cannot use this scheme for profiling because the _mcount call
|
|
|
c6d234 |
- destroys the passed register information. */
|
|
|
c6d234 |
-static ElfW(Addr) fixup (struct link_map *l, ElfW(Word) reloc_offset)
|
|
|
c6d234 |
- __attribute__ ((unused));
|
|
|
c6d234 |
-static ElfW(Addr) profile_fixup (struct link_map *l, ElfW(Word) reloc_offset,
|
|
|
c6d234 |
- ElfW(Addr) retaddr)
|
|
|
c6d234 |
- __attribute__ ((unused));
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Set up the loaded object described by L so its unrelocated PLT
|
|
|
c6d234 |
- entries will jump to the on-demand fixup code in dl-runtime.c. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-static inline int __attribute__ ((unused))
|
|
|
c6d234 |
-elf_machine_runtime_setup (struct link_map *l, int lazy, int profile)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- Elf32_Addr *got;
|
|
|
c6d234 |
- extern void _dl_runtime_resolve (Elf32_Word) attribute_hidden;
|
|
|
c6d234 |
- extern void _dl_runtime_profile (Elf32_Word) attribute_hidden;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- if (l->l_info[DT_JMPREL] && lazy)
|
|
|
c6d234 |
- {
|
|
|
c6d234 |
- /* The GOT entries for functions in the PLT have not yet been filled
|
|
|
c6d234 |
- in. Their initial contents will arrange when called to push an
|
|
|
c6d234 |
- offset into the .rel.plt section, push _GLOBAL_OFFSET_TABLE_[1],
|
|
|
c6d234 |
- and then jump to _GLOBAL_OFFSET_TABLE[2]. */
|
|
|
c6d234 |
- got = (Elf32_Addr *) D_PTR (l, l_info[DT_PLTGOT]);
|
|
|
c6d234 |
- got[1] = (Elf32_Addr) l; /* Identify this shared object. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* The got[2] entry contains the address of a function which gets
|
|
|
c6d234 |
- called to get the address of a so far unresolved function and
|
|
|
c6d234 |
- jump to it. The profiling extension of the dynamic linker allows
|
|
|
c6d234 |
- to intercept the calls to collect information. In this case we
|
|
|
c6d234 |
- don't store the address in the GOT so that all future calls also
|
|
|
c6d234 |
- end in this function. */
|
|
|
c6d234 |
- if (__builtin_expect (profile, 0))
|
|
|
c6d234 |
- {
|
|
|
c6d234 |
- got[2] = (Elf32_Addr) &_dl_runtime_profile;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- if (_dl_name_match_p (GLRO(dl_profile), l))
|
|
|
c6d234 |
- /* This is the object we are looking for. Say that we really
|
|
|
c6d234 |
- want profiling and the timers are started. */
|
|
|
c6d234 |
- GL(dl_profile_map) = l;
|
|
|
c6d234 |
- }
|
|
|
c6d234 |
- else
|
|
|
c6d234 |
- /* This function will get called to fix up the GOT entry indicated by
|
|
|
c6d234 |
- the offset on the stack, and then jump to the resolved address. */
|
|
|
c6d234 |
- got[2] = (Elf32_Addr) &_dl_runtime_resolve;
|
|
|
c6d234 |
- }
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- return lazy;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* This code is used in dl-runtime.c to call the `fixup' function
|
|
|
c6d234 |
- and then redirect to the address it returns. */
|
|
|
c6d234 |
-#ifndef PROF
|
|
|
c6d234 |
-# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\
|
|
|
c6d234 |
- .text\n\
|
|
|
c6d234 |
- .globl _dl_runtime_resolve\n\
|
|
|
c6d234 |
- .type _dl_runtime_resolve, @function\n\
|
|
|
c6d234 |
-_dl_runtime_resolve:\n\
|
|
|
c6d234 |
- add -12,sp # Preserve registers otherwise clobbered.\n\
|
|
|
c6d234 |
- mov d1,(20,sp)\n\
|
|
|
c6d234 |
- mov d0,(16,sp)\n\
|
|
|
c6d234 |
- mov r1,d0\n\
|
|
|
c6d234 |
- mov r0,d1\n\
|
|
|
c6d234 |
- call fixup,[],0 # Call resolver.\n\
|
|
|
c6d234 |
- mov d0,a0\n\
|
|
|
c6d234 |
- mov (12,sp),d1 # Copy return address back to mdr,\n\
|
|
|
c6d234 |
- mov d1,mdr # in case the callee returns with retf\n\
|
|
|
c6d234 |
- mov (16,sp),d0 # Get register content back.\n\
|
|
|
c6d234 |
- mov (20,sp),d1\n\
|
|
|
c6d234 |
- add 12,sp\n\
|
|
|
c6d234 |
- jmp (a0)\n\
|
|
|
c6d234 |
- .size _dl_runtime_resolve, .-_dl_runtime_resolve\n\
|
|
|
c6d234 |
-\n\
|
|
|
c6d234 |
- .globl _dl_runtime_profile\n\
|
|
|
c6d234 |
- .type _dl_runtime_profile, @function\n\
|
|
|
c6d234 |
-_dl_runtime_profile:\n\
|
|
|
c6d234 |
- add -12,sp # Preserve registers otherwise clobbered.\n\
|
|
|
c6d234 |
- mov d1,(20,sp)\n\
|
|
|
c6d234 |
- mov d0,(16,sp)\n\
|
|
|
c6d234 |
- mov r1,d0\n\
|
|
|
c6d234 |
- mov r0,d1\n\
|
|
|
c6d234 |
- call profile_fixup,[],0 # Call resolver.\n\
|
|
|
c6d234 |
- mov d0,a0\n\
|
|
|
c6d234 |
- mov (12,sp),d1 # Copy return address back to mdr,\n\
|
|
|
c6d234 |
- mov d1,mdr # in case the callee returns with retf\n\
|
|
|
c6d234 |
- mov (16,sp),d0 # Get register content back.\n\
|
|
|
c6d234 |
- mov (20,sp),d1\n\
|
|
|
c6d234 |
- add 12,sp\n\
|
|
|
c6d234 |
- jmp (a0)\n\
|
|
|
c6d234 |
- .size _dl_runtime_profile, .-_dl_runtime_profile\n\
|
|
|
c6d234 |
- .previous\n\
|
|
|
c6d234 |
-");
|
|
|
c6d234 |
-#else
|
|
|
c6d234 |
-# define ELF_MACHINE_RUNTIME_TRAMPOLINE asm ("\n\
|
|
|
c6d234 |
- .text\n\
|
|
|
c6d234 |
- .globl _dl_runtime_resolve\n\
|
|
|
c6d234 |
- .globl _dl_runtime_profile\n\
|
|
|
c6d234 |
- .type _dl_runtime_resolve, @function\n\
|
|
|
c6d234 |
- .type _dl_runtime_profile, @function\n\
|
|
|
c6d234 |
-_dl_runtime_resolve:\n\
|
|
|
c6d234 |
-_dl_runtime_profile:\n\
|
|
|
c6d234 |
- add -12,sp # Preserve registers otherwise clobbered.\n\
|
|
|
c6d234 |
- mov d1,(20,sp)\n\
|
|
|
c6d234 |
- mov d0,(16,sp)\n\
|
|
|
c6d234 |
- mov r1,d0\n\
|
|
|
c6d234 |
- mov r0,d1\n\
|
|
|
c6d234 |
- call profile_fixup,[],0 # Call resolver.\n\
|
|
|
c6d234 |
- mov d0,a0\n\
|
|
|
c6d234 |
- mov (12,sp),d1 # Copy return address back to mdr,\n\
|
|
|
c6d234 |
- mov d1,mdr # in case the callee returns with retf\n\
|
|
|
c6d234 |
- mov (16,sp),d0 # Get register content back.\n\
|
|
|
c6d234 |
- mov (20,sp),d1\n\
|
|
|
c6d234 |
- add 12,sp\n\
|
|
|
c6d234 |
- jmp (a0)\n\
|
|
|
c6d234 |
- .size _dl_runtime_resolve, .-_dl_runtime_resolve\n\
|
|
|
c6d234 |
- .size _dl_runtime_profile, .-_dl_runtime_profile\n\
|
|
|
c6d234 |
- .previous\n\
|
|
|
c6d234 |
-");
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Mask identifying addresses reserved for the user program,
|
|
|
c6d234 |
- where the dynamic linker should not map anything. */
|
|
|
c6d234 |
-#define ELF_MACHINE_USER_ADDRESS_MASK 0xf8000000UL
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Initial entry point code for the dynamic linker.
|
|
|
c6d234 |
- The C function `_dl_start' is the real entry point;
|
|
|
c6d234 |
- its return value is the user program's entry point. */
|
|
|
c6d234 |
-#define RTLD_START asm ("\n\
|
|
|
c6d234 |
- .text\n\
|
|
|
c6d234 |
-.globl _start\n\
|
|
|
c6d234 |
-.globl _dl_start_user\n\
|
|
|
c6d234 |
-_start:\n\
|
|
|
c6d234 |
- mov 0,a3 # Mark the top of the stack\n\
|
|
|
c6d234 |
- mov sp,a1\n\
|
|
|
c6d234 |
- add -20,sp # Prepare for function call\n\
|
|
|
c6d234 |
- mov a1,d0\n\
|
|
|
c6d234 |
- call _dl_start,[],0\n\
|
|
|
c6d234 |
-_dl_start_user:\n\
|
|
|
c6d234 |
- # Save the user entry point address in d2.\n\
|
|
|
c6d234 |
- mov d0,d2\n\
|
|
|
c6d234 |
- # Point a2 at the GOT.\n\
|
|
|
c6d234 |
-0: mov pc,a2\n\
|
|
|
c6d234 |
- add _GLOBAL_OFFSET_TABLE_ - (0b-.),a2\n\
|
|
|
c6d234 |
- # Store the highest stack address\n\
|
|
|
c6d234 |
- mov (__libc_stack_end@GOT,a2),a0\n\
|
|
|
c6d234 |
- mov a1,(a0)\n\
|
|
|
c6d234 |
- # See if we were run as a command with the executable file\n\
|
|
|
c6d234 |
- # name as an extra leading argument.\n\
|
|
|
c6d234 |
- mov (_dl_skip_args@GOT,a2),a0\n\
|
|
|
c6d234 |
- mov (a0),d0\n\
|
|
|
c6d234 |
- # Pop the original argument count.\n\
|
|
|
c6d234 |
- mov (20,sp),d3\n\
|
|
|
c6d234 |
- # Subtract _dl_skip_args from it.\n\
|
|
|
c6d234 |
- sub d0,d3\n\
|
|
|
c6d234 |
- # Adjust the stack pointer to skip _dl_skip_args words.\n\
|
|
|
c6d234 |
- asl2 d0\n\
|
|
|
c6d234 |
- mov sp,a0\n\
|
|
|
c6d234 |
- add d0,a0\n\
|
|
|
c6d234 |
- mov a0,sp\n\
|
|
|
c6d234 |
- # Push argc back on the stack.\n\
|
|
|
c6d234 |
- mov d3,(20,sp)\n\
|
|
|
c6d234 |
- # The special initializer gets called with the stack just\n\
|
|
|
c6d234 |
- # as the application's entry point will see it; it can\n\
|
|
|
c6d234 |
- # switch stacks if it moves these contents over.\n\
|
|
|
c6d234 |
-" RTLD_START_SPECIAL_INIT "\n\
|
|
|
c6d234 |
- # Load the parameters again.\n\
|
|
|
c6d234 |
- # (d0, d1, (12,sp), (16,sp)) = (_dl_loaded, argc, argv, envp)\n\
|
|
|
c6d234 |
- add 24,a0\n\
|
|
|
c6d234 |
- mov a0,(12,sp) # a0 is 24+sp\n\
|
|
|
c6d234 |
- mov d3,d1 # d3 contained argc\n\
|
|
|
c6d234 |
- inc d3\n\
|
|
|
c6d234 |
- asl2 d3 # d3 is now (argc+1)*4,\n\
|
|
|
c6d234 |
- add d3,a0 # the offset between argv and envp\n\
|
|
|
c6d234 |
- mov a0,(16,sp)\n\
|
|
|
c6d234 |
- mov (_rtld_local@GOTOFF,a2),d0\n\
|
|
|
c6d234 |
- # Call the function to run the initializers.\n\
|
|
|
c6d234 |
- call _dl_init@PLT,[],0\n\
|
|
|
c6d234 |
- # Pass our finalizer function to the user in d0, as per ELF ABI.\n\
|
|
|
c6d234 |
- mov (_dl_fini@GOT,a2),d0\n\
|
|
|
c6d234 |
- add 20,sp\n\
|
|
|
c6d234 |
- # Jump to the user's entry point.\n\
|
|
|
c6d234 |
- mov d2,a1\n\
|
|
|
c6d234 |
- jmp (a1)\n\
|
|
|
c6d234 |
- .previous\n\
|
|
|
c6d234 |
-");
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifndef RTLD_START_SPECIAL_INIT
|
|
|
c6d234 |
-#define RTLD_START_SPECIAL_INIT /* nothing */
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* ELF_RTYPE_CLASS_PLT iff TYPE describes relocation of a PLT entry, so
|
|
|
c6d234 |
- PLT entries should not be allowed to define the value.
|
|
|
c6d234 |
- ELF_RTYPE_CLASS_NOCOPY iff TYPE should not be allowed to resolve to one
|
|
|
c6d234 |
- of the main executable's symbols, as for a COPY reloc. */
|
|
|
c6d234 |
-#define elf_machine_type_class(type) \
|
|
|
c6d234 |
- ((((type) == R_MN10300_JMP_SLOT) * ELF_RTYPE_CLASS_PLT) \
|
|
|
c6d234 |
- | (((type) == R_MN10300_COPY) * ELF_RTYPE_CLASS_COPY))
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* A reloc type used for ld.so cmdline arg lookups to reject PLT entries. */
|
|
|
c6d234 |
-#define ELF_MACHINE_JMP_SLOT R_MN10300_JMP_SLOT
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-static inline Elf32_Addr
|
|
|
c6d234 |
-elf_machine_fixup_plt (struct link_map *map, lookup_t t,
|
|
|
c6d234 |
- const Elf32_Rela *reloc,
|
|
|
c6d234 |
- Elf32_Addr *reloc_addr, Elf32_Addr value)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- return *reloc_addr = value;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Return the final value of a plt relocation. */
|
|
|
c6d234 |
-static inline Elf32_Addr
|
|
|
c6d234 |
-elf_machine_plt_value (struct link_map *map, const Elf32_Rela *reloc,
|
|
|
c6d234 |
- Elf32_Addr value)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- return value + reloc->r_addend;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#endif /* !dl_machine_h */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifdef RESOLVE
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* The mn10300 never uses Elf32_Rel relocations. */
|
|
|
c6d234 |
-#define ELF_MACHINE_NO_REL 1
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Perform the relocation specified by RELOC and SYM (which is fully resolved).
|
|
|
c6d234 |
- MAP is the object containing the reloc. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-static inline void
|
|
|
c6d234 |
-elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
|
|
|
c6d234 |
- const Elf32_Sym *sym, const struct r_found_version *version,
|
|
|
c6d234 |
- void *const reloc_addr_arg, int skip_ifunc)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- const unsigned int r_type = ELF32_R_TYPE (reloc->r_info);
|
|
|
c6d234 |
- Elf32_Addr value, *reloc_addr;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Make sure we drop any previous alignment assumptions. */
|
|
|
c6d234 |
- asm ("" : "=r" (reloc_addr) : "0" (reloc_addr_arg));
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define COPY_UNALIGNED_WORD(sw, tw, align) \
|
|
|
c6d234 |
- { \
|
|
|
c6d234 |
- unsigned long *__sl = (void*)&(sw), *__tl = (void*)&(tw); \
|
|
|
c6d234 |
- unsigned short *__ss = (void*)&(sw), *__ts = (void*)&(tw); \
|
|
|
c6d234 |
- unsigned char *__sc = (void*)&(sw), *__tc = (void*)&(tw); \
|
|
|
c6d234 |
- switch ((align)) \
|
|
|
c6d234 |
- { \
|
|
|
c6d234 |
- case 0: \
|
|
|
c6d234 |
- *__tl = *__sl; \
|
|
|
c6d234 |
- break; \
|
|
|
c6d234 |
- case 2: \
|
|
|
c6d234 |
- *__ts++ = *__ss++; \
|
|
|
c6d234 |
- *__ts = *__ss; \
|
|
|
c6d234 |
- break; \
|
|
|
c6d234 |
- default: \
|
|
|
c6d234 |
- *__tc++ = *__sc++; \
|
|
|
c6d234 |
- *__tc++ = *__sc++; \
|
|
|
c6d234 |
- *__tc++ = *__sc++; \
|
|
|
c6d234 |
- *__tc = *__sc; \
|
|
|
c6d234 |
- break; \
|
|
|
c6d234 |
- } \
|
|
|
c6d234 |
- }
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define COPY_UNALIGNED_HALFWORD(sw, tw, align) \
|
|
|
c6d234 |
- { \
|
|
|
c6d234 |
- unsigned short *__ss = (void*)&(sw), *__ts = (void*)&(tw); \
|
|
|
c6d234 |
- unsigned char *__sc = (void*)&(sw), *__tc = (void*)&(tw); \
|
|
|
c6d234 |
- switch ((align)) \
|
|
|
c6d234 |
- { \
|
|
|
c6d234 |
- case 0: \
|
|
|
c6d234 |
- *__ts = *__ss; \
|
|
|
c6d234 |
- break; \
|
|
|
c6d234 |
- default: \
|
|
|
c6d234 |
- *__tc++ = *__sc++; \
|
|
|
c6d234 |
- *__tc = *__sc; \
|
|
|
c6d234 |
- break; \
|
|
|
c6d234 |
- } \
|
|
|
c6d234 |
- }
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#if !defined RTLD_BOOTSTRAP || !defined HAVE_Z_COMBRELOC
|
|
|
c6d234 |
- if (__builtin_expect (r_type == R_MN10300_RELATIVE, 0))
|
|
|
c6d234 |
- {
|
|
|
c6d234 |
-# if !defined RTLD_BOOTSTRAP && !defined HAVE_Z_COMBRELOC
|
|
|
c6d234 |
- /* This is defined in rtld.c, but nowhere in the static libc.a;
|
|
|
c6d234 |
- make the reference weak so static programs can still link.
|
|
|
c6d234 |
- This declaration cannot be done when compiling rtld.c (i.e.
|
|
|
c6d234 |
- #ifdef RTLD_BOOTSTRAP) because rtld.c contains the common
|
|
|
c6d234 |
- defn for _dl_rtld_map, which is incompatible with a weak decl
|
|
|
c6d234 |
- in the same file. */
|
|
|
c6d234 |
- weak_extern (_dl_rtld_map);
|
|
|
c6d234 |
- if (map != &_dl_rtld_map) /* Already done in rtld itself. */
|
|
|
c6d234 |
-# endif
|
|
|
c6d234 |
- {
|
|
|
c6d234 |
- COPY_UNALIGNED_WORD (*reloc_addr, value, (int) reloc_addr & 3);
|
|
|
c6d234 |
- value += map->l_addr;
|
|
|
c6d234 |
- COPY_UNALIGNED_WORD (value, *reloc_addr, (int) reloc_addr & 3);
|
|
|
c6d234 |
- }
|
|
|
c6d234 |
- }
|
|
|
c6d234 |
-# ifndef RTLD_BOOTSTRAP
|
|
|
c6d234 |
- else if (__builtin_expect (r_type == R_MN10300_NONE, 0))
|
|
|
c6d234 |
- return;
|
|
|
c6d234 |
-# endif
|
|
|
c6d234 |
- else
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
- {
|
|
|
c6d234 |
-#ifndef RTLD_BOOTSTRAP
|
|
|
c6d234 |
- const Elf32_Sym *const refsym = sym;
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- value = RESOLVE (&sym, version, ELF32_R_TYPE (reloc->r_info));
|
|
|
c6d234 |
- if (sym)
|
|
|
c6d234 |
- value += sym->st_value;
|
|
|
c6d234 |
- value += reloc->r_addend; /* Assume copy relocs have zero addend. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- switch (r_type)
|
|
|
c6d234 |
- {
|
|
|
c6d234 |
-#ifndef RTLD_BOOTSTRAP
|
|
|
c6d234 |
- case R_MN10300_COPY:
|
|
|
c6d234 |
- if (sym == NULL)
|
|
|
c6d234 |
- /* This can happen in trace mode if an object could not be
|
|
|
c6d234 |
- found. */
|
|
|
c6d234 |
- break;
|
|
|
c6d234 |
- if (sym->st_size > refsym->st_size
|
|
|
c6d234 |
- || (GLRO(dl_verbose) && sym->st_size < refsym->st_size))
|
|
|
c6d234 |
- {
|
|
|
c6d234 |
- extern char **_dl_argv;
|
|
|
c6d234 |
- const char *strtab;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- strtab = (const void *) D_PTR (map, l_info[DT_STRTAB]);
|
|
|
c6d234 |
- _dl_error_printf ("\
|
|
|
c6d234 |
-%s: Symbol `%s' has different size in shared object, consider re-linking\n",
|
|
|
c6d234 |
- _dl_argv[0] ?: "<program name unknown>",
|
|
|
c6d234 |
- strtab + refsym->st_name);
|
|
|
c6d234 |
- }
|
|
|
c6d234 |
- memcpy (reloc_addr, (void *) value, MIN (sym->st_size,
|
|
|
c6d234 |
- refsym->st_size));
|
|
|
c6d234 |
- break;
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
- case R_MN10300_GLOB_DAT:
|
|
|
c6d234 |
- case R_MN10300_JMP_SLOT:
|
|
|
c6d234 |
- /* These addresses are always aligned. */
|
|
|
c6d234 |
- *reloc_addr = value;
|
|
|
c6d234 |
- break;
|
|
|
c6d234 |
- case R_MN10300_32:
|
|
|
c6d234 |
- COPY_UNALIGNED_WORD (value, *reloc_addr, (int) reloc_addr & 3);
|
|
|
c6d234 |
- break;
|
|
|
c6d234 |
-#ifndef RTLD_BOOTSTRAP
|
|
|
c6d234 |
- case R_MN10300_16:
|
|
|
c6d234 |
- COPY_UNALIGNED_HALFWORD (value, *reloc_addr, (int) reloc_addr & 1);
|
|
|
c6d234 |
- break;
|
|
|
c6d234 |
- case R_MN10300_8:
|
|
|
c6d234 |
- *(char *) reloc_addr = value;
|
|
|
c6d234 |
- break;
|
|
|
c6d234 |
- case R_MN10300_PCREL32:
|
|
|
c6d234 |
- value -= (Elf32_Addr) reloc_addr;
|
|
|
c6d234 |
- COPY_UNALIGNED_WORD (value, *reloc_addr, (int) reloc_addr & 3);
|
|
|
c6d234 |
- break;
|
|
|
c6d234 |
- case R_MN10300_PCREL16:
|
|
|
c6d234 |
- value -= (Elf32_Addr) reloc_addr;
|
|
|
c6d234 |
- COPY_UNALIGNED_HALFWORD (value, *reloc_addr, (int) reloc_addr & 1);
|
|
|
c6d234 |
- break;
|
|
|
c6d234 |
- case R_MN10300_PCREL8:
|
|
|
c6d234 |
- value -= (Elf32_Addr) reloc_addr;
|
|
|
c6d234 |
- *(char *) reloc_addr = (value - (Elf32_Addr) reloc_addr);
|
|
|
c6d234 |
- break;
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
- case R_MN10300_NONE: /* Alright, Wilbur. */
|
|
|
c6d234 |
- break;
|
|
|
c6d234 |
-#if !defined RTLD_BOOTSTRAP || defined _NDEBUG
|
|
|
c6d234 |
- default:
|
|
|
c6d234 |
- _dl_reloc_bad_type (map, ELFW(R_TYPE) (reloc->r_info), 0);
|
|
|
c6d234 |
- break;
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
- }
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- }
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-static inline void
|
|
|
c6d234 |
-elf_machine_rela_relative (Elf32_Addr l_addr, const Elf32_Rela *reloc,
|
|
|
c6d234 |
- void *const reloc_addr_arg)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- Elf32_Addr value, *reloc_addr;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- asm ("" : "=r" (reloc_addr) : "0" (reloc_addr_arg));
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- COPY_UNALIGNED_WORD (*reloc_addr, value, (int)reloc_addr & 3);
|
|
|
c6d234 |
- value += l_addr;
|
|
|
c6d234 |
- COPY_UNALIGNED_WORD (value, *reloc_addr, (int)reloc_addr & 3);
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-static inline void
|
|
|
c6d234 |
-elf_machine_lazy_rel (struct link_map *map,
|
|
|
c6d234 |
- Elf32_Addr l_addr, const Elf32_Rela *reloc,
|
|
|
c6d234 |
- int skip_ifunc)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- unsigned long int const r_type = ELF32_R_TYPE (reloc->r_info);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Check for unexpected PLT reloc type. */
|
|
|
c6d234 |
- if (__builtin_expect (r_type, R_MN10300_JMP_SLOT) == R_MN10300_JMP_SLOT)
|
|
|
c6d234 |
- {
|
|
|
c6d234 |
- Elf32_Addr* const reloc_addr = (void *)(l_addr + reloc->r_offset);
|
|
|
c6d234 |
- Elf32_Addr value;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Perform a RELATIVE reloc on the .got entry that transfers
|
|
|
c6d234 |
- to the .plt. */
|
|
|
c6d234 |
- COPY_UNALIGNED_WORD (*reloc_addr, value, (int)reloc_addr & 3);
|
|
|
c6d234 |
- value += l_addr;
|
|
|
c6d234 |
- COPY_UNALIGNED_WORD (value, *reloc_addr, (int)reloc_addr & 3);
|
|
|
c6d234 |
- }
|
|
|
c6d234 |
- else if (__builtin_expect (r_type, R_MN10300_NONE) != R_MN10300_NONE)
|
|
|
c6d234 |
- _dl_reloc_bad_type (map, ELFW(R_TYPE) (reloc->r_info), 1);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#endif /* RESOLVE */
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/elf/start.S b/ports/sysdeps/am33/elf/start.S
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 518e75e478bbeb78..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/elf/start.S
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,80 +0,0 @@
|
|
|
c6d234 |
-/* Startup code compliant to the ELF MN10300 ABI.
|
|
|
c6d234 |
- Copyright (C) 1995,1996,1997,1998,2000,2001 Free Software Foundation, Inc.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>
|
|
|
c6d234 |
- Based on ../../i386/elf/start.S.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* This is the canonical entry point, usually the first thing in the text
|
|
|
c6d234 |
- segment. The SVR4/i386 ABI (pages 3-31, 3-32) says that when the entry
|
|
|
c6d234 |
- point runs, most registers' values are unspecified, except for:
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- a0 Contains a function pointer to be registered with `atexit'.
|
|
|
c6d234 |
- This is how the dynamic linker arranges to have DT_FINI
|
|
|
c6d234 |
- functions called for shared libraries that have been loaded
|
|
|
c6d234 |
- before this code runs.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- sp The stack contains the arguments and environment:
|
|
|
c6d234 |
- (4,sp) argc
|
|
|
c6d234 |
- (8,sp) argv[0]
|
|
|
c6d234 |
- ...
|
|
|
c6d234 |
- (4*(argc+1),sp) NULL
|
|
|
c6d234 |
- (4*(argc+2),sp) envp[0]
|
|
|
c6d234 |
- ...
|
|
|
c6d234 |
- NULL
|
|
|
c6d234 |
-*/
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include "bp-sym.h"
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- .text
|
|
|
c6d234 |
- .globl _start
|
|
|
c6d234 |
- .type _start,@function
|
|
|
c6d234 |
-_start:
|
|
|
c6d234 |
- /* Extract the arguments as encoded on the stack and set up
|
|
|
c6d234 |
- the arguments for `main': argc, argv. envp will be determined
|
|
|
c6d234 |
- later in __libc_start_main. */
|
|
|
c6d234 |
- mov sp,a3
|
|
|
c6d234 |
- add -32,sp
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- mov a3,(28,sp) /* stack_end. */
|
|
|
c6d234 |
- mov d0,(24,sp) /* rtld_fini. */
|
|
|
c6d234 |
- mov _fini, d3
|
|
|
c6d234 |
- mov d3,(20,sp) /* fini. */
|
|
|
c6d234 |
- mov _init, d2
|
|
|
c6d234 |
- mov d2,(16,sp) /* init. */
|
|
|
c6d234 |
- inc4 a3
|
|
|
c6d234 |
- mov a3,(12,sp) /* argv. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Set the initial frame pointer as 0, so that the bottom of
|
|
|
c6d234 |
- the stack is clearly marked. */
|
|
|
c6d234 |
- mov 0,a3
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- mov (32,sp), d1 /* argc. */
|
|
|
c6d234 |
- mov BP_SYM (main), d0 /* main. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Call the user's main function, and exit with its value.
|
|
|
c6d234 |
- But let the libc call main. */
|
|
|
c6d234 |
- call BP_SYM (__libc_start_main),[],0
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- call BP_SYM (abort),[],0 /* Crash if somehow `exit' does return. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Define a symbol for the first piece of initialized data. */
|
|
|
c6d234 |
- .data
|
|
|
c6d234 |
- .globl __data_start
|
|
|
c6d234 |
-__data_start:
|
|
|
c6d234 |
- .long 0
|
|
|
c6d234 |
- .weak data_start
|
|
|
c6d234 |
- data_start = __data_start
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/fpu/bits/fenv.h b/ports/sysdeps/am33/fpu/bits/fenv.h
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index b0e60e9312f135b2..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/fpu/bits/fenv.h
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,72 +0,0 @@
|
|
|
c6d234 |
-/* Copyright (C) 1998-2012 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>
|
|
|
c6d234 |
- based on the corresponding file in the mips port.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifndef _FENV_H
|
|
|
c6d234 |
-# error "Never use <bits/fenv.h> directly; include <fenv.h> instead."
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Define bits representing the exception. We use the EF bit
|
|
|
c6d234 |
- positions of the appropriate bits in the FPCR register. */
|
|
|
c6d234 |
-enum
|
|
|
c6d234 |
- {
|
|
|
c6d234 |
- FE_INEXACT =
|
|
|
c6d234 |
-#define FE_INEXACT 0x01
|
|
|
c6d234 |
- FE_INEXACT,
|
|
|
c6d234 |
- FE_UNDERFLOW =
|
|
|
c6d234 |
-#define FE_UNDERFLOW 0x02
|
|
|
c6d234 |
- FE_UNDERFLOW,
|
|
|
c6d234 |
- FE_OVERFLOW =
|
|
|
c6d234 |
-#define FE_OVERFLOW 0x04
|
|
|
c6d234 |
- FE_OVERFLOW,
|
|
|
c6d234 |
- FE_DIVBYZERO =
|
|
|
c6d234 |
-#define FE_DIVBYZERO 0x08
|
|
|
c6d234 |
- FE_DIVBYZERO,
|
|
|
c6d234 |
- FE_INVALID =
|
|
|
c6d234 |
-#define FE_INVALID 0x10
|
|
|
c6d234 |
- FE_INVALID,
|
|
|
c6d234 |
- };
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define FE_ALL_EXCEPT \
|
|
|
c6d234 |
- (FE_INEXACT | FE_DIVBYZERO | FE_UNDERFLOW | FE_OVERFLOW | FE_INVALID)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* The AM33/2.0 FPU supports only Round to nearest. Bits 3<<16 are
|
|
|
c6d234 |
- reserved to represent other rounding modes. */
|
|
|
c6d234 |
-enum
|
|
|
c6d234 |
- {
|
|
|
c6d234 |
- FE_TONEAREST =
|
|
|
c6d234 |
-#define FE_TONEAREST 0x00000
|
|
|
c6d234 |
- FE_TONEAREST,
|
|
|
c6d234 |
- };
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Type representing exception flags. */
|
|
|
c6d234 |
-typedef unsigned int fexcept_t;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Type representing floating-point environment. */
|
|
|
c6d234 |
-typedef unsigned int fenv_t;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* If the default argument is used we use this value. */
|
|
|
c6d234 |
-#define FE_DFL_ENV ((__const fenv_t *) -1)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifdef __USE_GNU
|
|
|
c6d234 |
-/* Floating-point environment where none of the exception is masked. */
|
|
|
c6d234 |
-# define FE_NOMASK_ENV ((__const fenv_t *) -2)
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/fpu/fclrexcpt.c b/ports/sysdeps/am33/fpu/fclrexcpt.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 492ea38ba39bf061..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/fpu/fclrexcpt.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,52 +0,0 @@
|
|
|
c6d234 |
-/* Clear given exceptions in current floating-point environment.
|
|
|
c6d234 |
- Copyright (C) 1998-2012 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>
|
|
|
c6d234 |
- based on corresponding file in the MIPS port.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <fenv.h>
|
|
|
c6d234 |
-#include <fenv_libc.h>
|
|
|
c6d234 |
-#include <fpu_control.h>
|
|
|
c6d234 |
-#include <shlib-compat.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-int
|
|
|
c6d234 |
-__feclearexcept (int excepts)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- fpu_control_t cw;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Mask out unsupported bits/exceptions. */
|
|
|
c6d234 |
- excepts &= FE_ALL_EXCEPT;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Read the complete control word. */
|
|
|
c6d234 |
- _FPU_GETCW (cw);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Clear exception flag bits and cause bits. EF bits are cleared by
|
|
|
c6d234 |
- assigning 1 to them (and there's no way to set them); other bits
|
|
|
c6d234 |
- are copied normally. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- cw &= ~((excepts << CAUSE_SHIFT) | FE_ALL_EXCEPT);
|
|
|
c6d234 |
- cw |= excepts;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Put the new data in effect. */
|
|
|
c6d234 |
- _FPU_SETFCW (cw);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Success. */
|
|
|
c6d234 |
- return 0;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-libm_hidden_ver (__feclearexcept, feclearexcept)
|
|
|
c6d234 |
-versioned_symbol (libm, __feclearexcept, feclearexcept, GLIBC_2_2);
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/fpu/fedisblxcpt.c b/ports/sysdeps/am33/fpu/fedisblxcpt.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 170f8200ed1224fa..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/fpu/fedisblxcpt.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,41 +0,0 @@
|
|
|
c6d234 |
-/* Disable floating-point exceptions.
|
|
|
c6d234 |
- Copyright (C) 2000, 2004 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>
|
|
|
c6d234 |
- based on corresponding file in the MIPS port.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <fenv.h>
|
|
|
c6d234 |
-#include <fenv_libc.h>
|
|
|
c6d234 |
-#include <fpu_control.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-int
|
|
|
c6d234 |
-fedisableexcept (int excepts)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- fpu_control_t new_exc, old_exc;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Get the current control word. */
|
|
|
c6d234 |
- _FPU_GETCW (new_exc);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- old_exc = (new_exc & ENABLE_MASK) >> ENABLE_SHIFT;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- excepts &= FE_ALL_EXCEPT;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- new_exc &= ~(excepts << ENABLE_SHIFT);
|
|
|
c6d234 |
- _FPU_SETCW (new_exc);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- return old_exc;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/fpu/feenablxcpt.c b/ports/sysdeps/am33/fpu/feenablxcpt.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index fe6d880c2192fd7c..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/fpu/feenablxcpt.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,41 +0,0 @@
|
|
|
c6d234 |
-/* Enable floating-point exceptions.
|
|
|
c6d234 |
- Copyright (C) 2000, 2004 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>
|
|
|
c6d234 |
- based on corresponding file in the MIPS port.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <fenv.h>
|
|
|
c6d234 |
-#include <fenv_libc.h>
|
|
|
c6d234 |
-#include <fpu_control.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-int
|
|
|
c6d234 |
-feenableexcept (int excepts)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- fpu_control_t new_exc, old_exc;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Get the current control word. */
|
|
|
c6d234 |
- _FPU_GETCW (new_exc);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- old_exc = (new_exc & ENABLE_MASK) >> ENABLE_SHIFT;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- excepts &= FE_ALL_EXCEPT;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- new_exc |= excepts << ENABLE_SHIFT;
|
|
|
c6d234 |
- _FPU_SETCW (new_exc);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- return old_exc;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/fpu/fegetenv.c b/ports/sysdeps/am33/fpu/fegetenv.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 6da6eeb91357d2d5..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/fpu/fegetenv.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,34 +0,0 @@
|
|
|
c6d234 |
-/* Store current floating-point environment.
|
|
|
c6d234 |
- Copyright (C) 1998, 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>
|
|
|
c6d234 |
- based on corresponding file in the MIPS port.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <fenv.h>
|
|
|
c6d234 |
-#include <fpu_control.h>
|
|
|
c6d234 |
-#include <shlib-compat.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-int
|
|
|
c6d234 |
-__fegetenv (fenv_t *envp)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- _FPU_GETCW (*envp);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Success. */
|
|
|
c6d234 |
- return 0;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-versioned_symbol (libm, __fegetenv, fegetenv, GLIBC_2_2);
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/fpu/fegetexcept.c b/ports/sysdeps/am33/fpu/fegetexcept.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 13e5306af994302c..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/fpu/fegetexcept.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,34 +0,0 @@
|
|
|
c6d234 |
-/* Get enabled floating-point exceptions.
|
|
|
c6d234 |
- Copyright (C) 2000, 2004 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>
|
|
|
c6d234 |
- based on corresponding file in the MIPS port.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <fenv.h>
|
|
|
c6d234 |
-#include <fenv_libc.h>
|
|
|
c6d234 |
-#include <fpu_control.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-int
|
|
|
c6d234 |
-fegetexcept (void)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- unsigned int exc;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Get the current control word. */
|
|
|
c6d234 |
- _FPU_GETCW (exc);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- return (exc & ENABLE_MASK) >> ENABLE_SHIFT;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/fpu/fegetround.c b/ports/sysdeps/am33/fpu/fegetround.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index d649f18bf7c8ffe2..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/fpu/fegetround.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,34 +0,0 @@
|
|
|
c6d234 |
-/* Return current rounding direction.
|
|
|
c6d234 |
- Copyright (C) 1998, 2004 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>
|
|
|
c6d234 |
- based on corresponding file in the MIPS port.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <fenv.h>
|
|
|
c6d234 |
-#include <fenv_libc.h>
|
|
|
c6d234 |
-#include <fpu_control.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-int
|
|
|
c6d234 |
-fegetround (void)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- int cw;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Get control word. */
|
|
|
c6d234 |
- _FPU_GETCW (cw);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- return (cw & ROUND_MASK);
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/fpu/feholdexcpt.c b/ports/sysdeps/am33/fpu/feholdexcpt.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 1c002d8d9490364d..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/fpu/feholdexcpt.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,38 +0,0 @@
|
|
|
c6d234 |
-/* Store current floating-point environment and clear exceptions.
|
|
|
c6d234 |
- Copyright (C) 2000, 2004 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>
|
|
|
c6d234 |
- based on corresponding file in the MIPS port.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <fenv.h>
|
|
|
c6d234 |
-#include <fpu_control.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-int
|
|
|
c6d234 |
-feholdexcept (fenv_t *envp)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- fpu_control_t cw;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Save the current state. */
|
|
|
c6d234 |
- _FPU_GETCW (cw);
|
|
|
c6d234 |
- *envp = cw;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Clear all exception enable bits and flags. */
|
|
|
c6d234 |
- cw &= ~(_FPU_MASK_V|_FPU_MASK_Z|_FPU_MASK_O|_FPU_MASK_U|_FPU_MASK_I);
|
|
|
c6d234 |
- _FPU_SETFCW (cw);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- return 0;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/fpu/fenv_libc.h b/ports/sysdeps/am33/fpu/fenv_libc.h
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 40d57259bdc3e702..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/fpu/fenv_libc.h
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,32 +0,0 @@
|
|
|
c6d234 |
-/* Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>
|
|
|
c6d234 |
- based on the corresponding file in the mips port.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifndef _FENV_LIBC_H
|
|
|
c6d234 |
-#define _FENV_LIBC_H 1
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Mask for enabling exceptions and for the CAUSE bits. */
|
|
|
c6d234 |
-#define ENABLE_MASK 0x003E0U
|
|
|
c6d234 |
-#define CAUSE_MASK 0x07C00U
|
|
|
c6d234 |
-#define ROUND_MASK 0x30000U
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Shift for FE_* flags to get up to the ENABLE bits and the CAUSE bits. */
|
|
|
c6d234 |
-#define ENABLE_SHIFT 5
|
|
|
c6d234 |
-#define CAUSE_SHIFT 10
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#endif /* _FENV_LIBC_H */
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/fpu/fesetenv.c b/ports/sysdeps/am33/fpu/fesetenv.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 110c49c9f8fd780a..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/fpu/fesetenv.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,59 +0,0 @@
|
|
|
c6d234 |
-/* Install given floating-point environment.
|
|
|
c6d234 |
- Copyright (C) 1998, 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>
|
|
|
c6d234 |
- based on corresponding file in the MIPS port.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <fenv.h>
|
|
|
c6d234 |
-#include <fpu_control.h>
|
|
|
c6d234 |
-#include <shlib-compat.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-int
|
|
|
c6d234 |
-__fesetenv (const fenv_t *envp)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- fpu_control_t cw;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* We want to clear all EF bits for the default end IEEE. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- if (envp == FE_DFL_ENV)
|
|
|
c6d234 |
- _FPU_SETFCW (_FPU_DEFAULT|FE_ALL_EXCEPT);
|
|
|
c6d234 |
- else if (envp == FE_NOMASK_ENV)
|
|
|
c6d234 |
- _FPU_SETFCW (_FPU_IEEE|FE_ALL_EXCEPT);
|
|
|
c6d234 |
- else
|
|
|
c6d234 |
- {
|
|
|
c6d234 |
- fpu_control_t temp;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- _FPU_GETCW (temp);
|
|
|
c6d234 |
- cw = *envp;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* If EF bits are cleared and the user requests them to be set,
|
|
|
c6d234 |
- we have to fail, because there's no way to do it. */
|
|
|
c6d234 |
- if (~temp & cw & FE_ALL_EXCEPT)
|
|
|
c6d234 |
- return -1;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* We clear EF bits by storing a 1 in them, so flip the
|
|
|
c6d234 |
- FE_ALL_EXCEPT bits. */
|
|
|
c6d234 |
- cw = (cw & ~FE_ALL_EXCEPT) | (~cw & FE_ALL_EXCEPT);
|
|
|
c6d234 |
- _FPU_SETFCW (cw);
|
|
|
c6d234 |
- }
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Success. */
|
|
|
c6d234 |
- return 0;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-libm_hidden_ver (__fesetenv, fesetenv)
|
|
|
c6d234 |
-versioned_symbol (libm, __fesetenv, fesetenv, GLIBC_2_2);
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/fpu/fesetround.c b/ports/sysdeps/am33/fpu/fesetround.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index e77dc7684f93163b..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/fpu/fesetround.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,28 +0,0 @@
|
|
|
c6d234 |
-/* Set current rounding direction.
|
|
|
c6d234 |
- Copyright (C) 2004 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <fenv.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-int
|
|
|
c6d234 |
-fesetround (int round)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- /* The only supported rounding mode is to-nearest. Just check
|
|
|
c6d234 |
- whether we're switching to it. */
|
|
|
c6d234 |
- return (round != FE_TONEAREST);
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/fpu/feupdateenv.c b/ports/sysdeps/am33/fpu/feupdateenv.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 70951a36753f62b7..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/fpu/feupdateenv.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,46 +0,0 @@
|
|
|
c6d234 |
-/* Install given floating-point environment and raise exceptions.
|
|
|
c6d234 |
- Copyright (C) 1998, 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>
|
|
|
c6d234 |
- based on corresponding file in the MIPS port.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <fenv.h>
|
|
|
c6d234 |
-#include <fpu_control.h>
|
|
|
c6d234 |
-#include <shlib-compat.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-int
|
|
|
c6d234 |
-__feupdateenv (const fenv_t *envp)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- int temp;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Save current exceptions. */
|
|
|
c6d234 |
- _FPU_GETCW (temp);
|
|
|
c6d234 |
- temp &= FE_ALL_EXCEPT;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Install new environment. */
|
|
|
c6d234 |
- fesetenv (envp);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Raise the safed exception. Incidently for us the implementation
|
|
|
c6d234 |
- defined format of the values in objects of type fexcept_t is the
|
|
|
c6d234 |
- same as the ones specified using the FE_* constants. */
|
|
|
c6d234 |
- feraiseexcept (temp);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Success. */
|
|
|
c6d234 |
- return 0;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-versioned_symbol (libm, __feupdateenv, feupdateenv, GLIBC_2_2);
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/fpu/fgetexcptflg.c b/ports/sysdeps/am33/fpu/fgetexcptflg.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index d5828e6011a71881..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/fpu/fgetexcptflg.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,43 +0,0 @@
|
|
|
c6d234 |
-/* Store current representation for exceptions.
|
|
|
c6d234 |
- Copyright (C) 1998, 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>
|
|
|
c6d234 |
- based on corresponding file in the MIPS port.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <fenv.h>
|
|
|
c6d234 |
-#include <fpu_control.h>
|
|
|
c6d234 |
-#include <shlib-compat.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-int
|
|
|
c6d234 |
-__fegetexceptflag (fexcept_t *flagp, int excepts)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- fexcept_t temp;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Get the current exceptions. */
|
|
|
c6d234 |
- _FPU_GETCW (temp);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* We only save the relevant bits here. In particular, care has to be
|
|
|
c6d234 |
- taken with the CAUSE bits, as an inadvertent restore later on could
|
|
|
c6d234 |
- generate unexpected exceptions. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- *flagp = temp & excepts & FE_ALL_EXCEPT;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Success. */
|
|
|
c6d234 |
- return 0;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-versioned_symbol (libm, __fegetexceptflag, fegetexceptflag, GLIBC_2_2);
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/fpu/fpu_control.h b/ports/sysdeps/am33/fpu/fpu_control.h
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index de28228e7182627e..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/fpu/fpu_control.h
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,74 +0,0 @@
|
|
|
c6d234 |
-/* FPU control word bits. AM33/2.0 version.
|
|
|
c6d234 |
- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2004
|
|
|
c6d234 |
- Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>
|
|
|
c6d234 |
- based on the corresponding file in the mips port.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifndef _FPU_CONTROL_H
|
|
|
c6d234 |
-#define _FPU_CONTROL_H
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* AM33/2.0 FPU floating point control register bits.
|
|
|
c6d234 |
- *
|
|
|
c6d234 |
- * 31-22 -> reserved
|
|
|
c6d234 |
- * 21-18 -> floating-point condition codes (L, G, E, U)
|
|
|
c6d234 |
- * 17-16 -> rounding modes (00 is to-nearest; other values are reserved
|
|
|
c6d234 |
- * 15 -> reserved (read as 0, write with 0)
|
|
|
c6d234 |
- * 14-10 -> Exception Cause (inValid, divZero, Overflow, Underflow, Inexact)
|
|
|
c6d234 |
- * 9- 5 -> Exception Enable
|
|
|
c6d234 |
- * 4- 0 -> Exception Flag, cleared when exception cause is set
|
|
|
c6d234 |
- */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <features.h>
|
|
|
c6d234 |
-#include <fenv.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* masking of interrupts */
|
|
|
c6d234 |
-#define _FPU_MASK_V 0x0200 /* Invalid operation */
|
|
|
c6d234 |
-#define _FPU_MASK_Z 0x0100 /* Division by zero */
|
|
|
c6d234 |
-#define _FPU_MASK_O 0x0080 /* Overflow */
|
|
|
c6d234 |
-#define _FPU_MASK_U 0x0040 /* Underflow */
|
|
|
c6d234 |
-#define _FPU_MASK_I 0x0020 /* Inexact operation */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* rounding control */
|
|
|
c6d234 |
-#define _FPU_RC_NEAREST 0x0 /* Only available mode */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define _FPU_RESERVED 0xffc08000 /* Reserved bits in fpcr */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* The fdlibm code requires strict IEEE double precision arithmetic,
|
|
|
c6d234 |
- and no interrupts for exceptions, rounding to nearest. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define _FPU_DEFAULT 0x0000001f
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* IEEE: same as above, but exceptions */
|
|
|
c6d234 |
-#define _FPU_IEEE 0x000003ff
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Type of the control word. */
|
|
|
c6d234 |
-typedef unsigned int fpu_control_t;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Macros for accessing the hardware control word. _FPU_SETCW is
|
|
|
c6d234 |
- defined such that it won't modify the EF bits, that are cleared
|
|
|
c6d234 |
- when assigned bits that are set. Use SETFCW to get them actually
|
|
|
c6d234 |
- reset. */
|
|
|
c6d234 |
-#define _FPU_SETFCW(cw) __asm__ ("fmov %0,fpcr" : : "ri" (cw))
|
|
|
c6d234 |
-#define _FPU_SETCW(cw) _FPU_SETFCW((cw) & ~FE_ALL_EXCEPT)
|
|
|
c6d234 |
-#define _FPU_GETCW(cw) __asm__ ("fmov fpcr,%0" : "=r" (cw))
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Default control word set at startup. */
|
|
|
c6d234 |
-extern fpu_control_t __fpu_control;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#endif /* fpu_control.h */
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/fpu/fraiseexcpt.c b/ports/sysdeps/am33/fpu/fraiseexcpt.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 628ad56e9be78034..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/fpu/fraiseexcpt.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,78 +0,0 @@
|
|
|
c6d234 |
-/* Raise given exceptions.
|
|
|
c6d234 |
- Copyright (C) 2000, 2002, 2004 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>
|
|
|
c6d234 |
- based on corresponding file in the M68K port.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <fenv.h>
|
|
|
c6d234 |
-#include <float.h>
|
|
|
c6d234 |
-#include <math.h>
|
|
|
c6d234 |
-#include <shlib-compat.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-int
|
|
|
c6d234 |
-__feraiseexcept (int excepts)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- /* Raise exceptions represented by EXCEPTS. But we must raise only one
|
|
|
c6d234 |
- signal at a time. It is important that if the overflow/underflow
|
|
|
c6d234 |
- exception and the divide by zero exception are given at the same
|
|
|
c6d234 |
- time, the overflow/underflow exception follows the divide by zero
|
|
|
c6d234 |
- exception. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* First: invalid exception. */
|
|
|
c6d234 |
- if (excepts & FE_INVALID)
|
|
|
c6d234 |
- {
|
|
|
c6d234 |
- /* One example of a invalid operation is 0 * Infinity. */
|
|
|
c6d234 |
- float x = HUGE_VALF, y = 0.0f;
|
|
|
c6d234 |
- __asm__ __volatile__ ("fmul %1,%0" : "+f" (x) : "f" (y));
|
|
|
c6d234 |
- }
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Next: division by zero. */
|
|
|
c6d234 |
- if (excepts & FE_DIVBYZERO)
|
|
|
c6d234 |
- {
|
|
|
c6d234 |
- float x = 1.0f, y = 0.0f;
|
|
|
c6d234 |
- __asm__ __volatile__ ("fdiv %1,%0" : "+f" (x) : "f" (y));
|
|
|
c6d234 |
- }
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Next: overflow. */
|
|
|
c6d234 |
- if (excepts & FE_OVERFLOW)
|
|
|
c6d234 |
- {
|
|
|
c6d234 |
- float x = FLT_MAX;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- __asm__ __volatile__ ("fmul %0,%0" : "+f" (x));
|
|
|
c6d234 |
- }
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Next: underflow. */
|
|
|
c6d234 |
- if (excepts & FE_UNDERFLOW)
|
|
|
c6d234 |
- {
|
|
|
c6d234 |
- float x = -FLT_MIN;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- __asm__ __volatile__ ("fmul %0,%0" : "+f" (x));
|
|
|
c6d234 |
- }
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Last: inexact. */
|
|
|
c6d234 |
- if (excepts & FE_INEXACT)
|
|
|
c6d234 |
- {
|
|
|
c6d234 |
- float x = 1.0f, y = 3.0f;
|
|
|
c6d234 |
- __asm__ __volatile__ ("fdiv %1,%0" : "=f" (x) : "f" (y));
|
|
|
c6d234 |
- }
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Success. */
|
|
|
c6d234 |
- return 0;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-libm_hidden_ver (__feraiseexcept, feraiseexcept)
|
|
|
c6d234 |
-versioned_symbol (libm, __feraiseexcept, feraiseexcept, GLIBC_2_2);
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/fpu/fsetexcptflg.c b/ports/sysdeps/am33/fpu/fsetexcptflg.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index a5bde4020096076b..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/fpu/fsetexcptflg.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,56 +0,0 @@
|
|
|
c6d234 |
-/* Set floating-point environment exception handling.
|
|
|
c6d234 |
- Copyright (C) 1998, 1999, 2000, 2002, 2004 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>
|
|
|
c6d234 |
- based on corresponding file in the MIPS port.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <fenv.h>
|
|
|
c6d234 |
-#include <fpu_control.h>
|
|
|
c6d234 |
-#include <shlib-compat.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-int
|
|
|
c6d234 |
-__fesetexceptflag (const fexcept_t *flagp, int excepts)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- fpu_control_t cw, temp;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Get the current exceptions. */
|
|
|
c6d234 |
- _FPU_GETCW (cw);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Make sure the flags we want restored are legal. */
|
|
|
c6d234 |
- excepts &= FE_ALL_EXCEPT;
|
|
|
c6d234 |
- temp = *flagp & excepts;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* If EF bits are clear and the user requests them to be set,
|
|
|
c6d234 |
- we have to fail, because there's no way to do it. */
|
|
|
c6d234 |
- if (~(cw & excepts) & temp)
|
|
|
c6d234 |
- return -1;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* We clear EF bits by storing a 1 in them, so flip the
|
|
|
c6d234 |
- FE_ALL_EXCEPT bits. */
|
|
|
c6d234 |
- temp = (~temp & FE_ALL_EXCEPT);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Now clear the bits called for, and copy them in from flagp. Note that
|
|
|
c6d234 |
- we ignore all non-flag bits from *flagp, so they don't matter. */
|
|
|
c6d234 |
- cw = (cw & ~FE_ALL_EXCEPT) | temp;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- _FPU_SETFCW (cw);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Success. */
|
|
|
c6d234 |
- return 0;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-versioned_symbol (libm, __fesetexceptflag, fesetexceptflag, GLIBC_2_2);
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/fpu/ftestexcept.c b/ports/sysdeps/am33/fpu/ftestexcept.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index ef3e761fcc110dd6..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/fpu/ftestexcept.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,33 +0,0 @@
|
|
|
c6d234 |
-/* Test exception in current environment.
|
|
|
c6d234 |
- Copyright (C) 1998, 2004 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>
|
|
|
c6d234 |
- based on corresponding file in the MIPS port.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <fenv.h>
|
|
|
c6d234 |
-#include <fpu_control.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-int
|
|
|
c6d234 |
-fetestexcept (int excepts)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- int cw;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Get current control word. */
|
|
|
c6d234 |
- _FPU_GETCW (cw);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- return cw & excepts & FE_ALL_EXCEPT;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/jmpbuf-offsets.h b/ports/sysdeps/am33/jmpbuf-offsets.h
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 9884f2e3c099aeb8..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/jmpbuf-offsets.h
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,19 +0,0 @@
|
|
|
c6d234 |
-/* Private macros for accessing __jmp_buf contents. AM33 version.
|
|
|
c6d234 |
- Copyright (C) 2006 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define __JMP_BUF_SP 20
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/jmpbuf-unwind.h b/ports/sysdeps/am33/jmpbuf-unwind.h
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index d5c01e27978d6ab4..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/jmpbuf-unwind.h
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,25 +0,0 @@
|
|
|
c6d234 |
-/* Examine __jmp_buf for unwinding frames. AM33 version.
|
|
|
c6d234 |
- Copyright (C) 2006 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <setjmp.h>
|
|
|
c6d234 |
-#include <jmpbuf-offsets.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Test if longjmp to JMPBUF would unwind the frame
|
|
|
c6d234 |
- containing a local variable at ADDRESS. */
|
|
|
c6d234 |
-#define _JMPBUF_UNWINDS(jmpbuf, address, demangle) \
|
|
|
c6d234 |
- ((void *) (address) < (void *) demangle (jmpbuf[__JMP_BUF_SP]))
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/linuxthreads/pspinlock.c b/ports/sysdeps/am33/linuxthreads/pspinlock.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index a1674974abfb749b..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/linuxthreads/pspinlock.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,73 +0,0 @@
|
|
|
c6d234 |
-/* POSIX spinlock implementation. AM33 version.
|
|
|
c6d234 |
- Copyright 2001 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Library General Public License as
|
|
|
c6d234 |
- published by the Free Software Foundation; either version 2 of the
|
|
|
c6d234 |
- License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Library General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Library General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <errno.h>
|
|
|
c6d234 |
-#include <pthread.h>
|
|
|
c6d234 |
-#include "internals.h"
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-int
|
|
|
c6d234 |
-__pthread_spin_lock (pthread_spinlock_t *lock)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- __asm__ __volatile__("1: bset %1, (%0); beq 1b"
|
|
|
c6d234 |
- : : "a" (lock), "d" (1) : "memory");
|
|
|
c6d234 |
- return 0;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-weak_alias (__pthread_spin_lock, pthread_spin_lock)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-int
|
|
|
c6d234 |
-__pthread_spin_trylock (pthread_spinlock_t *lock)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- int oldval = 1;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- __asm__ __volatile__ ("bset %0, (%1); beq 1f; clr %0; 1:" :
|
|
|
c6d234 |
- "+d" (oldval) : "a" (lock) : "memory");
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- return oldval ? EBUSY : 0;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-weak_alias (__pthread_spin_trylock, pthread_spin_trylock)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-int
|
|
|
c6d234 |
-__pthread_spin_unlock (pthread_spinlock_t *lock)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- *lock = 0;
|
|
|
c6d234 |
- return 0;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-weak_alias (__pthread_spin_unlock, pthread_spin_unlock)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-int
|
|
|
c6d234 |
-__pthread_spin_init (pthread_spinlock_t *lock, int pshared)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- /* We can ignore the `pshared' parameter. Since we are busy-waiting
|
|
|
c6d234 |
- all processes which can access the memory location `lock' points
|
|
|
c6d234 |
- to can use the spinlock. */
|
|
|
c6d234 |
- *lock = 0;
|
|
|
c6d234 |
- return 0;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-weak_alias (__pthread_spin_init, pthread_spin_init)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-int
|
|
|
c6d234 |
-__pthread_spin_destroy (pthread_spinlock_t *lock)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- /* Nothing to do. */
|
|
|
c6d234 |
- return 0;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-weak_alias (__pthread_spin_destroy, pthread_spin_destroy)
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/linuxthreads/pt-machine.h b/ports/sysdeps/am33/linuxthreads/pt-machine.h
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 86d0f8b1e1cb0e01..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/linuxthreads/pt-machine.h
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,67 +0,0 @@
|
|
|
c6d234 |
-/* Machine-dependent pthreads configuration and inline functions.
|
|
|
c6d234 |
- am33 version.
|
|
|
c6d234 |
- Copyright (C) 1996,1997,1998,1999,2000,2001, 2004
|
|
|
c6d234 |
- Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>
|
|
|
c6d234 |
- Based on ../i386/pt-machine.h.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Library General Public License as
|
|
|
c6d234 |
- published by the Free Software Foundation; either version 2 of the
|
|
|
c6d234 |
- License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Library General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Library General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifndef _PT_MACHINE_H
|
|
|
c6d234 |
-#define _PT_MACHINE_H 1
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifndef __ASSEMBLER__
|
|
|
c6d234 |
-#ifndef PT_EI
|
|
|
c6d234 |
-# define PT_EI extern inline
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Get some notion of the current stack. Need not be exactly the top
|
|
|
c6d234 |
- of the stack, just something somewhere in the current frame. */
|
|
|
c6d234 |
-#define CURRENT_STACK_FRAME __builtin_frame_address (0)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Spinlock implementation; required. */
|
|
|
c6d234 |
-PT_EI long int
|
|
|
c6d234 |
-testandset (int *spinlock)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- long int ret = 1;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* This won't test&set the entire int, only the least significant
|
|
|
c6d234 |
- byte. I hope this doesn't matter, since we can't do better. */
|
|
|
c6d234 |
- __asm__ __volatile__ ("bset %0, %1; bne 1f; clr %0; 1:" :
|
|
|
c6d234 |
- "+d" (ret), "+m" (*(volatile int *)spinlock));
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- return ret;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-PT_EI int
|
|
|
c6d234 |
-get_eflags (void)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- int res;
|
|
|
c6d234 |
- __asm__ __volatile__ ("mov psw,%0" : "=d" (res));
|
|
|
c6d234 |
- return res;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-PT_EI void
|
|
|
c6d234 |
-set_eflags (int newflags)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- __asm__ __volatile__ ("mov %0,psw" : : "d" (newflags) : "cc");
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#endif /* __ASSEMBLER__ */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#endif /* pt-machine.h */
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/memusage.h b/ports/sysdeps/am33/memusage.h
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 19d7a732ca41c078..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/memusage.h
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,22 +0,0 @@
|
|
|
c6d234 |
-/* Copyright 2000, 2001 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define GETSP() ({ uintptr_t stack_ptr; \
|
|
|
c6d234 |
- asm ("mov sp,%0" : "=a" (stack_ptr)); \
|
|
|
c6d234 |
- stack_ptr; })
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <sysdeps/generic/memusage.h>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/preconfigure b/ports/sysdeps/am33/preconfigure
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 9495465389764b09..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/preconfigure
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,5 +0,0 @@
|
|
|
c6d234 |
-case "$machine" in
|
|
|
c6d234 |
-am33*)
|
|
|
c6d234 |
- base_machine=am33 machine=am33
|
|
|
c6d234 |
- ;;
|
|
|
c6d234 |
-esac
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/setjmp.S b/ports/sysdeps/am33/setjmp.S
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 54b239d65c3a4f3a..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/setjmp.S
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,79 +0,0 @@
|
|
|
c6d234 |
-/* setjmp for am33.
|
|
|
c6d234 |
- Copyright (C) 2001, 2004 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <sysdep.h>
|
|
|
c6d234 |
-#define _ASM
|
|
|
c6d234 |
-#define _SETJMP_H
|
|
|
c6d234 |
-#include <bits/setjmp.h>
|
|
|
c6d234 |
-#include <asm-syntax.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-ENTRY (__sigsetjmp)
|
|
|
c6d234 |
-.Lsigsetjmp:
|
|
|
c6d234 |
- /* Save registers. */
|
|
|
c6d234 |
- mov d0,a0
|
|
|
c6d234 |
- mov d2,(0,a0)
|
|
|
c6d234 |
- mov d3,(4,a0)
|
|
|
c6d234 |
- mov mdr,d0
|
|
|
c6d234 |
- mov d0,(8,a0)
|
|
|
c6d234 |
- /* Restore d0 for __sigjmp_save. */
|
|
|
c6d234 |
- mov a0,d0
|
|
|
c6d234 |
- mov a2,(12,a0)
|
|
|
c6d234 |
- mov a3,(16,a0)
|
|
|
c6d234 |
- mov sp,a1
|
|
|
c6d234 |
- mov a1,(20,a0)
|
|
|
c6d234 |
- add 24,a0
|
|
|
c6d234 |
- mov r4,(a0+)
|
|
|
c6d234 |
- mov r5,(a0+)
|
|
|
c6d234 |
- mov r6,(a0+)
|
|
|
c6d234 |
- mov r7,(a0+)
|
|
|
c6d234 |
-#ifdef __AM33_2__
|
|
|
c6d234 |
- fmov fs4,(a0+)
|
|
|
c6d234 |
- fmov fs5,(a0+)
|
|
|
c6d234 |
- fmov fs6,(a0+)
|
|
|
c6d234 |
- fmov fs7,(a0+)
|
|
|
c6d234 |
- fmov fs8,(a0+)
|
|
|
c6d234 |
- fmov fs9,(a0+)
|
|
|
c6d234 |
- fmov fs10,(a0+)
|
|
|
c6d234 |
- fmov fs11,(a0+)
|
|
|
c6d234 |
- fmov fs12,(a0+)
|
|
|
c6d234 |
- fmov fs13,(a0+)
|
|
|
c6d234 |
- fmov fs14,(a0+)
|
|
|
c6d234 |
- fmov fs15,(a0+)
|
|
|
c6d234 |
- fmov fs16,(a0+)
|
|
|
c6d234 |
- fmov fs17,(a0+)
|
|
|
c6d234 |
- fmov fs18,(a0+)
|
|
|
c6d234 |
- fmov fs19,(a0+)
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
- /* Make a tail call to __sigjmp_save; it takes the same args. */
|
|
|
c6d234 |
- jmp __sigjmp_save
|
|
|
c6d234 |
-END (__sigsetjmp)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* BSD `_setjmp' entry point to `sigsetjmp (..., 1)'. */
|
|
|
c6d234 |
-ENTRY (setjmp)
|
|
|
c6d234 |
- /* Tail-call setsetjmp with savesigs==1. */
|
|
|
c6d234 |
- mov 1,d1
|
|
|
c6d234 |
- bra .Lsigsetjmp
|
|
|
c6d234 |
-END (setjmp)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* BSD `_setjmp' entry point to `sigsetjmp (..., 0)'. */
|
|
|
c6d234 |
-ENTRY (_setjmp)
|
|
|
c6d234 |
- /* Tail-call setsetjmp with savesigs==0. */
|
|
|
c6d234 |
- clr d1
|
|
|
c6d234 |
- bra .Lsigsetjmp
|
|
|
c6d234 |
-END (_setjmp)
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/shlib-versions b/ports/sysdeps/am33/shlib-versions
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index ad6ded9dc4d755eb..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/shlib-versions
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-am33.*-.*-linux.* DEFAULT GLIBC_2.2.5
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/stackinfo.h b/ports/sysdeps/am33/stackinfo.h
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index c7a7977773458663..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/stackinfo.h
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,27 +0,0 @@
|
|
|
c6d234 |
-/* Copyright 2001 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* This file contains a bit of information about the stack allocation
|
|
|
c6d234 |
- of the processor. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifndef _STACKINFO_H
|
|
|
c6d234 |
-#define _STACKINFO_H 1
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* On am33 the stack grows down. */
|
|
|
c6d234 |
-#define _STACK_GROWS_DOWN 1
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#endif /* stackinfo.h */
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/sys/ucontext.h b/ports/sysdeps/am33/sys/ucontext.h
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 1615b6368c9530c0..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/sys/ucontext.h
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,122 +0,0 @@
|
|
|
c6d234 |
-/* Copyright 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Library General Public License as
|
|
|
c6d234 |
- published by the Free Software Foundation; either version 2 of the
|
|
|
c6d234 |
- License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Library General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Library General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* AM33/2.0 context switching support. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifndef _SYS_UCONTEXT_H
|
|
|
c6d234 |
-#define _SYS_UCONTEXT_H 1
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <features.h>
|
|
|
c6d234 |
-#include <signal.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Type for general register. */
|
|
|
c6d234 |
-typedef int greg_t;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Number of general registers. */
|
|
|
c6d234 |
-#define NGREG 28
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Container for all general registers. */
|
|
|
c6d234 |
-typedef greg_t gregset_t[NGREG];
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Number of each register is the `gregset_t' array. */
|
|
|
c6d234 |
-enum
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- REG_D0 = 0,
|
|
|
c6d234 |
-#define REG_D0 REG_D0
|
|
|
c6d234 |
- REG_D1,
|
|
|
c6d234 |
-#define REG_D1 REG_D1
|
|
|
c6d234 |
- REG_D2,
|
|
|
c6d234 |
-#define REG_D2 REG_D2
|
|
|
c6d234 |
- REG_D3,
|
|
|
c6d234 |
-#define REG_D3 REG_D3
|
|
|
c6d234 |
- REG_A0,
|
|
|
c6d234 |
-#define REG_A0 REG_A0
|
|
|
c6d234 |
- REG_A1,
|
|
|
c6d234 |
-#define REG_A1 REG_A1
|
|
|
c6d234 |
- REG_A2,
|
|
|
c6d234 |
-#define REG_A2 REG_A2
|
|
|
c6d234 |
- REG_A3,
|
|
|
c6d234 |
-#define REG_A3 REG_A3
|
|
|
c6d234 |
- REG_E0,
|
|
|
c6d234 |
-#define REG_E0 REG_E0
|
|
|
c6d234 |
- REG_E1,
|
|
|
c6d234 |
-#define REG_E1 REG_E1
|
|
|
c6d234 |
- REG_E2,
|
|
|
c6d234 |
-#define REG_E2 REG_E2
|
|
|
c6d234 |
- REG_E3,
|
|
|
c6d234 |
-#define REG_E3 REG_E3
|
|
|
c6d234 |
- REG_E4,
|
|
|
c6d234 |
-#define REG_E4 REG_E4
|
|
|
c6d234 |
- REG_E5,
|
|
|
c6d234 |
-#define REG_E5 REG_E5
|
|
|
c6d234 |
- REG_E6,
|
|
|
c6d234 |
-#define REG_E6 REG_E6
|
|
|
c6d234 |
- REG_E7,
|
|
|
c6d234 |
-#define REG_E7 REG_E7
|
|
|
c6d234 |
- REG_LAR,
|
|
|
c6d234 |
-#define REG_LAR REG_LAR
|
|
|
c6d234 |
- REG_LIR,
|
|
|
c6d234 |
-#define REG_LIR REG_LIR
|
|
|
c6d234 |
- REG_MDR,
|
|
|
c6d234 |
-#define REG_MDR REG_MDR
|
|
|
c6d234 |
- REG_MCVF,
|
|
|
c6d234 |
-#define REG_MCVF REG_MCVF
|
|
|
c6d234 |
- REG_MCRL,
|
|
|
c6d234 |
-#define REG_MCRL REG_MCRL
|
|
|
c6d234 |
- REG_MCRH,
|
|
|
c6d234 |
-#define REG_MCRH REG_MCRH
|
|
|
c6d234 |
- REG_MDRQ,
|
|
|
c6d234 |
-#define REG_MDRQ REG_MDRQ
|
|
|
c6d234 |
- REG_SP,
|
|
|
c6d234 |
-#define REG_SP REG_SP
|
|
|
c6d234 |
- REG_EPSW,
|
|
|
c6d234 |
-#define REG_EPSW REG_EPSW
|
|
|
c6d234 |
- REG_PC,
|
|
|
c6d234 |
-#define REG_PC REG_PC
|
|
|
c6d234 |
-};
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-typedef int freg_t;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Structure to describe FPU registers. */
|
|
|
c6d234 |
-typedef struct {
|
|
|
c6d234 |
- union {
|
|
|
c6d234 |
- double fp_dregs[16];
|
|
|
c6d234 |
- float fp_fregs[32];
|
|
|
c6d234 |
- freg_t fp_regs[32];
|
|
|
c6d234 |
- } regs;
|
|
|
c6d234 |
- freg_t fpcr;
|
|
|
c6d234 |
-} fpregset_t;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Context to describe whole processor state. */
|
|
|
c6d234 |
-typedef struct
|
|
|
c6d234 |
- {
|
|
|
c6d234 |
- gregset_t gregs;
|
|
|
c6d234 |
- fpregset_t fpregs;
|
|
|
c6d234 |
- } mcontext_t;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Userlevel context. */
|
|
|
c6d234 |
-typedef struct ucontext
|
|
|
c6d234 |
- {
|
|
|
c6d234 |
- unsigned long int uc_flags;
|
|
|
c6d234 |
- struct ucontext *uc_link;
|
|
|
c6d234 |
- __sigset_t uc_sigmask;
|
|
|
c6d234 |
- stack_t uc_stack;
|
|
|
c6d234 |
- mcontext_t uc_mcontext;
|
|
|
c6d234 |
- long int uc_filler[5];
|
|
|
c6d234 |
- } ucontext_t;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#endif /* sys/ucontext.h */
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/sysdep.h b/ports/sysdeps/am33/sysdep.h
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 2ddb656957b5bc8f..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/sysdep.h
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,81 +0,0 @@
|
|
|
c6d234 |
-/* Copyright 2001 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>.
|
|
|
c6d234 |
- Based on ../i386/sysdep.h.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Library General Public License as
|
|
|
c6d234 |
- published by the Free Software Foundation; either version 2 of the
|
|
|
c6d234 |
- License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Library General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Library General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <sysdeps/generic/sysdep.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifdef __ASSEMBLER__
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Syntactic details of assembler. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifdef HAVE_ELF
|
|
|
c6d234 |
-/* For ELF we need the `.type' directive to make shared libs work right. */
|
|
|
c6d234 |
-#define ASM_TYPE_DIRECTIVE(name,typearg) .type name,typearg;
|
|
|
c6d234 |
-#define ASM_SIZE_DIRECTIVE(name) .size name,.-name;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* In ELF C symbols are asm symbols. */
|
|
|
c6d234 |
-#undef NO_UNDERSCORES
|
|
|
c6d234 |
-#define NO_UNDERSCORES
|
|
|
c6d234 |
-#else
|
|
|
c6d234 |
-#define ASM_TYPE_DIRECTIVE(name,type) /* Nothing is specified. */
|
|
|
c6d234 |
-#define ASM_SIZE_DIRECTIVE(name) /* Nothing is specified. */
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Define an entry point visible from C. */
|
|
|
c6d234 |
-#define ENTRY(name) \
|
|
|
c6d234 |
- ASM_GLOBAL_DIRECTIVE C_SYMBOL_NAME(name); \
|
|
|
c6d234 |
- ASM_TYPE_DIRECTIVE (C_SYMBOL_NAME(name),@function) \
|
|
|
c6d234 |
- C_LABEL(name) \
|
|
|
c6d234 |
- CALL_MCOUNT
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#undef END
|
|
|
c6d234 |
-#define END(name) \
|
|
|
c6d234 |
- ASM_SIZE_DIRECTIVE(name) \
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* If compiled for profiling, call `mcount' at the start of each function. */
|
|
|
c6d234 |
-#ifdef PROF
|
|
|
c6d234 |
-/* The mcount code relies on a normal frame pointer being on the stack
|
|
|
c6d234 |
- to locate our caller, so push one just for its benefit. */
|
|
|
c6d234 |
-#define CALL_MCOUNT \
|
|
|
c6d234 |
- movm [a3],(sp); mov sp,a3; add -12,sp; \
|
|
|
c6d234 |
- call JUMPTARGET(mcount),[],0; add 12,sp; movm (sp),[a3];
|
|
|
c6d234 |
-#else
|
|
|
c6d234 |
-#define CALL_MCOUNT /* Do nothing. */
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifdef NO_UNDERSCORES
|
|
|
c6d234 |
-/* Since C identifiers are not normally prefixed with an underscore
|
|
|
c6d234 |
- on this system, the asm identifier `syscall_error' intrudes on the
|
|
|
c6d234 |
- C name space. Make sure we use an innocuous name. */
|
|
|
c6d234 |
-#define syscall_error __syscall_error
|
|
|
c6d234 |
-#define mcount _mcount
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#undef JUMPTARGET
|
|
|
c6d234 |
-#ifdef PIC
|
|
|
c6d234 |
-#define JUMPTARGET(name) name##@PLT
|
|
|
c6d234 |
-#else
|
|
|
c6d234 |
-#define JUMPTARGET(name) name
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Local label name for asm code. */
|
|
|
c6d234 |
-#ifndef L
|
|
|
c6d234 |
-#define L(name) name
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#endif /* __ASSEMBLER__ */
|
|
|
c6d234 |
diff --git a/ports/sysdeps/am33/tininess.h b/ports/sysdeps/am33/tininess.h
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 1db37790f881a73f..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/am33/tininess.h
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#define TININESS_AFTER_ROUNDING 1
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/am33/sysdep.S b/ports/sysdeps/unix/am33/sysdep.S
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 26740c2404d6f00d..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/am33/sysdep.S
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,63 +0,0 @@
|
|
|
c6d234 |
-/* Copyright (C) 1991, 1992, 1993, 1994, 1995, 1996, 1997, 2000, 2001
|
|
|
c6d234 |
- Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>.
|
|
|
c6d234 |
- Based on ../i386/sysdep.S.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Library General Public License as
|
|
|
c6d234 |
- published by the Free Software Foundation; either version 2 of the
|
|
|
c6d234 |
- License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Library General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Library General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <sysdep.h>
|
|
|
c6d234 |
-#define _ERRNO_H
|
|
|
c6d234 |
-#include <bits/errno.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-.globl C_SYMBOL_NAME(errno)
|
|
|
c6d234 |
-.globl syscall_error
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#undef syscall_error
|
|
|
c6d234 |
-#ifdef NO_UNDERSCORES
|
|
|
c6d234 |
-__syscall_error:
|
|
|
c6d234 |
-#else
|
|
|
c6d234 |
-syscall_error:
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-#if defined (EWOULDBLOCK_sys) && EWOULDBLOCK_sys != EAGAIN
|
|
|
c6d234 |
- /* We translate the system's EWOULDBLOCK error into EAGAIN.
|
|
|
c6d234 |
- The GNU C library always defines EWOULDBLOCK==EAGAIN.
|
|
|
c6d234 |
- EWOULDBLOCK_sys is the original number. */
|
|
|
c6d234 |
- cmp EWOULDBLOCK_sys,d0 /* Is it the old EWOULDBLOCK? */
|
|
|
c6d234 |
- bne .Lnotb /* Branch if not. */
|
|
|
c6d234 |
- mov EAGAIN,d0 /* Yes; translate it to EAGAIN. */
|
|
|
c6d234 |
-.Lnotb:
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-#ifndef PIC
|
|
|
c6d234 |
-# ifndef _LIBC_REENTRANT
|
|
|
c6d234 |
- mov d0,(C_SYMBOL_NAME (errno))
|
|
|
c6d234 |
-# else
|
|
|
c6d234 |
- movm [d2],(sp)
|
|
|
c6d234 |
- add -12,sp
|
|
|
c6d234 |
- mov d0,d2
|
|
|
c6d234 |
- call __errno_location,[],0
|
|
|
c6d234 |
- mov d2,(a0)
|
|
|
c6d234 |
- add 12,sp
|
|
|
c6d234 |
- movm (sp),[d2]
|
|
|
c6d234 |
-# endif
|
|
|
c6d234 |
-#else
|
|
|
c6d234 |
-# error "This shouldn't be assembled for PIC"
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
- mov -1,d0
|
|
|
c6d234 |
- mov d0,a0
|
|
|
c6d234 |
- ret
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#undef __syscall_error
|
|
|
c6d234 |
-END (__syscall_error)
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/am33/sysdep.h b/ports/sysdeps/unix/am33/sysdep.h
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index dff1baebf4667ed6..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/am33/sysdep.h
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,32 +0,0 @@
|
|
|
c6d234 |
-/* Copyright 2001 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>.
|
|
|
c6d234 |
- Based on ../i386/sysdep.h.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Library General Public License as
|
|
|
c6d234 |
- published by the Free Software Foundation; either version 2 of the
|
|
|
c6d234 |
- License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Library General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Library General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <sysdeps/unix/sysdep.h>
|
|
|
c6d234 |
-#include "../../am33/sysdep.h"
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifdef __ASSEMBLER__
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define r0 d0 /* Normal return-value register. */
|
|
|
c6d234 |
-#define r1 !!!! /* Secondary return-value register. */
|
|
|
c6d234 |
-#define scratch d1 /* Call-clobbered register for random use. */
|
|
|
c6d234 |
-#define MOVE(x,y) mov x, y
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define ret ret [],0
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#endif /* __ASSEMBLER__ */
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/Makefile b/ports/sysdeps/unix/sysv/linux/am33/Makefile
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index ece39e8a4cee3f3e..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/Makefile
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,3 +0,0 @@
|
|
|
c6d234 |
-ifeq ($(subdir),misc)
|
|
|
c6d234 |
-sysdep_routines += setfsgid setfsuid
|
|
|
c6d234 |
-endif
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/bits/fcntl.h b/ports/sysdeps/unix/sysv/linux/am33/bits/fcntl.h
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 33b8bcd37e149f3c..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/bits/fcntl.h
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,180 +0,0 @@
|
|
|
c6d234 |
-/* O_*, F_*, FD_* bit values for Linux.
|
|
|
c6d234 |
- Copyright (C) 1995, 1996, 1997, 1998, 2000, Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Library General Public License as
|
|
|
c6d234 |
- published by the Free Software Foundation; either version 2 of the
|
|
|
c6d234 |
- License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Library General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Library General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifndef _FCNTL_H
|
|
|
c6d234 |
-# error "Never use <bits/fcntl.h> directly; include <fcntl.h> instead."
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <sys/types.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
|
|
|
c6d234 |
- located on an ext2 file system */
|
|
|
c6d234 |
-#define O_ACCMODE 0003
|
|
|
c6d234 |
-#define O_RDONLY 00
|
|
|
c6d234 |
-#define O_WRONLY 01
|
|
|
c6d234 |
-#define O_RDWR 02
|
|
|
c6d234 |
-#define O_CREAT 0100 /* not fcntl */
|
|
|
c6d234 |
-#define O_EXCL 0200 /* not fcntl */
|
|
|
c6d234 |
-#define O_NOCTTY 0400 /* not fcntl */
|
|
|
c6d234 |
-#define O_TRUNC 01000 /* not fcntl */
|
|
|
c6d234 |
-#define O_APPEND 02000
|
|
|
c6d234 |
-#define O_NONBLOCK 04000
|
|
|
c6d234 |
-#define O_NDELAY O_NONBLOCK
|
|
|
c6d234 |
-#define O_SYNC 010000
|
|
|
c6d234 |
-#define O_FSYNC O_SYNC
|
|
|
c6d234 |
-#define O_ASYNC 020000
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifdef __USE_GNU
|
|
|
c6d234 |
-# define O_DIRECT 040000 /* Direct disk access. */
|
|
|
c6d234 |
-# define O_DIRECTORY 0200000 /* Must be a directory. */
|
|
|
c6d234 |
-# define O_NOFOLLOW 0400000 /* Do not follow links. */
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* For now Linux has synchronisity options for data and read operations.
|
|
|
c6d234 |
- We define the symbols here but let them do the same as O_SYNC since
|
|
|
c6d234 |
- this is a superset. */
|
|
|
c6d234 |
-#if defined __USE_POSIX199309 || defined __USE_UNIX98
|
|
|
c6d234 |
-# define O_DSYNC O_SYNC /* Synchronize data. */
|
|
|
c6d234 |
-# define O_RSYNC O_SYNC /* Synchronize read operations. */
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifdef __USE_LARGEFILE64
|
|
|
c6d234 |
-# define O_LARGEFILE 0100000
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Values for the second argument to `fcntl'. */
|
|
|
c6d234 |
-#define F_DUPFD 0 /* Duplicate file descriptor. */
|
|
|
c6d234 |
-#define F_GETFD 1 /* Get file descriptor flags. */
|
|
|
c6d234 |
-#define F_SETFD 2 /* Set file descriptor flags. */
|
|
|
c6d234 |
-#define F_GETFL 3 /* Get file status flags. */
|
|
|
c6d234 |
-#define F_SETFL 4 /* Set file status flags. */
|
|
|
c6d234 |
-#ifndef __USE_FILE_OFFSET64
|
|
|
c6d234 |
-# define F_GETLK 5 /* Get record locking info. */
|
|
|
c6d234 |
-# define F_SETLK 6 /* Set record locking info (non-blocking). */
|
|
|
c6d234 |
-# define F_SETLKW 7 /* Set record locking info (blocking). */
|
|
|
c6d234 |
-#else
|
|
|
c6d234 |
-# define F_GETLK F_GETLK64 /* Get record locking info. */
|
|
|
c6d234 |
-# define F_SETLK F_SETLK64 /* Set record locking info (non-blocking).*/
|
|
|
c6d234 |
-# define F_SETLKW F_SETLKW64 /* Set record locking info (blocking). */
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-#define F_GETLK64 12 /* Get record locking info. */
|
|
|
c6d234 |
-#define F_SETLK64 13 /* Set record locking info (non-blocking). */
|
|
|
c6d234 |
-#define F_SETLKW64 14 /* Set record locking info (blocking). */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#if defined __USE_BSD || defined __USE_XOPEN2K
|
|
|
c6d234 |
-# define F_SETOWN 8 /* Get owner of socket (receiver of SIGIO). */
|
|
|
c6d234 |
-# define F_GETOWN 9 /* Set owner of socket (receiver of SIGIO). */
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifdef __USE_GNU
|
|
|
c6d234 |
-# define F_SETSIG 10 /* Set number of signal to be sent. */
|
|
|
c6d234 |
-# define F_GETSIG 11 /* Get number of signal to be sent. */
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifdef __USE_GNU
|
|
|
c6d234 |
-# define F_SETLEASE 1024 /* Set a lease. */
|
|
|
c6d234 |
-# define F_GETLEASE 1025 /* Enquire what lease is active. */
|
|
|
c6d234 |
-# define F_NOTIFY 1026 /* Request notfications on a directory. */
|
|
|
c6d234 |
-# define F_DUPFD_CLOEXEC 1030 /* Duplicate file descriptor with
|
|
|
c6d234 |
- close-on-exit set. */
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* For F_[GET|SET]FD. */
|
|
|
c6d234 |
-#define FD_CLOEXEC 1 /* actually anything with low bit set goes */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* For posix fcntl() and `l_type' field of a `struct flock' for lockf(). */
|
|
|
c6d234 |
-#define F_RDLCK 0 /* Read lock. */
|
|
|
c6d234 |
-#define F_WRLCK 1 /* Write lock. */
|
|
|
c6d234 |
-#define F_UNLCK 2 /* Remove lock. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* For old implementation of bsd flock(). */
|
|
|
c6d234 |
-#define F_EXLCK 4 /* or 3 */
|
|
|
c6d234 |
-#define F_SHLCK 8 /* or 4 */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifdef __USE_BSD
|
|
|
c6d234 |
-/* Operations for bsd flock(), also used by the kernel implementation. */
|
|
|
c6d234 |
-# define LOCK_SH 1 /* shared lock */
|
|
|
c6d234 |
-# define LOCK_EX 2 /* exclusive lock */
|
|
|
c6d234 |
-# define LOCK_NB 4 /* or'd with one of the above to prevent
|
|
|
c6d234 |
- blocking */
|
|
|
c6d234 |
-# define LOCK_UN 8 /* remove lock */
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifdef __USE_GNU
|
|
|
c6d234 |
-# define LOCK_MAND 32 /* This is a mandatory flock: */
|
|
|
c6d234 |
-# define LOCK_READ 64 /* ... which allows concurrent read operations. */
|
|
|
c6d234 |
-# define LOCK_WRITE 128 /* ... which allows concurrent write operations. */
|
|
|
c6d234 |
-# define LOCK_RW 192 /* ... Which allows concurrent read & write operations. */
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifdef __USE_GNU
|
|
|
c6d234 |
-/* Types of directory notifications that may be requested with F_NOTIFY. */
|
|
|
c6d234 |
-# define DN_ACCESS 0x00000001 /* File accessed. */
|
|
|
c6d234 |
-# define DN_MODIFY 0x00000002 /* File modified. */
|
|
|
c6d234 |
-# define DN_CREATE 0x00000004 /* File created. */
|
|
|
c6d234 |
-# define DN_DELETE 0x00000008 /* File removed. */
|
|
|
c6d234 |
-# define DN_RENAME 0x00000010 /* File renamed. */
|
|
|
c6d234 |
-# define DN_ATTRIB 0x00000020 /* File changed attibutes. */
|
|
|
c6d234 |
-# define DN_MULTISHOT 0x80000000 /* Don't remove notifier. */
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-struct flock
|
|
|
c6d234 |
- {
|
|
|
c6d234 |
- short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
|
|
|
c6d234 |
- short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
|
|
|
c6d234 |
-#ifndef __USE_FILE_OFFSET64
|
|
|
c6d234 |
- __off_t l_start; /* Offset where the lock begins. */
|
|
|
c6d234 |
- __off_t l_len; /* Size of the locked area; zero means until EOF. */
|
|
|
c6d234 |
-#else
|
|
|
c6d234 |
- __off64_t l_start; /* Offset where the lock begins. */
|
|
|
c6d234 |
- __off64_t l_len; /* Size of the locked area; zero means until EOF. */
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
- __pid_t l_pid; /* Process holding the lock. */
|
|
|
c6d234 |
- };
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifdef __USE_LARGEFILE64
|
|
|
c6d234 |
-struct flock64
|
|
|
c6d234 |
- {
|
|
|
c6d234 |
- short int l_type; /* Type of lock: F_RDLCK, F_WRLCK, or F_UNLCK. */
|
|
|
c6d234 |
- short int l_whence; /* Where `l_start' is relative to (like `lseek'). */
|
|
|
c6d234 |
- __off64_t l_start; /* Offset where the lock begins. */
|
|
|
c6d234 |
- __off64_t l_len; /* Size of the locked area; zero means until EOF. */
|
|
|
c6d234 |
- __pid_t l_pid; /* Process holding the lock. */
|
|
|
c6d234 |
- };
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Define some more compatibility macros to be backward compatible with
|
|
|
c6d234 |
- BSD systems which did not managed to hide these kernel macros. */
|
|
|
c6d234 |
-#ifdef __USE_BSD
|
|
|
c6d234 |
-# define FAPPEND O_APPEND
|
|
|
c6d234 |
-# define FFSYNC O_FSYNC
|
|
|
c6d234 |
-# define FASYNC O_ASYNC
|
|
|
c6d234 |
-# define FNONBLOCK O_NONBLOCK
|
|
|
c6d234 |
-# define FNDELAY O_NDELAY
|
|
|
c6d234 |
-#endif /* Use BSD. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Advise to `posix_fadvise'. */
|
|
|
c6d234 |
-#ifdef __USE_XOPEN2K
|
|
|
c6d234 |
-# define POSIX_FADV_NORMAL 0 /* No further special treatment. */
|
|
|
c6d234 |
-# define POSIX_FADV_RANDOM 1 /* Expect random page references. */
|
|
|
c6d234 |
-# define POSIX_FADV_SEQUENTIAL 2 /* Expect sequential page references. */
|
|
|
c6d234 |
-# define POSIX_FADV_WILLNEED 3 /* Will need these pages. */
|
|
|
c6d234 |
-# define POSIX_FADV_DONTNEED 4 /* Don't need these pages. */
|
|
|
c6d234 |
-# define POSIX_FADV_NOREUSE 5 /* Data will be accessed once. */
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/bits/mman.h b/ports/sysdeps/unix/sysv/linux/am33/bits/mman.h
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 763b060e667097c6..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/bits/mman.h
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,96 +0,0 @@
|
|
|
c6d234 |
-/* Definitions for POSIX memory map interface. Linux/AM33 version.
|
|
|
c6d234 |
- Copyright (C) 1997, 2000, 2001, 2004 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Library General Public License as
|
|
|
c6d234 |
- published by the Free Software Foundation; either version 2 of the
|
|
|
c6d234 |
- License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Library General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Library General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifndef _SYS_MMAN_H
|
|
|
c6d234 |
-# error "Never use <bits/mman.h> directly; include <sys/mman.h> instead."
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* The following definitions basically come from the kernel headers.
|
|
|
c6d234 |
- But the kernel header is not namespace clean. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Protections are chosen from these bits, OR'd together. The
|
|
|
c6d234 |
- implementation does not necessarily support PROT_EXEC or PROT_WRITE
|
|
|
c6d234 |
- without PROT_READ. The only guarantees are that no writing will be
|
|
|
c6d234 |
- allowed without PROT_WRITE and no access will be allowed for PROT_NONE. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define PROT_READ 0x1 /* Page can be read. */
|
|
|
c6d234 |
-#define PROT_WRITE 0x2 /* Page can be written. */
|
|
|
c6d234 |
-#define PROT_EXEC 0x4 /* Page can be executed. */
|
|
|
c6d234 |
-#define PROT_NONE 0x0 /* Page can not be accessed. */
|
|
|
c6d234 |
-#define PROT_GROWSDOWN 0x01000000 /* Extend change to start of
|
|
|
c6d234 |
- growsdown vma (mprotect only). */
|
|
|
c6d234 |
-#define PROT_GROWSUP 0x02000000 /* Extend change to start of
|
|
|
c6d234 |
- growsup vma (mprotect only). */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Sharing types (must choose one and only one of these). */
|
|
|
c6d234 |
-#define MAP_SHARED 0x01 /* Share changes. */
|
|
|
c6d234 |
-#define MAP_PRIVATE 0x02 /* Changes are private. */
|
|
|
c6d234 |
-#ifdef __USE_MISC
|
|
|
c6d234 |
-# define MAP_TYPE 0x0f /* Mask for type of mapping. */
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Other flags. */
|
|
|
c6d234 |
-#define MAP_FIXED 0x10 /* Interpret addr exactly. */
|
|
|
c6d234 |
-#ifdef __USE_MISC
|
|
|
c6d234 |
-# define MAP_FILE 0
|
|
|
c6d234 |
-# define MAP_ANONYMOUS 0x20 /* Don't use a file. */
|
|
|
c6d234 |
-# define MAP_ANON MAP_ANONYMOUS
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* These are Linux-specific. */
|
|
|
c6d234 |
-#ifdef __USE_MISC
|
|
|
c6d234 |
-# define MAP_GROWSDOWN 0x0100 /* Stack-like segment. */
|
|
|
c6d234 |
-# define MAP_DENYWRITE 0x0800 /* ETXTBSY */
|
|
|
c6d234 |
-# define MAP_EXECUTABLE 0x1000 /* Mark it as an executable. */
|
|
|
c6d234 |
-# define MAP_LOCKED 0x2000 /* Lock the mapping. */
|
|
|
c6d234 |
-# define MAP_NORESERVE 0x4000 /* Don't check for reservations. */
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Flags to `msync'. */
|
|
|
c6d234 |
-#define MS_ASYNC 1 /* Sync memory asynchronously. */
|
|
|
c6d234 |
-#define MS_SYNC 4 /* Synchronous memory sync. */
|
|
|
c6d234 |
-#define MS_INVALIDATE 2 /* Invalidate the caches. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Flags for `mlockall'. */
|
|
|
c6d234 |
-#define MCL_CURRENT 1 /* Lock all currently mapped pages. */
|
|
|
c6d234 |
-#define MCL_FUTURE 2 /* Lock all additions to address
|
|
|
c6d234 |
- space. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Flags for `mremap'. */
|
|
|
c6d234 |
-#ifdef __USE_GNU
|
|
|
c6d234 |
-# define MREMAP_MAYMOVE 1
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Advice to `madvise'. */
|
|
|
c6d234 |
-#ifdef __USE_BSD
|
|
|
c6d234 |
-# define MADV_NORMAL 0 /* No further special treatment. */
|
|
|
c6d234 |
-# define MADV_RANDOM 1 /* Expect random page references. */
|
|
|
c6d234 |
-# define MADV_SEQUENTIAL 2 /* Expect sequential page references. */
|
|
|
c6d234 |
-# define MADV_WILLNEED 3 /* Will need these pages. */
|
|
|
c6d234 |
-# define MADV_DONTNEED 4 /* Don't need these pages. */
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* The POSIX people had to invent similar names for the same things. */
|
|
|
c6d234 |
-#ifdef __USE_XOPEN2K
|
|
|
c6d234 |
-# define POSIX_MADV_NORMAL 0 /* No further special treatment. */
|
|
|
c6d234 |
-# define POSIX_MADV_RANDOM 1 /* Expect random page references. */
|
|
|
c6d234 |
-# define POSIX_MADV_SEQUENTIAL 2 /* Expect sequential page references. */
|
|
|
c6d234 |
-# define POSIX_MADV_WILLNEED 3 /* Will need these pages. */
|
|
|
c6d234 |
-# define POSIX_MADV_DONTNEED 4 /* Don't need these pages. */
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/brk.c b/ports/sysdeps/unix/sysv/linux/am33/brk.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index dc7ec639b3a558c0..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/brk.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,45 +0,0 @@
|
|
|
c6d234 |
-/* brk system call for Linux/am33.
|
|
|
c6d234 |
- Copyright (C) 1995, 1996, 2000 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>.
|
|
|
c6d234 |
- Based on ../i386/brk.c.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Library General Public License as
|
|
|
c6d234 |
- published by the Free Software Foundation; either version 2 of the
|
|
|
c6d234 |
- License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Library General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Library General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <errno.h>
|
|
|
c6d234 |
-#include <unistd.h>
|
|
|
c6d234 |
-#include <sysdep.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* This must be initialized data because commons can't have aliases. */
|
|
|
c6d234 |
-void *__curbrk = 0;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-int
|
|
|
c6d234 |
-__brk (void *addr)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- void *newbrk;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- newbrk = INLINE_SYSCALL (brk, 1, addr);
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- __curbrk = newbrk;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- if (newbrk < addr)
|
|
|
c6d234 |
- {
|
|
|
c6d234 |
- __set_errno (ENOMEM);
|
|
|
c6d234 |
- return -1;
|
|
|
c6d234 |
- }
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- return 0;
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
-weak_alias (__brk, brk)
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/chown.c b/ports/sysdeps/unix/sysv/linux/am33/chown.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 819923eb4971ad16..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/chown.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/chown.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/clone.S b/ports/sysdeps/unix/sysv/linux/am33/clone.S
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index e014c4ace94b71b6..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/clone.S
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,80 +0,0 @@
|
|
|
c6d234 |
-/* Copyright 2001 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>.
|
|
|
c6d234 |
- Based on ../i386/clone.S.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Library General Public License as
|
|
|
c6d234 |
- published by the Free Software Foundation; either version 2 of the
|
|
|
c6d234 |
- License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Library General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Library General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* clone() is even more special than fork() as it mucks with stacks
|
|
|
c6d234 |
- and invokes a function in the right context after its all over. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <sysdep.h>
|
|
|
c6d234 |
-#define _ERRNO_H 1
|
|
|
c6d234 |
-#include <bits/errno.h>
|
|
|
c6d234 |
-#include <asm-syntax.h>
|
|
|
c6d234 |
-#include <bp-sym.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* int clone(int (*fn)(void *arg), void *child_stack, int flags, void *arg); */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- .text
|
|
|
c6d234 |
-ENTRY (BP_SYM (__clone))
|
|
|
c6d234 |
- /* Sanity check arguments. */
|
|
|
c6d234 |
- cmp 0,d0 /* no NULL function pointers */
|
|
|
c6d234 |
- beq L(error_inval)
|
|
|
c6d234 |
- cmp 0,d1 /* no NULL stack pointers */
|
|
|
c6d234 |
- beq L(error_inval)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Allocate room for a function call in the new stack, and
|
|
|
c6d234 |
- store fn and arg in it. They will be read back in
|
|
|
c6d234 |
- thread_start. */
|
|
|
c6d234 |
- mov d1,a0
|
|
|
c6d234 |
- sub 12,a0
|
|
|
c6d234 |
- mov d0,(a0)
|
|
|
c6d234 |
- mov (16,sp),d1
|
|
|
c6d234 |
- mov d1,(4,a0)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Do the system call */
|
|
|
c6d234 |
- mov a0,d1
|
|
|
c6d234 |
- mov (12,sp),a0
|
|
|
c6d234 |
- mov SYS_ify(clone),d0
|
|
|
c6d234 |
- syscall 0
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- cmp 0,d0
|
|
|
c6d234 |
- beq thread_start
|
|
|
c6d234 |
- blt L(to_SYSCALL_ERROR_LABEL)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-L(pseudo_end):
|
|
|
c6d234 |
- ret
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-L(error_inval):
|
|
|
c6d234 |
- mov -EINVAL,d0
|
|
|
c6d234 |
-L(to_SYSCALL_ERROR_LABEL):
|
|
|
c6d234 |
- jmp SYSCALL_ERROR_LABEL
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-thread_start:
|
|
|
c6d234 |
- mov 0,a3 /* terminate the stack frame */
|
|
|
c6d234 |
- mov (4,sp),d0
|
|
|
c6d234 |
- mov (sp),a0
|
|
|
c6d234 |
- calls (a0)
|
|
|
c6d234 |
-#ifdef PIC
|
|
|
c6d234 |
-L(here):
|
|
|
c6d234 |
- mov pc,a2
|
|
|
c6d234 |
- add _GLOBAL_OFFSET_TABLE_-(L(here) - .),a2
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
- call JUMPTARGET (_exit),[],0
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-PSEUDO_END (BP_SYM (__clone))
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-weak_alias (BP_SYM (__clone), BP_SYM (clone))
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/configure b/ports/sysdeps/unix/sysv/linux/am33/configure
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 870c6a79299f161e..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/configure
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,4 +0,0 @@
|
|
|
c6d234 |
-# This file is generated from configure.in by Autoconf. DO NOT EDIT!
|
|
|
c6d234 |
- # Local configure fragment for am33/sysdeps/unix/sysv/linux/am33
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-arch_minimum_kernel=2.6.25
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/configure.in b/ports/sysdeps/unix/sysv/linux/am33/configure.in
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 43e33f74ca823331..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/configure.in
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,4 +0,0 @@
|
|
|
c6d234 |
-GLIBC_PROVIDES dnl See aclocal.m4 in the top level source directory.
|
|
|
c6d234 |
-# Local configure fragment for am33/sysdeps/unix/sysv/linux/am33
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-arch_minimum_kernel=2.6.25
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/fchown.c b/ports/sysdeps/unix/sysv/linux/am33/fchown.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 3a69ecc9e7dec0d4..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/fchown.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/fchown.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/fcntl.c b/ports/sysdeps/unix/sysv/linux/am33/fcntl.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index ea951bc4f931fad3..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/fcntl.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/fcntl.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/fxstat.c b/ports/sysdeps/unix/sysv/linux/am33/fxstat.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 4f219f0b9dfa95de..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/fxstat.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/fxstat.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/getegid.c b/ports/sysdeps/unix/sysv/linux/am33/getegid.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 37b4b4a530503613..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/getegid.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/getegid.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/geteuid.c b/ports/sysdeps/unix/sysv/linux/am33/geteuid.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index ebcb555b5e321b50..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/geteuid.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/geteuid.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/getgid.c b/ports/sysdeps/unix/sysv/linux/am33/getgid.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 0a4d6061f08b9a02..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/getgid.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/getgid.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/getgroups.c b/ports/sysdeps/unix/sysv/linux/am33/getgroups.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 20a7166103ad24e4..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/getgroups.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/getgroups.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/getmsg.c b/ports/sysdeps/unix/sysv/linux/am33/getmsg.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 3a1fa0852504b0ce..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/getmsg.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/getmsg.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/getresgid.c b/ports/sysdeps/unix/sysv/linux/am33/getresgid.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index b703a414cc2a2b07..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/getresgid.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/getresgid.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/getresuid.c b/ports/sysdeps/unix/sysv/linux/am33/getresuid.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 0b14cefe34668cd6..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/getresuid.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/getresuid.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/getuid.c b/ports/sysdeps/unix/sysv/linux/am33/getuid.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index d682c79a49289efb..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/getuid.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/getuid.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/lchown.c b/ports/sysdeps/unix/sysv/linux/am33/lchown.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index c89de99ba235bf45..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/lchown.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/lchown.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/linuxthreads/sysdep-cancel.h b/ports/sysdeps/unix/sysv/linux/am33/linuxthreads/sysdep-cancel.h
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 101cab0b17170d07..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/linuxthreads/sysdep-cancel.h
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,158 +0,0 @@
|
|
|
c6d234 |
-/* Copyright (C) 2002, 2003, 2004 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Lesser General Public
|
|
|
c6d234 |
- License as published by the Free Software Foundation; either
|
|
|
c6d234 |
- version 2.1 of the License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Lesser General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Lesser General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <sysdep.h>
|
|
|
c6d234 |
-#include <tls.h>
|
|
|
c6d234 |
-#include <pt-machine.h>
|
|
|
c6d234 |
-#ifndef __ASSEMBLER__
|
|
|
c6d234 |
-# include <linuxthreads/internals.h>
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#if IS_IN (libc) || IS_IN (libpthread) || IS_IN (librt)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-# undef PSEUDO
|
|
|
c6d234 |
-# define PSEUDO(name, syscall_name, args) \
|
|
|
c6d234 |
- .text ; \
|
|
|
c6d234 |
- ENTRY (name) \
|
|
|
c6d234 |
- PUSHARGS_##args \
|
|
|
c6d234 |
- DOARGS_##args \
|
|
|
c6d234 |
- SINGLE_THREAD_P; \
|
|
|
c6d234 |
- bne L(pseudo_cancel); \
|
|
|
c6d234 |
- mov SYS_ify (syscall_name),d0; \
|
|
|
c6d234 |
- syscall 0 \
|
|
|
c6d234 |
- POPARGS_##args ; \
|
|
|
c6d234 |
- cmp -126,d0; \
|
|
|
c6d234 |
- bls L(pseudo_end); \
|
|
|
c6d234 |
- jmp SYSCALL_ERROR_LABEL; \
|
|
|
c6d234 |
- L(pseudo_cancel): \
|
|
|
c6d234 |
- add -(16+STACK_SPACE (args)),sp; \
|
|
|
c6d234 |
- SAVE_ARGS_##args \
|
|
|
c6d234 |
- CENABLE \
|
|
|
c6d234 |
- mov d0,r0; \
|
|
|
c6d234 |
- LOAD_ARGS_##args \
|
|
|
c6d234 |
- mov SYS_ify (syscall_name),d0; \
|
|
|
c6d234 |
- syscall 0; \
|
|
|
c6d234 |
- mov d0,(12,sp); \
|
|
|
c6d234 |
- mov r0,d0; \
|
|
|
c6d234 |
- CDISABLE \
|
|
|
c6d234 |
- mov (12,sp),d0; \
|
|
|
c6d234 |
- add +16+STACK_SPACE (args),sp \
|
|
|
c6d234 |
- POPARGS_##args ; \
|
|
|
c6d234 |
- cmp -126,d0; \
|
|
|
c6d234 |
- bls L(pseudo_end); \
|
|
|
c6d234 |
- jmp SYSCALL_ERROR_LABEL; \
|
|
|
c6d234 |
- L(pseudo_end): \
|
|
|
c6d234 |
- mov d0,a0
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Reserve up to 2 stack slots for a0 and d1, but fewer than that if
|
|
|
c6d234 |
- we don't have that many arguments. */
|
|
|
c6d234 |
-# define STACK_SPACE(n) (((((n) < 3) * (2 - (n))) + 2) * 4)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-# define SAVE_ARGS_0
|
|
|
c6d234 |
-# define SAVE_ARGS_1 mov a0,(20,sp) ;
|
|
|
c6d234 |
-# define SAVE_ARGS_2 SAVE_ARGS_1 mov d1,(24,sp) ;
|
|
|
c6d234 |
-# define SAVE_ARGS_3 SAVE_ARGS_2
|
|
|
c6d234 |
-# define SAVE_ARGS_4 SAVE_ARGS_3
|
|
|
c6d234 |
-# define SAVE_ARGS_5 SAVE_ARGS_4
|
|
|
c6d234 |
-# define SAVE_ARGS_6 SAVE_ARGS_5
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-# define LOAD_ARGS_0
|
|
|
c6d234 |
-# define LOAD_ARGS_1 mov (20,sp),a0 ;
|
|
|
c6d234 |
-# define LOAD_ARGS_2 LOAD_ARGS_1 mov (24,sp),d1 ;
|
|
|
c6d234 |
-# define LOAD_ARGS_3 LOAD_ARGS_2
|
|
|
c6d234 |
-# define LOAD_ARGS_4 LOAD_ARGS_3
|
|
|
c6d234 |
-# define LOAD_ARGS_5 LOAD_ARGS_4
|
|
|
c6d234 |
-# define LOAD_ARGS_6 LOAD_ARGS_5
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-# if IS_IN (libpthread)
|
|
|
c6d234 |
-# define CENABLE call __pthread_enable_asynccancel,[],0;
|
|
|
c6d234 |
-# define CDISABLE call __pthread_disable_asynccancel,[],0;
|
|
|
c6d234 |
-# elif IS_IN (librt)
|
|
|
c6d234 |
-# ifdef PIC
|
|
|
c6d234 |
-# define CENABLE movm [a2],(sp); \
|
|
|
c6d234 |
- 1: mov pc,a2; \
|
|
|
c6d234 |
- add _GLOBAL_OFFSET_TABLE_-(1b-.),a2; \
|
|
|
c6d234 |
- call +__librt_enable_asynccancel@PLT,[],0; \
|
|
|
c6d234 |
- movm (sp),[a2];
|
|
|
c6d234 |
-# define CENABLE movm [a2],(sp); \
|
|
|
c6d234 |
- 1: mov pc,a2; \
|
|
|
c6d234 |
- add _GLOBAL_OFFSET_TABLE_-(1b-.),a2; \
|
|
|
c6d234 |
- call +__librt_disable_asynccancel@PLT,[],0; \
|
|
|
c6d234 |
- movm (sp),[a2];
|
|
|
c6d234 |
-# else
|
|
|
c6d234 |
-# define CENABLE call +__librt_enable_asynccancel,[],0;
|
|
|
c6d234 |
-# define CDISABLE call +__librt_disable_asynccancel,[],0;
|
|
|
c6d234 |
-# endif
|
|
|
c6d234 |
-# else
|
|
|
c6d234 |
-# define CENABLE call +__libc_enable_asynccancel,[],0;
|
|
|
c6d234 |
-# define CDISABLE call +__libc_disable_asynccancel,[],0;
|
|
|
c6d234 |
-# endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#if IS_IN (libc)
|
|
|
c6d234 |
-# define __local_multiple_threads __libc_multiple_threads
|
|
|
c6d234 |
-#elif IS_IN (libpthread)
|
|
|
c6d234 |
-# define __local_multiple_threads __pthread_multiple_threads
|
|
|
c6d234 |
-#else
|
|
|
c6d234 |
-# define __local_multiple_threads __librt_multiple_threads
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-# ifndef __ASSEMBLER__
|
|
|
c6d234 |
-# if defined FLOATING_STACKS && USE___THREAD && defined PIC
|
|
|
c6d234 |
-# define SINGLE_THREAD_P \
|
|
|
c6d234 |
- __builtin_expect (THREAD_GETMEM (THREAD_SELF, \
|
|
|
c6d234 |
- p_header.data.multiple_threads) == 0, 1)
|
|
|
c6d234 |
-# else
|
|
|
c6d234 |
-extern int __local_multiple_threads
|
|
|
c6d234 |
-# if IS_IN (libc) || IS_IN (libpthread)
|
|
|
c6d234 |
- attribute_hidden;
|
|
|
c6d234 |
-# else
|
|
|
c6d234 |
- ;
|
|
|
c6d234 |
-# endif
|
|
|
c6d234 |
-# define SINGLE_THREAD_P __builtin_expect (__local_multiple_threads == 0, 1)
|
|
|
c6d234 |
-# endif
|
|
|
c6d234 |
-# else
|
|
|
c6d234 |
-# if !defined PIC
|
|
|
c6d234 |
-# define SINGLE_THREAD_P \
|
|
|
c6d234 |
- mov (+__local_multiple_threads),d0; \
|
|
|
c6d234 |
- cmp 0,d0
|
|
|
c6d234 |
-# elif IS_IN (libc) || IS_IN (libpthread)
|
|
|
c6d234 |
-# define SINGLE_THREAD_P \
|
|
|
c6d234 |
- movm [a2],(sp); \
|
|
|
c6d234 |
- 1: mov pc,a2; \
|
|
|
c6d234 |
- add _GLOBAL_OFFSET_TABLE_-(1b-.),a2; \
|
|
|
c6d234 |
- mov (+__local_multiple_threads@GOTOFF,a2),d0; \
|
|
|
c6d234 |
- movm (sp),[a2]; \
|
|
|
c6d234 |
- cmp 0,d0
|
|
|
c6d234 |
-# else
|
|
|
c6d234 |
-# define SINGLE_THREAD_P \
|
|
|
c6d234 |
- movm [a2],(sp); \
|
|
|
c6d234 |
- 1: mov pc,a2; \
|
|
|
c6d234 |
- add _GLOBAL_OFFSET_TABLE_-(1b-.),a2; \
|
|
|
c6d234 |
- mov (+__local_multiple_threads@GOT,a2),a2; \
|
|
|
c6d234 |
- mov (a2),d0; \
|
|
|
c6d234 |
- movm (sp),[a2]; \
|
|
|
c6d234 |
- cmp 0,d0
|
|
|
c6d234 |
-# endif
|
|
|
c6d234 |
-# endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#elif !defined __ASSEMBLER__
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* This code should never be used but we define it anyhow. */
|
|
|
c6d234 |
-# define SINGLE_THREAD_P (1)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/lockf64.c b/ports/sysdeps/unix/sysv/linux/am33/lockf64.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index a88f5a784a544f0a..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/lockf64.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/lockf64.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/lxstat.c b/ports/sysdeps/unix/sysv/linux/am33/lxstat.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 0efa0aea491950a6..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/lxstat.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/lxstat.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/profil-counter.h b/ports/sysdeps/unix/sysv/linux/am33/profil-counter.h
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index f4b7eaae76da4cf5..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/profil-counter.h
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,26 +0,0 @@
|
|
|
c6d234 |
-/* Low-level statistical profiling support function. Linux/am33 version.
|
|
|
c6d234 |
- Copyright (C) 1996, 1997, 1998, 2001 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Library General Public License as
|
|
|
c6d234 |
- published by the Free Software Foundation; either version 2 of the
|
|
|
c6d234 |
- License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Library General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Library General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <signal.h>
|
|
|
c6d234 |
-#include <sigcontextinfo.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-static void
|
|
|
c6d234 |
-profil_counter (int signo, SIGCONTEXT scp)
|
|
|
c6d234 |
-{
|
|
|
c6d234 |
- profil_count ((void *) GET_PC (scp));
|
|
|
c6d234 |
-}
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/putmsg.c b/ports/sysdeps/unix/sysv/linux/am33/putmsg.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index ebc1680ca7d1f2b5..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/putmsg.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/putmsg.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/setegid.c b/ports/sysdeps/unix/sysv/linux/am33/setegid.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 2e3a54c893448c3d..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/setegid.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/setegid.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/seteuid.c b/ports/sysdeps/unix/sysv/linux/am33/seteuid.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 18e41d08c1b7821f..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/seteuid.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/seteuid.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/setfsgid.c b/ports/sysdeps/unix/sysv/linux/am33/setfsgid.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 0886712569e3e055..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/setfsgid.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/setfsgid.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/setfsuid.c b/ports/sysdeps/unix/sysv/linux/am33/setfsuid.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index a9f22eb8ab823deb..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/setfsuid.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/setfsuid.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/setgid.c b/ports/sysdeps/unix/sysv/linux/am33/setgid.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 377021d9ec8f9cea..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/setgid.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/setgid.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/setgroups.c b/ports/sysdeps/unix/sysv/linux/am33/setgroups.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index cb9a7708e38ebc68..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/setgroups.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/setgroups.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/setregid.c b/ports/sysdeps/unix/sysv/linux/am33/setregid.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 99c57ad20f1ddb0c..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/setregid.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/setregid.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/setresgid.c b/ports/sysdeps/unix/sysv/linux/am33/setresgid.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index daca1a48332e49d6..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/setresgid.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/setresgid.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/setresuid.c b/ports/sysdeps/unix/sysv/linux/am33/setresuid.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 3aeabe9ad708c454..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/setresuid.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/setresuid.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/setreuid.c b/ports/sysdeps/unix/sysv/linux/am33/setreuid.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 8ad61226e979db47..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/setreuid.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/setreuid.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/setrlimit.c b/ports/sysdeps/unix/sysv/linux/am33/setrlimit.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index bfaef74c387f91c0..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/setrlimit.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/setrlimit.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/setuid.c b/ports/sysdeps/unix/sysv/linux/am33/setuid.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index de394379be6f9f90..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/setuid.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/setuid.c>
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/socket.S b/ports/sysdeps/unix/sysv/linux/am33/socket.S
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index b4d3caab8a6506d8..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/socket.S
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,72 +0,0 @@
|
|
|
c6d234 |
-/* Copyright 2001 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>.
|
|
|
c6d234 |
- Based on ../i386/socket.S.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Library General Public License as
|
|
|
c6d234 |
- published by the Free Software Foundation; either version 2 of the
|
|
|
c6d234 |
- License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Library General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Library General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <sysdep.h>
|
|
|
c6d234 |
-#include <socketcall.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define P(a, b) P2(a, b)
|
|
|
c6d234 |
-#define P2(a, b) a##b
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- .text
|
|
|
c6d234 |
-/* The socket-oriented system calls are handled unusally in Linux.
|
|
|
c6d234 |
- They are all gated through the single `socketcall' system call number.
|
|
|
c6d234 |
- `socketcall' takes two arguments: the first is the subcode, specifying
|
|
|
c6d234 |
- which socket function is being called; and the second is a pointer to
|
|
|
c6d234 |
- the arguments to the specific function.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The .S files for the other calls just #define socket and #include this. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifndef __socket
|
|
|
c6d234 |
-#ifndef NO_WEAK_ALIAS
|
|
|
c6d234 |
-#define __socket P(__,socket)
|
|
|
c6d234 |
-#else
|
|
|
c6d234 |
-#define __socket socket
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-.globl __socket
|
|
|
c6d234 |
-ENTRY (__socket)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- mov d0,(4,sp)
|
|
|
c6d234 |
- mov d1,(8,sp)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- mov SYS_ify(socketcall),d0 /* System call number in d0. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Use ## so `socket' is a separate token that might be #define'd. */
|
|
|
c6d234 |
- mov P(SOCKOP_,socket),a0 /* Subcode is first arg to syscall. */
|
|
|
c6d234 |
- mov sp,d1
|
|
|
c6d234 |
- add 4,d1 /* Address of args is 2nd arg. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Do the system call trap. */
|
|
|
c6d234 |
- syscall 0
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* d0 is < 0 if there was an error. */
|
|
|
c6d234 |
- cmp -126,d0
|
|
|
c6d234 |
- bls L(pseudo_end)
|
|
|
c6d234 |
- jmp SYSCALL_ERROR_LABEL
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- /* Successful; return the syscall's value. */
|
|
|
c6d234 |
-L(pseudo_end):
|
|
|
c6d234 |
- ret
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-PSEUDO_END (__socket)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifndef NO_WEAK_ALIAS
|
|
|
c6d234 |
-weak_alias (__socket, socket)
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/syscall.S b/ports/sysdeps/unix/sysv/linux/am33/syscall.S
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 63fa6ddcd4f670ae..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/syscall.S
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,42 +0,0 @@
|
|
|
c6d234 |
-/* Copyright (C) 1995, 1996, 1998, 2001 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>.
|
|
|
c6d234 |
- Based on ../i386/syscall.S.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Library General Public License as
|
|
|
c6d234 |
- published by the Free Software Foundation; either version 2 of the
|
|
|
c6d234 |
- License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Library General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Library General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <sysdep.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Please consult the file sysdeps/unix/sysv/linux/am33/sysdep.h for
|
|
|
c6d234 |
- more information about the value -126 used below.*/
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- .text
|
|
|
c6d234 |
-ENTRY (syscall)
|
|
|
c6d234 |
- movm [d2,d3,a2,a3],(sp) /* Save register contents. */
|
|
|
c6d234 |
- mov d1,a0
|
|
|
c6d234 |
- mov (28,sp),d1
|
|
|
c6d234 |
- mov (32,sp),a3
|
|
|
c6d234 |
- mov (36,sp),a2
|
|
|
c6d234 |
- mov (40,sp),d3
|
|
|
c6d234 |
- mov (44,sp),d2
|
|
|
c6d234 |
- syscall 0 /* Do the system call. */
|
|
|
c6d234 |
- movm (sp),[d2,d3,a2,a3] /* Restore register contents. */
|
|
|
c6d234 |
- cmp -126,d0 /* Check for error. */
|
|
|
c6d234 |
- bls L(pseudo_end)
|
|
|
c6d234 |
- jmp SYSCALL_ERROR_LABEL /* Jump to error handler if error. */
|
|
|
c6d234 |
-L(pseudo_end):
|
|
|
c6d234 |
- ret /* Return to caller. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-PSEUDO_END (syscall)
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/sysdep.S b/ports/sysdeps/unix/sysv/linux/am33/sysdep.S
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 877fd1e0823af3dd..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/sysdep.S
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,41 +0,0 @@
|
|
|
c6d234 |
-/* Copyright (C) 1995, 1996, 1997, 1998, 2001, 2004
|
|
|
c6d234 |
- Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>.
|
|
|
c6d234 |
- Based on ../i386/sysdep.S.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Library General Public License as
|
|
|
c6d234 |
- published by the Free Software Foundation; either version 2 of the
|
|
|
c6d234 |
- License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Library General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Library General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#include <sysdep.h>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* The following code is only used in the shared library when we
|
|
|
c6d234 |
- compile the reentrant version. Otherwise each system call defines
|
|
|
c6d234 |
- each own version. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifndef PIC
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#undef CALL_MCOUNT
|
|
|
c6d234 |
-#define CALL_MCOUNT /* Don't insert the profiling call, it clobbers %eax. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- .text
|
|
|
c6d234 |
-ENTRY (__syscall_error)
|
|
|
c6d234 |
- mov d0,d1
|
|
|
c6d234 |
- clr d0
|
|
|
c6d234 |
- sub d1,d0
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define __syscall_error __syscall_error_1
|
|
|
c6d234 |
-#include <../../../am33/sysdep.S>
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#endif /* !PIC */
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/sysdep.h b/ports/sysdeps/unix/sysv/linux/am33/sysdep.h
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index 68f93f8003e2dc07..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/sysdep.h
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1,316 +0,0 @@
|
|
|
c6d234 |
-/* Copyright 2001, 2004 Free Software Foundation, Inc.
|
|
|
c6d234 |
- This file is part of the GNU C Library.
|
|
|
c6d234 |
- Contributed by Alexandre Oliva <aoliva@redhat.com>.
|
|
|
c6d234 |
- Based on ../i386/sysdep.h.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is free software; you can redistribute it and/or
|
|
|
c6d234 |
- modify it under the terms of the GNU Library General Public License as
|
|
|
c6d234 |
- published by the Free Software Foundation; either version 2 of the
|
|
|
c6d234 |
- License, or (at your option) any later version.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The GNU C Library is distributed in the hope that it will be useful,
|
|
|
c6d234 |
- but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
c6d234 |
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
c6d234 |
- Library General Public License for more details.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- You should have received a copy of the GNU Library General Public
|
|
|
c6d234 |
- License along with the GNU C Library. If not, see
|
|
|
c6d234 |
- <http://www.gnu.org/licenses/>. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifndef _LINUX_AM33_SYSDEP_H
|
|
|
c6d234 |
-#define _LINUX_AM33_SYSDEP_H 1
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* There is some commonality. */
|
|
|
c6d234 |
-#include "../../../am33/sysdep.h"
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* For Linux we can use the system call table in the header file
|
|
|
c6d234 |
- /usr/include/asm/unistd.h
|
|
|
c6d234 |
- of the kernel. But these symbols do not follow the SYS_* syntax
|
|
|
c6d234 |
- so we have to redefine the `SYS_ify' macro here. */
|
|
|
c6d234 |
-#undef SYS_ify
|
|
|
c6d234 |
-#define SYS_ify(syscall_name) __NR_##syscall_name
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* ELF-like local names start with `.L'. */
|
|
|
c6d234 |
-#undef L
|
|
|
c6d234 |
-#define L(name) .L##name
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifdef __ASSEMBLER__
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Linux uses a negative return value to indicate syscall errors,
|
|
|
c6d234 |
- unlike most Unices, which use the condition codes' carry flag.
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- Since version 2.1 the return value of a system call might be
|
|
|
c6d234 |
- negative even if the call succeeded. E.g., the `lseek' system call
|
|
|
c6d234 |
- might return a large offset. Therefore we must not anymore test
|
|
|
c6d234 |
- for < 0, but test for a real error by making sure the value in %eax
|
|
|
c6d234 |
- is a real error number. Linus said he will make sure the no syscall
|
|
|
c6d234 |
- returns a value in -1 .. -4095 as a valid result so we can savely
|
|
|
c6d234 |
- test with -4095. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* We don't want the label for the error handle to be global when we define
|
|
|
c6d234 |
- it here. */
|
|
|
c6d234 |
-#ifdef PIC
|
|
|
c6d234 |
-# define SYSCALL_ERROR_LABEL 0f
|
|
|
c6d234 |
-#else
|
|
|
c6d234 |
-# define SYSCALL_ERROR_LABEL syscall_error
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#undef PSEUDO
|
|
|
c6d234 |
-#define PSEUDO(name, syscall_name, args) \
|
|
|
c6d234 |
- .text; \
|
|
|
c6d234 |
- ENTRY (name) \
|
|
|
c6d234 |
- DO_CALL (syscall_name, args); \
|
|
|
c6d234 |
- cmp -126,d0; \
|
|
|
c6d234 |
- bls L(pseudo_end); \
|
|
|
c6d234 |
- jmp SYSCALL_ERROR_LABEL; \
|
|
|
c6d234 |
- L(pseudo_end): \
|
|
|
c6d234 |
- mov d0,a0;
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#undef PSEUDO_END
|
|
|
c6d234 |
-#define PSEUDO_END(name) \
|
|
|
c6d234 |
- SYSCALL_ERROR_HANDLER \
|
|
|
c6d234 |
- END (name)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#undef PSEUDO_NOERROR
|
|
|
c6d234 |
-#define PSEUDO_NOERRNO(name, syscall_name, args) \
|
|
|
c6d234 |
- .text; \
|
|
|
c6d234 |
- ENTRY (name) \
|
|
|
c6d234 |
- DO_CALL (syscall_name, args)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#undef PSEUDO_END_NOERRNO
|
|
|
c6d234 |
-#define PSEUDO_END_NOERRNO(name) \
|
|
|
c6d234 |
- END (name)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define ret_NOERRNO ret
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* The function has to return the error code. */
|
|
|
c6d234 |
-#undef PSEUDO_ERRVAL
|
|
|
c6d234 |
-#define PSEUDO_ERRVAL(name, syscall_name, args) \
|
|
|
c6d234 |
- .text; \
|
|
|
c6d234 |
- ENTRY (name) \
|
|
|
c6d234 |
- DO_CALL (syscall_name, args); \
|
|
|
c6d234 |
- clr d1; \
|
|
|
c6d234 |
- sub d0,d1,d0
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#undef PSEUDO_END_ERRVAL
|
|
|
c6d234 |
-#define PSEUDO_END_ERRVAL(name) \
|
|
|
c6d234 |
- END (name)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define ret_ERRVAL ret
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifndef PIC
|
|
|
c6d234 |
-#define SYSCALL_ERROR_HANDLER /* Nothing here; code in sysdep.S is used. */
|
|
|
c6d234 |
-#else
|
|
|
c6d234 |
-/* Store (- d0) into errno through the GOT. */
|
|
|
c6d234 |
-#ifdef _LIBC_REENTRANT
|
|
|
c6d234 |
-#define SYSCALL_ERROR_HANDLER \
|
|
|
c6d234 |
-0:movm [d2,a2],(sp); \
|
|
|
c6d234 |
- add -12,sp; \
|
|
|
c6d234 |
-1:mov pc,a2; \
|
|
|
c6d234 |
- add _GLOBAL_OFFSET_TABLE_-(1b-.),a2; \
|
|
|
c6d234 |
- clr d2; \
|
|
|
c6d234 |
- sub d0,d2; \
|
|
|
c6d234 |
- call __errno_location@PLT,[],0; \
|
|
|
c6d234 |
- mov d2,(a0); \
|
|
|
c6d234 |
- add 12,sp; \
|
|
|
c6d234 |
- movm (sp),[d2,a2]; \
|
|
|
c6d234 |
- mov -1,d0; \
|
|
|
c6d234 |
- mov d0,a0; \
|
|
|
c6d234 |
- jmp L(pseudo_end);
|
|
|
c6d234 |
-/* A quick note: it is assumed that the call to `__errno_location' does
|
|
|
c6d234 |
- not modify the stack! */
|
|
|
c6d234 |
-#else
|
|
|
c6d234 |
-#define SYSCALL_ERROR_HANDLER \
|
|
|
c6d234 |
-0:mov pc,a0; \
|
|
|
c6d234 |
- add _GLOBAL_OFFSET_TABLE_-(0b-.),a0; \
|
|
|
c6d234 |
- clr d1; \
|
|
|
c6d234 |
- sub d0,d1; \
|
|
|
c6d234 |
- mov (errno@GOT,a0),a1; \
|
|
|
c6d234 |
- mov d1,(a0); \
|
|
|
c6d234 |
- mov -1,d0; \
|
|
|
c6d234 |
- mov d0,a0; \
|
|
|
c6d234 |
- jmp L(pseudo_end);
|
|
|
c6d234 |
-#endif /* _LIBC_REENTRANT */
|
|
|
c6d234 |
-#endif /* PIC */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Linux takes system call arguments in registers:
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- syscall number d0 call-clobbered
|
|
|
c6d234 |
- arg 1 a0 call-clobbered
|
|
|
c6d234 |
- arg 2 d1 call-clobbered
|
|
|
c6d234 |
- arg 3 a3 call-saved
|
|
|
c6d234 |
- arg 4 a2 call-saved
|
|
|
c6d234 |
- arg 5 d3 call-saved
|
|
|
c6d234 |
- arg 6 d2 call-saved
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- The stack layout upon entering the function is:
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- (24,sp) Arg# 6
|
|
|
c6d234 |
- (20,sp) Arg# 5
|
|
|
c6d234 |
- (16,sp) Arg# 4
|
|
|
c6d234 |
- (12,sp) Arg# 3
|
|
|
c6d234 |
- d1 Arg# 2
|
|
|
c6d234 |
- d0 Arg# 1
|
|
|
c6d234 |
- (sp) Return address
|
|
|
c6d234 |
-
|
|
|
c6d234 |
- (Of course a function with say 3 arguments does not have entries for
|
|
|
c6d234 |
- arguments 4, 5 and 6.) */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#undef DO_CALL
|
|
|
c6d234 |
-#define DO_CALL(syscall_name, args) \
|
|
|
c6d234 |
- PUSHARGS_##args \
|
|
|
c6d234 |
- DOARGS_##args \
|
|
|
c6d234 |
- mov SYS_ify (syscall_name),d0; \
|
|
|
c6d234 |
- syscall 0 \
|
|
|
c6d234 |
- POPARGS_##args
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define PUSHARGS_0 /* No arguments to push. */
|
|
|
c6d234 |
-#define _DOARGS_0(N) /* No arguments to frob. */
|
|
|
c6d234 |
-#define DOARGS_0 /* No arguments to frob. */
|
|
|
c6d234 |
-#define POPARGS_0 /* No arguments to pop. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define PUSHARGS_1 /* No arguments to push. */
|
|
|
c6d234 |
-#define _DOARGS_1(N) _DOARGS_0 (N-4) mov d0,a0;
|
|
|
c6d234 |
-#define DOARGS_1 _DOARGS_1 (4)
|
|
|
c6d234 |
-#define POPARGS_1 /* No arguments to pop. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define PUSHARGS_2 /* No arguments to push. */
|
|
|
c6d234 |
-#define _DOARGS_2(N) _DOARGS_1 (N-4) /* Argument already in d1. */
|
|
|
c6d234 |
-#define DOARGS_2 _DOARGS_2 (8)
|
|
|
c6d234 |
-#define POPARGS_2 /* No arguments to pop. */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define PUSHARGS_3 movm [a3],(sp);
|
|
|
c6d234 |
-#define _DOARGS_3(N) _DOARGS_2 (N-4) mov (N,sp),a3;
|
|
|
c6d234 |
-#define DOARGS_3 _DOARGS_3 (16)
|
|
|
c6d234 |
-#define POPARGS_3 ; movm (sp),[a3]
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define PUSHARGS_4 movm [a2,a3],(sp);
|
|
|
c6d234 |
-#define _DOARGS_4(N) _DOARGS_3 (N-4) mov (N,sp),a2;
|
|
|
c6d234 |
-#define DOARGS_4 _DOARGS_4 (24)
|
|
|
c6d234 |
-#define POPARGS_4 ; movm (sp),[a2,a3]
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define PUSHARGS_5 movm [d3,a2,a3],(sp);
|
|
|
c6d234 |
-#define _DOARGS_5(N) _DOARGS_4 (N-4) mov (N,sp),d3;
|
|
|
c6d234 |
-#define DOARGS_5 _DOARGS_5 (32)
|
|
|
c6d234 |
-#define POPARGS_5 ; movm (sp),[d3,a2,a3]
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define PUSHARGS_6 movm [d2,d3,a2,a3],(sp);
|
|
|
c6d234 |
-#define _DOARGS_6(N) _DOARGS_5 (N-4) mov (N,sp),d2;
|
|
|
c6d234 |
-#define DOARGS_6 _DOARGS_6 (40)
|
|
|
c6d234 |
-#define POPARGS_6 ; movm (sp),[d2,d3,a2,a3]
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#else /* !__ASSEMBLER__ */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* Define a macro which expands inline into the wrapper code for a system
|
|
|
c6d234 |
- call. */
|
|
|
c6d234 |
-#undef INLINE_SYSCALL
|
|
|
c6d234 |
-#define INLINE_SYSCALL(name, nr, args...) \
|
|
|
c6d234 |
- ({ \
|
|
|
c6d234 |
- unsigned int resultvar = INTERNAL_SYSCALL (name, , nr, args); \
|
|
|
c6d234 |
- if (__builtin_expect (INTERNAL_SYSCALL_ERROR_P (resultvar, ), 0)) \
|
|
|
c6d234 |
- { \
|
|
|
c6d234 |
- __set_errno (INTERNAL_SYSCALL_ERRNO (resultvar, )); \
|
|
|
c6d234 |
- resultvar = 0xffffffff; \
|
|
|
c6d234 |
- } \
|
|
|
c6d234 |
- (int) resultvar; })
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define INTERNAL_SYSCALL(name, err, nr, args...) \
|
|
|
c6d234 |
-({ \
|
|
|
c6d234 |
- register long __sc0 asm ("d0") = __NR_##name; \
|
|
|
c6d234 |
- inline_syscall##nr(name, ## args); \
|
|
|
c6d234 |
- __sc0; \
|
|
|
c6d234 |
-})
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#undef INTERNAL_SYSCALL_DECL
|
|
|
c6d234 |
-#define INTERNAL_SYSCALL_DECL(err) do { } while (0)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#undef INTERNAL_SYSCALL_ERROR_P
|
|
|
c6d234 |
-#define INTERNAL_SYSCALL_ERROR_P(val, err) \
|
|
|
c6d234 |
- ((unsigned int) (val) >= (unsigned long)-125)
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#undef INTERNAL_SYSCALL_ERRNO
|
|
|
c6d234 |
-#define INTERNAL_SYSCALL_ERRNO(val, err) (-(val))
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define inline_syscall0(name,dummy...) \
|
|
|
c6d234 |
-__asm__ __volatile__ ("syscall 0" \
|
|
|
c6d234 |
- : "+d" (__sc0) \
|
|
|
c6d234 |
- : : "memory")
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define inline_syscall1(name,arg1) \
|
|
|
c6d234 |
-register long __sc1 asm ("a0") = (long) (arg1); \
|
|
|
c6d234 |
-inline_syscall0 (name); \
|
|
|
c6d234 |
-__asm__ __volatile__ ("" : : "r" (__sc1))
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define inline_syscall2(name,arg1,arg2) \
|
|
|
c6d234 |
-register long __sc2 asm ("d1") = (long) (arg2); \
|
|
|
c6d234 |
-inline_syscall1 (name,(arg1)); \
|
|
|
c6d234 |
-__asm__ __volatile__ ("" : : "r" (__sc2))
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-/* We can't tell whether a3 is going to be eliminated in the enclosing
|
|
|
c6d234 |
- function, so we have to assume it isn't. We first load the value
|
|
|
c6d234 |
- of any arguments into their registers, except for a3 itself, that
|
|
|
c6d234 |
- may be needed to load the value of the other arguments. Then, we
|
|
|
c6d234 |
- save a3's value in some other register, and load the argument value
|
|
|
c6d234 |
- into a3. We have to force both a3 and its copy to be live in
|
|
|
c6d234 |
- different registers at the same time, to avoid having the copy
|
|
|
c6d234 |
- spilled and the value reloaded into the same register, in which
|
|
|
c6d234 |
- case we'd be unable to get the value of a3 back, should the stack
|
|
|
c6d234 |
- slot reference be (offset,a3). */
|
|
|
c6d234 |
-#define inline_syscall3(name,arg1,arg2,arg3) \
|
|
|
c6d234 |
-long __sc3v = (long) (arg3); \
|
|
|
c6d234 |
-register long __sc1 asm ("a0") = (long) (arg1); \
|
|
|
c6d234 |
-register long __sc2 asm ("d1") = (long) (arg2); \
|
|
|
c6d234 |
-register long __sc3 asm ("a3") = __sc3; \
|
|
|
c6d234 |
-register long __sc3c; \
|
|
|
c6d234 |
-__asm__ __volatile__ ("mov %1,%0" : "=&r" (__sc3c) : "r" (__sc3)); \
|
|
|
c6d234 |
-__sc3 = __sc3v; \
|
|
|
c6d234 |
-__asm__ __volatile__ ("" : : "r" (__sc3c), "r" (__sc3)); \
|
|
|
c6d234 |
-inline_syscall0 (name); \
|
|
|
c6d234 |
-__sc3 = __sc3c; \
|
|
|
c6d234 |
-__asm__ __volatile__ ("" : : "r" (__sc3), "r" (__sc2), "r" (__sc1))
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#ifdef PIC
|
|
|
c6d234 |
-/* Since a2 is the PIC register, it requires similar handling as a3
|
|
|
c6d234 |
- when we're generating PIC, as a2's value may be needed to load
|
|
|
c6d234 |
- arguments whose values live in global variables. The difference is
|
|
|
c6d234 |
- that we don't need to require its value to be live in a register;
|
|
|
c6d234 |
- it may well be in a stack slot, as long as we save it before
|
|
|
c6d234 |
- clobbering a3 and restore it after restoring a3. */
|
|
|
c6d234 |
-#define inline_syscall4(name,arg1,arg2,arg3,arg4) \
|
|
|
c6d234 |
-long __sc4v = (long) (arg4); \
|
|
|
c6d234 |
-long __sc3v = (long) (arg3); \
|
|
|
c6d234 |
-register long __sc1 asm ("a0") = (long) (arg1); \
|
|
|
c6d234 |
-register long __sc2 asm ("d1") = (long) (arg2); \
|
|
|
c6d234 |
-register long __sc3 asm ("a3") = __sc3; \
|
|
|
c6d234 |
-register long __sc3c; \
|
|
|
c6d234 |
-register long __sc4 asm ("a2") = __sc4; \
|
|
|
c6d234 |
-long __sc4c = __sc4; \
|
|
|
c6d234 |
-__sc4 = __sc4v; \
|
|
|
c6d234 |
-__asm__ __volatile__ ("mov %1,%0" : "=&r" (__sc3c) : "r" (__sc3)); \
|
|
|
c6d234 |
-__sc3 = __sc3v; \
|
|
|
c6d234 |
-__asm__ __volatile__ ("" : : "r" (__sc3c), "r" (__sc3), "r" (__sc4)); \
|
|
|
c6d234 |
-inline_syscall0 (name); \
|
|
|
c6d234 |
-__sc3 = __sc3c; \
|
|
|
c6d234 |
-__sc4 = __sc4c; \
|
|
|
c6d234 |
-__asm__ __volatile__ ("" : : "r" (__sc4), "r" (__sc3), \
|
|
|
c6d234 |
- "r" (__sc2), "r" (__sc1))
|
|
|
c6d234 |
-#else
|
|
|
c6d234 |
-#define inline_syscall4(name,arg1,arg2,arg3,arg4) \
|
|
|
c6d234 |
-register long __sc4 asm ("a2") = (long) (arg4); \
|
|
|
c6d234 |
-inline_syscall3 (name,(arg1),(arg2),(arg3)); \
|
|
|
c6d234 |
-__asm__ __volatile__ ("" : : "r" (__sc4))
|
|
|
c6d234 |
-#endif
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define inline_syscall5(name,arg1,arg2,arg3,arg4,arg5) \
|
|
|
c6d234 |
-register long __sc5 asm ("d3") = (long) (arg5); \
|
|
|
c6d234 |
-inline_syscall4 (name,(arg1),(arg2),(arg3),(arg4)); \
|
|
|
c6d234 |
-__asm__ __volatile__ ("" : : "r" (__sc5))
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#define inline_syscall6(name,arg1,arg2,arg3,arg4,arg5,arg6) \
|
|
|
c6d234 |
-register long __sc6 asm ("d2") = (long) (arg6); \
|
|
|
c6d234 |
-inline_syscall5 (name,(arg1),(arg2),(arg3),(arg4),(arg5)); \
|
|
|
c6d234 |
-__asm__ __volatile__ ("" : : "r" (__sc6))
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#endif /* __ASSEMBLER__ */
|
|
|
c6d234 |
-
|
|
|
c6d234 |
-#endif /* linux/am33/sysdep.h */
|
|
|
c6d234 |
diff --git a/ports/sysdeps/unix/sysv/linux/am33/xstat.c b/ports/sysdeps/unix/sysv/linux/am33/xstat.c
|
|
|
c6d234 |
deleted file mode 100644
|
|
|
c6d234 |
index e9869f550892e9a2..0000000000000000
|
|
|
c6d234 |
--- a/ports/sysdeps/unix/sysv/linux/am33/xstat.c
|
|
|
c6d234 |
+++ /dev/null
|
|
|
c6d234 |
@@ -1 +0,0 @@
|
|
|
c6d234 |
-#include <sysdeps/unix/sysv/linux/i386/xstat.c>
|