direct-io.hg

changeset 15309:03e04b861d91

[IA64] Trivial whitespace cleanups

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
author Alex Williamson <alex.williamson@hp.com>
date Wed May 23 10:40:19 2007 -0600 (2007-05-23)
parents 26492c6476f0
children 40542d29da2b
files tools/libxc/ia64/xc_dom_ia64_util.c tools/libxc/ia64/xc_ia64_linux_restore.c tools/libxc/xc_efi.h xen/arch/ia64/xen/dom_fw_common.c xen/arch/ia64/xen/dom_fw_dom0.c xen/arch/ia64/xen/dom_fw_domu.c xen/arch/ia64/xen/dom_fw_utils.c
line diff
     1.1 --- a/tools/libxc/ia64/xc_dom_ia64_util.c	Wed May 23 08:51:42 2007 -0600
     1.2 +++ b/tools/libxc/ia64/xc_dom_ia64_util.c	Wed May 23 10:40:19 2007 -0600
     1.3 @@ -33,7 +33,7 @@ xen_ia64_version(struct xc_dom_image *do
     1.4  int
     1.5  xen_ia64_fpswa_revision(struct xc_dom_image *dom, unsigned int *revision)
     1.6  {
     1.7 -    int ret = -1;
     1.8 +    int ret;
     1.9      DECLARE_HYPERCALL;
    1.10      hypercall.op     = __HYPERVISOR_ia64_dom0vp_op;
    1.11      hypercall.arg[0] = IA64_DOM0VP_fpswa_revision;
    1.12 @@ -41,13 +41,13 @@ xen_ia64_fpswa_revision(struct xc_dom_im
    1.13  
    1.14      if (lock_pages(revision, sizeof(*revision)) != 0) {
    1.15          PERROR("Could not lock memory for xen fpswa hypercall");
    1.16 -        goto out;
    1.17 +        return -1;
    1.18      }
    1.19  
    1.20      ret = do_xen_hypercall(dom->guest_xc, &hypercall);
    1.21      
    1.22      unlock_pages(revision, sizeof(*revision));
    1.23 -out:
    1.24 +
    1.25      return ret;
    1.26  }
    1.27  
    1.28 @@ -79,6 +79,7 @@ xen_ia64_dom_fw_map(struct xc_dom_image 
    1.29                                 mpaddr / page_size);
    1.30      if (ret != NULL)
    1.31          ret = (void*)((unsigned long)ret | (mpaddr & (page_size - 1)));
    1.32 +
    1.33      return ret;
    1.34  }
    1.35  
    1.36 @@ -151,6 +152,7 @@ xen_ia64_dom_fw_setup(struct xc_dom_imag
    1.37      }
    1.38      rc = dom_fw_init(d, brkimm, bp, imva_tables_base,
    1.39                       (unsigned long)imva_hypercall_base, maxmem);
    1.40 +
    1.41   out:
    1.42      if (imva_hypercall_base != NULL)
    1.43          xen_ia64_dom_fw_unmap(d, imva_hypercall_base);
    1.44 @@ -160,6 +162,7 @@ xen_ia64_dom_fw_setup(struct xc_dom_imag
    1.45          xen_ia64_dom_fw_unmap(d, imva);
    1.46      if (bp != NULL)
    1.47          xen_ia64_dom_fw_unmap(d, bp);
    1.48 +
    1.49      return rc;
    1.50  }
    1.51  
     2.1 --- a/tools/libxc/ia64/xc_ia64_linux_restore.c	Wed May 23 08:51:42 2007 -0600
     2.2 +++ b/tools/libxc/ia64/xc_ia64_linux_restore.c	Wed May 23 10:40:19 2007 -0600
     2.3 @@ -47,13 +47,13 @@ read_page(int xc_handle, int io_fd, uint
     2.4      mem = xc_map_foreign_range(xc_handle, dom, PAGE_SIZE,
     2.5                                 PROT_READ|PROT_WRITE, pfn);
     2.6      if (mem == NULL) {
     2.7 -            ERROR("cannot map page");
     2.8 -            return -1;
     2.9 +        ERROR("cannot map page");
    2.10 +        return -1;
    2.11      }
    2.12      if (!read_exact(io_fd, mem, PAGE_SIZE)) {
    2.13 -            ERROR("Error when reading from state file (5)");
    2.14 -            munmap(mem, PAGE_SIZE);
    2.15 -            return -1;
    2.16 +        ERROR("Error when reading from state file (5)");
    2.17 +        munmap(mem, PAGE_SIZE);
    2.18 +        return -1;
    2.19      }
    2.20      munmap(mem, PAGE_SIZE);
    2.21      return 0;
    2.22 @@ -99,12 +99,12 @@ xc_domain_restore(int xc_handle, int io_
    2.23      DPRINTF("xc_linux_restore start: p2m_size = %lx\n", p2m_size);
    2.24  
    2.25      if (!read_exact(io_fd, &ver, sizeof(unsigned long))) {
    2.26 -	ERROR("Error when reading version");
    2.27 -	goto out;
    2.28 +        ERROR("Error when reading version");
    2.29 +        goto out;
    2.30      }
    2.31      if (ver != 1) {
    2.32 -	ERROR("version of save doesn't match");
    2.33 -	goto out;
    2.34 +        ERROR("version of save doesn't match");
    2.35 +        goto out;
    2.36      }
    2.37  
    2.38      if (lock_pages(&ctxt, sizeof(ctxt))) {
    2.39 @@ -164,11 +164,11 @@ xc_domain_restore(int xc_handle, int io_
    2.40              ERROR("Error when reading batch size");
    2.41              goto out;
    2.42          }
    2.43 -	if (gmfn == INVALID_MFN)
    2.44 -		break;
    2.45 +        if (gmfn == INVALID_MFN)
    2.46 +            break;
    2.47  
    2.48 -	if (read_page(xc_handle, io_fd, dom, gmfn) < 0)
    2.49 -		goto out;
    2.50 +        if (read_page(xc_handle, io_fd, dom, gmfn) < 0)
    2.51 +            goto out;
    2.52      }
    2.53  
    2.54      DPRINTF("Received all pages\n");
    2.55 @@ -195,11 +195,11 @@ xc_domain_restore(int xc_handle, int io_
    2.56              goto out;
    2.57          }
    2.58  
    2.59 -	DPRINTF ("Try to free %u pages\n", count);
    2.60 +        DPRINTF ("Try to free %u pages\n", count);
    2.61  
    2.62          for (i = 0; i < count; i++) {
    2.63  
    2.64 -	    volatile unsigned long pfn;
    2.65 +            volatile unsigned long pfn;
    2.66  
    2.67              struct xen_memory_reservation reservation = {
    2.68                  .nr_extents   = 1,
    2.69 @@ -207,9 +207,9 @@ xc_domain_restore(int xc_handle, int io_
    2.70                  .domid        = dom
    2.71              };
    2.72              set_xen_guest_handle(reservation.extent_start,
    2.73 -				 (unsigned long *)&pfn);
    2.74 +                                 (unsigned long *)&pfn);
    2.75  
    2.76 -	    pfn = pfntab[i];
    2.77 +            pfn = pfntab[i];
    2.78              rc = xc_memory_op(xc_handle, XENMEM_decrease_reservation,
    2.79                                &reservation);
    2.80              if (rc != 1) {
    2.81 @@ -218,7 +218,7 @@ xc_domain_restore(int xc_handle, int io_
    2.82              }
    2.83          }
    2.84  
    2.85 -	DPRINTF("Decreased reservation by %d pages\n", count);
    2.86 +        DPRINTF("Decreased reservation by %d pages\n", count);
    2.87      }
    2.88  
    2.89  
    2.90 @@ -235,8 +235,8 @@ xc_domain_restore(int xc_handle, int io_
    2.91      domctl.u.vcpucontext.vcpu   = 0;
    2.92      set_xen_guest_handle(domctl.u.vcpucontext.ctxt, &ctxt);
    2.93      if (xc_domctl(xc_handle, &domctl) != 0) {
    2.94 -	    ERROR("Couldn't set vcpu context");
    2.95 -	    goto out;
    2.96 +        ERROR("Couldn't set vcpu context");
    2.97 +        goto out;
    2.98      }
    2.99  
   2.100      /* Second to set registers...  */
   2.101 @@ -246,20 +246,20 @@ xc_domain_restore(int xc_handle, int io_
   2.102      domctl.u.vcpucontext.vcpu   = 0;
   2.103      set_xen_guest_handle(domctl.u.vcpucontext.ctxt, &ctxt);
   2.104      if (xc_domctl(xc_handle, &domctl) != 0) {
   2.105 -	    ERROR("Couldn't set vcpu context");
   2.106 -	    goto out;
   2.107 +        ERROR("Couldn't set vcpu context");
   2.108 +        goto out;
   2.109      }
   2.110  
   2.111      /* Just a check.  */
   2.112      if (xc_vcpu_getcontext(xc_handle, dom, 0 /* XXX */, &ctxt)) {
   2.113          ERROR("Could not get vcpu context");
   2.114 -	goto out;
   2.115 +        goto out;
   2.116      }
   2.117  
   2.118      /* Then get privreg page.  */
   2.119      if (read_page(xc_handle, io_fd, dom, ctxt.privregs_pfn) < 0) {
   2.120 -	    ERROR("Could not read vcpu privregs");
   2.121 -	    goto out;
   2.122 +        ERROR("Could not read vcpu privregs");
   2.123 +        goto out;
   2.124      }
   2.125  
   2.126      /* Read shared info.  */
   2.127 @@ -267,12 +267,12 @@ xc_domain_restore(int xc_handle, int io_
   2.128                                         PROT_READ|PROT_WRITE, shared_info_frame);
   2.129      if (shared_info == NULL) {
   2.130              ERROR("cannot map page");
   2.131 -	    goto out;
   2.132 +            goto out;
   2.133      }
   2.134      if (!read_exact(io_fd, shared_info, PAGE_SIZE)) {
   2.135              ERROR("Error when reading shared_info page");
   2.136              munmap(shared_info, PAGE_SIZE);
   2.137 -	    goto out;
   2.138 +            goto out;
   2.139      }
   2.140  
   2.141      /* clear any pending events and the selector */
   2.142 @@ -322,7 +322,7 @@ xc_domain_restore(int xc_handle, int io_
   2.143          xc_domain_destroy(xc_handle, dom);
   2.144  
   2.145      if (page_array != NULL)
   2.146 -	    free(page_array);
   2.147 +        free(page_array);
   2.148  
   2.149      unlock_pages(&ctxt, sizeof(ctxt));
   2.150  
     3.1 --- a/tools/libxc/xc_efi.h	Wed May 23 08:51:42 2007 -0600
     3.2 +++ b/tools/libxc/xc_efi.h	Wed May 23 10:40:19 2007 -0600
     3.3 @@ -28,7 +28,7 @@ typedef struct {
     3.4  /*
     3.5   * Generic EFI table header
     3.6   */
     3.7 -typedef	struct {
     3.8 +typedef struct {
     3.9  	uint64_t signature;
    3.10  	uint32_t revision;
    3.11  	uint32_t headersize;
     4.1 --- a/xen/arch/ia64/xen/dom_fw_common.c	Wed May 23 08:51:42 2007 -0600
     4.2 +++ b/xen/arch/ia64/xen/dom_fw_common.c	Wed May 23 10:40:19 2007 -0600
     4.3 @@ -171,8 +171,9 @@ static void
     4.4  dom_efi_hypercall_patch(uint64_t brkimm, unsigned long paddr,
     4.5                          unsigned long hypercall, unsigned long imva)
     4.6  {
     4.7 -	build_hypercall_bundle((uint64_t *)(imva + paddr - FW_HYPERCALL_BASE_PADDR),
     4.8 -	                       brkimm, hypercall, 1);
     4.9 +	build_hypercall_bundle((uint64_t *)(imva + paddr -
    4.10 +			       FW_HYPERCALL_BASE_PADDR),
    4.11 +			       brkimm, hypercall, 1);
    4.12  }
    4.13  
    4.14  // builds a hypercall bundle at domain physical address
    4.15 @@ -181,8 +182,9 @@ dom_fw_hypercall_patch(uint64_t brkimm, 
    4.16  		       unsigned long hypercall,unsigned long ret,
    4.17                         unsigned long imva)
    4.18  {
    4.19 -	build_hypercall_bundle((uint64_t *)(imva + paddr - FW_HYPERCALL_BASE_PADDR),
    4.20 -	                       brkimm, hypercall, ret);
    4.21 +	build_hypercall_bundle((uint64_t *)(imva + paddr -
    4.22 +			       FW_HYPERCALL_BASE_PADDR),
    4.23 +			       brkimm, hypercall, ret);
    4.24  }
    4.25  
    4.26  static void
    4.27 @@ -397,7 +399,7 @@ efi_mdt_cmp(const void *a, const void *b
    4.28  	if (x->phys_addr < y->phys_addr)
    4.29  		return -1;
    4.30  
    4.31 -	// num_pages == 0 is allowed.
    4.32 +	/* num_pages == 0 is allowed. */
    4.33  	if (x->num_pages > y->num_pages)
    4.34  		return 1;
    4.35  	if (x->num_pages < y->num_pages)
     5.1 --- a/xen/arch/ia64/xen/dom_fw_dom0.c	Wed May 23 08:51:42 2007 -0600
     5.2 +++ b/xen/arch/ia64/xen/dom_fw_dom0.c	Wed May 23 10:40:19 2007 -0600
     5.3 @@ -52,6 +52,7 @@ acpi_update_lsapic(acpi_table_entry_head
     5.4          enable = 1;
     5.5      else
     5.6          enable = 0;
     5.7 +
     5.8      if (lsapic->flags.enabled && enable) {
     5.9          printk("enable lsapic entry: 0x%lx\n", (u64)lsapic);
    5.10          lsapic->id = lsapic_nbr;
    5.11 @@ -103,6 +104,7 @@ static void __init
    5.12  touch_acpi_table(void)
    5.13  {
    5.14      lsapic_nbr = 0;
    5.15 +
    5.16      if (acpi_table_parse_madt(ACPI_MADT_LSAPIC, acpi_update_lsapic, 0) < 0)
    5.17          printk("Error parsing MADT - no LAPIC entries\n");
    5.18      if (acpi_table_parse_madt(ACPI_MADT_PLAT_INT_SRC,
    5.19 @@ -118,6 +120,7 @@ void __init
    5.20  efi_systable_init_dom0(struct fw_tables *tables)
    5.21  {
    5.22      int i = 1;
    5.23 +
    5.24      /* Write messages to the console.  */
    5.25      touch_acpi_table();
    5.26  
    5.27 @@ -352,7 +355,7 @@ complete_dom0_memmap(struct domain *d,
    5.28              md->type == EFI_CONVENTIONAL_MEMORY) {
    5.29              unsigned long start = md->phys_addr & PAGE_MASK;
    5.30              unsigned long end = md->phys_addr +
    5.31 -                (md->num_pages << EFI_PAGE_SHIFT);
    5.32 +                                (md->num_pages << EFI_PAGE_SHIFT);
    5.33  
    5.34              if (end == start) {
    5.35                  /* md->num_pages = 0 is allowed. */
    5.36 @@ -371,8 +374,7 @@ complete_dom0_memmap(struct domain *d,
    5.37          if (efi_mmio(addr, PAGE_SIZE)) {
    5.38              unsigned long flags;
    5.39              flags = ASSIGN_writable | ASSIGN_nocache;
    5.40 -            assign_domain_mmio_page(d, addr, addr,
    5.41 -                        PAGE_SIZE, flags);
    5.42 +            assign_domain_mmio_page(d, addr, addr, PAGE_SIZE, flags);
    5.43          }
    5.44      }
    5.45      setup_dom0_memmap_info(d, tables, &num_mds);
     6.1 --- a/xen/arch/ia64/xen/dom_fw_domu.c	Wed May 23 08:51:42 2007 -0600
     6.2 +++ b/xen/arch/ia64/xen/dom_fw_domu.c	Wed May 23 10:40:19 2007 -0600
     6.3 @@ -51,6 +51,7 @@ void
     6.4  efi_systable_init_domu(struct fw_tables *tables)
     6.5  {
     6.6      int i = 1;
     6.7 +
     6.8      printk(XENLOG_GUEST XENLOG_INFO "DomainU EFI build up:");
     6.9  
    6.10      tables->efi_tables[i].guid = ACPI_20_TABLE_GUID;
    6.11 @@ -96,6 +97,7 @@ complete_domu_memmap(domain_t *d,
    6.12      /* 3 = start info page, xenstore page and console page */
    6.13      paddr_end = paddr_start + memmap_info_size + 3 * PAGE_SIZE;
    6.14      memmap_info = xen_ia64_dom_fw_map(d, paddr_start);
    6.15 +
    6.16      if (memmap_info->efi_memmap_size == 0) {
    6.17          create_memmap = 1;
    6.18      } else if (memmap_info->efi_memdesc_size != sizeof(md[0]) ||
    6.19 @@ -136,9 +138,9 @@ complete_domu_memmap(domain_t *d,
    6.20           * memory map. create it for compatibility
    6.21           */
    6.22          memmap_info->efi_memdesc_size = sizeof(md[0]);
    6.23 -        memmap_info->efi_memdesc_version =
    6.24 -            EFI_MEMORY_DESCRIPTOR_VERSION;
    6.25 +        memmap_info->efi_memdesc_version = EFI_MEMORY_DESCRIPTOR_VERSION;
    6.26          memmap_info->efi_memmap_size = 1 * sizeof(md[0]);
    6.27 +
    6.28          md = (efi_memory_desc_t*)&memmap_info->memdesc;
    6.29          md[num_mds].type = EFI_CONVENTIONAL_MEMORY;
    6.30          md[num_mds].pad = 0;
    6.31 @@ -150,6 +152,7 @@ complete_domu_memmap(domain_t *d,
    6.32  
    6.33      memmap_start = &memmap_info->memdesc;
    6.34      memmap_end = memmap_start + memmap_info->efi_memmap_size;
    6.35 +
    6.36      /* XXX Currently the table must be in a single page. */
    6.37      if ((unsigned long)memmap_end > (unsigned long)memmap_info + PAGE_SIZE) {
    6.38          xen_ia64_dom_fw_unmap(d, memmap_info);
    6.39 @@ -167,6 +170,7 @@ complete_domu_memmap(domain_t *d,
    6.40      for (p = memmap_start; p < memmap_end; p += memmap_info->efi_memdesc_size) {
    6.41          unsigned long start;
    6.42          unsigned long end;
    6.43 +
    6.44          md = p;
    6.45          start = md->phys_addr;
    6.46          end = md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT);
    6.47 @@ -178,29 +182,23 @@ complete_domu_memmap(domain_t *d,
    6.48  
    6.49          /* exclude [paddr_start, paddr_end) */
    6.50          if (paddr_end <= start || end <= paddr_start) {
    6.51 -            MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB,
    6.52 -                start, end);
    6.53 +            MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB, start, end);
    6.54          } else if (paddr_start <= start && paddr_end < end) {
    6.55 -            MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB,
    6.56 -                paddr_end, end);
    6.57 +            MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB, paddr_end, end);
    6.58          } else if (start < paddr_start && end <= paddr_end) {
    6.59 -            MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB,
    6.60 -                start, paddr_start);
    6.61 +            MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB, start, paddr_start);
    6.62          } else {
    6.63 -            MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB,
    6.64 -                start, paddr_start);
    6.65 -            MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB,
    6.66 -                paddr_end, end);
    6.67 +            MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB, start, paddr_start);
    6.68 +            MAKE_MD(EFI_CONVENTIONAL_MEMORY, EFI_MEMORY_WB, paddr_end, end);
    6.69          }
    6.70      }
    6.71  
    6.72      /* memmap info page. */
    6.73 -    MAKE_MD(EFI_RUNTIME_SERVICES_DATA, EFI_MEMORY_WB,
    6.74 -        paddr_start, paddr_end);
    6.75 +    MAKE_MD(EFI_RUNTIME_SERVICES_DATA, EFI_MEMORY_WB, paddr_start, paddr_end);
    6.76  
    6.77      /* Create an entry for IO ports.  */
    6.78      MAKE_MD(EFI_MEMORY_MAPPED_IO_PORT_SPACE, EFI_MEMORY_UC,
    6.79 -        IO_PORTS_PADDR, IO_PORTS_PADDR + IO_PORTS_SIZE);
    6.80 +            IO_PORTS_PADDR, IO_PORTS_PADDR + IO_PORTS_SIZE);
    6.81  
    6.82      num_mds = i;
    6.83      sort(tables->efi_memmap, num_mds, sizeof(efi_memory_desc_t),
     7.1 --- a/xen/arch/ia64/xen/dom_fw_utils.c	Wed May 23 08:51:42 2007 -0600
     7.2 +++ b/xen/arch/ia64/xen/dom_fw_utils.c	Wed May 23 10:40:19 2007 -0600
     7.3 @@ -41,6 +41,7 @@ xen_ia64_fpswa_revision(struct domain *d
     7.4  {
     7.5      if (fpswa_interface == NULL)
     7.6          return -ENOSYS;
     7.7 +
     7.8      *revision = fpswa_interface->revision;
     7.9      return 0;
    7.10  }
    7.11 @@ -90,6 +91,7 @@ dom_fw_set_convmem_end(struct domain *d)
    7.12          memmap_info->efi_memdesc_version !=
    7.13          EFI_MEMORY_DESCRIPTOR_VERSION)
    7.14          return -EINVAL;
    7.15 +
    7.16      /* only 1page case is supported */
    7.17      if (d->shared_info->arch.memmap_info_num_pages != 1)
    7.18          return -ENOSYS;
    7.19 @@ -111,10 +113,13 @@ dom_fw_set_convmem_end(struct domain *d)
    7.20  
    7.21      if (d->arch.convmem_end == 0)
    7.22          d->arch.convmem_end = d->max_pages << PAGE_SHIFT;
    7.23 +
    7.24      for (p = memmap_start; p < memmap_end; p += memmap_info->efi_memdesc_size) {
    7.25          unsigned long end;
    7.26 +
    7.27          md = p;
    7.28          end = md->phys_addr + (md->num_pages << EFI_PAGE_SHIFT);
    7.29 +
    7.30          if (md->attribute == EFI_MEMORY_WB &&
    7.31              md->type == EFI_CONVENTIONAL_MEMORY &&
    7.32              md->num_pages > 0 &&
    7.33 @@ -130,8 +135,8 @@ dom_fw_set_convmem_end(struct domain *d)
    7.34  static inline void
    7.35  assign_new_domain_page_if_dom0(struct domain *d, unsigned long mpaddr)
    7.36  {
    7.37 -        if (d == dom0)
    7.38 -            assign_new_domain0_page(d, mpaddr);
    7.39 +    if (d == dom0)
    7.40 +        assign_new_domain0_page(d, mpaddr);
    7.41  }
    7.42  
    7.43  int