#ifndef CONSTS #define CONSTSs /**************************************************************************** * * This header file contains utility constants & macro definitions. * ****************************************************************************/ #define MAXPROC 20 /* Hardware & software constants */ #define PAGESIZE 4096 /* page size in bytes */ #define WORDLEN 4 /* word size in bytes */ #define PTEMAGICNO 0x2A #define ROMPAGESTART 0x20000000 /* ROM Reserved Page */ /* timer, timescale, TOD-LO and other bus regs */ #define RAMBASEADDR 0x10000000 #define TODLOADDR 0x1000001C #define INTERVALTMR 0x10000020 #define TIMESCALEADDR 0x10000024 /* utility constants */ #define TRUE 1 #define FALSE 0 #define HIDDEN static #define EOS '\0' #define NULL ((void *)0xFFFFFFFF) /* vectors number and type */ #define VECTSNUM 4 #define TLBTRAP 0 #define PROGTRAP 1 #define SYSTRAP 2 #define TRAPTYPES 3 /* device interrupts */ #define DISKINT 3 #define TAPEINT 4 #define NETWINT 5 #define PRNTINT 6 #define TERMINT 7 #define DEVREGLEN 4 /* device register field length in bytes & regs per dev */ #define DEVREGSIZE 16 /* device register size in bytes */ /* device register field number for non-terminal devices */ #define STATUS 0 #define COMMAND 1 #define DATA0 2 #define DATA1 3 /* device register field number for terminal devices */ #define RECVSTATUS 0 #define RECVCOMMAND 1 #define TRANSTATUS 2 #define TRANCOMMAND 3 /* device common STATUS codes */ #define UNINSTALLED 0 #define READY 1 #define BUSY 3 /* device common COMMAND codes */ #define RESET 0 #define ACK 1 /* operations */ #define MIN(A,B) ((A) < (B) ? A : B) #define MAX(A,B) ((A) < (B) ? B : A) #define ALIGNED(A) (((unsigned)A & 0x3) == 0) /* Useful operations */ #define STCK(T) ((T) = ((* ((cpu_t *) TODLOADDR)) / (* ((cpu_t *) TIMESCALEADDR)))) #endif