DM: change VM_SYSMEM/VM_MMIO to VM_MEMMAP_SYSMEM/VM_MEMMAP_MMIO

these MACROs are only for MEMMAP

Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
Jason Chen CJ 2018-04-18 11:49:18 +08:00 committed by lijinxia
parent 4e8bcb6224
commit 899f6076ea
2 changed files with 10 additions and 9 deletions

View File

@ -321,7 +321,7 @@ vm_map_memseg_vma(struct vmctx *ctx, size_t len, vm_paddr_t gpa,
struct vm_memmap memmap; struct vm_memmap memmap;
bzero(&memmap, sizeof(struct vm_memmap)); bzero(&memmap, sizeof(struct vm_memmap));
memmap.type = VM_SYSMEM; memmap.type = VM_MEMMAP_SYSMEM;
memmap.using_vma = 1; memmap.using_vma = 1;
memmap.vma_base = vma; memmap.vma_base = vma;
memmap.len = len; memmap.len = len;
@ -338,7 +338,7 @@ vm_alloc_set_memseg(struct vmctx *ctx, int segid, size_t len,
struct vm_memmap memmap; struct vm_memmap memmap;
int error, flags; int error, flags;
if (segid == VM_SYSMEM) { if (segid == VM_MEMMAP_SYSMEM) {
bzero(&memseg, sizeof(struct vm_memseg)); bzero(&memseg, sizeof(struct vm_memseg));
memseg.len = len; memseg.len = len;
memseg.gpa = gpa; memseg.gpa = gpa;
@ -418,8 +418,8 @@ vm_setup_memory(struct vmctx *ctx, size_t memsize, enum vm_mmap_style vms)
gpa = 0; gpa = 0;
len = ctx->lowmem; len = ctx->lowmem;
prot = PROT_ALL; prot = PROT_ALL;
error = vm_alloc_set_memseg(ctx, VM_SYSMEM, len, gpa, prot, error = vm_alloc_set_memseg(ctx, VM_MEMMAP_SYSMEM, len, gpa,
baseaddr, &ctx->mmap_lowmem); prot, baseaddr, &ctx->mmap_lowmem);
if (error) if (error)
return error; return error;
} }
@ -429,8 +429,8 @@ vm_setup_memory(struct vmctx *ctx, size_t memsize, enum vm_mmap_style vms)
gpa = 4*GB; gpa = 4*GB;
len = ctx->highmem; len = ctx->highmem;
prot = PROT_ALL; prot = PROT_ALL;
error = vm_alloc_set_memseg(ctx, VM_SYSMEM, len, gpa, prot, error = vm_alloc_set_memseg(ctx, VM_MEMMAP_SYSMEM, len, gpa,
baseaddr, &ctx->mmap_highmem); prot, baseaddr, &ctx->mmap_highmem);
if (error) if (error)
return error; return error;
} }

View File

@ -116,7 +116,7 @@ struct vm_memseg {
uint64_t gpa; uint64_t gpa;
}; };
#define VM_SYSMEM 0 #define VM_MEMMAP_SYSMEM 0
#define VM_MMIO 1 #define VM_MMIO 1
/** /**
@ -126,7 +126,7 @@ struct vm_memmap {
/** @type: memory mapping type */ /** @type: memory mapping type */
uint32_t type; uint32_t type;
/** @using_vma: using vma_base to get vm0_gpa, /** @using_vma: using vma_base to get vm0_gpa,
* only for type == VM_SYSTEM * only for type == VM_MEMMAP_SYSMEM
*/ */
uint32_t using_vma; uint32_t using_vma;
/** @gpa: user OS guest physical start address of memory mapping */ /** @gpa: user OS guest physical start address of memory mapping */
@ -138,7 +138,8 @@ struct vm_memmap {
*/ */
uint64_t hpa; uint64_t hpa;
/** @vma_base: service OS user virtual start address of /** @vma_base: service OS user virtual start address of
* memory, only for type == VM_SYSMEM && using_vma == true * memory, only for type == VM_MEMMAP_SYSMEM &&
* using_vma == true
*/ */
uint64_t vma_base; uint64_t vma_base;
}; };