Casio_asm/interpreter/segments.h

31 lines
734 B
C

#ifndef SEGMENTS_H
#define SEGMENTS_H
#include "mmu.h"
#include "stack.h"
#include "../common/platform.h"
//unmap all the managed segments in an MMU safely
void Segments_unmapAll(mmu_t *mmu);
//map file segments
int Segments_mapFile(mmu_t *mmu, int fd, int pos, int len, int off, char access);
void Segments_unmapFile(mmu_t *mmu, int pos);
//map RAM segments
int Segments_mapRam(mmu_t *mmu, int pos, int len, char access);
void Segments_unmapRam(mmu_t *mmu, int pos);
//map stack
int Segments_mapStack(mmu_t *mmu, stack_t *stack, int pos, char access);
//map VRAM
int Segments_mapVram(mmu_t *mmu, int pos);
#define MAPPING_INFO_ram 1
#define MAPPING_INFO_stack 2
#define MAPPING_INFO_file 3
#define MAPPING_INFO_vram 4
#endif