1 /* 2 Mem 3 Simple memory operations--encapsulates the byte order and 4 most of the pager accesses 5 JBS 15 June 1994 6 */ 7 8 #ifndef _MEM_ 9 10 #define _MEM_ 11 12 #include "config.h" 13 #include "page.h" 14 #include "types.h" 15 16 #define BLOCK_SHIFT (9) 17 #define BLOCK_SIZE (1<<BLOCK_SHIFT) 18 19 #define make_word(hi,lo) \ 20 ((((word) (hi) << 8) + (word) (lo))) 21 22 #define ptr_from_seg(page,off) (pg_fetch(page)+(off)) 23 24 #define rd_byte_seg(p,o) (*ptr_from_seg(p,o)) 25 byte rd_byte_addr(long_word); 26 27 word rd_word_ptr(byte *); 28 word rd_word_seg(word, word); 29 word rd_word_addr(long_word); 30 31 void wr_byte_addr(long_word, byte); 32 33 void wr_word_ptr(byte *, word); 34 void wr_word_addr(long_word, word); 35 36 #endif 37