old-trainOS/include/vmm.h

35 lines
707 B
C
Raw Permalink Normal View History

2015-08-09 00:42:56 +00:00
#pragma once
#include <inttypes.h>
#include <config.h>
2015-08-09 00:42:56 +00:00
2015-08-13 12:56:50 +00:00
#if defined(__cplusplus)
extern "C" {
#endif
#if defined(USE_VIRTUAL_MEMORY_MANAGEMENT)
2015-08-09 00:42:56 +00:00
#define VM_PRESENT 0x01
#define VM_WRITABLE 0x02
#define VM_USER 0x04
#define VM_KERNEL (VM_PRESENT | VM_WRITABLE
#define VM_PROGRAM (VM_PRESENT | VM_WRITABLE | VM_USER)
void vmm_init(void);
/**
* Maps a physical address to a virtual address.
* @param virtual The virtual address to be mapped.
* @param physical Target physical address
* @param flags Flags for the mapping
* @remarks If flags is 0, the mapping will be undone.
*/
void vmm_map(uintptr_t virtual, uintptr_t physical, uint32_t flags);
2015-08-13 12:56:50 +00:00
#endif
2015-08-13 12:56:50 +00:00
#if defined(__cplusplus)
}
#endif