📄 sunromvec.h
字号:
/* * Notce that the value of "romp" will be * truncated based on the running hardware: * Sun-2 0x00EF0000 * Sun-3 0x0FEF0000 * Sun-3x 0xFEFE00000 * This was deliberately done for Sun-3 so that programs using this header * file (with the Sun-3 support) would continue to run on Sun-2 systems. */#ifdef sun3x#define romp ((struct sunromvec *) 0xFEFE0000) /* Pegasus romp-> */#else sun3x#define romp ((struct sunromvec *) 0x0FEF0000)#endif sun3x#endif sun4 #endif sun4c#endif OPENPROMS/* * The possible values for "*romp->v_insource" and "*romp->v_outsink" are * listed below. These may be extended in the future. Your program should * cope with this gracefully (e.g. by continuing to vector through the ROM * I/O routines if these are set in a way you don't understand). */#define INKEYB 0 /* Input from parallel keyboard. */#define INUARTA 1 /* Input or output to Uart A. */#define INUARTB 2 /* Input or output to Uart B. */#define INUARTC 3 /* Input or output to Uart C. */#define INUARTD 4 /* Input or output to Uart D. */#define OUTSCREEN 0 /* Output to frame buffer. */#define OUTUARTA 1 /* Input or output to Uart A. */#define OUTUARTB 2 /* Input or output to Uart B. */#define OUTUARTC 3 /* Input or output to Uart C. */#define OUTUARTD 4 /* Input or output to Uart D. *//* * Structure set up by the boot command to pass arguments to the booted program. */struct bootparam { char *bp_argv[8]; /* String arguments. */ char bp_strings[100]; /* String table for string arguments. */ char bp_dev[2]; /* Device name. */ int bp_ctlr; /* Controller Number. */ int bp_unit; /* Unit Number. */ int bp_part; /* Partition/file Number. */ char *bp_name; /* File name. Points into "bp_strings". */ struct boottab *bp_boottab; /* Points to table entry for device. */};/* * This table entry describes a device. It exists in the PROM. A pointer to * it is passed in "bootparam". It can be used to locate ROM subroutines for * opening, reading, and writing the device. NOTE: When using this interface, * only ONE device can be open at any given time. In other words, it is not * possible to open a tape and a disk at the same time. */struct boottab { char b_dev[2]; /* Two character device name. */ int (*b_probe)(); /* probe(): "-1" or controller number. */ int (*b_boot)(); /* boot(bp): "-1" or start address. */ int (*b_open)(); /* open(iobp): "-"1 or "0". */ int (*b_close)(); /* close(iobp): "-"1 or "0". */ int (*b_strategy)(); /* strategy(iobp, rw): "-1" or "0". */ char *b_desc; /* Printable string describing device. */ struct devinfo *b_devinfo; /* Information to configure device. */};enum MAPTYPES { /* Page map entry types. */ MAP_MAINMEM, MAP_OBIO, MAP_MBMEM, MAP_MBIO, MAP_VME16A16D, MAP_VME16A32D, MAP_VME24A16D, MAP_VME24A32D, MAP_VME32A16D, MAP_VME32A32D};/* * This table gives information about the resources needed by a device. */struct devinfo { unsigned int d_devbytes; /* Bytes occupied by device in IO space. */ unsigned int d_dmabytes; /* Bytes needed by device in DMA memory. */ unsigned int d_localbytes; /* Bytes needed by device for local info. */ unsigned int d_stdcount; /* How many standard addresses. */ unsigned long *d_stdaddrs; /* The vector of standard addresses. */ enum MAPTYPES d_devtype; /* What map space device is in. */ unsigned int d_maxiobytes; /* Size to break big I/O's into. */};/* * This following defines the memory map interface * between the ROM Monitor and the Unix kernel. * * The ROM Monitor requires that nobody mess with parts of virtual memory if * they expect any ROM Monitor services. The following rules apply to all of * the virtual addresses between MONSTART and MONEND. * (1) Do not write to these addresses. * (2) Do not read from (depend on the contents of) these addresses, except * as documented here or in <mon/sunromvec.h>. * (3) Do not re-map these addresses. * (4) Do not change or double-map the pmegs that these addresses map through. * (5) Do not change or double-map the main memory that these addresses map * to. * (6) You are free to change or double-map I/O devices which these addresses * map to. * (7) These rules apply in all map contexts. */#ifndef OPENPROMS#ifdef sun2 #define MONSTART 0x00E00000#define MONEND 0x00F00000#endif sun2#ifdef sun3 #define MONSTART 0x0FE00000#define MONEND 0x0FF00000#endif sun3 #ifdef sun3x#define MONSTART 0xFEF00000#define MONEND 0xFF000000#endif sun3x/* XXX - is this right for sun4m? */#if defined(sun4) || defined(sun4c) || defined(sun4m)#define MONSTART 0xFFD00000#define MONEND 0xFFF00000#endif sun4 || sun4c || sun4m#endif OPENPROMS#if !defined(sun4) && !defined(sun4c)/* * The one page at MONSHORTPAGE must remain mapped to the same piece * of main memory. The pmeg used to map it there can be changed if so * desired. This page should not be read from or written in. It is * used for ROM Monitor globals, since it is addressable with short * absolute instructions. (We give a 32-bit value below so the * compiler/assembler will use absolute short addressing. The hardware * will accept either 0 or 0xF as the top 4 bits.) */#define MONSHORTPAGE 0xFFFFE000#define MONSHORTSEG 0xFFFE0000#endif !sun4 && !sun4c/* XXX - is this really right for sun4m? */#if defined(sun4) || defined(sun4c) || defined(sun4m)/* * The one page at GLOBAL_PAGE must remain mapped to the same piece of main * memory. The pmeg used to map it there can be changed if desired. This page * should not be read from or written into. It is used for Monitor globals. */#define GLOBAL_PAGE 0xFFEFE000#endif sun4 || sun4c || sun4m#ifdef sun3x#define GLOBAL_PAGE 0xFEF72000#endif sun3x/* * For virtual addresses outside the above range, you can re-map the addresses * as desired (but see MONSHORTPAGE). Any pmeg not referenced by segments * between MONSTART and MONEND can be used freely (but see MONSHORTPAGE). * When a stand-alone program is booted, available main memory will be mapped * contiguously, using ascending physical page addresses, starting at virtual * address "0x00000000". The complete set of available memory may not be * mapped due to a lack of pmegs. The complete set is defined by globals * "v_memorysize", "v_memoryavail" and "v_memorybitmap". For non-Sun-4 * machines, we guarantee that at least MAINMEM_MAP_SIZE page map entries * will be available for mapping starting from location "0x0". For Sun-4, * (at least at the time of Sunrise and Cobra), we guarantee that at least * 4 megabytes will be mapped beginning with location "0x0". When a * stand-alone program is booted, the number of segment table entries required * to map DVMA_MAP_SIZE bytes will be allocated. The corresponding pages will * be mapped into DVMA space. */#ifdef sun2 #define MAINMEM_MAP_SIZE 0x00600000#define DVMA_MAP_SIZE 0x00080000#endif sun2 #ifdef sun3 #define MAINMEM_MAP_SIZE 0x00800000#define DVMA_MAP_SIZE 0x00080000#endif sun3 #ifdef sun3x#define MAINMEM_MAP_SIZE 0x00800000 /* Eight Megabytes */#define DVMA_MAP_SIZE 0x00100000 /* One Megabyte */#endif#ifdef sun4#ifdef sunray#define MAINMEM_MAP_SIZE 0x02000000#else sunray#define MAINMEM_MAP_SIZE 0x00800000#endif sunray#define DVMA_MAP_SIZE 0x00080000#endif#ifdef sun4c#define MAINMEM_MAP_SIZE 0x00400000#define DVMA_MAP_SIZE 0x00080000#endif/* XXX - Is this right for sun4m? */#ifdef sun4m#define MAINMEM_MAP_SIZE 0x04000000 /* 64 megabytes! */#define DVMA_MAP_SIZE 0x00080000#endif sun4m/* * The following are included for compatability with previous versions * of this header file. Names containing capital letters have been * changed to conform with "Bill Joy Normal Form". This section provides * the translation between the old and new names. It can go away once * Sun-1 applications have been converted over. */#define RomVecPtr romp#define v_SunRev v_mon_id#define v_MemorySize v_memorysize#define v_EchoOn v_echo#define v_InSource v_insource#define v_OutSink v_outsink#define v_InitGetkey v_initgetkey#define v_KeybId v_keybid#define v_Keybuf v_keybuf#define v_FBAddr v_fbaddr#define v_FontTable v_font#define v_message v_printf#define v_KeyFrsh v_nmi#define AbortEnt v_abortent#define v_RefrCnt v_nmiclock#define v_GlobPtr v_gp#define v_KRptInitial v_keyrinit#define v_KRptTick v_keyrtick#define v_ExitOp v_exit_to_mon#define v_fwrstr v_fwritestr#define v_linbuf v_linebuf#endif /*!_mon_sunromvec_h*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -