Use <machine/asm.h>. (e.g. prepare for ELF)

This commit is contained in:
matt 2000-07-13 03:13:05 +00:00
parent b4c1bfd1f3
commit 98ffc615b2
2 changed files with 16 additions and 17 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: srt0.s,v 1.5 2000/07/10 10:42:27 ragge Exp $ */
/* $NetBSD: srt0.s,v 1.6 2000/07/13 03:13:05 matt Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -33,7 +33,6 @@
#include "../include/asm.h"
#define JSBENTRY(x) .globl x ; .align 2 ; x :
/*
* Auto-moving startup code for standalone programs. Can be loaded
* (almost) anywhere in memory but moves itself to the position
@ -45,16 +44,16 @@
nisse: .set nisse,0 # pass -e nisse to ld gives OK start addr
.globl nisse
JSBENTRY(_start)
ALTENTRY(start)
nop;nop;
movl $_start, sp # Probably safe place for stack
movl $_C_LABEL(start), sp # Probably safe place for stack
pushr $0x1fff # save for later usage
subl3 $_start, $_edata, r0
movab _start, r1
movl $_start, r3
subl3 $_C_LABEL(start), $_C_LABEL(edata), r0
movab _C_LABEL(start), r1
movl $_C_LABEL(start), r3
movc3 r0,(r1),(r3) # Kopiera text + data
subl3 $_edata, $_end, r2
subl3 $_C_LABEL(edata), $_C_LABEL(end), r2
movc5 $0,(r3),$0,r2,(r3) # Nolla bss också.
movpsl -(sp)
@ -71,7 +70,7 @@ ENTRY(machdep_start, 0)
mtpr $0,$0x18 # stop real time interrupt clock
movl 4(ap), r6
movl 20(ap), r9 # end of symbol table
movab _bootrpb,r10 # get RPB address
movab _C_LABEL(bootrpb),r10 # get RPB address
pushl r10 # argument for new boot
ashl $9,76(r10),r8 # memory size (COMPAT)
movl $3,r11 # ask boot (COMPAT)

View File

@ -1,4 +1,4 @@
/* $NetBSD: str.s,v 1.2 2000/04/22 20:29:58 ragge Exp $ */
/* $NetBSD: str.s,v 1.3 2000/07/13 03:13:05 matt Exp $ */
/*
* Copyright (c) 1996 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -40,7 +40,7 @@
/*
* atoi() used in devopen.
*/
ENTRY(atoi, 0);
ENTRY(atoi, 0)
movl 4(ap),r1
clrl r0
@ -59,7 +59,7 @@ ENTRY(atoi, 0);
* index() small and easy.
* doesnt work if we search for null.
*/
ENTRY(index, 0);
ENTRY(index, 0)
movq 4(ap),r0
1: cmpb (r0), r1
beql 2f
@ -71,7 +71,7 @@ ENTRY(index, 0);
/*
* cmpc3 is emulated on MVII.
*/
ENTRY(bcmp, 0);
ENTRY(bcmp, 0)
movl 4(ap), r2
movl 8(ap), r1
movl 12(ap), r0
@ -84,15 +84,15 @@ ENTRY(bcmp, 0);
/*
* Is movc3/movc5 emulated on any CPU? I dont think so; use them here.
*/
ENTRY(bzero,0);
ENTRY(bzero,0)
movc5 $0,*4(ap),$0,8(ap),*4(ap)
ret
ENTRY(bcopy,0);
ENTRY(bcopy,0)
movc3 12(ap), *4(ap), *8(ap)
ret
ENTRY(strlen, 0);
ENTRY(strlen, 0)
movl 4(ap), r0
1: tstb (r0)+
bneq 1b
@ -138,7 +138,7 @@ ENTRY(strncpy, 0)
ENTRY(strcat, 0)
pushl 4(ap)
calls $1,_strlen
calls $1,_C_LABEL(strlen)
addl2 4(ap),r0
movl 8(ap),r1
1: movb (r1)+,(r0)+