RESTART(5spp) RISC/os Reference Manual RESTART(5spp)
NAME
restart - description of standalone communication block
SYNOPSIS
#include <prom/entrypt.h>
DESCRIPTION
The restart block is used to communicate information between
various components of the MIPS standalone system. Informa-
tion conveyed in the restart block allows the PROM monitor
to warm start existing program images, and dbgmon to commun-
icate with its clients.
The format of a restart block is:
struct restart_blk {
int rb_magic; /* magic pattern */
int (*rb_restart)();/* restart routine */
int rb_occurred; /* to avoid loops on restart failure */
int rb_checksum; /* checksum of 1st 32 wrds of restrt */
char *rb_fbss; /* start of PROM bss and stack area */
char *rb_ebss; /* end of PROM bss and stack area */
/*
* These entries are for communication between the debug monitor
* and the client process being debugged
* NOTE: a return value of -1 from (*rb_vtop)() is distinguished
* to indicate that a translation could not be made.
*/
int (*rb_bpaddr)(); /* breakpoint handler */
int (*rb_vtop)(); /* virtual to physical conversion rtn */
};
Constants that are used in conjunction with the restart
block are:
#define RESTART_MAGIC 0xfeedface
#define RESTART_CSUMCNT 32 /* cksum 32 words of restart routine */
#define RESTART_ADDR 0xa0000400 /* PROM looks for restart block here */
The block is always located at physical address 0x400, and
is referenced by the PROM monitor via the k1seg address
0xa0000400. The fields in the restart block have the fol-
lowing uses:
rb_magic
This field is checked by the PROM monitor at the time
of a warm start to determine the validity of the res-
tart block. In order for a warm start to occur, this
field must be equal to the value RESTARTMAGIC. This
field must be assigned RESTARTMAGIC by the standalone
program to indicate its desire to permit warm starts on
its image.
rb_restart
Printed 1/6/92 Page 1
RESTART(5spp) RISC/os Reference Manual RESTART(5spp)
This field indicates the address to transfer to in
order to initiate a warm start on the current memory
image. This field must be assigned by the standalone
program.
rb_occurred
This field must be zero to allow a warm start, this
field is set non-zero by the PROM monitor once it has
attempted a warm start to avoid infinite loops should
the warm start fail.
rb_checksum
This field should be assigned the 32 bit, 2's comple-
ment sum of the first 32 words starting with the
address in rbrestart. The PROM monitor calculates the
sum of the first 32 words of the warm start routine and
compares its sum with the value in rbrestart to ensure
that the restart code is valid.
rb_fbss
The address of the first word of memory used by PROM
for its bss segment. This address is a "k1seg"
address. Note that the PROM also "uses" the utlbmiss
and general exception vectors along with the restart
block itself, all of which lie outside of its bss
region.
rb_ebss
The address of the first work beyond the PROM bss seg-
ment.
rb_bpaddr
This location is non-zero if the debug monitor,
dbgmon(1spp), is present. The non-zero contents of
rbbpaddr is the address of the debug monitor entry
point for breakpoint handling. If rbbpaddr is non-
zero, standalone programs that field their own excep-
tions should transfer to this location if they receive
a breakpoint exception via a "break 1" instruction.
Before transferring to this location, the standalone
program should restore all registers except "at" and
"k0" to the contents the registers had at the time of
the exception. The "k0" register should be set to the
contents of the "at" register at the time of the fault,
and the "at" register should be loaded with the con-
tents of rbbpaddr and a jump register performed to
enter the debug monitor breakpoint handler. If
rbbpaddr is zero, the debug monitor is not present;
the breakpoint exception should then be reported and
the program terminated.
rb_vtop
Page 2 Printed 1/6/92
RESTART(5spp) RISC/os Reference Manual RESTART(5spp)
A standalone program may offer to translate "kuseg" or
"k2seg" addresses to k0seg or k1seg addresses by
assigning rbvtop to the address of a routine that pro-
vides this service. This routine is called with a sin-
gle parameter, which is a kuseg or k2seg address; it
should return a corresponding address in k0seg or
k1seg. The translation should be based upon the
current process identifier in the R2000 tlbhi register.
If for some reason the translation can not be made, the
routine should return -1.
NOTE: currently the dbgmon command "dump" does not call the
rbvtop entry point for kuseg or k2seg addresses; the dump
command must be given k0seg or k1seg addresses.
SEE ALSO
dbgmon(1spp), prom(1spp), warm(1spp)
Printed 1/6/92 Page 3