From 6f0a2dad9f8b1a019e39444e7e0a2202c947c48a Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 1 Jul 1996 22:16:20 +0000 Subject: [PATCH] Fri Jun 28 16:53:01 1996 David Mosberger-Tang * sysdeps/unix/sysv/linux/alpha/init-first.h, sysdeps/unix/sysv/linux/m68k/init-first.h, sysdeps/unix/sysv/linux/i386/init-first.h: New files. * sysdeps/unix/sysv/linux/init-first.c: Use platform-dependent init-first.h to make abstract machine dependent parts of initialization. --- sysdeps/unix/sysv/linux/alpha/init-first.h | 12 ++++++++++++ sysdeps/unix/sysv/linux/m68k/init-first.h | 12 ++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 sysdeps/unix/sysv/linux/alpha/init-first.h create mode 100644 sysdeps/unix/sysv/linux/m68k/init-first.h diff --git a/sysdeps/unix/sysv/linux/alpha/init-first.h b/sysdeps/unix/sysv/linux/alpha/init-first.h new file mode 100644 index 0000000..c27c589 --- /dev/null +++ b/sysdeps/unix/sysv/linux/alpha/init-first.h @@ -0,0 +1,12 @@ +/* This fragment is invoked in the stack context of program start. + Its job is to set up a pointer to argc as an argument, pass + control to `INIT', and, if necessary, clean up after the call + to leave the stack in the same condition it was found in. */ + +#define SYSDEP_CALL_INIT(NAME, INIT) \ + asm(".globl " #NAME "\n" \ + #NAME ":\n\t" \ + "ldgp $29, 0($27)\n\t" \ + ".prologue 1\n\t" \ + "mov $30, $16\n\t" \ + "br $31, " #INIT "..ng"); diff --git a/sysdeps/unix/sysv/linux/m68k/init-first.h b/sysdeps/unix/sysv/linux/m68k/init-first.h new file mode 100644 index 0000000..7d8c320 --- /dev/null +++ b/sysdeps/unix/sysv/linux/m68k/init-first.h @@ -0,0 +1,12 @@ +/* This fragment is invoked in the stack context of program start. + Its job is to set up a pointer to argc as an argument, pass + control to `INIT', and, if necessary, clean up after the call + to leave the stack in the same condition it was found in. */ + +#define SYSDEP_CALL_INIT(NAME, INIT) \ + asm(".globl " #NAME "\n\t" \ + #NAME ":\n\t" \ + "pea %sp@(4)\n\t" \ + "jbsr " #INIT "\n\t" \ + "addq #4,%sp\n\t" \ + "rts"); -- 2.7.4