2017-05-14 13:07:24 +01:00
|
|
|
#ifndef VMAS_H
|
|
|
|
#define VMAS_H
|
2017-05-14 21:10:58 +01:00
|
|
|
#include <stdint.h>
|
|
|
|
#define DEFAULT_STACKSIZE 0x100
|
|
|
|
#define DEFAULT_CODESIZE 0x300
|
|
|
|
#define DEFAULT_DATASIZE 0x100
|
2017-05-14 13:07:24 +01:00
|
|
|
|
|
|
|
class VMAddrSpace {
|
2017-05-14 21:10:58 +01:00
|
|
|
private:
|
|
|
|
uint32_t stacksize, codesize, datasize;
|
2017-05-14 13:07:24 +01:00
|
|
|
|
|
|
|
public:
|
2017-05-14 21:10:58 +01:00
|
|
|
VMAddrSpace();
|
|
|
|
VMAddrSpace(uint32_t ss, uint32_t cs, uint32_t ds);
|
|
|
|
uint8_t *stack, *code, *data;
|
|
|
|
bool allocate(void);
|
2017-05-25 17:46:23 +01:00
|
|
|
bool insStack(uint8_t *buf, uint32_t size);
|
|
|
|
bool insCode(uint8_t *buf, uint32_t size);
|
|
|
|
bool insData(uint8_t *buf, uint32_t size);
|
2017-05-14 13:07:24 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|