29 lines
483 B
C
29 lines
483 B
C
#ifndef VMM_VMM_H_
|
|
#define VMM_VMM_H_
|
|
|
|
#include <stddef.h>
|
|
#include "spinlock/spinlock.h"
|
|
#include "bootinfo/bootinfo.h"
|
|
#include "compiler/attr.h"
|
|
|
|
typedef struct {
|
|
SpinLock spinlock;
|
|
} VirtMem;
|
|
|
|
typedef struct VasRange {
|
|
struct VasRange *next;
|
|
|
|
uint8_t *virtstart;
|
|
uint8_t *physstart;
|
|
size_t size;
|
|
uint8_t pgflags;
|
|
} PACKED VasRange;
|
|
|
|
extern VirtMem VIRT_MEM;
|
|
|
|
void vmm_init(void);
|
|
|
|
#define VIRT(X) ((void *)(BOOT_INFO.hhdm_off + (uint64_t)(X)))
|
|
|
|
#endif // VMM_VMM_H_
|