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

View File

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