summaryrefslogtreecommitdiffstats
path: root/lib/libc/amd64/SYS.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/amd64/SYS.h')
-rw-r--r--lib/libc/amd64/SYS.h34
1 files changed, 25 insertions, 9 deletions
diff --git a/lib/libc/amd64/SYS.h b/lib/libc/amd64/SYS.h
index dfb679f..53837ab 100644
--- a/lib/libc/amd64/SYS.h
+++ b/lib/libc/amd64/SYS.h
@@ -1,6 +1,6 @@
/*-
- * Copyright (c) 1990, 1993
- * The Regents of the University of California. All rights reserved.
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* William Jolitz.
@@ -33,18 +33,34 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * @(#)SYS.h 8.1 (Berkeley) 6/4/93
+ * from: @(#)SYS.h 5.5 (Berkeley) 5/7/91
+ *
+ * $Id: SYS.h,v 1.3 1993/11/04 00:01:17 paul Exp $
*/
#include <sys/syscall.h>
+#include "DEFS.h"
-#ifdef PROF
-#define ENTRY(x) .globl _/**/x; \
- .data; 1:; .long 0; .text; .align 2; _/**/x: \
- movl $1b,%eax; call mcount
+#ifdef PIC
+#define PIC_PROLOGUE \
+ pushl %ebx; \
+ call 1f; \
+1: \
+ popl %ebx; \
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ebx
+#define PIC_EPILOGUE \
+ popl %ebx
+#define PIC_PLT(x) x@PLT
+#define PIC_GOT(x) x@GOT(%ebx)
+#define PIC_GOTOFF(x) x@GOTOFF(%ebx)
#else
-#define ENTRY(x) .globl _/**/x; .text; .align 2; _/**/x:
-#endif PROF
+#define PIC_PROLOGUE
+#define PIC_EPILOGUE
+#define PIC_PLT(x) x
+#define PIC_GOT(x) x
+#define PIC_GOTOFF(x) x
+#endif
+
#define SYSCALL(x) 2: jmp cerror; ENTRY(x); lea SYS_/**/x,%eax; LCALL(7,0); jb 2b
#define RSYSCALL(x) SYSCALL(x); ret
#define PSEUDO(x,y) ENTRY(x); lea SYS_/**/y, %eax; ; LCALL(7,0); ret
OpenPOWER on IntegriCloud