mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-30 14:08:21 +00:00
mm: rename vmm api to mm
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
#include <arch/msr.h>
|
||||
#include <arch/ist.h>
|
||||
#include <kernel/interrupt.h>
|
||||
#include <kernel/vmm.h>
|
||||
#include <kernel/mm.h>
|
||||
#include <kernel/timer.h>
|
||||
#include <kernel/scheduler.h>
|
||||
#include <kernel/dpc.h>
|
||||
@@ -23,7 +23,7 @@ typedef struct cpu_t {
|
||||
|
||||
struct cpu_t *self; // expected to be here by other code
|
||||
|
||||
vmmcontext_t *vmmctx; // expected to be here by other code
|
||||
mm_context_t *mmctx; // expected to be here by other code
|
||||
|
||||
long hardware_id; // expected to be here by other code
|
||||
long internal_id; // expected to be here by other code
|
||||
@@ -131,13 +131,13 @@ static inline cpu_t *current_cpu(void) {
|
||||
return cpu;
|
||||
}
|
||||
|
||||
static inline vmmcontext_t *current_vmm_context(void) {
|
||||
vmmcontext_t *context;
|
||||
static inline mm_context_t *current_mm_context(void) {
|
||||
mm_context_t *context;
|
||||
asm volatile ("mov %%gs:16, %%rax" : "=a"(context) : : "memory");
|
||||
return context;
|
||||
}
|
||||
|
||||
static inline void set_current_vmm_context(vmmcontext_t *context) {
|
||||
static inline void set_current_mm_context(mm_context_t *context) {
|
||||
asm volatile ("mov %%rax, %%gs:16" : : "a"(context) : "memory");
|
||||
}
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ static void pci_archinit() {
|
||||
void *phys = (void *)mcfgentries[i].address;
|
||||
uintmax_t pageoffset = (uintptr_t)phys % PAGE_SIZE;
|
||||
size_t mappingsize = pageoffset + MCFG_MAPPING_SIZE(mcfgentries[i].end_bus - mcfgentries[i].start_bus + 1);
|
||||
void *virt = vmm_map(NULL, mappingsize, VMM_FLAGS_PHYSICAL,
|
||||
void *virt = mm_map(NULL, mappingsize, MM_RANGE_FLAGS_PHYSICAL,
|
||||
ARCH_MMU_FLAGS_READ | ARCH_MMU_FLAGS_WRITE | ARCH_MMU_FLAGS_NOEXEC | ARCH_MMU_FLAGS_UC, phys);
|
||||
__assert(virt);
|
||||
mcfgentries[i].address = (uintptr_t)virt + pageoffset;
|
||||
|
||||
Reference in New Issue
Block a user