summaryrefslogtreecommitdiffstats
path: root/sys/lib/libkern/arch/amd64
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2007-11-25 18:25:25 +0000
committerderaadt <deraadt@openbsd.org>2007-11-25 18:25:25 +0000
commit4d6af78a85c54abcce707f76977611c77d8dfe20 (patch)
tree04014b8faba6f61654418ba7ebb480ab63fc1ea7 /sys/lib/libkern/arch/amd64
parenttypo; ok jmc@, deanna@ (diff)
downloadwireguard-openbsd-4d6af78a85c54abcce707f76977611c77d8dfe20.tar.xz
wireguard-openbsd-4d6af78a85c54abcce707f76977611c77d8dfe20.zip
libkern, begone. Move to a new mechanism where config(8)'s "file"
directive can select between MI and MD versions of these files. At the same time, adjust the boot programs to pick exactly what they need, instead of the 7 or 8 mechanisms previously used. There will be some fallout from this, but testing it all by myself is a ridiculously slow process; it will be finished in-tree. Various developers were very nice and avoided making fun of me when I was gibbering in the corner..
Diffstat (limited to 'sys/lib/libkern/arch/amd64')
-rw-r--r--sys/lib/libkern/arch/amd64/Makefile.inc14
-rw-r--r--sys/lib/libkern/arch/amd64/htonl.S (renamed from sys/lib/libkern/arch/amd64/byte_swap_4.S)7
-rw-r--r--sys/lib/libkern/arch/amd64/htons.S (renamed from sys/lib/libkern/arch/amd64/byte_swap_2.S)7
-rw-r--r--sys/lib/libkern/arch/amd64/index.S29
-rw-r--r--sys/lib/libkern/arch/amd64/rindex.S29
-rw-r--r--sys/lib/libkern/arch/amd64/strchr.S23
-rw-r--r--sys/lib/libkern/arch/amd64/strrchr.S23
7 files changed, 44 insertions, 88 deletions
diff --git a/sys/lib/libkern/arch/amd64/Makefile.inc b/sys/lib/libkern/arch/amd64/Makefile.inc
deleted file mode 100644
index be83971422a..00000000000
--- a/sys/lib/libkern/arch/amd64/Makefile.inc
+++ /dev/null
@@ -1,14 +0,0 @@
-# $NetBSD: Makefile.inc,v 1.2 2002/11/25 00:55:22 fvdl Exp $
-
-SRCS+= imax.c imin.c lmax.c lmin.c max.c min.c ulmax.c ulmin.c \
- byte_swap_2.S byte_swap_4.S \
- bcmp.S bcopy.S bzero.S ffs.S \
- memchr.S memcmp.S memcpy.S memmove.S memset.S \
- ovbcopy.S \
- strchr.S strcmp.S \
- strlcpy.c strlcat.c strlen.S \
- strncasecmp.c strncmp.c strncpy.c strrchr.S \
- scanc.S skpc.S random.c
-# bswap64.c strcasecmp.c strncasecmp.c \ strtoul.c \
-
-CFLAGS+=-mcmodel=kernel
diff --git a/sys/lib/libkern/arch/amd64/byte_swap_4.S b/sys/lib/libkern/arch/amd64/htonl.S
index f6a961e38f5..b9b121597f6 100644
--- a/sys/lib/libkern/arch/amd64/byte_swap_4.S
+++ b/sys/lib/libkern/arch/amd64/htonl.S
@@ -39,13 +39,10 @@
*/
#include <machine/asm.h>
-#if defined(LIBC_SCCS)
- RCSID("$NetBSD: byte_swap_4.S,v 1.1 2001/06/19 00:22:45 fvdl Exp $")
-#endif
-_ENTRY(_C_LABEL(bswap32))
-_ENTRY(_C_LABEL(ntohl))
_ENTRY(_C_LABEL(htonl))
+_ENTRY(_C_LABEL(ntohl))
+_ENTRY(_C_LABEL(bswap32))
_PROF_PROLOGUE
movl %edi,%eax
bswap %eax
diff --git a/sys/lib/libkern/arch/amd64/byte_swap_2.S b/sys/lib/libkern/arch/amd64/htons.S
index 19ed5e27812..a35b67b2951 100644
--- a/sys/lib/libkern/arch/amd64/byte_swap_2.S
+++ b/sys/lib/libkern/arch/amd64/htons.S
@@ -39,13 +39,10 @@
*/
#include <machine/asm.h>
-#if defined(LIBC_SCCS)
- RCSID("$NetBSD: byte_swap_2.S,v 1.1 2001/06/19 00:22:45 fvdl Exp $")
-#endif
-_ENTRY(_C_LABEL(bswap16))
-_ENTRY(_C_LABEL(ntohs))
_ENTRY(_C_LABEL(htons))
+_ENTRY(_C_LABEL(ntohs))
+_ENTRY(_C_LABEL(bswap16))
_PROF_PROLOGUE
movl %edi,%eax
xchgb %ah,%al
diff --git a/sys/lib/libkern/arch/amd64/index.S b/sys/lib/libkern/arch/amd64/index.S
index 60754f266f0..e69de29bb2d 100644
--- a/sys/lib/libkern/arch/amd64/index.S
+++ b/sys/lib/libkern/arch/amd64/index.S
@@ -1,29 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Public domain.
- * Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com>
- */
-
-#include <machine/asm.h>
-
-#if defined(LIBC_SCCS)
- RCSID("$NetBSD: index.S,v 1.1 2001/06/19 00:22:46 fvdl Exp $")
-#endif
-
-#ifdef STRCHR
-ENTRY(strchr)
-#else
-ENTRY(index)
-#endif
- movq %rdi,%rax
- movb %sil,%cl
-L1:
- movb (%rax),%dl
- cmpb %dl,%cl /* found char? */
- je L2
- incq %rax
- testb %dl,%dl /* null terminator? */
- jnz L1
- xorq %rax,%rax
-L2:
- ret
diff --git a/sys/lib/libkern/arch/amd64/rindex.S b/sys/lib/libkern/arch/amd64/rindex.S
index 6ba7c52a11f..e69de29bb2d 100644
--- a/sys/lib/libkern/arch/amd64/rindex.S
+++ b/sys/lib/libkern/arch/amd64/rindex.S
@@ -1,29 +0,0 @@
-/*
- * Written by J.T. Conklin <jtc@netbsd.org>.
- * Public domain.
- * Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com>
- */
-
-#include <machine/asm.h>
-
-#if defined(LIBC_SCCS)
- RCSID("$NetBSD: rindex.S,v 1.1 2001/06/19 00:22:47 fvdl Exp $")
-#endif
-
-#ifdef STRRCHR
-ENTRY(strrchr)
-#else
-ENTRY(rindex)
-#endif
- movb %sil,%cl
- xorq %rax,%rax /* init pointer to null */
-L1:
- movb (%rdi),%dl
- cmpb %dl,%cl
- jne L2
- movq %rdi,%rax
-L2:
- incq %rdi
- testb %dl,%dl /* null terminator??? */
- jnz L1
- ret
diff --git a/sys/lib/libkern/arch/amd64/strchr.S b/sys/lib/libkern/arch/amd64/strchr.S
index 91fd708891f..058c56a5358 100644
--- a/sys/lib/libkern/arch/amd64/strchr.S
+++ b/sys/lib/libkern/arch/amd64/strchr.S
@@ -1,4 +1,21 @@
-/* $NetBSD: strchr.S,v 1.1 2001/06/19 00:22:47 fvdl Exp $ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ * Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com>
+ */
-#define STRCHR
-#include "index.S"
+#include <machine/asm.h>
+
+ENTRY(strchr)
+ movq %rdi,%rax
+ movb %sil,%cl
+L1:
+ movb (%rax),%dl
+ cmpb %dl,%cl /* found char? */
+ je L2
+ incq %rax
+ testb %dl,%dl /* null terminator? */
+ jnz L1
+ xorq %rax,%rax
+L2:
+ ret
diff --git a/sys/lib/libkern/arch/amd64/strrchr.S b/sys/lib/libkern/arch/amd64/strrchr.S
index 9b23edfb435..097b4f1f699 100644
--- a/sys/lib/libkern/arch/amd64/strrchr.S
+++ b/sys/lib/libkern/arch/amd64/strrchr.S
@@ -1,4 +1,21 @@
-/* $NetBSD: strrchr.S,v 1.1 2001/06/19 00:22:47 fvdl Exp $ */
+/*
+ * Written by J.T. Conklin <jtc@netbsd.org>.
+ * Public domain.
+ * Adapted for NetBSD/x86_64 by Frank van der Linden <fvdl@wasabisystems.com>
+ */
-#define STRRCHR
-#include "rindex.S"
+#include <machine/asm.h>
+
+ENTRY(strrchr)
+ movb %sil,%cl
+ xorq %rax,%rax /* init pointer to null */
+L1:
+ movb (%rdi),%dl
+ cmpb %dl,%cl
+ jne L2
+ movq %rdi,%rax
+L2:
+ incq %rdi
+ testb %dl,%dl /* null terminator??? */
+ jnz L1
+ ret