haiku/src/kernel/vm2/area.h
Michael Phipps f913779a80 Initial check in. Very preliminary and not really part of the kernel right now...
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@329 a95241bf-73f2-0310-859d-f6bbb57e9c96
2002-07-19 03:55:07 +00:00

51 lines
1.7 KiB
C++

#ifndef _AREA_H
#define _AREA_H
#include "OS.h"
#include "vm.h"
#include "list.h"
class areaManager;
class vpage;
class area : public node
{
protected:
list vpages;
char name[B_OS_NAME_LENGTH];
pageState state;
protectType protection;
int areaID;
int in_count;
int out_count;
int copy_count;
areaManager *manager;
unsigned long start_address;
unsigned long end_address;
vpage *findVPage(unsigned long);
public:
area(areaManager *myManager);
bool nameMatch(char *matchName) {return (strcmp(matchName,name)==0);}
unsigned long mapAddressSpecToAddress(addressSpec type,unsigned long requested,int pageCount);
status_t createAreaMappingFile(char *name, int pageCount,void **address, addressSpec type,pageState state,protectType protect,int fd,size_t offset);
status_t createArea (char *name, int pageCount,void **address, addressSpec type,pageState state,protectType protect);
int getAreaID(void) {return areaID;}
void setAreaID(int id) {areaID=id;}
void freeArea(void);
status_t getInfo(area_info *dest);
bool contains(void *address);
status_t resize(size_t newSize);
status_t setProtection(protectType prot);
bool couldAdd(unsigned long start,unsigned long end) { return ((end<start_address) || (start>end_address));}
unsigned long getEndAddress(void) {return end_address;}
void pager(int desperation);
void saver(void);
bool fault(void *fault_address, bool writeError); // true = OK, false = panic.
char getByte(unsigned long ); // This is for testing only
void setByte(unsigned long ,char value); // This is for testing only
int getInt(unsigned long ); // This is for testing only
void setInt(unsigned long ,int value); // This is for testing only
};
#endif