summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2000-02-22 19:27:20 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2000-02-22 19:27:20 +0000
commitf19a9cdec2be86dd535b2a0effa37f4a51e6f4f1 (patch)
treeec7a9bda1c5c60a4c69bed1b333f7bd170bae35f /sys
parent26a2827ca0f7463d8c9ef1afc1a377fded516a7e (diff)
put C accessable labels on {,u}{rem,div}
Diffstat (limited to 'sys')
-rw-r--r--sys/lib/libkern/arch/sparc/Makefile.inc10
-rw-r--r--sys/lib/libkern/arch/sparc/divrem.m47
2 files changed, 10 insertions, 7 deletions
diff --git a/sys/lib/libkern/arch/sparc/Makefile.inc b/sys/lib/libkern/arch/sparc/Makefile.inc
index 3d14262e7a8..d66b88ec73f 100644
--- a/sys/lib/libkern/arch/sparc/Makefile.inc
+++ b/sys/lib/libkern/arch/sparc/Makefile.inc
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile.inc,v 1.6 1999/12/07 00:49:10 deraadt Exp $
+# $OpenBSD: Makefile.inc,v 1.7 2000/02/22 19:27:18 deraadt Exp $
# $NetBSD: Makefile.inc,v 1.12 1996/04/23 23:05:22 christos Exp $
SRCS+= __main.c imax.c imin.c lmax.c lmin.c max.c min.c ulmax.c ulmin.c \
@@ -17,25 +17,25 @@ CLEANFILES+=rem.S sdiv.S udiv.S urem.S
sdiv.S: divrem.m4
echo 'building ${.TARGET} from ${.ALLSRC}'
- (echo "define(NAME,\`.div')define(OP,\`div')define(S,\`true')"; \
+ (echo "define(NAME,\`.div')define(NAME2,\`__div')define(OP,\`div')define(S,\`true')"; \
cat ${.ALLSRC}) | m4 > ${.TARGET}
chmod 444 ${.TARGET}
udiv.S: divrem.m4
@echo 'building ${.TARGET} from ${.ALLSRC}'
- @(echo "define(NAME,\`.udiv')define(OP,\`div')define(S,\`false')"; \
+ @(echo "define(NAME,\`.udiv')define(NAME2,\`__udiv')define(OP,\`div')define(S,\`false')"; \
cat ${.ALLSRC}) | m4 > ${.TARGET}
@chmod 444 ${.TARGET}
rem.S: divrem.m4
echo 'building ${.TARGET} from ${.ALLSRC}'
- (echo "define(NAME,\`.rem')define(OP,\`rem')define(S,\`true')"; \
+ (echo "define(NAME,\`.rem')define(NAME2,\`__rem')define(OP,\`rem')define(S,\`true')"; \
cat ${.ALLSRC}) | m4 > ${.TARGET}
chmod 444 ${.TARGET}
urem.S: divrem.m4
@echo 'building ${.TARGET} from ${.ALLSRC}'
- @(echo "define(NAME,\`.urem')define(OP,\`rem')define(S,\`false')"; \
+ @(echo "define(NAME,\`.urem')define(NAME2,\`__urem')define(OP,\`rem')define(S,\`false')"; \
cat ${.ALLSRC}) | m4 > ${.TARGET}
@chmod 444 ${.TARGET}
diff --git a/sys/lib/libkern/arch/sparc/divrem.m4 b/sys/lib/libkern/arch/sparc/divrem.m4
index 4ee3a2d8243..5c9973bb963 100644
--- a/sys/lib/libkern/arch/sparc/divrem.m4
+++ b/sys/lib/libkern/arch/sparc/divrem.m4
@@ -1,4 +1,4 @@
-/* $OpenBSD: divrem.m4,v 1.2 1997/11/07 15:57:33 niklas Exp $ */
+/* $OpenBSD: divrem.m4,v 1.3 2000/02/22 19:27:19 deraadt Exp $ */
/* $NetBSD: divrem.m4,v 1.3 1995/04/22 09:37:39 pk Exp $ */
/*
@@ -49,7 +49,7 @@
#ifdef notdef
.asciz "@(#)divrem.m4 8.1 (Berkeley) 6/4/93"
#endif
- .asciz "$OpenBSD: divrem.m4,v 1.2 1997/11/07 15:57:33 niklas Exp $"
+ .asciz "$OpenBSD: divrem.m4,v 1.3 2000/02/22 19:27:19 deraadt Exp $"
#endif /* LIBC_SCCS and not lint */
/*
@@ -57,6 +57,7 @@
*
* m4 parameters:
* NAME name of function to generate
+ * NAME secondary name of function to generate
* OP OP=div => %o0 / %o1; OP=rem => %o0 % %o1
* S S=true => signed; S=false => unsigned
*
@@ -136,6 +137,8 @@ L.$1.eval(TWOSUPN+$2):
#include "DEFS.h"
#include <machine/trap.h>
+ .globl NAME2
+NAME2:
FUNC(NAME)
ifelse(S, `true',
` ! compute sign of result; if neither is negative, no problem