00001 /*header file for src/memory/zone.cpp*/ 00002 00003 #ifndef _CORE_MEMORY_ZONE_HPP 00004 #define _CORE_MEMORY_ZONE_HPP 00005 00006 /*necessary includes*/ 00007 #include "src/common/stack.hpp" 00008 00009 namespace Memory { 00010 00011 00012 /*a list of zones*/ 00013 class zone 00014 { 00015 public: 00016 stack_t page_list; 00017 size_t one_page; //one page's size 00018 public: 00019 void init (uint32 *buf, size_t elems, size_t pg_siz); 00020 void done(); 00021 void set_length(size_t n); 00022 00023 addr_t alloc(size_t cnt); 00024 int free(addr_t addr); 00025 size_t length(); 00026 }; 00027 00028 00029 }; /*namespace Memory*/ 00030 00031 #endif