summaryrefslogtreecommitdiff
path: root/sys/lib
diff options
context:
space:
mode:
authorPer Fogelstrom <pefo@cvs.openbsd.org>2004-08-11 10:24:28 +0000
committerPer Fogelstrom <pefo@cvs.openbsd.org>2004-08-11 10:24:28 +0000
commit3bf6836c83d18e0f81f66e3aaf969fb5ef62f7d9 (patch)
treef16b075e67ebbea122e9c47853c1b6b29ff7e121 /sys/lib
parenta93f6e3179522792e745d565a898a34d29ccc0db (diff)
move to mips64
Diffstat (limited to 'sys/lib')
-rw-r--r--sys/lib/libkern/arch/mips/DEFS.h3
-rw-r--r--sys/lib/libkern/arch/mips/Makefile.inc12
-rw-r--r--sys/lib/libkern/arch/mips/SYS.h44
-rw-r--r--sys/lib/libkern/arch/mips/bcmp.S82
-rw-r--r--sys/lib/libkern/arch/mips/bcopy.S96
-rw-r--r--sys/lib/libkern/arch/mips/bzero.S39
-rw-r--r--sys/lib/libkern/arch/mips/ffs.S21
-rw-r--r--sys/lib/libkern/arch/mips/htonl.S23
-rw-r--r--sys/lib/libkern/arch/mips/htons.S19
-rw-r--r--sys/lib/libkern/arch/mips/strcmp.S30
-rw-r--r--sys/lib/libkern/arch/mips/strlen.S19
11 files changed, 0 insertions, 388 deletions
diff --git a/sys/lib/libkern/arch/mips/DEFS.h b/sys/lib/libkern/arch/mips/DEFS.h
deleted file mode 100644
index 8f9ff7b01c2..00000000000
--- a/sys/lib/libkern/arch/mips/DEFS.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/* $OpenBSD: DEFS.h,v 1.2 1997/11/07 15:57:14 niklas Exp $ */
-
-#include <machine/asm.h>
diff --git a/sys/lib/libkern/arch/mips/Makefile.inc b/sys/lib/libkern/arch/mips/Makefile.inc
deleted file mode 100644
index 420fb818fd4..00000000000
--- a/sys/lib/libkern/arch/mips/Makefile.inc
+++ /dev/null
@@ -1,12 +0,0 @@
-# $OpenBSD: Makefile.inc,v 1.10 2003/06/01 17:00:31 deraadt Exp $
-# $NetBSD: Makefile.inc,v 1.4 1996/04/13 01:17:46 cgd Exp $
-#
-# There are likely more that we will notice when we go native
-
-SRCS+= __main.c imax.c imin.c lmax.c lmin.c max.c min.c ulmax.c ulmin.c \
- memchr.c memcmp.c memset.c strcmp.c \
- bcmp.S bcopy.S bzero.S strcmp.c strlcat.c strlcpy.c \
- ffs.S htonl.S \
- htons.S strcmp.S strlen.S strncmp.c random.c scanc.c skpc.c strncpy.c \
- strncasecmp.c
-
diff --git a/sys/lib/libkern/arch/mips/SYS.h b/sys/lib/libkern/arch/mips/SYS.h
deleted file mode 100644
index 50e667355e5..00000000000
--- a/sys/lib/libkern/arch/mips/SYS.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* * $OpenBSD: SYS.h,v 1.3 2003/06/02 23:28:08 millert Exp $*/
-/*-
- * 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.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * from: @(#)SYS.h 5.5 (Berkeley) 5/7/91
- */
-
-#include <machine/asm.h>
-#include <sys/syscall.h>
-
-#define SYSCALL(x) .text; .align 2; 2: jmp PIC_PLT(cerror); ENTRY(x); movl $(SYS_/**/x),%eax; int $0x80; jc 2b
-#define RSYSCALL(x) SYSCALL(x); ret
-#define PSEUDO(x,y) ENTRY(x); movl $(SYS_/**/y),%eax; int $0x80; ret
-#define CALL(x,y) call PIC_PLT(_/**/y); addl $4*x,%esp
-
- .globl cerror
diff --git a/sys/lib/libkern/arch/mips/bcmp.S b/sys/lib/libkern/arch/mips/bcmp.S
deleted file mode 100644
index 1bca82dfb97..00000000000
--- a/sys/lib/libkern/arch/mips/bcmp.S
+++ /dev/null
@@ -1,82 +0,0 @@
-/* $OpenBSD: bcmp.S,v 1.7 1998/03/01 16:10:22 niklas Exp $ */
-
-#include "DEFS.h"
-
-
-/*
- * bcmp(s1, s2, n)
- */
-LEAF(bcmp)
- .set noreorder
- blt a2, 16, smallcmp # is it worth any trouble?
- xor v0, a0, a1 # compare low two bits of addresses
- and v0, v0, 3
- subu a3, zero, a1 # compute # bytes to word align address
- bne v0, zero, unalignedcmp # not possible to align addresses
- and a3, a3, 3
-
- beq a3, zero, 1f
- subu a2, a2, a3 # subtract from remaining count
- move v0, v1 # init v0,v1 so unmodified bytes match
- LWHI v0, 0(a0) # read 1, 2, or 3 bytes
- LWHI v1, 0(a1)
- addu a1, a1, a3
- bne v0, v1, nomatch
- addu a0, a0, a3
-1:
- and a3, a2, ~3 # compute number of whole words left
- subu a2, a2, a3 # which has to be >= (16-3) & ~3
- addu a3, a3, a0 # compute ending address
-2:
- lw v0, 0(a0) # compare words
- lw v1, 0(a1)
- addu a0, a0, 4
- bne v0, v1, nomatch
- addu a1, a1, 4
- bne a0, a3, 2b
- nop
- b smallcmp # finish remainder
- nop
-unalignedcmp:
- beq a3, zero, 2f
- subu a2, a2, a3 # subtract from remaining count
- addu a3, a3, a0 # compute ending address
-1:
- lbu v0, 0(a0) # compare bytes until a1 word aligned
- lbu v1, 0(a1)
- addu a0, a0, 1
- bne v0, v1, nomatch
- addu a1, a1, 1
- bne a0, a3, 1b
- nop
-2:
- and a3, a2, ~3 # compute number of whole words left
- subu a2, a2, a3 # which has to be >= (16-3) & ~3
- addu a3, a3, a0 # compute ending address
-3:
- LWHI v0, 0(a0) # compare words a0 unaligned, a1 aligned
- LWLO v0, 3(a0)
- lw v1, 0(a1)
- addu a0, a0, 4
- bne v0, v1, nomatch
- addu a1, a1, 4
- bne a0, a3, 3b
- nop
-smallcmp:
- ble a2, zero, match
- addu a3, a2, a0 # compute ending address
-1:
- lbu v0, 0(a0)
- lbu v1, 0(a1)
- addu a0, a0, 1
- bne v0, v1, nomatch
- addu a1, a1, 1
- bne a0, a3, 1b
- nop
-match:
- j ra
- move v0, zero
-nomatch:
- j ra
- li v0, 1
-END(bcmp)
diff --git a/sys/lib/libkern/arch/mips/bcopy.S b/sys/lib/libkern/arch/mips/bcopy.S
deleted file mode 100644
index 23b3bc0b328..00000000000
--- a/sys/lib/libkern/arch/mips/bcopy.S
+++ /dev/null
@@ -1,96 +0,0 @@
-/* $OpenBSD: bcopy.S,v 1.8 1998/03/01 16:10:24 niklas Exp $ */
-
-#include "DEFS.h"
-
-
-/*
- * memcpy(to, from, len)
- * {ov}bcopy(from, to, len)
- */
-LEAF(memcpy)
- .set noreorder
- move v0, a0 # swap from and to
- move a0, a1
- move a1, v0
-ALEAF(bcopy)
-ALEAF(ovbcopy)
- .set noreorder
- addu t0, a0, a2 # t0 = end of s1 region
- sltu t1, a1, t0
- sltu t2, a0, a1
- and t1, t1, t2 # t1 = true if from < to < (from+len)
- beq t1, zero, forward # non overlapping, do forward copy
- slt t2, a2, 12 # check for small copy
-
- ble a2, zero, 2f
- addu t1, a1, a2 # t1 = end of to region
-1:
- lb v1, -1(t0) # copy bytes backwards,
- subu t0, t0, 1 # doesnt happen often so do slow way
- subu t1, t1, 1
- bne t0, a0, 1b
- sb v1, 0(t1)
-2:
- j ra
- nop
-forward:
- bne t2, zero, smallcpy # do a small bcopy
- xor v1, a0, a1 # compare low two bits of addresses
- and v1, v1, 3
- subu a3, zero, a1 # compute # bytes to word align address
- beq v1, zero, aligned # addresses can be word aligned
- and a3, a3, 3
-
- beq a3, zero, 1f
- subu a2, a2, a3 # subtract from remaining count
- LWHI v1, 0(a0) # get next 4 bytes (unaligned)
- LWLO v1, 3(a0)
- addu a0, a0, a3
- SWHI v1, 0(a1) # store 1, 2, or 3 bytes to align a1
- addu a1, a1, a3
-1:
- and v1, a2, 3 # compute number of words left
- subu a3, a2, v1
- move a2, v1
- addu a3, a3, a0 # compute ending address
-2:
- LWHI v1, 0(a0) # copy words a0 unaligned, a1 aligned
- LWLO v1, 3(a0)
- addu a0, a0, 4
- sw v1, 0(a1)
- addu a1, a1, 4
- bne a0, a3, 2b
- nop # We have to do this mmu-bug.
- b smallcpy
- nop
-aligned:
- beq a3, zero, 1f
- subu a2, a2, a3 # subtract from remaining count
- LWHI v1, 0(a0) # copy 1, 2, or 3 bytes to align
- addu a0, a0, a3
- SWHI v1, 0(a1)
- addu a1, a1, a3
-1:
- and v1, a2, 3 # compute number of whole words left
- subu a3, a2, v1
- move a2, v1
- addu a3, a3, a0 # compute ending address
-2:
- lw v1, 0(a0) # copy words
- addu a0, a0, 4
- sw v1, 0(a1)
- bne a0, a3, 2b
- addu a1, a1, 4
-smallcpy:
- ble a2, zero, 2f
- addu a3, a2, a0 # compute ending address
-1:
- lbu v1, 0(a0) # copy bytes
- addu a0, a0, 1
- sb v1, 0(a1)
- bne a0, a3, 1b
- addu a1, a1, 1 # MMU BUG ? can not do -1(a1) at 0x80000000!!
-2:
- j ra
- nop
-END(memcpy)
diff --git a/sys/lib/libkern/arch/mips/bzero.S b/sys/lib/libkern/arch/mips/bzero.S
deleted file mode 100644
index adc329b57a6..00000000000
--- a/sys/lib/libkern/arch/mips/bzero.S
+++ /dev/null
@@ -1,39 +0,0 @@
-/* $OpenBSD: bzero.S,v 1.6 1998/03/01 16:10:26 niklas Exp $ */
-
-#include "DEFS.h"
-
-
-/*
- * bzero(s1, n)
- */
-LEAF(bzero)
-ALEAF(blkclr)
- .set noreorder
- blt a1, 12, smallclr # small amount to clear?
- subu a3, zero, a0 # compute # bytes to word align address
- and a3, a3, 3
- beq a3, zero, 1f # skip if word aligned
- subu a1, a1, a3 # subtract from remaining count
- SWHI zero, 0(a0) # clear 1, 2, or 3 bytes to align
- addu a0, a0, a3
-1:
- and v0, a1, 3 # compute number of words left
- subu a3, a1, v0
- move a1, v0
- addu a3, a3, a0 # compute ending address
-2:
- addu a0, a0, 4 # clear words
- bne a0, a3, 2b # unrolling loop does not help
- sw zero, -4(a0) # since we are limited by memory speed
-smallclr:
- ble a1, zero, 2f
- addu a3, a1, a0 # compute ending address
-1:
- addu a0, a0, 1 # clear bytes
- bne a0, a3, 1b
- sb zero, -1(a0)
-2:
- j ra
- nop
-END(bzero)
-
diff --git a/sys/lib/libkern/arch/mips/ffs.S b/sys/lib/libkern/arch/mips/ffs.S
deleted file mode 100644
index ef1c2c99e3e..00000000000
--- a/sys/lib/libkern/arch/mips/ffs.S
+++ /dev/null
@@ -1,21 +0,0 @@
-/* $OpenBSD: ffs.S,v 1.5 1998/03/01 16:10:28 niklas Exp $ */
-
-#include "DEFS.h"
-
-
-/*
- * bit = ffs(value)
- */
-LEAF(ffs)
- .set noreorder
- beq a0, zero, 2f
- move v0, zero
-1:
- and v1, a0, 1 # bit set?
- addu v0, v0, 1
- beq v1, zero, 1b # no, continue
- srl a0, a0, 1
-2:
- j ra
- nop
-END(ffs)
diff --git a/sys/lib/libkern/arch/mips/htonl.S b/sys/lib/libkern/arch/mips/htonl.S
deleted file mode 100644
index afcb8e35620..00000000000
--- a/sys/lib/libkern/arch/mips/htonl.S
+++ /dev/null
@@ -1,23 +0,0 @@
-/* $OpenBSD: htonl.S,v 1.5 1998/03/01 16:10:30 niklas Exp $ */
-
-#include "DEFS.h"
-
-
-/*
- * netorder = htonl(hostorder)
- * hostorder = ntohl(netorder)
- */
-LEAF(htonl) # a0 = 0x11223344, return 0x44332211
-ALEAF(ntohl)
- .set noreorder
- srl v1, a0, 24 # v1 = 0x00000011
- sll v0, a0, 24 # v0 = 0x44000000
- or v0, v0, v1
- and v1, a0, 0xff00
- sll v1, v1, 8 # v1 = 0x00330000
- or v0, v0, v1
- srl v1, a0, 8
- and v1, v1, 0xff00 # v1 = 0x00002200
- j ra
- or v0, v0, v1
-END(htonl)
diff --git a/sys/lib/libkern/arch/mips/htons.S b/sys/lib/libkern/arch/mips/htons.S
deleted file mode 100644
index b1d5a60fa4a..00000000000
--- a/sys/lib/libkern/arch/mips/htons.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* $OpenBSD: htons.S,v 1.5 1998/03/01 16:10:32 niklas Exp $ */
-
-#include "DEFS.h"
-
-
-/*
- * netorder = htons(hostorder)
- * hostorder = ntohs(netorder)
- */
-LEAF(htons)
-ALEAF(ntohs)
- .set noreorder
- srl v0, a0, 8
- and v0, v0, 0xff
- sll v1, a0, 8
- and v1, v1, 0xff00
- j ra
- or v0, v0, v1
-END(htons)
diff --git a/sys/lib/libkern/arch/mips/strcmp.S b/sys/lib/libkern/arch/mips/strcmp.S
deleted file mode 100644
index e95ebe698b0..00000000000
--- a/sys/lib/libkern/arch/mips/strcmp.S
+++ /dev/null
@@ -1,30 +0,0 @@
-/* $OpenBSD: strcmp.S,v 1.5 1998/03/01 16:10:34 niklas Exp $ */
-
-#include "DEFS.h"
-
-
-/*
- * NOTE: this version assumes unsigned chars in order to be "8 bit clean".
- */
-LEAF(strcmp)
- .set noreorder
-1:
- lbu t0, 0(a0) # get two bytes and compare them
- lbu t1, 0(a1)
- beq t0, zero, LessOrEq # end of first string?
- nop
- bne t0, t1, NotEq
- nop
- lbu t0, 1(a0) # unroll loop
- lbu t1, 1(a1)
- beq t0, zero, LessOrEq # end of first string?
- addu a0, a0, 2
- beq t0, t1, 1b
- addu a1, a1, 2
-NotEq:
- j ra
- subu v0, t0, t1
-LessOrEq:
- j ra
- subu v0, zero, t1
-END(strcmp)
diff --git a/sys/lib/libkern/arch/mips/strlen.S b/sys/lib/libkern/arch/mips/strlen.S
deleted file mode 100644
index b1262b8f7ad..00000000000
--- a/sys/lib/libkern/arch/mips/strlen.S
+++ /dev/null
@@ -1,19 +0,0 @@
-/* $OpenBSD: strlen.S,v 1.5 1998/03/01 16:10:37 niklas Exp $ */
-
-#include "DEFS.h"
-
-
-/*
- * strlen(str)
- */
-LEAF(strlen)
- .set noreorder
- addu v1, a0, 1
-1:
- lb v0, 0(a0) # get byte from string
- addu a0, a0, 1 # increment pointer
- bne v0, zero, 1b # continue if not end
- nop
- j ra
- subu v0, a0, v1 # compute length - 1 for '\0' char
-END(strlen)