[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen-unstable] [IA64] Trivial whitespace cleanups
# HG changeset patch # User Alex Williamson <alex.williamson@xxxxxx> # Date 1179938419 21600 # Node ID 03e04b861d91b78fbbf392b118dabfbbd61fe75f # Parent 26492c6476f056e2940c1dc6c59e6f7aaec40bd3 [IA64] Trivial whitespace cleanups Signed-off-by: Alex Williamson <alex.williamson@xxxxxx> --- tools/libxc/ia64/xc_dom_ia64_util.c | 9 +++- tools/libxc/ia64/xc_ia64_linux_restore.c | 60 +++++++++++++++---------------- tools/libxc/xc_efi.h | 2 - xen/arch/ia64/xen/dom_fw_common.c | 12 +++--- xen/arch/ia64/xen/dom_fw_dom0.c | 8 ++-- xen/arch/ia64/xen/dom_fw_domu.c | 28 ++++++-------- xen/arch/ia64/xen/dom_fw_utils.c | 9 +++- 7 files changed, 69 insertions(+), 59 deletions(-) diff -r 26492c6476f0 -r 03e04b861d91 tools/libxc/ia64/xc_dom_ia64_util.c --- a/tools/libxc/ia64/xc_dom_ia64_util.c Wed May 23 08:51:42 2007 -0600 +++ b/tools/libxc/ia64/xc_dom_ia64_util.c Wed May 23 10:40:19 2007 -0600 @@ -33,7 +33,7 @@ int int xen_ia64_fpswa_revision(struct xc_dom_image *dom, unsigned int *revision) { - int ret = -1; + int ret; DECLARE_HYPERCALL; hypercall.op = __HYPERVISOR_ia64_dom0vp_op; hypercall.arg[0] = IA64_DOM0VP_fpswa_revision; @@ -41,13 +41,13 @@ xen_ia64_fpswa_revision(struct xc_dom_im if (lock_pages(revision, sizeof(*revision)) != 0) { PERROR("Could not lock memory for xen fpswa hypercall"); - goto out; + return -1; } ret = do_xen_hypercall(dom->guest_xc, &hypercall); unlock_pages(revision, sizeof(*revision)); -out: + return ret; } @@ -79,6 +79,7 @@ xen_ia64_dom_fw_map(struct xc_dom_image mpaddr / page_size); if (ret != NULL) ret = (void*)((unsigned long)ret | (mpaddr & (page_size - 1))); + return ret; } @@ -151,6 +152,7 @@ xen_ia64_dom_fw_setup(struct xc_dom_imag } rc = dom_fw_init(d, brkimm, bp, imva_tables_base, (unsigned long)imva_hypercall_base, maxmem); + out: if (imva_hypercall_base != NULL) xen_ia64_dom_fw_unmap(d, imva_hypercall_base); @@ -160,6 +162,7 @@ xen_ia64_dom_fw_setup(struct xc_dom_imag xen_ia64_dom_fw_unmap(d, imva); if (bp != NULL) xen_ia64_dom_fw_unmap(d, bp); + return rc; } diff -r 26492c6476f0 -r 03e04b861d91 tools/libxc/ia64/xc_ia64_linux_restore.c --- a/tools/libxc/ia64/xc_ia64_linux_restore.c Wed May 23 08:51:42 2007 -0600 +++ b/tools/libxc/ia64/xc_ia64_linux_restore.c Wed May 23 10:40:19 2007 -0600 @@ -47,13 +47,13 @@ read_page(int xc_handle, int io_fd, uint mem = xc_map_foreign_range(xc_handle, dom, PAGE_SIZE, PROT_READ|PROT_WRITE, pfn); if (mem == NULL) { - ERROR("cannot map page"); - return -1; + ERROR("cannot map page"); + return -1; } if (!read_exact(io_fd, mem, PAGE_SIZE)) { - ERROR("Error when reading from state file (5)"); - munmap(mem, PAGE_SIZE); - return -1; + ERROR("Error when reading from state file (5)"); + munmap(mem, PAGE_SIZE); + return -1; } munmap(mem, PAGE_SIZE); return 0; @@ -99,12 +99,12 @@ xc_domain_restore(int xc_handle, int io_ DPRINTF("xc_linux_restore start: p2m_size = %lx\n", p2m_size); if (!read_exact(io_fd, &ver, sizeof(unsigned long))) { - ERROR("Error when reading version"); - goto out; + ERROR("Error when reading version"); + goto out; } if (ver != 1) { - ERROR("version of save doesn't match"); - goto out; + ERROR("version of save doesn't match"); + goto out; } if (lock_pages(&ctxt, sizeof(ctxt))) { @@ -164,11 +164,11 @@ xc_domain_restore(int xc_handle, int io_ ERROR("Error when reading batch size"); goto out; } - if (gmfn == INVALID_MFN) - break; - - if (read_page(xc_handle, io_fd, dom, gmfn) < 0) - goto out; + if (gmfn == INVALID_MFN) + break; + + if (read_page(xc_handle, io_fd, dom, gmfn) < 0) + goto out; } DPRINTF("Received all pages\n"); @@ -195,11 +195,11 @@ xc_domain_restore(int xc_handle, int io_ goto out; } - DPRINTF ("Try to free %u pages\n", count); + DPRINTF ("Try to free %u pages\n", count); for (i = 0; i < count; i++) { - volatile unsigned long pfn; + volatile unsigned long pfn; struct xen_memory_reservation reservation = { .nr_extents = 1, @@ -207,9 +207,9 @@ xc_domain_restore(int xc_handle, int io_ .domid = dom }; set_xen_guest_handle(reservation.extent_start, - (unsigned long *)&pfn); - - pfn = pfntab[i]; + (unsigned long *)&pfn); + + pfn = pfntab[i]; rc = xc_memory_op(xc_handle, XENMEM_decrease_reservation, &reservation); if (rc != 1) { @@ -218,7 +218,7 @@ xc_domain_restore(int xc_handle, int io_ } } - DPRINTF("Decreased reservation by %d pages\n", count); + DPRINTF("Decreased reservation by %d pages\n", count); } @@ -235,8 +235,8 @@ xc_domain_restore(int xc_handle, int io_ domctl.u.vcpucontext.vcpu = 0; set_xen_guest_handle(domctl.u.vcpucontext.ctxt, &ctxt); if (xc_domctl(xc_handle, &domctl) != 0) { - ERROR("Couldn't set vcpu context"); - goto out; + ERROR("Couldn't set vcpu context"); + goto out; } /* Second to set registers... */ @@ -246,20 +246,20 @@ xc_domain_restore(int xc_handle, int io_ domctl.u.vcpucontext.vcpu = 0; set_xen_guest_handle(domctl.u.vcpucontext.ctxt, &ctxt); if (xc_domctl(xc_handle, &domctl) != 0) { - ERROR("Couldn't set vcpu context"); - goto out; + ERROR("Couldn't set vcpu context"); + goto out; } /* Just a check. */ if (xc_vcpu_getcontext(xc_handle, dom, 0 /* XXX */, &ctxt)) { ERROR("Could not get vcpu context"); - goto out; + goto out; } /* Then get privreg page. */ if (read_page(xc_handle, io_fd, dom, ctxt.privregs_pfn) < 0) { - ERROR("Could not read vcpu privregs"); - goto out; + ERROR("Could not read vcpu privregs"); + goto out; } /* Read shared info. */ @@ -267,12 +267,12 @@ xc_domain_restore(int xc_handle, int io_ PROT_READ|PROT_WRITE, shared_info_frame); if (shared_info == NULL) { ERROR("cannot map page"); - goto out; + goto out; } if (!read_exact(io_fd, shared_info, PAGE_SIZE)) { ERROR("Error when reading shared_info page"); munmap(shared_info, PAGE_SIZE); - goto out; + goto out; } /* clear any pending events and the selector */ @@ -322,7 +322,7 @@ xc_domain_restore(int xc_handle, int io_ xc_domain_destroy(xc_handle, dom); if (page_array != NULL) - free(page_array); + free(page_array); unlock_pages(&ctxt, sizeof(ctxt)); diff -r 26492c6476f0 -r 03e04b861d91 tools/libxc/xc_efi.h --- a/tools/libxc/xc_efi.h Wed May 23 08:51:42 2007 -0600 +++ b/tools/libxc/xc_efi.h Wed May 23 10:40:19 2007 -0600 @@ -28,7 +28,7 @@ typedef struct { /* * Generic EFI table header */ -typedef struct { +typedef struct { uint64_t signature; uint32_t revision; uint32_t headersize; diff -r 26492c6476f0 -r 03e04b861d91 xen/arch/ia64/xen/dom_fw_common.c --- a/xen/arch/ia64/xen/dom_fw_common.c Wed May 23 08:51:42 2007 -0600 +++ b/xen/arch/ia64/xen/dom_fw_common.c Wed May 23 10:40:19 2007 -0600 @@ -171,8 +171,9 @@ dom_efi_hypercall_patch(uint64_t brkimm, dom_efi_hypercall_patch(uint64_t brkimm, unsigned long paddr, unsigned long hypercall, unsigned long imva) { - build_hypercall_bundle((uint64_t *)(imva + paddr - FW_HYPERCALL_BASE_PADDR), - brkimm, hypercall, 1); + build_hypercall_bundle((uint64_t *)(imva + paddr - + FW_HYPERCALL_BASE_PADDR), + brkimm, hypercall, 1); } // builds a hypercall bundle at domain physical address @@ -181,8 +182,9 @@ dom_fw_hypercall_patch(uint64_t brkimm, unsigned long hypercall,unsigned long ret, unsigned long imva) { - build_hypercall_bundle((uint64_t *)(imva + paddr - FW_HYPERCALL_BASE_PADDR), - brkimm, hypercall, ret); + build_hypercall_bundle((uint64_t *)(imva + paddr - + FW_HYPERCALL_BASE_PADDR), + brkimm, hypercall, ret); } static void @@ -397,7 +399,7 @@ efi_mdt_cmp(const void *a, const void *b if (x->phys_addr < y->phys_addr) return -1; - // num_pages == 0 is allowed. + /* num_pages == 0 is allowed. */ if (x->num_pages > y->num_pages) return 1; if (x->num_pages < y->num_pages) diff -r 26492c6476f0 -r 03e04b861d91 xen/arch/ia64/xen/dom_fw_dom0.c --- a/xen/arch/ia64/xen/dom_fw_dom0.c Wed May 23 08:51:42 2007 -0600 +++ b/xen/arch/ia64/xen/dom_fw_dom0.c Wed May 23 10:40:19 2007 -0600 @@ -52,6 +52,7 @@ acpi_update_lsapic(acpi_table_entry_head enable = 1; else enable = 0; + if (lsapic->flags.enabled && enable) { printk("enable lsapic entry: 0x%lx\n", (u64)lsapic); lsapic->id = lsapic_nbr; @@ -103,6 +104,7 @@ touch_acpi_table(void) touch_acpi_table(void) { lsapic_nbr = 0; + if (acpi_table_parse_madt(ACPI_MADT_LSAPIC, acpi_update_lsapic, 0) < 0) printk("Error parsing MADT - no LAPIC entries\n"); if (acpi_table_parse_madt(ACPI_MADT_PLAT_INT_SRC, @@ -118,6 +120,7 @@ efi_systable_init_dom0(struct fw_tables efi_systable_init_dom0(struct fw_tables *tables) { int i = 1; + /* Write messages to the console. */ touch_acpi_table(); @@ -352,7 +355,7 @@ complete_dom0_memmap(struct domain *d, md->type == EFI_CONVENTIONAL_MEMORY) { unsigned long start = md->phys_addr & PAGE_MASK; unsigned long end = md->phys_addr + - (md->num_pages << EFI_PAGE_SHIFT); + (md->num_pages << EFI_PAGE_SHIFT); if (end == start) { /* md->num_pages = 0 is allowed. */ @@ -371,8 +374,7 @@ complete_dom0_memmap(struct domain *d, if (efi_mmio(addr, PAGE_SIZE)) { unsigned long flags; flags = ASSIGN_writable | ASSIGN_nocache; - assign_domain_mmio_page(d, addr, addr, - PAGE_SIZE, flags); + assign_domain_mmio_page(d, addr, addr, PAGE_SIZE, flags); } } setup_dom0_memmap_info(d, tables, &num_mds); diff -r 26492c6476f0 -r 03e04b861d91 xen/arch/ia64/xen/dom_fw_domu.c --- a/xen/arch/ia64/xen/dom_fw_domu.c Wed May 23 08:51:42 2007 -0600 +++ b/xen/arch/ia64/xen/dom_fw_domu.c Wed May 23 10:40:19 2007 -0600 @@ -51,6 +51,7 @@ efi_systable_init_domu(struct fw_tables efi_systable_init_domu(struct fw_tables *tables) { int i = 1; + printk(XENLOG_GUEST XENLOG_INFO "DomainU EFI build up:"); tables->efi_tables[i].guid = ACPI_20_TABLE_GUID; @@ -96,6 +97,7 @@ complete_domu_memmap(domain_t *d, /* 3 = start info page, xenstore page and console page */ paddr_end = paddr_start + memmap_info_size + 3 * PAGE_SIZE; memmap_info = xen_ia64_dom_fw_map(d, paddr_start); + if (memmap_info->efi_memmap_size == 0) { create_memmap = 1; } else if (memmap_info->efi_memdesc_size != sizeof(md[0]) || @@ -136,9 +138,9 @@ complete_domu_memmap(domain_t *d, * memory map. create it for compatibility */ memmap_info->efi_memdesc_size = sizeof(md[0]); - memmap_info->efi_memdesc_version = - EFI_MEMORY_DESCRIPTOR_VERSION; + memmap_info->efi_memdesc_version = EFI_MEMORY_DESCRIPTOR_VERSION; memmap_info->efi_memmap_size = 1 * sizeof(md[0]); + md = (efi_memory_desc_t*)&memmap_info->memdesc; md[num_mds].type = EFI_CONVENTIONAL_MEMORY; md[num_mds].pad = 0; @@ -150,6 +152,7 @@ complete_domu_memmap(domain_t *d, memmap_start = &memmap_info->memdesc; memmap_end = memmap_start + memmap_info->efi_memmap_size; + /* XXX Currently the table must be in a single page. */ if ((unsigned long)memmap_end > (unsigned long)memmap_info + PAGE_SIZE) { xen_ia64_dom_fw_unmap(d, memmap_info); @@ -167,6 +170,7 @@ complete_domu_memmap(domain_t *d, for (p = memmap_start; p < memmap_end; p += memmap_info->efi_memdesc_size) { unsigned long start; unsigned long end; + md = p; start = md->phys_addr; end = md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT); @@ -178,29 +182,23 @@ complete_domu_memmap(domain_t *d, /* exclude [paddr_start, paddr_end) */ if (paddr_end <= start || end <= paddr_start) { - MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB, - start, end); + MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB, start, end); } else if (paddr_start <= start && paddr_end < end) { - MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB, - paddr_end, end); + MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB, paddr_end, end); } else if (start < paddr_start && end <= paddr_end) { - MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB, - start, paddr_start); + MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB, start, paddr_start); } else { - MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB, - start, paddr_start); - MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB, - paddr_end, end); + MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB, start, paddr_start); + MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB, paddr_end, end); } } /* memmap info page. */ - MAKE_MD(EFI_RUNTIME_SERVICES_DATA, EFI_MEMORY_WB, - paddr_start, paddr_end); + MAKE_MD(EFI_RUNTIME_SERVICES_DATA, EFI_MEMORY_WB, paddr_start, paddr_end); /* Create an entry for IO ports. */ MAKE_MD(EFI_MEMORY_MAPPED_IO_PORT_SPACE, EFI_MEMORY_UC, - IO_PORTS_PADDR, IO_PORTS_PADDR + IO_PORTS_SIZE); + IO_PORTS_PADDR, IO_PORTS_PADDR + IO_PORTS_SIZE); num_mds = i; sort(tables->efi_memmap, num_mds, sizeof(efi_memory_desc_t), diff -r 26492c6476f0 -r 03e04b861d91 xen/arch/ia64/xen/dom_fw_utils.c --- a/xen/arch/ia64/xen/dom_fw_utils.c Wed May 23 08:51:42 2007 -0600 +++ b/xen/arch/ia64/xen/dom_fw_utils.c Wed May 23 10:40:19 2007 -0600 @@ -41,6 +41,7 @@ xen_ia64_fpswa_revision(struct domain *d { if (fpswa_interface == NULL) return -ENOSYS; + *revision = fpswa_interface->revision; return 0; } @@ -90,6 +91,7 @@ dom_fw_set_convmem_end(struct domain *d) memmap_info->efi_memdesc_version != EFI_MEMORY_DESCRIPTOR_VERSION) return -EINVAL; + /* only 1page case is supported */ if (d->shared_info->arch.memmap_info_num_pages != 1) return -ENOSYS; @@ -111,10 +113,13 @@ dom_fw_set_convmem_end(struct domain *d) if (d->arch.convmem_end == 0) d->arch.convmem_end = d->max_pages << PAGE_SHIFT; + for (p = memmap_start; p < memmap_end; p += memmap_info->efi_memdesc_size) { unsigned long end; + md = p; end = md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT); + if (md->attribute == EFI_MEMORY_WB && md->type == EFI_CONVENTIONAL_MEMORY && md->num_pages > 0 && @@ -130,8 +135,8 @@ static inline void static inline void assign_new_domain_page_if_dom0(struct domain *d, unsigned long mpaddr) { - if (d == dom0) - assign_new_domain0_page(d, mpaddr); + if (d == dom0) + assign_new_domain0_page(d, mpaddr); } int _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxxxxxxxx http://lists.xensource.com/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |