📄 sunromvec.h
字号:
/* * sunromvec.h * * @(#)sunromvec.h 1.1 92/07/30 SMI * Copyright (c) 1986 by Sun Microsystems, Inc. */#ifndef _mon_sunromvec_h#define _mon_sunromvec_h#include <sys/types.h>#include <sys/param.h>/* * For sun4c and later, only Version 0 stuff is coming out of this file, * everything else is in <mon/openprom.h>. */#if defined(sun4c) || defined(sun3x)/* * This structure defines a segment of physical memory. To support * sparse physical memory, the PROMs construct a list of these structures * representing what memory is present. On other machines, the kernel will * fake up the physical memory list without this structure. */struct physmemory { unsigned int address; unsigned int size; struct physmemory *next;};#endif sun4c || sun3x#ifdef OPENPROMS#include <mon/openprom.h>#else OPENPROMS/* * Autoconfig operations */struct config_ops { int (*devr_next)(/* int nodeid */); int (*devr_child)(/* int nodeid */); int (*devr_getproplen)(/* int nodeid; caddr_t name; */); int (*devr_getprop)(/* int nodeid; caddr_t name; addr_t value; */); int (*devr_setprop)(/* int nodeid; caddr_t name; addr_t value; int len; */); int (*devr_nextprop)(/* int nodeid; caddr_t previous; */);};/* * This file defines the entire interface between the ROM * Monitor and the programs (or kernels) that run under it. * * The main Sun-2 and Sun-3 interface consists of * the VECTOR TABLE at the front of the Boot PROM. * * The main Sun-4 interface consists of (1) the VECTOR TABLE and (2) the * TRAP VECTOR TABLE, near the front of the Boot PROM. Beginning at address * "0x00000000", there is a 4K-byte TRAP TABLE containing 256 16-byte entries. * Each 16-byte TRAP TABLE entry contains the executable code associated with * that trap. The initial 128 TRAP TABLE entries are dedicated to hardware * traps while, the final 128 TRAP TABLE entries are reserved for programmer- * initiated traps. With a few exceptions, the VECTOR TABLE, which appeared * in Sun-2 and Sun-3 firmware, follows the TRAP TABLE. Finally, the TRAP * VECTOR TABLE follows the VECTOR TABLE. Each TRAP VECTOR TABLE entry * contains the address of the trap handler, which is eventually called to * handle the trap condition. * * These tables are the ONLY knowledge the outside world has of this rom. * They are referenced by hardware and software. Once located, NO ENTRY CAN * BE ADDED, DELETED or RE-LOCATED UNLESS YOU CHANGE THE ENTIRE WORLD THAT * DEPENDS ON IT! Notice that, for Sun-4, EACH ENTRY IN STRUCTURE "sunromvec" * MUST HAVE A CORRESPONDING ENTRY IN VECTOR TABLE "vector_table", which * resides in file "../sun4/traptable.s". * * The easiest way to reference elements of these TABLEs is to say: * *romp->xxx * as in: * (*romp->v_putchar)(c); * * Various entries have been added at various times. As of the Rev N, the * VECTOR TABLE includes an entry "v_romvec_version" which is an integer * defining which entries in the table are valid. The "V1:" type comments * on each entry state which version the entry first appeared in. In order * to determine if the Monitor your program is running under contains the * entry, you can simply compare the value of "v_romvec_version" to the * constant in the comment field. For example, * if (romp->v_romvec_version >= 1) { * reference *romp->v_memorybitmap... * } else { * running under older version of the Monitor... * } * Entries which do not contain a "Vn:" comment are in all versions. */struct sunromvec { char *v_initsp; /* Initial Stack Pointer for hardware.*/ void (*v_startmon)(); /* Initial PC for hardware. */ int *v_diagberr; /* Bus error handler for diagnostics. */ /* * Configuration information passed to standalone code and UNIX. */ struct bootparam **v_bootparam; /* Information for boot-strapped pgm. */ unsigned int *v_memorysize; /* Total physical memory in bytes. */ /* * Single character input and output. */ unsigned char (*v_getchar)(); /* Get a character from input source. */ void (*v_putchar)(); /* Put a character to output sink. */ int (*v_mayget)(); /* Maybe get a character, or "-1". */ int (*v_mayput)(); /* Maybe put a character, or "-1". */ unsigned char *v_echo; /* Should "getchar" echo input? */ unsigned char *v_insource; /* Current source of input. */ unsigned char *v_outsink; /* Currrent output sink. */ /* * Keyboard input and frame buffer output. */ int (*v_getkey)(); /* Get next key if one is available. */ void (*v_initgetkey)();/* Initialization for "getkey". */ unsigned int *v_translation; /* Keyboard translation selector. */ unsigned char *v_keybid; /* Keyboard ID byte. */ int *v_screen_x; /* V2: Screen x pos (R/O). */ int *v_screen_y; /* V2: Screen y pos (R/O). */ struct keybuf *v_keybuf; /* Up/down keycode buffer. */ char *v_mon_id; /* Revision level of the monitor. */ /* * Frame buffer output and terminal emulation. */ void (*v_fwritechar)();/* Write a character to frame buffer. */ int *v_fbaddr; /* Address of frame buffer. */ char **v_font; /* Font table for frame buffer. */ void (*v_fwritestr)(); /* Quickly write a string to frame * * buffer. */ /* * Re-boot interface routine. Resets and re-boots system. No return. */ void (*v_boot_me)(); /* For example, boot_me("xy()vmunix").*/ /* * Command line input and parsing. */ unsigned char *v_linebuf; /* The command line buffer. */ unsigned char **v_lineptr; /* Current pointer into "linebuf". */ int *v_linesize; /* Length of current command line. */ void (*v_getline)(); /* Get a command line from user. */ unsigned char (*v_getone)(); /* Get next character from "linebuf". */ unsigned char (*v_peekchar)(); /* Peek at next character without * * advancing pointer. */ int *v_fbthere; /* Is there a frame buffer or not? * * 1=yes. */ int (*v_getnum)(); /* Grab hex number from command line. */ /* * Phrase output to current output sink. */ int (*v_printf)(); /* Similar to Kernel's "printf". */ void (*v_printhex)(); /* Format N digits in hexadecimal. */ unsigned char *v_leds; /* RAM copy of LED register value. */ void (*v_set_leds)(); /* Sets LEDs and RAM copy */ /* * The nmi related information. */ void (*v_nmi)(); /* Address for the Sun-4 level 14 * * interrupt vector. */ void (*v_abortent)(); /* Entry for keyboard abort. */ int *v_nmiclock; /* Counts in milliseconds. */ int *v_fbtype; /* Frame buffer type: see <sun/fbio.h>*/ /* * Assorted other things. */ unsigned int v_romvec_version; /* Version number of "romvec". */ struct globram *v_gp; /* Monitor's global variables. */ struct zscc_device *v_keybzscc; /* Address of keyboard in use. */ int *v_keyrinit; /* Millisecs before keyboard repeat. */ unsigned char *v_keyrtick; /* Millisecs between repetitions. */ unsigned int *v_memoryavail; /* V1: Size of usable main memory. */ long *v_resetaddr; /* where to jump on a RESET trap. */ long *v_resetmap; /* Page map entry for "resetaddr". */ void (*v_exit_to_mon)();/* Exit from user program. */ unsigned char **v_memorybitmap; /* V1: Bit map of main memory or NULL.*/#ifndef sun3x void (*v_setcxsegmap)();/* Set segment in any context. */#endif sun3x void (**v_vector_cmd)();/* V2: Handler for the 'w' (vector) * * command. */#if defined(sun4) || defined(sun4c) unsigned long *v_exp_trap_signal;/* V3: Location of the expected trap * * signal. Was trap expected or not? */ unsigned long *v_trap_vector_table_base; /* V3: Address of the TRAP * * VECTOR TABLE which exists in RAM. */#endif sun4 || sun4c#ifdef sun4c struct physmemory *v_physmemory; /* ptr to memory list */ unsigned int *v_monmemory; /* memory taken by monitor */ struct config_ops *v_config_ops; /* configuration operations */#endif sun4c/* XXX - does sun4m really need this too? */#if defined(sun3x) || defined(sun4m) int **v_lomemptaddr; /* address of low memory ptes */ int **v_monptaddr; /* address of debug/mon ptes */ int **v_dvmaptaddr; /* address of dvma ptes */ int **v_monptphysaddr; /* Physical Addr of the KADB PTE's */ int **v_shadowpteaddr; /* addr of shadow cp of DVMA pte's */ struct physmemory *v_physmemory; /* Ptr to memory list for Hydra */#endif sun3x || sun4m int dummy1z; int dummy2z; int dummy3z; int dummy4z;};/* * THE FOLLOWING CONSTANT, "romp" MUST BE CHANGED ANYTIME THE VALUE OF * "PROM_BASE" IN file "../sun2/cpu.addrs.h" (for Sun-2), file * "../sun3/cpu.addrs.h" (for Sun-3) or file "../sun4/cpu.addrs.h" (for Sun-4) * IS CHANGED. IT IS CONSTANT HERE SO THAT EVERY MODULE WHICH NEEDS AN ADDRESS * OUT OF STRUCTURE "sunromvec" DOES NOT HAVE TO INCLUDE the appropriate * "cpu.addrs.h" file. * * Since Sun-4 supports 32-bit addressing, rather than 28-bit addressing as is * supported by Sun-3, the value of "romp" had to be increased. Furthermore, * since the VECTOR TABLE, which appeared at the beginning of Sun-3 firmware, * now appears after the 4K-byte TRAP TABLE in Sun-4 firmware, the value of * "romp" was incresed by an additional 4K. * * If the value of "romp" is changed, several other changes are required. * A complete list of required changes is given below. * (1) Makefile: RELOC= * (2) ../sun2/cpu.addrs.h: #define PROM_BASE (for Sun-2) * or * (2) ../sun3/cpu.addrs.h: #define PROM_BASE (for Sun-3) * or * (2) ../sun3x/cpu.addrs.h: #define PROM_BASE (for Sun-3x) * or * (2) ../sun4/cpu.addrs.h: #define PROM_BASE (for Sun-4) * */#ifdef sun4cextern struct sunromvec *romp;#else sun4c#ifdef sun4#define romp ((struct sunromvec *) 0xFFE81000) /* Used when running the * * firmware out of ROM. */#else sun4
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -