New arguments to the rom routines. Adapt srt0 to new world also.

This commit is contained in:
ragge 2000-05-20 13:22:39 +00:00
parent 9ff9efe46a
commit a8a7bf342f
2 changed files with 29 additions and 44 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: romread.s,v 1.1 1999/03/06 16:36:06 ragge Exp $ */
/* $NetBSD: romread.s,v 1.2 2000/05/20 13:22:39 ragge Exp $ */
/*
* Copyright (c) 1995 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -58,11 +58,10 @@ ENTRY(read750, 0xFFE)
ret
/*
* romread_uvax (int lbn, int size, void *buf, int *regs)
* romread_uvax (int lbn, int size, void *buf, struct rpb *rpb)
*/
ENTRY(romread_uvax, 0xFFE)
movl 16(ap), r11 # array of bootregs
movl 44(r11), r11 # restore boot-contents of r11 (rpb)
movl 16(ap),r11 # restore boot-contents of r11 (rpb)
movl 52(r11), r7 # load iovec/bqo into r7
addl3 (r7), r7, r6 # load qio into r6
pushl r11 # base of rpb
@ -75,11 +74,10 @@ ENTRY(romread_uvax, 0xFFE)
ret # r0 holds the result
/*
* romwrite_uvax (int lbn, int size, void *buf, int *regs)
* romwrite_uvax (int lbn, int size, void *buf, struct rpb *rpb)
*/
ENTRY(romwrite_uvax, 0xFFE)
movl 16(ap), r11 # array of bootregs
movl 44(r11), r11 # restore boot-contents of r11 (rpb)
movl 16(ap), r11 # restore boot-contents of r11 (rpb)
movl 52(r11), r7 # load iovec/bqo into r7
addl3 (r7), r7, r6 # load qio into r6
pushl r11 # base of rpb

View File

@ -1,4 +1,4 @@
/* $NetBSD: srt0.s,v 1.2 1999/05/23 21:58:19 ragge Exp $ */
/* $NetBSD: srt0.s,v 1.3 2000/05/20 13:22:39 ragge Exp $ */
/*
* Copyright (c) 1994 Ludd, University of Lule}, Sweden.
* All rights reserved.
@ -32,6 +32,8 @@
/* All bugs are subject to removal without further notice */
#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
@ -43,18 +45,9 @@
nisse: .set nisse,0 # pass -e nisse to ld gives OK start addr
.globl nisse
_start: .globl _start
nop;nop; # If we get called by calls, or something
movl r8, _memsz # If we come from disk, save memsize
cmpl ap, $-1 # Check if we are net-booted. XXX - kludge
beql 2f # jump if not
ashl $9,76(r11),_memsz # got memsize from rpb
movzbl 102(r11), r10 # Get bootdev from rpb.
movzwl 48(r11), r11 # Get howto
2: movl $_start, sp # Probably safe place for stack
subl2 $52, sp # do not overwrite saved boot-registers
JSBENTRY(_start)
nop;nop;
movl $_start, sp # Probably safe place for stack
subl3 $_start, $_edata, r0
movab _start, r1
@ -67,22 +60,16 @@ _start: .globl _start
1: movl $relocated, (sp) # return-address on top of stack
rsb # can be replaced with new address
relocated: # now relocation is done !!!
movl r10,_bootdev # Save bootdev early
movl r11,_howto # howto also...
movl sp, _bootregs
calls $0, _Xmain # Were here!
pushl r11 # RPB is copied here.
calls $1, _Xmain # Were here!
halt # no return
ENTRY(machdep_start, 0)
mtpr $0x1f,$0x12 # Block all interrupts
mtpr $0,$0x18 # stop real time interrupt clock
movl 4(ap), r6
movl _howto, r11
movl _opendev, r10
movl 20(ap), r9
movl _memsz, r8
calls $0,(r6)
movl 20(ap), r9 # end of symbol table
movab _bootrpb,-(sp)
calls $1,(r6)
ret
.globl _memsz
_memsz: .long 0x0