summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2013-01-05 11:20:57 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2013-01-05 11:20:57 +0000
commit34fe484bd1ebda2a0a3be6925defcca214148624 (patch)
treee109e53aac9f159240d7bd2f6d81eb65a3a3bd78 /lib
parent7d77ce8ae17a2d60c0c384747a1dfb8dabfca904 (diff)
Switch m88k ports to ELF.
Diffstat (limited to 'lib')
-rw-r--r--lib/csu/m88k/Makefile72
-rw-r--r--lib/csu/m88k/crt0.c83
-rw-r--r--lib/csu/m88k/md_init.h39
-rw-r--r--lib/libc/arch/m88k/SYS.h10
-rw-r--r--lib/libc/arch/m88k/gen/_setjmp.S112
-rw-r--r--lib/libc/arch/m88k/gen/fabs.S18
-rw-r--r--lib/libc/arch/m88k/gen/flt_rounds.c4
-rw-r--r--lib/libc/arch/m88k/gen/fpgetmask.c4
-rw-r--r--lib/libc/arch/m88k/gen/fpgetround.c4
-rw-r--r--lib/libc/arch/m88k/gen/fpgetsticky.c4
-rw-r--r--lib/libc/arch/m88k/gen/fpsetmask.c6
-rw-r--r--lib/libc/arch/m88k/gen/fpsetround.c6
-rw-r--r--lib/libc/arch/m88k/gen/fpsetsticky.c6
-rw-r--r--lib/libc/arch/m88k/gen/setjmp.S132
-rw-r--r--lib/libc/arch/m88k/gen/sigsetjmp.S140
-rw-r--r--lib/libc/arch/m88k/net/htonl.S4
-rw-r--r--lib/libc/arch/m88k/net/htons.S6
-rw-r--r--lib/libc/arch/m88k/net/ntohl.S4
-rw-r--r--lib/libc/arch/m88k/net/ntohs.S6
-rw-r--r--lib/libc/arch/m88k/sys/Ovfork.S10
-rw-r--r--lib/libc/arch/m88k/sys/brk.S30
-rw-r--r--lib/libc/arch/m88k/sys/cerror.S16
-rw-r--r--lib/libc/arch/m88k/sys/exect.S6
-rw-r--r--lib/libc/arch/m88k/sys/fork.S10
-rw-r--r--lib/libc/arch/m88k/sys/sbrk.S24
-rw-r--r--lib/libc/arch/m88k/sys/sigpending.S14
-rw-r--r--lib/libc/arch/m88k/sys/sigprocmask.S20
-rw-r--r--lib/libc/arch/m88k/sys/sigreturn.S4
-rw-r--r--lib/libc/arch/m88k/sys/sigsuspend.S12
-rw-r--r--lib/libc/arch/m88k/sys/syscall.S8
-rw-r--r--lib/libc/arch/m88k/sys/tfork_thread.S18
-rw-r--r--lib/libm/arch/m88k/fenv.c52
-rw-r--r--lib/librthread/arch/m88k/_atomic_lock.c4
-rw-r--r--lib/librthread/arch/m88k/cerror.S24
34 files changed, 497 insertions, 415 deletions
diff --git a/lib/csu/m88k/Makefile b/lib/csu/m88k/Makefile
index d6cac6be23c..67a803909ea 100644
--- a/lib/csu/m88k/Makefile
+++ b/lib/csu/m88k/Makefile
@@ -1,46 +1,64 @@
-# $OpenBSD: Makefile,v 1.3 2011/11/08 10:37:09 guenther Exp $
-# from: @(#)Makefile 5.5 (Berkeley) 5/21/91
+# $OpenBSD: Makefile,v 1.4 2013/01/05 11:20:55 miod Exp $
+# from: @(#)Makefile 8.1 (Berkeley) 6/1/93
-CFLAGS+= -I${.CURDIR}/..
-OBJS= crt0.o gcrt0.o scrt0.o
-SRCS= crt0.c
+OBJS= crt0.o gcrt0.o
+OBJS+= crtbegin.o crtend.o
+OBJS+= crtbeginS.o crtendS.o
+SRCS= crt0.c crtbegin.c crtbeginS.c crtend.c crtendS.c
-.if !defined(NOPIC)
-DYNAMIC = -DDYNAMIC
-.endif
+ELFDIR= ${.CURDIR}/../common_elf
+.PATH: ${ELFDIR}
+CFLAGS+= -I${ELFDIR} -I${.CURDIR}
+
+#PICFLAG= -fpic
+PICFLAG=
all: ${OBJS}
-crt0.o: ${SRCS}
- @echo "${COMPILE.c} -DCRT0 ${DYNAMIC} ${.CURDIR}/${SRCS} -o ${.TARGET}"
- @${COMPILE.c} -DCRT0 ${.CURDIR}/${SRCS} -o ${.TARGET}.o
- @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+crt0.o: crt0.c
+ @echo ${COMPILE.c} -DCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
+ @${COMPILE.c} -DCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}.o
+ @${LD} -x -r -o ${.TARGET} ${.TARGET}.o
+ @rm -f ${.TARGET}.o
+
+gcrt0.o: crt0.c
+ @echo ${COMPILE.c} -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}
+ @${COMPILE.c} -DMCRT0 ${.CURDIR}/crt0.c -o ${.TARGET}.o
+ @${LD} -x -r -o ${.TARGET} ${.TARGET}.o
+ @rm -f ${.TARGET}.o
+
+crtbegin.o: crtbegin.c
+ @echo ${COMPILE.c} ${ELFDIR}/crtbegin.c -o ${.TARGET}
+ @${COMPILE.c} ${ELFDIR}/crtbegin.c -o ${.TARGET}.o
+ @${LD} -x -r -o ${.TARGET} ${.TARGET}.o
+ @rm -f ${.TARGET}.o
+
+crtbeginS.o: crtbeginS.c
+ @echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbeginS.c -o ${.TARGET}
+ @${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtbeginS.c -o ${.TARGET}.o
+ @${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
-gcrt0.o: ${SRCS}
- @echo "${COMPILE.c} -DMCRT0 ${.CURDIR}/${SRCS} -o ${.TARGET}"
- @${COMPILE.c} -DMCRT0 ${.CURDIR}/${SRCS} -o ${.TARGET}.o
- @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+crtend.o: crtend.c
+ @echo ${COMPILE.c} ${ELFDIR}/crtend.c -o ${.TARGET}
+ @${COMPILE.c} ${ELFDIR}/crtend.c -o ${.TARGET}.o
+ @${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
-scrt0.o: ${SRCS}
- @echo "${COMPILE.c} -DSCRT0 ${.CURDIR}/${SRCS} -o ${.TARGET}"
- @${COMPILE.c} -DSCRT0 ${.CURDIR}/${SRCS} -o ${.TARGET}.o
- @${LD} -x -r ${.TARGET}.o -o ${.TARGET}
+crtendS.o: crtendS.c
+ @echo ${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtendS.c -o ${.TARGET}
+ @${COMPILE.c} ${PICFLAG} ${ELFDIR}/crtendS.c -o ${.TARGET}.o
+ @${LD} -x -r -o ${.TARGET} ${.TARGET}.o
@rm -f ${.TARGET}.o
realinstall:
${INSTALL} ${INSTALL_COPY} -S -o ${BINOWN} -g ${BINGRP} -m 444 ${OBJS} \
${DESTDIR}/usr/lib
-.if make(depend)
-CPPFLAGS+= -DDYNAMIC
-.endif
-
-afterdepend: .depend
+afterdepend:: .depend
@(TMP=/tmp/_depend$$$$; \
- sed -e 's/^\([^\.]*\).o[ ]*:/\1.o g\1.o s\1.o:/' \
- < .depend > $$TMP; \
+ sed -e 's/^\([^\.]*\).o[ ]*:/\1.o g\1.o:/' \
+ < .depend > $$TMP; \
mv $$TMP .depend)
.include <bsd.prog.mk>
diff --git a/lib/csu/m88k/crt0.c b/lib/csu/m88k/crt0.c
index fc4cc1ab4aa..58c42ed4fd1 100644
--- a/lib/csu/m88k/crt0.c
+++ b/lib/csu/m88k/crt0.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: crt0.c,v 1.9 2005/08/04 16:33:05 espie Exp $ */
+/* $OpenBSD: crt0.c,v 1.10 2013/01/05 11:20:55 miod Exp $ */
/*
* Mach Operating System
@@ -34,37 +34,53 @@
* the envp[] NULL-terminated array.
*/
+#include <sys/param.h>
#include <stdlib.h>
-#include "common.h"
+char **environ;
+char *__progname = "";
-struct kframe {
- int argc;
- char *argv[0];
-};
+char __progname_storage[NAME_MAX + 1];
+
+#ifdef MCRT0
+extern void monstartup(u_long, u_long);
+extern void _mcleanup(void);
+extern unsigned char _etext, _eprol;
+#endif /* MCRT0 */
+
+static inline char *_strrchr(const char *p, char ch);
__asm__ (
" .text\n"
-" .align 8\n"
-" .globl start\n"
-"start:\n"
-" br.n _start\n"
-" or r2, r31, r0\n"
+" .align 3\n"
+" .globl __start\n"
+" .globl _start\n"
+"__start:\n"
+"_start:\n"
+" or %r0, %r0, %r0\n" /* two nop because execution may */
+" or %r0, %r0, %r0\n" /* skip up to two instructions */
+ /* see setregs() in the kernel */
+ /* for details. */
+" ld %r2, %r31, 0\n" /* argc */
+" addu %r3, %r31, 4\n" /* argv */
+" lda %r4, %r3[%r2]\n"
+" br.n ___start\n"
+" addu %r4, %r4, 4\n" /* envp = argv + argc + 1 */
+/* cleanup is %r5, zeroed in setregs() at the moment */
);
static void
-start(struct kframe *kfp)
+___start(int argc, char **argv, char **envp, void (*cleanup)(void))
{
- char **argv, *ap, *s;
+ char *s;
- argv = &kfp->argv[0];
- environ = argv + kfp->argc + 1;
+ environ = envp;
- if (ap = argv[0]) {
- if ((__progname = _strrchr(ap, '/')) == NULL)
- __progname = ap;
+ if ((__progname = argv[0]) != NULL) { /* NULL ptr if argc = 0 */
+ if ((__progname = _strrchr(__progname, '/')) == NULL)
+ __progname = argv[0];
else
- ++__progname;
+ __progname++;
for (s = __progname_storage; *__progname &&
s < &__progname_storage[sizeof __progname_storage - 1]; )
*s++ = *__progname++;
@@ -72,23 +88,32 @@ start(struct kframe *kfp)
__progname = __progname_storage;
}
-__asm__ ("eprol:");
+ if (cleanup)
+ atexit(cleanup);
#ifdef MCRT0
atexit(_mcleanup);
- monstartup((u_long)&eprol, (u_long)&etext);
+ monstartup((u_long)&_eprol, (u_long)&_etext);
#endif
-__asm__ ("__callmain:"); /* Defined for the benefit of debuggers */
- exit(main(kfp->argc, argv, environ));
+ __init();
+
+ exit(main(argc, argv, environ));
}
-#include "common.c"
+static char *
+_strrchr(const char *p, char ch)
+{
+ char *save;
+
+ for (save = NULL;; ++p) {
+ if (*p == ch)
+ save = (char *)p;
+ if (!*p)
+ return(save);
+ }
+}
#ifdef MCRT0
-__asm__ ("\
- text\n\
- global _eprol\n\
-_eprol:\n\
-");
+asm("\t.text\n_eprol:\n");
#endif
diff --git a/lib/csu/m88k/md_init.h b/lib/csu/m88k/md_init.h
new file mode 100644
index 00000000000..76a4e2c9cf2
--- /dev/null
+++ b/lib/csu/m88k/md_init.h
@@ -0,0 +1,39 @@
+/* $OpenBSD: md_init.h,v 1.1 2013/01/05 11:20:55 miod Exp $ */
+
+/*
+ * Copyright (c) 2012 Miodrag Vallat.
+ *
+ * Permission to use, copy, modify, and distribute this software for any
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#define MD_SECT_CALL_FUNC(section, func) __asm ( \
+ "\t.section\t" #section ",\"ax\",@progbits\n" \
+ "\tbsr\t" #func "\n" \
+ "\t.previous")
+
+#define MD_SECTION_PROLOGUE(section, entry) __asm ( \
+ "\t.section\t" #section ",\"ax\",@progbits\n" \
+ "\t.globl\t" #entry "\n" \
+ "\t.type\t" #entry ",@function\n" \
+ "\t.align\t2\n" \
+ #entry ":\n" \
+ "\tsubu\t%r31, %r31, 16\n" \
+ "\tst\t%r1, %r31, 0\n" \
+ "\t.previous")
+
+#define MD_SECTION_EPILOGUE(section) __asm( \
+ "\t.section\t" #section ",\"ax\",@progbits\n" \
+ "\tld\t%r1, %r31, 0\n" \
+ "\tjmp.n\t%r1\n" \
+ "\taddu\t%r31, %r31, 16\n" \
+ "\t.previous")
diff --git a/lib/libc/arch/m88k/SYS.h b/lib/libc/arch/m88k/SYS.h
index 14cd26e5ab7..446c4c37d6f 100644
--- a/lib/libc/arch/m88k/SYS.h
+++ b/lib/libc/arch/m88k/SYS.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: SYS.h,v 1.12 2007/10/24 20:19:09 miod Exp $*/
+/* $OpenBSD: SYS.h,v 1.13 2013/01/05 11:20:55 miod Exp $*/
/*-
* Copyright (c) 1990 The Regents of the University of California.
* All rights reserved.
@@ -48,8 +48,8 @@
#endif
#define __DO_SYSCALL(x) \
- or r13,r0,__SYSCALLNAME(SYS_,x); \
- tb0 0, r0, 128
+ or %r13, %r0, __SYSCALLNAME(SYS_,x); \
+ tb0 0, %r0, 128
#define __SYSCALL__NOERROR(p,x,y) \
__ENTRY(p,x); \
@@ -62,11 +62,11 @@
#define __PSEUDO_NOERROR(p,x,y) \
__SYSCALL__NOERROR(p,x,y); \
- jmp r1
+ jmp %r1
#define __PSEUDO(p,x,y) \
__SYSCALL(p,x,y); \
- jmp r1
+ jmp %r1
/*
* System calls entry points are really named _thread_sys_{syscall},
diff --git a/lib/libc/arch/m88k/gen/_setjmp.S b/lib/libc/arch/m88k/gen/_setjmp.S
index 4e74b39fcb3..ffa1c78846e 100644
--- a/lib/libc/arch/m88k/gen/_setjmp.S
+++ b/lib/libc/arch/m88k/gen/_setjmp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: _setjmp.S,v 1.9 2012/08/12 17:14:39 miod Exp $ */
+/* $OpenBSD: _setjmp.S,v 1.10 2013/01/05 11:20:55 miod Exp $ */
/*-
* Copyright (c) 2002 Steve Murphree, Jr.
* All rights reserved.
@@ -55,68 +55,68 @@
int _setjmp(jmp_buf env);
*/
ENTRY(_setjmp)
- st r1, r2,0 /* save registers to the environment buffer */
- st r14,r2,8
- st r15,r2,12
- st r16,r2,16
- st r17,r2,20
- st r18,r2,24
- st r19,r2,28
- st r20,r2,32
- st r21,r2,36
- st r22,r2,40
- st r23,r2,44
- st r24,r2,48
- st r25,r2,52
- st r26,r2,56
- st r27,r2,60
- st r28,r2,64
- st r29,r2,68
- st r30,r2,72
- st r31,r2,76
- or r4,r0,U_SETJMP_SIG /* setjmp type to _setjmp */
- st r4,r2,80
- jmp.n r1
- or r2,r0,0 /* return 0 */
+ st %r1, %r2,0 /* save registers to the environment buffer */
+ st %r14,%r2,8
+ st %r15,%r2,12
+ st %r16,%r2,16
+ st %r17,%r2,20
+ st %r18,%r2,24
+ st %r19,%r2,28
+ st %r20,%r2,32
+ st %r21,%r2,36
+ st %r22,%r2,40
+ st %r23,%r2,44
+ st %r24,%r2,48
+ st %r25,%r2,52
+ st %r26,%r2,56
+ st %r27,%r2,60
+ st %r28,%r2,64
+ st %r29,%r2,68
+ st %r30,%r2,72
+ st %r31,%r2,76
+ or %r4,%r0,U_SETJMP_SIG /* setjmp type to _setjmp */
+ st %r4,%r2,80
+ jmp.n %r1
+ or %r2,%r0,0 /* return 0 */
/*
void _longjmp(jmp_buf env, int val);
*/
ENTRY(_longjmp)
- bcnd eq0,r2,2f /* check for bad environment buffer address. */
- ld r4,r2,80 /* check setjmp type. */
- cmp r4,r4,U_SETJMP_SIG /* should be U_SETJMP_SIG */
- bb1 ne,r4,2f /* if != U_SETJMP_SIG, abort. */
+ bcnd eq0,%r2,2f /* check for bad environment buffer address. */
+ ld %r4,%r2,80 /* check setjmp type. */
+ cmp %r4,%r4,U_SETJMP_SIG /* should be U_SETJMP_SIG */
+ bb1 ne,%r4,2f /* if != U_SETJMP_SIG, abort. */
- ld r14,r2,8 /* restore registers from the environment buffer */
- ld r15,r2,12
- ld r16,r2,16
- ld r17,r2,20
- ld r18,r2,24
- ld r19,r2,28
- ld r20,r2,32
- ld r21,r2,36
- ld r22,r2,40
- ld r23,r2,44
- ld r24,r2,48
- ld r25,r2,52
- ld r26,r2,56
- ld r27,r2,60
- ld r28,r2,64
- ld r29,r2,68
- ld r30,r2,72
- ld r31,r2,76
- ld r1,r2,0 /* restore r1 */
- bcnd.n ne0,r3,1f
- or r2,r3,r0
- or r2,r0,1 /* never return zero! */
-1: jmp r1
+ ld %r14,%r2,8 /* restore registers from the environment buffer */
+ ld %r15,%r2,12
+ ld %r16,%r2,16
+ ld %r17,%r2,20
+ ld %r18,%r2,24
+ ld %r19,%r2,28
+ ld %r20,%r2,32
+ ld %r21,%r2,36
+ ld %r22,%r2,40
+ ld %r23,%r2,44
+ ld %r24,%r2,48
+ ld %r25,%r2,52
+ ld %r26,%r2,56
+ ld %r27,%r2,60
+ ld %r28,%r2,64
+ ld %r29,%r2,68
+ ld %r30,%r2,72
+ ld %r31,%r2,76
+ ld %r1,%r2,0 /* restore r1 */
+ bcnd.n ne0,%r3,1f
+ or %r2,%r3,%r0
+ or %r2,%r0,1 /* never return zero! */
+1: jmp %r1
-2: subu r31,r31,16 /* get a temporary stack */
- st r1,r31,0 /* save r1 on stack (return address) */
+2: subu %r31,%r31,16 /* get a temporary stack */
+ st %r1,%r31,0 /* save r1 on stack (return address) */
bsr _C_LABEL(longjmperror)
bsr _C_LABEL(abort) /* NO RETURN */
- ld r1,r31,0 /* restore r1 from stack */
- jmp.n r1 /* this should not happen but we are prepared */
- addu r31,r31,16 /* restore the stack */
+ ld %r1,%r31,0 /* restore r1 from stack */
+ jmp.n %r1 /* this should not happen but we are prepared */
+ addu %r31,%r31,16 /* restore the stack */
diff --git a/lib/libc/arch/m88k/gen/fabs.S b/lib/libc/arch/m88k/gen/fabs.S
index 68fe00a9392..df9183adcbe 100644
--- a/lib/libc/arch/m88k/gen/fabs.S
+++ b/lib/libc/arch/m88k/gen/fabs.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: fabs.S,v 1.9 2011/07/08 22:28:33 martynas Exp $ */
+/* $OpenBSD: fabs.S,v 1.10 2013/01/05 11:20:55 miod Exp $ */
/*-
* Copyright (c) 1996 Nivas Madhur
* All rights reserved.
@@ -36,11 +36,11 @@
*/
ENTRY(fabs)
- subu r31,r31,16
- st.d r2,r31,0
- ld.bu r4,r31,0
- mask r4,r4,0x7f /* set sign bit to 0 */
- st.b r4,r31,0
- ld.d r2,r31,0
- jmp.n r1
- addu r31,r31,16
+ subu %r31,%r31,16
+ st.d %r2,%r31,0
+ ld.bu %r4,%r31,0
+ mask %r4,%r4,0x7f /* set sign bit to 0 */
+ st.b %r4,%r31,0
+ ld.d %r2,%r31,0
+ jmp.n %r1
+ addu %r31,%r31,16
diff --git a/lib/libc/arch/m88k/gen/flt_rounds.c b/lib/libc/arch/m88k/gen/flt_rounds.c
index 3f5e3231e04..c7dd499f27a 100644
--- a/lib/libc/arch/m88k/gen/flt_rounds.c
+++ b/lib/libc/arch/m88k/gen/flt_rounds.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: flt_rounds.c,v 1.4 2012/06/25 17:01:11 deraadt Exp $ */
+/* $OpenBSD: flt_rounds.c,v 1.5 2013/01/05 11:20:55 miod Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
@@ -24,6 +24,6 @@ __flt_rounds()
{
int x;
- __asm__("fldcr %0,fcr63" : "=r" (x));
+ __asm__("fldcr %0, %%fcr63" : "=r" (x));
return map[(x >> 14) & 0x03];
}
diff --git a/lib/libc/arch/m88k/gen/fpgetmask.c b/lib/libc/arch/m88k/gen/fpgetmask.c
index 5dc62b456e3..700831361b5 100644
--- a/lib/libc/arch/m88k/gen/fpgetmask.c
+++ b/lib/libc/arch/m88k/gen/fpgetmask.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fpgetmask.c,v 1.3 2005/08/07 16:40:14 espie Exp $ */
+/* $OpenBSD: fpgetmask.c,v 1.4 2013/01/05 11:20:55 miod Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
@@ -13,6 +13,6 @@ fpgetmask()
{
int x;
- __asm__ volatile ("fldcr %0,fcr63" : "=r" (x));
+ __asm__ volatile ("fldcr %0, %%fcr63" : "=r" (x));
return (x & 0x1f);
}
diff --git a/lib/libc/arch/m88k/gen/fpgetround.c b/lib/libc/arch/m88k/gen/fpgetround.c
index 4a95df6b7d3..ca59bb78ac7 100644
--- a/lib/libc/arch/m88k/gen/fpgetround.c
+++ b/lib/libc/arch/m88k/gen/fpgetround.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fpgetround.c,v 1.3 2005/08/07 16:40:14 espie Exp $ */
+/* $OpenBSD: fpgetround.c,v 1.4 2013/01/05 11:20:55 miod Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
@@ -13,6 +13,6 @@ fpgetround()
{
int x;
- __asm__ volatile ("fldcr %0, fcr63" : "=r" (x));
+ __asm__ volatile ("fldcr %0, %%fcr63" : "=r" (x));
return (x >> 14) & 0x03;
}
diff --git a/lib/libc/arch/m88k/gen/fpgetsticky.c b/lib/libc/arch/m88k/gen/fpgetsticky.c
index 05258e4b8e0..ae92201c48b 100644
--- a/lib/libc/arch/m88k/gen/fpgetsticky.c
+++ b/lib/libc/arch/m88k/gen/fpgetsticky.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fpgetsticky.c,v 1.3 2005/08/07 16:40:14 espie Exp $ */
+/* $OpenBSD: fpgetsticky.c,v 1.4 2013/01/05 11:20:55 miod Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
@@ -13,6 +13,6 @@ fpgetsticky()
{
int x;
- __asm__ volatile("fldcr %0,fcr62" : "=r" (x));
+ __asm__ volatile("fldcr %0, %%fcr62" : "=r" (x));
return x & 0x1f;
}
diff --git a/lib/libc/arch/m88k/gen/fpsetmask.c b/lib/libc/arch/m88k/gen/fpsetmask.c
index 03b7164052e..0f054ae4928 100644
--- a/lib/libc/arch/m88k/gen/fpsetmask.c
+++ b/lib/libc/arch/m88k/gen/fpsetmask.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fpsetmask.c,v 1.3 2005/08/07 16:40:14 espie Exp $ */
+/* $OpenBSD: fpsetmask.c,v 1.4 2013/01/05 11:20:55 miod Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
@@ -15,13 +15,13 @@ fpsetmask(mask)
fp_except old;
fp_except new;
- __asm__ volatile("fldcr %0,fcr63" : "=r" (old));
+ __asm__ volatile("fldcr %0, %%fcr63" : "=r" (old));
new = old;
new &= ~0x1f; /* clear bottom 5 bits and */
new |= (mask & 0x1f); /* set them to mask */
- __asm__ volatile("fstcr %0,fcr63" : : "r" (new));
+ __asm__ volatile("fstcr %0, %%fcr63" : : "r" (new));
return (old & 0x1f);
}
diff --git a/lib/libc/arch/m88k/gen/fpsetround.c b/lib/libc/arch/m88k/gen/fpsetround.c
index 7acbf0c57a8..c9401c999e6 100644
--- a/lib/libc/arch/m88k/gen/fpsetround.c
+++ b/lib/libc/arch/m88k/gen/fpsetround.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fpsetround.c,v 1.3 2005/08/07 16:40:14 espie Exp $ */
+/* $OpenBSD: fpsetround.c,v 1.4 2013/01/05 11:20:55 miod Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
@@ -15,13 +15,13 @@ fpsetround(rnd_dir)
fp_rnd old;
fp_rnd new;
- __asm__ volatile("fldcr %0,fcr63" : "=r" (old));
+ __asm__ volatile("fldcr %0, %%fcr63" : "=r" (old));
new = old;
new &= ~(0x03 << 14); /* clear old value */
new |= ((rnd_dir & 0x03) << 14);/* and set new one */
- __asm__ volatile("fstcr %0,fcr63" : : "r" (new));
+ __asm__ volatile("fstcr %0, %%fcr63" : : "r" (new));
return (old >> 14) & 0x03;
}
diff --git a/lib/libc/arch/m88k/gen/fpsetsticky.c b/lib/libc/arch/m88k/gen/fpsetsticky.c
index c225d569905..ccce67e209a 100644
--- a/lib/libc/arch/m88k/gen/fpsetsticky.c
+++ b/lib/libc/arch/m88k/gen/fpsetsticky.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fpsetsticky.c,v 1.3 2005/08/07 16:40:14 espie Exp $ */
+/* $OpenBSD: fpsetsticky.c,v 1.4 2013/01/05 11:20:55 miod Exp $ */
/*
* Written by J.T. Conklin, Apr 10, 1995
@@ -15,13 +15,13 @@ fpsetsticky(sticky)
fp_except old;
fp_except new;
- __asm__ volatile("fldcr %0,fcr62" : "=r" (old));
+ __asm__ volatile("fldcr %0, %%fcr62" : "=r" (old));
new = old;
new &= ~(0x1f);
new |= (sticky & 0x1f);
- __asm__ volatile("fstcr %0,fcr62" : : "r" (new));
+ __asm__ volatile("fstcr %0, %%fcr62" : : "r" (new));
return (old & 0x1f);
}
diff --git a/lib/libc/arch/m88k/gen/setjmp.S b/lib/libc/arch/m88k/gen/setjmp.S
index e5f145f57de..541cb8b5f4a 100644
--- a/lib/libc/arch/m88k/gen/setjmp.S
+++ b/lib/libc/arch/m88k/gen/setjmp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: setjmp.S,v 1.10 2012/08/12 17:14:39 miod Exp $ */
+/* $OpenBSD: setjmp.S,v 1.11 2013/01/05 11:20:55 miod Exp $ */
/*-
* Copyright (c) 2002 Steve Murphree, Jr.
* All rights reserved.
@@ -54,80 +54,80 @@
int setjmp(jmp_buf env);
*/
ENTRY(setjmp)
- st r1, r2,0 /* save registers to the environment buffer */
- st r14,r2,8
- st r15,r2,12
- st r16,r2,16
- st r17,r2,20
- st r18,r2,24
- st r19,r2,28
- st r20,r2,32
- st r21,r2,36
- st r22,r2,40
- st r23,r2,44
- st r24,r2,48
- st r25,r2,52
- st r26,r2,56
- st r27,r2,60
- st r28,r2,64
- st r29,r2,68
- st r30,r2,72
- st r31,r2,76
- or r4,r0,SETJMP_SIG /* r4 now contains setjmp type */
- st r4,r2,80 /* setjmp type to _setjmp */
- or r14,r2,0 /* store address of env in r14 */
+ st %r1, %r2,0 /* save registers to the environment buffer */
+ st %r14,%r2,8
+ st %r15,%r2,12
+ st %r16,%r2,16
+ st %r17,%r2,20
+ st %r18,%r2,24
+ st %r19,%r2,28
+ st %r20,%r2,32
+ st %r21,%r2,36
+ st %r22,%r2,40
+ st %r23,%r2,44
+ st %r24,%r2,48
+ st %r25,%r2,52
+ st %r26,%r2,56
+ st %r27,%r2,60
+ st %r28,%r2,64
+ st %r29,%r2,68
+ st %r30,%r2,72
+ st %r31,%r2,76
+ or %r4,%r0,SETJMP_SIG /* r4 now contains setjmp type */
+ st %r4,%r2,80 /* setjmp type to _setjmp */
+ or %r14,%r2,0 /* store address of env in r14 */
bsr.n _C_LABEL(sigblock) /* r2 = sigblock(0) */
- or r2,r0,0
- st r2,r14,4 /* save signal set in offset 4 of env */
- ld r1,r14,0
- ld r14,r14,8
- jmp.n r1 /* return 0 */
- or r2,r0,0
+ or %r2,%r0,0
+ st %r2,%r14,4 /* save signal set in offset 4 of env */
+ ld %r1,%r14,0
+ ld %r14,%r14,8
+ jmp.n %r1 /* return 0 */
+ or %r2,%r0,0
/*
void longjmp(jmp_buf env, int retval);
*/
ENTRY(longjmp)
- bcnd eq0,r2,2f /* check for bad environment buffer address. */
- ld r4,r2,80 /* check setjmp type. */
- cmp r4,r4,SETJMP_SIG /* should be SETJMP_SIG */
- bb1 ne,r4,2f /* if != SETJMP_SIG, abort. */
+ bcnd eq0,%r2,2f /* check for bad environment buffer address. */
+ ld %r4,%r2,80 /* check setjmp type. */
+ cmp %r4,%r4,SETJMP_SIG /* should be SETJMP_SIG */
+ bb1 ne,%r4,2f /* if != SETJMP_SIG, abort. */
- ld r14,r2,8 /* restore registers from the environment buffer */
- ld r15,r2,12
- ld r16,r2,16
- ld r17,r2,20
- ld r18,r2,24
- ld r19,r2,28
- ld r20,r2,32
- ld r21,r2,36
- ld r22,r2,40
- ld r23,r2,44
- ld r24,r2,48
- ld r25,r2,52
- ld r26,r2,56
- ld r27,r2,60
- ld r28,r2,64
- ld r29,r2,68
- ld r30,r2,72
- ld r31,r2,76
+ ld %r14,%r2,8 /* restore registers from the environment buffer */
+ ld %r15,%r2,12
+ ld %r16,%r2,16
+ ld %r17,%r2,20
+ ld %r18,%r2,24
+ ld %r19,%r2,28
+ ld %r20,%r2,32
+ ld %r21,%r2,36
+ ld %r22,%r2,40
+ ld %r23,%r2,44
+ ld %r24,%r2,48
+ ld %r25,%r2,52
+ ld %r26,%r2,56
+ ld %r27,%r2,60
+ ld %r28,%r2,64
+ ld %r29,%r2,68
+ ld %r30,%r2,72
+ ld %r31,%r2,76
- subu r31,r31,16 /* get a temporary stack */
- st.d r2,r31,0 /* save r2 and r3 on stack (env + return val) */
+ subu %r31,%r31,16 /* get a temporary stack */
+ st.d %r2,%r31,0 /* save r2 and r3 on stack (env + return val) */
bsr.n _C_LABEL(sigsetmask) /* restore the signal set */
- ld r2,r2,4
- ld.d r2,r31,0 /* restore r2 and r3 */
- addu r31,r31,16
- ld r1,r2,0 /* restore r1 */
- bcnd.n ne0,r3,1f
- or r2,r3,r0
- or r2,r0,1 /* never return zero! */
-1: jmp r1
+ ld %r2,%r2,4
+ ld.d %r2,%r31,0 /* restore r2 and r3 */
+ addu %r31,%r31,16
+ ld %r1,%r2,0 /* restore r1 */
+ bcnd.n ne0,%r3,1f
+ or %r2,%r3,%r0
+ or %r2,%r0,1 /* never return zero! */
+1: jmp %r1
-2: subu r31,r31,16 /* get a temporary stack */
- st r1,r31,0 /* save r1 on stack (return address) */
+2: subu %r31,%r31,16 /* get a temporary stack */
+ st %r1,%r31,0 /* save r1 on stack (return address) */
bsr _C_LABEL(longjmperror)
bsr _C_LABEL(abort) /* NO RETURN */
- ld r1,r31,0 /* restore r1 from stack */
- jmp.n r1 /* this should not happen but we are prepared */
- addu r31,r31,16 /* restore the stack */
+ ld %r1,%r31,0 /* restore r1 from stack */
+ jmp.n %r1 /* this should not happen but we are prepared */
+ addu %r31,%r31,16 /* restore the stack */
diff --git a/lib/libc/arch/m88k/gen/sigsetjmp.S b/lib/libc/arch/m88k/gen/sigsetjmp.S
index 019e149a905..d9bdf79324c 100644
--- a/lib/libc/arch/m88k/gen/sigsetjmp.S
+++ b/lib/libc/arch/m88k/gen/sigsetjmp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: sigsetjmp.S,v 1.11 2012/08/12 17:14:39 miod Exp $ */
+/* $OpenBSD: sigsetjmp.S,v 1.12 2013/01/05 11:20:55 miod Exp $ */
/*-
* Copyright (c) 2002 Steve Murphree, Jr.
* All rights reserved.
@@ -56,87 +56,87 @@
int sigsetjmp(sigjmp_buf env, int savemask);
*/
ENTRY(sigsetjmp)
- st r1, r2,0 /* save registers to the environment buffer */
- st r14,r2,8
- st r15,r2,12
- st r16,r2,16
- st r17,r2,20
- st r18,r2,24
- st r19,r2,28
- st r20,r2,32
- st r21,r2,36
- st r22,r2,40
- st r23,r2,44
- st r24,r2,48
- st r25,r2,52
- st r26,r2,56
- st r27,r2,60
- st r28,r2,64
- st r29,r2,68
- st r30,r2,72
- st r31,r2,76
- or r4,r0,SIGSETJMP_SIG /* r4 now contains setjmp type */
- st r4,r2,80 /* setjmp type to _setjmp */
- bcnd.n eq0,r3,1f /* skip signal stuff if savemask == 0 */
- st r3,r2,84 /* save `savemask' value */
- or r14,r2,0 /* store address of env in r14 */
+ st %r1, %r2,0 /* save registers to the environment buffer */
+ st %r14,%r2,8
+ st %r15,%r2,12
+ st %r16,%r2,16
+ st %r17,%r2,20
+ st %r18,%r2,24
+ st %r19,%r2,28
+ st %r20,%r2,32
+ st %r21,%r2,36
+ st %r22,%r2,40
+ st %r23,%r2,44
+ st %r24,%r2,48
+ st %r25,%r2,52
+ st %r26,%r2,56
+ st %r27,%r2,60
+ st %r28,%r2,64
+ st %r29,%r2,68
+ st %r30,%r2,72
+ st %r31,%r2,76
+ or %r4,%r0,SIGSETJMP_SIG /* r4 now contains setjmp type */
+ st %r4,%r2,80 /* setjmp type to _setjmp */
+ bcnd.n eq0,%r3,1f /* skip signal stuff if savemask == 0 */
+ st %r3,%r2,84 /* save `savemask' value */
+ or %r14,%r2,0 /* store address of env in r14 */
bsr.n _C_LABEL(sigblock) /* r2 = sigblock(0) */
- or r2,r0,r0
- st r2,r14,4 /* save signal set in offset 4 of env */
- ld r1,r14,0
- ld r14,r14,8
+ or %r2,%r0,%r0
+ st %r2,%r14,4 /* save signal set in offset 4 of env */
+ ld %r1,%r14,0
+ ld %r14,%r14,8
1:
- jmp.n r1 /* return 0 */
- or r2,r0,0
+ jmp.n %r1 /* return 0 */
+ or %r2,%r0,0
/*
void siglongjmp(sigjmp_buf env, int val);
*/
ENTRY(siglongjmp)
- bcnd eq0,r2,2f /* check for bad environment buffer address. */
- ld r4,r2,80 /* check setjmp type. */
- cmp r4,r4,SIGSETJMP_SIG /* should be SIGSETJMP_SIG */
- bb1 ne,r4,2f /* if != SIGSETJMP_SIG, abort. */
+ bcnd eq0,%r2,2f /* check for bad environment buffer address. */
+ ld %r4,%r2,80 /* check setjmp type. */
+ cmp %r4,%r4,SIGSETJMP_SIG /* should be SIGSETJMP_SIG */
+ bb1 ne,%r4,2f /* if != SIGSETJMP_SIG, abort. */
- ld r14,r2,8 /* restore registers from the environment buffer */
- ld r15,r2,12
- ld r16,r2,16
- ld r17,r2,20
- ld r18,r2,24
- ld r19,r2,28
- ld r20,r2,32
- ld r21,r2,36
- ld r22,r2,40
- ld r23,r2,44
- ld r24,r2,48
- ld r25,r2,52
- ld r26,r2,56
- ld r27,r2,60
- ld r28,r2,64
- ld r29,r2,68
- ld r30,r2,72
- ld r4,r2,84 /* get `savemask' value */
- bcnd.n eq0,r4,1f
- ld r31,r2,76
+ ld %r14,%r2,8 /* restore registers from the environment buffer */
+ ld %r15,%r2,12
+ ld %r16,%r2,16
+ ld %r17,%r2,20
+ ld %r18,%r2,24
+ ld %r19,%r2,28
+ ld %r20,%r2,32
+ ld %r21,%r2,36
+ ld %r22,%r2,40
+ ld %r23,%r2,44
+ ld %r24,%r2,48
+ ld %r25,%r2,52
+ ld %r26,%r2,56
+ ld %r27,%r2,60
+ ld %r28,%r2,64
+ ld %r29,%r2,68
+ ld %r30,%r2,72
+ ld %r4,%r2,84 /* get `savemask' value */
+ bcnd.n eq0,%r4,1f
+ ld %r31,%r2,76
- subu r31,r31,16 /* get a temporary stack */
- st.d r2,r31,0 /* save r2 and r3 on stack (env + return val) */
+ subu %r31,%r31,16 /* get a temporary stack */
+ st.d %r2,%r31,0 /* save r2 and r3 on stack (env + return val) */
bsr.n _C_LABEL(sigsetmask) /* restore the signal set */
- ld r2,r2,4
- ld.d r2,r31,0 /* restore r2 and r3 from stack */
- addu r31,r31,16
+ ld %r2,%r2,4
+ ld.d %r2,%r31,0 /* restore r2 and r3 from stack */
+ addu %r31,%r31,16
1:
- bcnd.n ne0,r3,1f
- ld r1,r2,0 /* restore r1 */
- or r3,r0,1 /* never return zero! */
+ bcnd.n ne0,%r3,1f
+ ld %r1,%r2,0 /* restore r1 */
+ or %r3,%r0,1 /* never return zero! */
1:
- jmp.n r1
- or r2,r3,r0
+ jmp.n %r1
+ or %r2,%r3,%r0
-2: subu r31,r31,16 /* get a temporary stack */
- st r1,r31,0 /* save r1 on stack (return address) */
+2: subu %r31,%r31,16 /* get a temporary stack */
+ st %r1,%r31,0 /* save r1 on stack (return address) */
bsr _C_LABEL(longjmperror)
bsr _C_LABEL(abort) /* NO RETURN */
- ld r1,r31,0 /* restore r1 from stack */
- jmp.n r1 /* this should not happen but we are prepared */
- addu r31,r31,16 /* restore the stack */
+ ld %r1,%r31,0 /* restore r1 from stack */
+ jmp.n %r1 /* this should not happen but we are prepared */
+ addu %r31,%r31,16 /* restore the stack */
diff --git a/lib/libc/arch/m88k/net/htonl.S b/lib/libc/arch/m88k/net/htonl.S
index 75673242c25..a2d2d68f2b2 100644
--- a/lib/libc/arch/m88k/net/htonl.S
+++ b/lib/libc/arch/m88k/net/htonl.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: htonl.S,v 1.5 2009/10/28 06:49:55 deraadt Exp $ */
+/* $OpenBSD: htonl.S,v 1.6 2013/01/05 11:20:55 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -38,4 +38,4 @@
/* netorder = htonl(hostorder) */
ENTRY(htonl)
- jmp r1
+ jmp %r1
diff --git a/lib/libc/arch/m88k/net/htons.S b/lib/libc/arch/m88k/net/htons.S
index 4a7b73d3c87..065f9023f29 100644
--- a/lib/libc/arch/m88k/net/htons.S
+++ b/lib/libc/arch/m88k/net/htons.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: htons.S,v 1.5 2009/10/28 06:49:55 deraadt Exp $ */
+/* $OpenBSD: htons.S,v 1.6 2013/01/05 11:20:55 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -38,5 +38,5 @@
/* hostorder = htons(netorder) */
ENTRY(htons)
- jmp.n r1
- clr r2,r2,16<16> /* clear the top 16 bits */
+ jmp.n %r1
+ clr %r2,%r2,16<16> /* clear the top 16 bits */
diff --git a/lib/libc/arch/m88k/net/ntohl.S b/lib/libc/arch/m88k/net/ntohl.S
index fdce914ea88..565f4b2742a 100644
--- a/lib/libc/arch/m88k/net/ntohl.S
+++ b/lib/libc/arch/m88k/net/ntohl.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntohl.S,v 1.5 2009/10/28 06:49:55 deraadt Exp $ */
+/* $OpenBSD: ntohl.S,v 1.6 2013/01/05 11:20:55 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -38,4 +38,4 @@
/* hostorder = ntohl(netorder) */
ENTRY(ntohl)
- jmp r1
+ jmp %r1
diff --git a/lib/libc/arch/m88k/net/ntohs.S b/lib/libc/arch/m88k/net/ntohs.S
index f95ed704cc3..ba86f9ce228 100644
--- a/lib/libc/arch/m88k/net/ntohs.S
+++ b/lib/libc/arch/m88k/net/ntohs.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntohs.S,v 1.5 2009/10/28 06:49:55 deraadt Exp $ */
+/* $OpenBSD: ntohs.S,v 1.6 2013/01/05 11:20:55 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -38,5 +38,5 @@
/* hostorder = ntohs(netorder) */
ENTRY(ntohs)
- jmp.n r1
- clr r2,r2,16<16> /* clear the top 16 bits */
+ jmp.n %r1
+ clr %r2,%r2,16<16> /* clear the top 16 bits */
diff --git a/lib/libc/arch/m88k/sys/Ovfork.S b/lib/libc/arch/m88k/sys/Ovfork.S
index d6e907e33b9..c51f626640f 100644
--- a/lib/libc/arch/m88k/sys/Ovfork.S
+++ b/lib/libc/arch/m88k/sys/Ovfork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: Ovfork.S,v 1.7 2005/08/07 16:40:15 espie Exp $ */
+/* $OpenBSD: Ovfork.S,v 1.8 2013/01/05 11:20:55 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -38,8 +38,8 @@
/* r2 = pid. r3 = 0 in parent, 1 in child */
SYSCALL(vfork)
- bcnd eq0,r3,parent
- or r2,r0,0
- or r3,r0,0
+ bcnd eq0,%r3,parent
+ or %r2,%r0,0
+ or %r3,%r0,0
parent:
- jmp r1 /* pid = vfork() */
+ jmp %r1 /* pid = vfork() */
diff --git a/lib/libc/arch/m88k/sys/brk.S b/lib/libc/arch/m88k/sys/brk.S
index dc4d353f2c8..59c55b18b88 100644
--- a/lib/libc/arch/m88k/sys/brk.S
+++ b/lib/libc/arch/m88k/sys/brk.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: brk.S,v 1.8 2005/08/07 16:40:15 espie Exp $ */
+/* $OpenBSD: brk.S,v 1.9 2013/01/05 11:20:55 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -40,22 +40,22 @@
.data
.align 8
-ASGLOBAL(minbrk)
+ASGLOBAL(__minbrk)
.long _end
ENTRY(brk)
- or.u r5,r0,hi16(minbrk)
- ld r5,r5,lo16(minbrk)
- cmp r3,r5,r2
- bb1 ls,r3,1f /* r2 should be > minbrk; can't go below end */
- or r2,r5,0 /* otherwise, set r2 to minbrk */
+ or.u %r5,%r0,%hi16(__minbrk)
+ ld %r5,%r5,%lo16(__minbrk)
+ cmp %r3,%r5,%r2
+ bb1 ls,%r3,1f /* r2 should be > minbrk; can't go below end */
+ or %r2,%r5,0 /* otherwise, set r2 to minbrk */
1:
- or r4,r2,0
- or r13,r0,__SYSCALLNAME(SYS_,break)
- tb0 0,r0,128
+ or %r4,%r2,0
+ or %r13,%r0,__SYSCALLNAME(SYS_,break)
+ tb0 0,%r0,128
br __cerror
- or.u r5,r0,hi16(__curbrk)
- st r4,r5,lo16(__curbrk)
- or r2,r0,0 /* clear r2/r3 to indicate success */
- jmp.n r1
- or r3,r0,0
+ or.u %r5,%r0,%hi16(__curbrk)
+ st %r4,%r5,%lo16(__curbrk)
+ or %r2,%r0,0 /* clear r2/r3 to indicate success */
+ jmp.n %r1
+ or %r3,%r0,0
diff --git a/lib/libc/arch/m88k/sys/cerror.S b/lib/libc/arch/m88k/sys/cerror.S
index 4594b4ed259..eefe97e5100 100644
--- a/lib/libc/arch/m88k/sys/cerror.S
+++ b/lib/libc/arch/m88k/sys/cerror.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: cerror.S,v 1.9 2011/04/09 15:45:17 deraadt Exp $ */
+/* $OpenBSD: cerror.S,v 1.10 2013/01/05 11:20:55 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -35,12 +35,12 @@
#include "SYS.h"
-WEAK_ALIAS(_cerror,__cerror)
+WEAK_ALIAS(__cerror,___cerror)
- .globl _errno
+ .globl _C_LABEL(errno)
ENTRY(__cerror)
- or.u r4,r0,hi16(_errno)
- st r2,r4,lo16(_errno)
- sub r2,r0,0x1
- jmp.n r1
- sub r3,r0,0x1
+ or.u %r4,%r0,%hi16(_C_LABEL(errno))
+ st %r2,%r4,%lo16(_C_LABEL(errno))
+ sub %r2,%r0,0x1
+ jmp.n %r1
+ sub %r3,%r0,0x1
diff --git a/lib/libc/arch/m88k/sys/exect.S b/lib/libc/arch/m88k/sys/exect.S
index 5824bb4bb15..9c1ae2310e6 100644
--- a/lib/libc/arch/m88k/sys/exect.S
+++ b/lib/libc/arch/m88k/sys/exect.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: exect.S,v 1.6 2005/08/07 16:40:15 espie Exp $ */
+/* $OpenBSD: exect.S,v 1.7 2013/01/05 11:20:55 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -36,6 +36,6 @@
#include "SYS.h"
ENTRY(exect)
- or r13,r0,SYS_execve
- tb0 0,r0,128 /* exect(file, argv, env) */
+ or %r13,%r0,SYS_execve
+ tb0 0,%r0,128 /* exect(file, argv, env) */
br __cerror
diff --git a/lib/libc/arch/m88k/sys/fork.S b/lib/libc/arch/m88k/sys/fork.S
index 201ac4f0bd8..79252bae23a 100644
--- a/lib/libc/arch/m88k/sys/fork.S
+++ b/lib/libc/arch/m88k/sys/fork.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: fork.S,v 1.5 2005/08/07 16:40:15 espie Exp $ */
+/* $OpenBSD: fork.S,v 1.6 2013/01/05 11:20:55 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -38,8 +38,8 @@
/* r2 = pid. r3 = 0 in parent, 1 in child */
SYSCALL(fork)
- bcnd eq0,r3,parent
- or r2,r0,0
- or r3,r0,0
+ bcnd eq0,%r3,parent
+ or %r2,%r0,0
+ or %r3,%r0,0
parent:
- jmp r1 /* pid = fork() */
+ jmp %r1 /* pid = fork() */
diff --git a/lib/libc/arch/m88k/sys/sbrk.S b/lib/libc/arch/m88k/sys/sbrk.S
index 180123f0172..2dd6fd9cb27 100644
--- a/lib/libc/arch/m88k/sys/sbrk.S
+++ b/lib/libc/arch/m88k/sys/sbrk.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: sbrk.S,v 1.8 2005/08/07 16:40:15 espie Exp $ */
+/* $OpenBSD: sbrk.S,v 1.9 2013/01/05 11:20:55 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -45,18 +45,18 @@ __curbrk:
.text
ENTRY(sbrk)
- or.u r5,r0,hi16(__curbrk)
- ld r5,r5,lo16(__curbrk)
- add r2,r2,r5
- or r4,r2,0
- or r13,r0,SYS_break
- tb0 0,r0,128
+ or.u %r5,%r0,%hi16(__curbrk)
+ ld %r5,%r5,%lo16(__curbrk)
+ add %r2,%r2,%r5
+ or %r4,%r2,0
+ or %r13,%r0,SYS_break
+ tb0 0,%r0,128
br __cerror
/* Save old __curbrk */
- or.u r5,r0,hi16(__curbrk)
- ld r2,r5,lo16(__curbrk)
+ or.u %r5,%r0,%hi16(__curbrk)
+ ld %r2,%r5,%lo16(__curbrk)
/* Update __curbrk */
- st r4,r5,lo16(__curbrk)
+ st %r4,%r5,%lo16(__curbrk)
/* and return old __curbrk */
- jmp.n r1
- or r3,r0,0
+ jmp.n %r1
+ or %r3,%r0,0
diff --git a/lib/libc/arch/m88k/sys/sigpending.S b/lib/libc/arch/m88k/sys/sigpending.S
index e3fb1f94397..e2746e39ada 100644
--- a/lib/libc/arch/m88k/sys/sigpending.S
+++ b/lib/libc/arch/m88k/sys/sigpending.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: sigpending.S,v 1.6 2005/08/07 16:40:15 espie Exp $ */
+/* $OpenBSD: sigpending.S,v 1.7 2013/01/05 11:20:55 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -36,10 +36,10 @@
#include "SYS.h"
ENTRY(sigpending)
- or r4,r2,0 /* save r2 */
- or r13,r0,SYS_sigpending
- tb0 0,r0,128
+ or %r4,%r2,0 /* save r2 */
+ or %r13,%r0,SYS_sigpending
+ tb0 0,%r0,128
br __cerror
- st r2,r4,0
- jmp.n r1
- or r2,r0,0
+ st %r2,%r4,0
+ jmp.n %r1
+ or %r2,%r0,0
diff --git a/lib/libc/arch/m88k/sys/sigprocmask.S b/lib/libc/arch/m88k/sys/sigprocmask.S
index a077ba9e6b9..136bdd505bc 100644
--- a/lib/libc/arch/m88k/sys/sigprocmask.S
+++ b/lib/libc/arch/m88k/sys/sigprocmask.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: sigprocmask.S,v 1.7 2005/08/07 16:40:15 espie Exp $ */
+/* $OpenBSD: sigprocmask.S,v 1.8 2013/01/05 11:20:55 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -36,17 +36,17 @@
#include "SYS.h"
SYSENTRY(sigprocmask)
- bcnd ne0,r3,1f /* if new sigset pointer is null */
- or r2,r0,1 /* how = SIG_BLOCK and do it */
+ bcnd ne0,%r3,1f /* if new sigset pointer is null */
+ or %r2,%r0,1 /* how = SIG_BLOCK and do it */
br 2f
1:
- ld r3,r3,0 /* else load set from *set and do it */
+ ld %r3,%r3,0 /* else load set from *set and do it */
2:
- or r13,r0,SYS_sigprocmask
- tb0 0,r0,128
+ or %r13,%r0,SYS_sigprocmask
+ tb0 0,%r0,128
br __cerror
- bcnd eq0,r4,3f /* if old mask not requested, done */
- st r2,r4,0 /* otherwise, set it */
+ bcnd eq0,%r4,3f /* if old mask not requested, done */
+ st %r2,%r4,0 /* otherwise, set it */
3:
- jmp.n r1
- or r2,r0,0
+ jmp.n %r1
+ or %r2,%r0,0
diff --git a/lib/libc/arch/m88k/sys/sigreturn.S b/lib/libc/arch/m88k/sys/sigreturn.S
index 5886102d4d9..9919b5221fe 100644
--- a/lib/libc/arch/m88k/sys/sigreturn.S
+++ b/lib/libc/arch/m88k/sys/sigreturn.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: sigreturn.S,v 1.7 2012/12/26 19:22:48 miod Exp $ */
+/* $OpenBSD: sigreturn.S,v 1.8 2013/01/05 11:20:55 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -40,4 +40,4 @@
*/
SYSCALL(sigreturn)
- jmp r1
+ jmp %r1
diff --git a/lib/libc/arch/m88k/sys/sigsuspend.S b/lib/libc/arch/m88k/sys/sigsuspend.S
index 0b0054fdb17..22ba6ef9d43 100644
--- a/lib/libc/arch/m88k/sys/sigsuspend.S
+++ b/lib/libc/arch/m88k/sys/sigsuspend.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: sigsuspend.S,v 1.8 2005/08/07 16:40:15 espie Exp $ */
+/* $OpenBSD: sigsuspend.S,v 1.9 2013/01/05 11:20:55 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -43,9 +43,9 @@
*/
SYSENTRY(sigsuspend)
- ld r2,r2,0 /* dereference the pointer mask */
- or r13,r0,SYS_sigsuspend
- tb0 0,r0,128
+ ld %r2,%r2,0 /* dereference the pointer mask */
+ or %r13,%r0,SYS_sigsuspend
+ tb0 0,%r0,128
br __cerror
- jmp.n r1
- or r2,r0,0
+ jmp.n %r1
+ or %r2,%r0,0
diff --git a/lib/libc/arch/m88k/sys/syscall.S b/lib/libc/arch/m88k/sys/syscall.S
index 477ba89cb01..f2da5052cb8 100644
--- a/lib/libc/arch/m88k/sys/syscall.S
+++ b/lib/libc/arch/m88k/sys/syscall.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: syscall.S,v 1.10 2007/10/24 20:19:11 miod Exp $ */
+/* $OpenBSD: syscall.S,v 1.11 2013/01/05 11:20:55 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -36,7 +36,7 @@
#include "SYS.h"
SYSENTRY(syscall)
- or r13,r0,0
- tb0 0,r0,128
+ or %r13,%r0,0
+ tb0 0,%r0,128
br __cerror
- jmp r1
+ jmp %r1
diff --git a/lib/libc/arch/m88k/sys/tfork_thread.S b/lib/libc/arch/m88k/sys/tfork_thread.S
index df901bba981..c59175da276 100644
--- a/lib/libc/arch/m88k/sys/tfork_thread.S
+++ b/lib/libc/arch/m88k/sys/tfork_thread.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: tfork_thread.S,v 1.2 2012/06/21 00:56:59 guenther Exp $ */
+/* $OpenBSD: tfork_thread.S,v 1.3 2013/01/05 11:20:55 miod Exp $ */
/*
* Copyright (c) 2005, Miodrag Vallat
@@ -31,23 +31,23 @@
* int __tfork_thread(const struct __tfork *param, size_t psize, void (*func)(void *), void *arg);
*/
ENTRY(__tfork_thread)
- or r13, r0, __SYSCALLNAME(SYS_,__tfork)
- tb0 0, r0, 128 /* corrupts r2 and r3 in the child */
+ or %r13, %r0, __SYSCALLNAME(SYS_,__tfork)
+ tb0 0, %r0, 128 /* corrupts r2 and r3 in the child */
br __cerror
- bcnd eq0, r2, 1f
+ bcnd eq0, %r2, 1f
/*
* In parent process: just return.
*/
- jmp r1
+ jmp %r1
1:
/*
* In child process: invoke function, then exit.
*/
- jsr.n r4 /* func */
- or r2, r5, r0 /* arg */
+ jsr.n %r4 /* func */
+ or %r2, %r5, %r0 /* arg */
- or r13, r0, __SYSCALLNAME(SYS_,__threxit)
- tb0 0, r0, 128
+ or %r13, %r0, __SYSCALLNAME(SYS_,__threxit)
+ tb0 0, %r0, 128
diff --git a/lib/libm/arch/m88k/fenv.c b/lib/libm/arch/m88k/fenv.c
index 771c6b9c968..3902c577e9a 100644
--- a/lib/libm/arch/m88k/fenv.c
+++ b/lib/libm/arch/m88k/fenv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fenv.c,v 1.4 2012/12/05 23:20:02 deraadt Exp $ */
+/* $OpenBSD: fenv.c,v 1.5 2013/01/05 11:20:55 miod Exp $ */
/*
* Copyright (c) 2011 Martynas Venckus <martynas@openbsd.org>
@@ -44,13 +44,13 @@ feclearexcept(int excepts)
excepts &= FE_ALL_EXCEPT;
/* Store the current floating-point status register */
- __asm__ __volatile__ ("fldcr %0, fcr62" : "=r" (fpsr));
+ __asm__ __volatile__ ("fldcr %0, %%fcr62" : "=r" (fpsr));
/* Clear the requested floating-point exceptions */
fpsr &= ~excepts;
/* Load the floating-point status register */
- __asm__ __volatile__ ("fstcr %0, fcr62" : : "r" (fpsr));
+ __asm__ __volatile__ ("fstcr %0, %%fcr62" : : "r" (fpsr));
return (0);
}
@@ -68,7 +68,7 @@ fegetexceptflag(fexcept_t *flagp, int excepts)
excepts &= FE_ALL_EXCEPT;
/* Store the current floating-point status register */
- __asm__ __volatile__ ("fldcr %0, fcr62" : "=r" (fpsr));
+ __asm__ __volatile__ ("fldcr %0, %%fcr62" : "=r" (fpsr));
/* Store the results in flagp */
*flagp = fpsr & excepts;
@@ -130,14 +130,14 @@ fesetexceptflag(const fexcept_t *flagp, int excepts)
excepts &= FE_ALL_EXCEPT;
/* Store the current floating-point status register */
- __asm__ __volatile__ ("fldcr %0, fcr62" : "=r" (fpsr));
+ __asm__ __volatile__ ("fldcr %0, %%fcr62" : "=r" (fpsr));
/* Set the requested status flags */
fpsr &= ~excepts;
fpsr |= *flagp & excepts;
/* Load the floating-point status register */
- __asm__ __volatile__ ("fstcr %0, fcr62" : : "r" (fpsr));
+ __asm__ __volatile__ ("fstcr %0, %%fcr62" : : "r" (fpsr));
return (0);
}
@@ -155,7 +155,7 @@ fetestexcept(int excepts)
excepts &= FE_ALL_EXCEPT;
/* Store the current floating-point status register */
- __asm__ __volatile__ ("fldcr %0, fcr62" : "=r" (fpsr));
+ __asm__ __volatile__ ("fldcr %0, %%fcr62" : "=r" (fpsr));
return (fpsr & excepts);
}
@@ -169,7 +169,7 @@ fegetround(void)
unsigned int fpcr;
/* Store the current floating-point control register */
- __asm__ __volatile__ ("fldcr %0, fcr63" : "=r" (fpcr));
+ __asm__ __volatile__ ("fldcr %0, %%fcr63" : "=r" (fpcr));
return (fpcr & _ROUND_MASK);
}
@@ -189,14 +189,14 @@ fesetround(int round)
return (-1);
/* Store the current floating-point control register */
- __asm__ __volatile__ ("fldcr %0, fcr63" : "=r" (fpcr));
+ __asm__ __volatile__ ("fldcr %0, %%fcr63" : "=r" (fpcr));
/* Set the rounding direction */
fpcr &= ~_ROUND_MASK;
fpcr |= round;
/* Load the floating-point control register */
- __asm__ __volatile__ ("fstcr %0, fcr63" : : "r" (fpcr));
+ __asm__ __volatile__ ("fstcr %0, %%fcr63" : : "r" (fpcr));
return (0);
}
@@ -209,8 +209,8 @@ int
fegetenv(fenv_t *envp)
{
/* Store the current floating-point control and status registers */
- __asm__ __volatile__ ("fldcr %0, fcr63" : "=r" (envp->__control));
- __asm__ __volatile__ ("fldcr %0, fcr62" : "=r" (envp->__status));
+ __asm__ __volatile__ ("fldcr %0, %%fcr63" : "=r" (envp->__control));
+ __asm__ __volatile__ ("fldcr %0, %%fcr62" : "=r" (envp->__status));
return (0);
}
@@ -227,18 +227,18 @@ feholdexcept(fenv_t *envp)
unsigned int fpsr, fpcr;
/* Store the current floating-point control and status registers */
- __asm__ __volatile__ ("fldcr %0, fcr63" : "=r" (envp->__control));
- __asm__ __volatile__ ("fldcr %0, fcr62" : "=r" (envp->__status));
+ __asm__ __volatile__ ("fldcr %0, %%fcr63" : "=r" (envp->__control));
+ __asm__ __volatile__ ("fldcr %0, %%fcr62" : "=r" (envp->__status));
/* Clear exception flags in FPSR */
fpsr = envp->__status;
fpsr &= ~FE_ALL_EXCEPT;
- __asm__ __volatile__ ("fstcr %0, fcr62" : : "r" (fpsr));
+ __asm__ __volatile__ ("fstcr %0, %%fcr62" : : "r" (fpsr));
/* Mask all exceptions */
fpcr = envp->__control;
fpcr &= ~FE_ALL_EXCEPT;
- __asm__ __volatile__ ("fstcr %0, fcr63" : : "r" (fpcr));
+ __asm__ __volatile__ ("fstcr %0, %%fcr63" : : "r" (fpcr));
return (0);
}
@@ -257,8 +257,8 @@ fesetenv(const fenv_t *envp)
fenv_t fenv;
/* Store the current floating-point control and status registers */
- __asm__ __volatile__ ("fldcr %0, fcr63" : "=r" (fenv.__control));
- __asm__ __volatile__ ("fldcr %0, fcr62" : "=r" (fenv.__status));
+ __asm__ __volatile__ ("fldcr %0, %%fcr63" : "=r" (fenv.__control));
+ __asm__ __volatile__ ("fldcr %0, %%fcr62" : "=r" (fenv.__status));
/* Set the requested control flags */
fenv.__control &= ~(FE_ALL_EXCEPT | _ROUND_MASK);
@@ -269,8 +269,8 @@ fesetenv(const fenv_t *envp)
fenv.__status |= envp->__status & FE_ALL_EXCEPT;
/* Load the floating-point control and status registers */
- __asm__ __volatile__ ("fstcr %0, fcr63" : : "r" (fenv.__control));
- __asm__ __volatile__ ("fstcr %0, fcr62" : : "r" (fenv.__status));
+ __asm__ __volatile__ ("fstcr %0, %%fcr63" : : "r" (fenv.__control));
+ __asm__ __volatile__ ("fstcr %0, %%fcr62" : : "r" (fenv.__status));
return (0);
}
@@ -289,7 +289,7 @@ feupdateenv(const fenv_t *envp)
unsigned int fpsr;
/* Store the current floating-point status register */
- __asm__ __volatile__ ("fldcr %0, fcr62" : "=r" (fpsr));
+ __asm__ __volatile__ ("fldcr %0, %%fcr62" : "=r" (fpsr));
/* Install new floating-point environment */
fesetenv(envp);
@@ -311,13 +311,13 @@ feenableexcept(int mask)
mask &= FE_ALL_EXCEPT;
/* Store the current floating-point control register */
- __asm__ __volatile__ ("fldcr %0, fcr63" : "=r" (fpcr));
+ __asm__ __volatile__ ("fldcr %0, %%fcr63" : "=r" (fpcr));
omask = fpcr & FE_ALL_EXCEPT;
fpcr |= mask;
/* Load the floating-point control register */
- __asm__ __volatile__ ("fstcr %0, fcr63" : : "r" (fpcr));
+ __asm__ __volatile__ ("fstcr %0, %%fcr63" : : "r" (fpcr));
return (omask);
@@ -331,13 +331,13 @@ fedisableexcept(int mask)
mask &= FE_ALL_EXCEPT;
/* Store the current floating-point control register */
- __asm__ __volatile__ ("fldcr %0, fcr63" : "=r" (fpcr));
+ __asm__ __volatile__ ("fldcr %0, %%fcr63" : "=r" (fpcr));
omask = fpcr & FE_ALL_EXCEPT;
fpcr &= ~mask;
/* Load the floating-point control register */
- __asm__ __volatile__ ("fstcr %0, fcr63" : : "r" (fpcr));
+ __asm__ __volatile__ ("fstcr %0, %%fcr63" : : "r" (fpcr));
return (omask);
}
@@ -348,7 +348,7 @@ fegetexcept(void)
unsigned int fpcr;
/* Store the current floating-point control register */
- __asm__ __volatile__ ("fldcr %0, fcr63" : "=r" (fpcr));
+ __asm__ __volatile__ ("fldcr %0, %%fcr63" : "=r" (fpcr));
return (fpcr & FE_ALL_EXCEPT);
}
diff --git a/lib/librthread/arch/m88k/_atomic_lock.c b/lib/librthread/arch/m88k/_atomic_lock.c
index 5f1820f0695..e1ff84b76c4 100644
--- a/lib/librthread/arch/m88k/_atomic_lock.c
+++ b/lib/librthread/arch/m88k/_atomic_lock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: _atomic_lock.c,v 1.2 2006/01/05 22:33:24 marc Exp $ */
+/* $OpenBSD: _atomic_lock.c,v 1.3 2013/01/05 11:20:55 miod Exp $ */
/*
* Copyright (c) 2003, Miodrag Vallat.
@@ -38,7 +38,7 @@ _atomic_lock(volatile _spinlock_lock_t *lock)
old = _SPINLOCK_LOCKED;
__asm__ __volatile__
- ("xmem %0, %2, r0" : "=r" (old) : "0" (old), "r" (lock));
+ ("xmem %0, %2, %%r0" : "=r" (old) : "0" (old), "r" (lock));
return (old != _SPINLOCK_UNLOCKED);
}
diff --git a/lib/librthread/arch/m88k/cerror.S b/lib/librthread/arch/m88k/cerror.S
index d9897800f69..bdc4c05029e 100644
--- a/lib/librthread/arch/m88k/cerror.S
+++ b/lib/librthread/arch/m88k/cerror.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: cerror.S,v 1.1 2012/02/18 17:10:10 miod Exp $ */
+/* $OpenBSD: cerror.S,v 1.2 2013/01/05 11:20:55 miod Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -38,18 +38,18 @@
.globl _C_LABEL(__errno)
ASENTRY(__cerror)
- subu r31,r31,16
- st r25,r0,r31
- st r1,r31,4
+ subu %r31,%r31,16
+ st %r25,%r0,%r31
+ st %r1,%r31,4
bsr.n _C_LABEL(__errno)
- or r25,r0,r2
- st r25,r0,r2
+ or %r25,%r0,%r2
+ st %r25,%r0,%r2
- subu r2,r0,1
- or r3, r0, r2
+ subu %r2,%r0,1
+ or %r3, %r0, %r2
- ld r1,r31,4
- ld r25,r0,r31
- jmp.n r1
- addu r31,r31,16
+ ld %r1,%r31,4
+ ld %r25,%r0,%r31
+ jmp.n %r1
+ addu %r31,%r31,16