summaryrefslogtreecommitdiff
path: root/ldso/ldso/m68k
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-02-10 09:26:57 +0000
committerEric Andersen <andersen@codepoet.org>2004-02-10 09:26:57 +0000
commit70709408336e483de74947eb53e9ba01ef4ab140 (patch)
treefe17e15c0f272c571607172fc5c89d094de5f60c /ldso/ldso/m68k
parentc201ba7c107edbb5fe81c641e87715a4930a4ff1 (diff)
Rework file naming, aiming for at least a vague level of consistancy
Diffstat (limited to 'ldso/ldso/m68k')
-rw-r--r--ldso/ldso/m68k/boot1_arch.h7
-rw-r--r--ldso/ldso/m68k/ld_syscalls.h174
-rw-r--r--ldso/ldso/m68k/ld_sysdep.h88
3 files changed, 0 insertions, 269 deletions
diff --git a/ldso/ldso/m68k/boot1_arch.h b/ldso/ldso/m68k/boot1_arch.h
deleted file mode 100644
index 42c96a6f5..000000000
--- a/ldso/ldso/m68k/boot1_arch.h
+++ /dev/null
@@ -1,7 +0,0 @@
-/* Any assmbly language/system dependent hacks needed to setup boot1.c so it
- * will work as expected and cope with whatever platform specific wierdness is
- * needed for this architecture. See arm/boot1_arch.h for an example of what
- * can be done.
- */
-
-#define DL_BOOT(X) void __attribute__ ((unused)) _dl_boot (X)
diff --git a/ldso/ldso/m68k/ld_syscalls.h b/ldso/ldso/m68k/ld_syscalls.h
deleted file mode 100644
index 1fb2cccd2..000000000
--- a/ldso/ldso/m68k/ld_syscalls.h
+++ /dev/null
@@ -1,174 +0,0 @@
-/*
- * This file contains the system call macros and syscall
- * numbers used by the shared library loader.
- */
-
-#define __NR_exit 1
-#define __NR_read 3
-#define __NR_write 4
-#define __NR_open 5
-#define __NR_close 6
-#define __NR_getuid 24
-#define __NR_geteuid 49
-#define __NR_getgid 47
-#define __NR_getegid 50
-#define __NR_readlink 85
-#define __NR_mmap 90
-#define __NR_munmap 91
-#define __NR_stat 106
-#define __NR_mprotect 125
-
-
-/* Here are the macros which define how this platform makes
- * system calls. This particular variant does _not_ set
- * errno (note how it is disabled in __syscall_return) since
- * these will get called before the errno symbol is dynamicly
- * linked. */
-
-
-#define __syscall_return(type, res) \
-do { \
- if ((unsigned long)(res) >= (unsigned long)(-125)) { \
- /* avoid using res which is declared to be in register d0; \
- errno might expand to a function call and clobber it. */ \
- /* int __err = -(res); \
- errno = __err; */ \
- res = -1; \
- } \
- return (type) (res); \
-} while (0)
-
-#define _syscall0(type, name) \
-type name(void) \
-{ \
- long __res; \
- __asm__ __volatile__ ("movel %1, %%d0\n\t" \
- "trap #0\n\t" \
- "movel %%d0, %0" \
- : "=g" (__res) \
- : "i" (__NR_##name) \
- : "cc", "%d0"); \
- if ((unsigned long)(__res) >= (unsigned long)(-125)) { \
- /* errno = -__res; */ \
- __res = -1; \
- } \
- return (type)__res; \
-}
-
-#define _syscall1(type, name, atype, a) \
-type name(atype a) \
-{ \
- long __res; \
- __asm__ __volatile__ ("movel %2, %%d1\n\t" \
- "movel %1, %%d0\n\t" \
- "trap #0\n\t" \
- "movel %%d0, %0" \
- : "=g" (__res) \
- : "i" (__NR_##name), \
- "g" ((long)a) \
- : "cc", "%d0", "%d1"); \
- if ((unsigned long)(__res) >= (unsigned long)(-125)) { \
- /* errno = -__res; */ \
- __res = -1; \
- } \
- return (type)__res; \
-}
-
-#define _syscall2(type, name, atype, a, btype, b) \
-type name(atype a, btype b) \
-{ \
- long __res; \
- __asm__ __volatile__ ("movel %3, %%d2\n\t" \
- "movel %2, %%d1\n\t" \
- "movel %1, %%d0\n\t" \
- "trap #0\n\t" \
- "movel %%d0, %0" \
- : "=g" (__res) \
- : "i" (__NR_##name), \
- "a" ((long)a), \
- "g" ((long)b) \
- : "cc", "%d0", "%d1", "%d2"); \
- if ((unsigned long)(__res) >= (unsigned long)(-125)) { \
- /* errno = -__res; */ \
- __res = -1; \
- } \
- return (type)__res; \
-}
-
-#define _syscall3(type, name, atype, a, btype, b, ctype, c) \
-type name(atype a, btype b, ctype c) \
-{ \
- long __res; \
- __asm__ __volatile__ ("movel %4, %%d3\n\t" \
- "movel %3, %%d2\n\t" \
- "movel %2, %%d1\n\t" \
- "movel %1, %%d0\n\t" \
- "trap #0\n\t" \
- "movel %%d0, %0" \
- : "=g" (__res) \
- : "i" (__NR_##name), \
- "a" ((long)a), \
- "a" ((long)b), \
- "g" ((long)c) \
- : "cc", "%d0", "%d1", "%d2", "%d3"); \
- if ((unsigned long)(__res) >= (unsigned long)(-125)) { \
- /* errno = -__res; */ \
- __res = -1; \
- } \
- return (type)__res; \
-}
-
-#define _syscall4(type, name, atype, a, btype, b, ctype, c, dtype, d) \
-type name(atype a, btype b, ctype c, dtype d) \
-{ \
- long __res; \
- __asm__ __volatile__ ("movel %5, %%d4\n\t" \
- "movel %4, %%d3\n\t" \
- "movel %3, %%d2\n\t" \
- "movel %2, %%d1\n\t" \
- "movel %1, %%d0\n\t" \
- "trap #0\n\t" \
- "movel %%d0, %0" \
- : "=g" (__res) \
- : "i" (__NR_##name), \
- "a" ((long)a), \
- "a" ((long)b), \
- "a" ((long)c), \
- "g" ((long)d) \
- : "cc", "%d0", "%d1", "%d2", "%d3", \
- "%d4"); \
- if ((unsigned long)(__res) >= (unsigned long)(-125)) { \
- /* errno = -__res; */ \
- __res = -1; \
- } \
- return (type)__res; \
-}
-
-#define _syscall5(type, name, atype, a, btype, b, ctype, c, dtype, d, etype, e)\
-type name(atype a, btype b, ctype c, dtype d, etype e) \
-{ \
- long __res; \
- __asm__ __volatile__ ("movel %6, %%d5\n\t" \
- "movel %5, %%d4\n\t" \
- "movel %4, %%d3\n\t" \
- "movel %3, %%d2\n\t" \
- "movel %2, %%d1\n\t" \
- "movel %1, %%d0\n\t" \
- "trap #0\n\t" \
- "movel %%d0, %0" \
- : "=g" (__res) \
- : "i" (__NR_##name), \
- "a" ((long)a), \
- "a" ((long)b), \
- "a" ((long)c), \
- "a" ((long)d), \
- "g" ((long)e) \
- : "cc", "%d0", "%d1", "%d2", "%d3", \
- "%d4", "%d5"); \
- if ((unsigned long)(__res) >= (unsigned long)(-125)) { \
- /* errno = -__res; */ \
- __res = -1; \
- } \
- return (type)__res; \
-}
-
diff --git a/ldso/ldso/m68k/ld_sysdep.h b/ldso/ldso/m68k/ld_sysdep.h
deleted file mode 100644
index 2cbc7d46b..000000000
--- a/ldso/ldso/m68k/ld_sysdep.h
+++ /dev/null
@@ -1,88 +0,0 @@
-
-/* Various assmbly language/system dependent hacks that are required
- so that we can minimize the amount of platform specific code. */
-
-/* Define this if the system uses RELOCA. */
-#define ELF_USES_RELOCA
-
-/* Get a pointer to the argv array. On many platforms this can be
- just the address if the first argument, on other platforms we need
- to do something a little more subtle here. */
-#define GET_ARGV(ARGVP, ARGS) ((ARGVP) = ((unsigned int *) &(ARGS)))
-
-/* Initialization sequence for a GOT. */
-#define INIT_GOT(GOT_BASE,MODULE) \
-{ \
- GOT_BASE[2] = (int) _dl_linux_resolve; \
- GOT_BASE[1] = (int) (MODULE); \
-}
-
-/* Here is a macro to perform a relocation. This is only used when
- bootstrapping the dynamic loader. RELP is the relocation that we
- are performing, REL is the pointer to the address we are
- relocating. SYMBOL is the symbol involved in the relocation, and
- LOAD is the load address. */
-#define PERFORM_BOOTSTRAP_RELOC(RELP,REL,SYMBOL,LOAD,SYMTAB) \
- switch (ELF32_R_TYPE ((RELP)->r_info)) \
- { \
- case R_68K_8: \
- *(char *) (REL) = (SYMBOL) + (RELP)->r_addend; \
- break; \
- case R_68K_16: \
- *(short *) (REL) = (SYMBOL) + (RELP)->r_addend; \
- break; \
- case R_68K_32: \
- *(REL) = (SYMBOL) + (RELP)->r_addend; \
- break; \
- case R_68K_PC8: \
- *(char *) (REL) = ((SYMBOL) + (RELP)->r_addend \
- - (unsigned int) (REL)); \
- break; \
- case R_68K_PC16: \
- *(short *) (REL) = ((SYMBOL) + (RELP)->r_addend \
- - (unsigned int) (REL)); \
- break; \
- case R_68K_PC32: \
- *(REL) = ((SYMBOL) + (RELP)->r_addend \
- - (unsigned int) (REL)); \
- break; \
- case R_68K_GLOB_DAT: \
- case R_68K_JMP_SLOT: \
- *(REL) = (SYMBOL); \
- break; \
- case R_68K_RELATIVE: /* Compatibility kludge */ \
- *(REL) = ((unsigned int) (LOAD) + ((RELP)->r_addend ? : *(REL))); \
- break; \
- default: \
- _dl_exit (1); \
- }
-
-
-/* Transfer control to the user's application, once the dynamic loader
- is done. */
-
-#define START() \
- __asm__ volatile ("unlk %%a6\n\t" \
- "jmp %0@" \
- : : "a" (_dl_elf_main));
-
-
-
-/* Here we define the magic numbers that this dynamic loader should accept */
-
-#define MAGIC1 EM_68K
-#undef MAGIC2
-/* Used for error messages */
-#define ELF_TARGET "m68k"
-
-struct elf_resolve;
-extern unsigned int _dl_linux_resolver (int, int, struct elf_resolve *, int);
-
-/* Define this because we do not want to call .udiv in the library.
- Not needed for m68k. */
-#define do_rem(result, n, base) ((result) = (n) % (base))
-
-/* 4096 bytes alignment */
-#define PAGE_ALIGN 0xfffff000
-#define ADDR_ALIGN 0xfff
-#define OFFS_ALIGN 0x7ffff000