From 899f6076ea8634c56d6decd5d71cca3332e6500f Mon Sep 17 00:00:00 2001 From: Jason Chen CJ Date: Wed, 18 Apr 2018 11:49:18 +0800 Subject: [PATCH] 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 --- core/vmmapi.c | 12 ++++++------ include/public/vhm_ioctl_defs.h | 7 ++++--- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/core/vmmapi.c b/core/vmmapi.c index 99888e179..870429dd6 100644 --- a/core/vmmapi.c +++ b/core/vmmapi.c @@ -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; } diff --git a/include/public/vhm_ioctl_defs.h b/include/public/vhm_ioctl_defs.h index 598b1ae5f..7c212dd47 100644 --- a/include/public/vhm_ioctl_defs.h +++ b/include/public/vhm_ioctl_defs.h @@ -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; };