/*
|
/*
|
* common.h -- common definitions
|
* common.h -- common definitions
|
*/
|
*/
|
|
|
|
|
#ifndef _COMMON_H_
|
#ifndef _COMMON_H_
|
#define _COMMON_H_
|
#define _COMMON_H_
|
|
|
|
|
#define K 1024 /* Kilo */
|
#define K 1024 /* Kilo */
|
#define M (K * K) /* Mega */
|
#define M (K * K) /* Mega */
|
|
|
#define RAM_BASE 0x00000000 /* physical RAM base address */
|
#define RAM_BASE 0x00000000 /* physical RAM base address */
|
#define RAM_SIZE_MAX (512 * M) /* maximum RAM size */
|
#define RAM_SIZE_MAX (512 * M) /* maximum RAM size */
|
#define RAM_SIZE_DFL (4 * M) /* default RAM size */
|
#define RAM_SIZE_DFL (4 * M) /* default RAM size */
|
#define ROM_BASE 0x20000000 /* physical ROM base address */
|
#define ROM_BASE 0x20000000 /* physical ROM base address */
|
#define ROM_SIZE_MAX (256 * M) /* maximum ROM size */
|
#define ROM_SIZE_MAX (256 * M) /* maximum ROM size */
|
#define ROM_SIZE (256 * K) /* actual ROM size */
|
#define ROM_SIZE (256 * K) /* actual ROM size */
|
#define IO_BASE 0x30000000 /* physical I/O base address */
|
#define IO_BASE 0x30000000 /* physical I/O base address */
|
#define IO_SIZE_MAX (256 * M) /* maximum I/O size */
|
#define IO_SIZE_MAX (256 * M) /* maximum I/O size */
|
|
|
#define IO_DEV_MASK 0x3FF00000 /* I/O device mask */
|
#define IO_DEV_MASK 0x3FF00000 /* I/O device mask */
|
#define IO_REG_MASK 0x000FFFFF /* I/O register mask */
|
#define IO_REG_MASK 0x000FFFFF /* I/O register mask */
|
#define IO_GRAPH_MASK 0x003FFFFF /* I/O graphics mask */
|
#define IO_GRAPH_MASK 0x003FFFFF /* I/O graphics mask */
|
|
|
#define TIMER_BASE 0x30000000 /* physical timer base address */
|
#define TIMER_BASE 0x30000000 /* physical timer base address */
|
#define DISPLAY_BASE 0x30100000 /* physical display base address */
|
#define DISPLAY_BASE 0x30100000 /* physical display base address */
|
#define KEYBOARD_BASE 0x30200000 /* physical keyboard base address */
|
#define KEYBOARD_BASE 0x30200000 /* physical keyboard base address */
|
#define TERM_BASE 0x30300000 /* physical terminal base address */
|
#define TERM_BASE 0x30300000 /* physical terminal base address */
|
#define MAX_NTERMS 2 /* max number of terminals */
|
#define MAX_NTERMS 2 /* max number of terminals */
|
#define DISK_BASE 0x30400000 /* physical disk base address */
|
#define DISK_BASE 0x30400000 /* physical disk base address */
|
#define OUTPUT_BASE 0x3F000000 /* physical output device address */
|
#define OUTPUT_BASE 0x3F000000 /* physical output device address */
|
|
#define SHUTDOWN_BASE 0x3F100000 /* physical shutdown device address */
|
#define GRAPH_BASE 0x3FC00000 /* physical grahics base address */
|
#define GRAPH_BASE 0x3FC00000 /* physical grahics base address */
|
/* extends to end of address space */
|
/* extends to end of address space */
|
|
|
#define PAGE_SIZE (4 * K) /* size of a page and a page frame */
|
#define PAGE_SIZE (4 * K) /* size of a page and a page frame */
|
#define OFFSET_MASK (PAGE_SIZE - 1) /* mask for offset within a page */
|
#define OFFSET_MASK (PAGE_SIZE - 1) /* mask for offset within a page */
|
#define PAGE_MASK (~OFFSET_MASK) /* mask for page number */
|
#define PAGE_MASK (~OFFSET_MASK) /* mask for page number */
|
|
|
#define INSTRS_PER_MSEC 1700 /* average execution speed */
|
#define CC_PER_USEC 50 /* clock cycles per microsecond */
|
|
#define CC_PER_INSTR 18 /* clock cycles per instruction */
|
|
|
|
|
typedef enum { false, true } Bool; /* truth values */
|
typedef enum { false, true } Bool; /* truth values */
|
|
|
|
|
typedef unsigned char Byte; /* 8 bit quantities */
|
typedef unsigned char Byte; /* 8 bit quantities */
|
typedef unsigned short Half; /* 16 bit quantities */
|
typedef unsigned short Half; /* 16 bit quantities */
|
typedef unsigned int Word; /* 32 bit quantities */
|
typedef unsigned int Word; /* 32 bit quantities */
|
|
|
|
|
#endif /* _COMMON_H_ */
|
#endif /* _COMMON_H_ */
|
|
|