Phoenix
Object-oriented orthogonally persistent operating system
vm_page.h
Go to the documentation of this file.
00001 /*
00002  * /phoenix/kernel/sys/vm_page.h
00003  *
00004  * This file is a part of Phoenix operating system.
00005  * Copyright (c) 2011-2012, Artyom Lebedev <artyom.lebedev@gmail.com>
00006  * All rights reserved.
00007  * See COPYING file for copyright details.
00008  */
00009 
00014 #ifndef VM_PAGE_H_
00015 #define VM_PAGE_H_
00016 
00017 namespace vm {
00018 
00022 class Page {
00023 public:
00025     enum Flags {
00029         F_MANAGED =         0x1,
00033         F_AVAILABLE =       0x2,
00037         F_ACPI_RECLAIM =    0x4,
00039         F_ACPI_NVS =        0x8,
00040     };
00041 
00042     Page(long flags = 0) {
00043         _flags = flags;
00044     }
00045 
00049     inline long GetFlags() { return _flags; }
00050 
00056     inline long SetFlags(long flags) {
00057         long ret = _flags;
00058         _flags = flags;
00059         return ret;
00060     }
00061 
00067     Paddr GetPaddr();
00068 
00076     inline void *operator new(size_t size, Page *location) {
00077         ASSERT(size == sizeof(Page));
00078         return location;
00079     }
00080 
00081 private:
00082     u32 _flags;
00083 };
00084 
00085 }
00086 
00087 #endif /* VM_PAGE_H_ */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines