// Memory handling and allocation // Copyright (c) 2001, David H. Hovemeyer // $Revision: 3.0 $ // This is free software. You are permitted to use, // redistribute, and modify it as specified in the file "COPYING". #ifndef MEM_H #define MEM_H #include "ktypes.h" #include "paging.h" struct Boot_Info; // Page flags #define PAGE_KERN 0x0001 // page used by kernel code or data #define PAGE_HW 0x0002 // page used by hardware (e.g., ISA hole) #define PAGE_ALLOCATED 0x0004 // page is allocated #define PAGE_UNUSED 0x0008 // page is unused #define PAGE_HEAP 0x0010 // page is in kernel heap #define PAGE_PAGEABLE 0x0020 // page can be paged out // x86 has 4096 byte pages #define PAGE_POWER 12 #define PAGE_SIZE (1<> PAGE_POWER); } // Pointer to the table of Page structs. extern struct Page* s_pageList; // Get the Page struct associated with given address. #define Get_Page(addr) (&s_pageList[Page_Index(addr)]) #endif // MEM_H