Main Page   Compound List   File List   Compound Members   File Members  

int.h

Go to the documentation of this file.
00001 
00002 /*
00003  Copyright (c) 1992-1993 The Regents of the University of California.
00004  All rights reserved.  See copyright.h for copyright notice and limitation 
00005  of liability and disclaimer of warranty provisions.
00006  */
00007 
00008 #include "copyright.h"
00009 
00010 
00011 #define MEMSIZE (1<<24)
00012 #define memoffset 0x10000000
00013 
00014 /* centralized memory-access primitives */
00015 #define amark(x)        x
00016 #define imark(x)        x
00017 
00018 #define ifetch(addr)    (*(int *)(int) (&(mem-memoffset)[imark(addr)]))
00019 #define fetch(addr)     (*(int *)(int) (&(mem-memoffset)[amark(addr)]))
00020 #define sfetch(addr)    (*(short *)(int) (&(mem-memoffset)[amark(addr)]))
00021 #define usfetch(addr)   (*(unsigned short *)(int)(&(mem-memoffset)[amark(addr)]))
00022 #define cfetch(addr)    (*(char *)(int) (&(mem-memoffset)[amark(addr)]))
00023 #define ucfetch(addr)   (*(unsigned char *)(int)(&(mem-memoffset)[amark(addr)]))
00024 
00025 #define store(addr, i)  \
00026         ((*(int *)(int) (&(mem-memoffset)[amark(addr)]) = (i)))
00027 #define sstore(addr, i) \
00028         ((*(short *)(int) (&(mem-memoffset)[amark(addr)]) = (i)))
00029 #define cstore(addr, i) \
00030         (((mem-memoffset)[amark(addr)] = (i)))
00031 

Generated on Mon Feb 10 09:54:45 2003 for nachos by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002
The University of Southern California does not screen or control the content on this website and thus does not guarantee the accuracy, integrity, or quality of such content. All content on this website is provided by and is the sole responsibility of the person from which such content originated, and such content does not necessarily reflect the opinions of the University administration or the Board of Trustees