direct-io.hg

changeset 12920:489e4d09ffb7

[XEN][POWERPC] Conistence with log vs. order
We use "log" for a log2 value, "order" is the log2 of page size, so:
order = log - PAGE_SHIFT
It is confusing, but more so if we are not consistent.
Signed-off-by: Jimi Xenidis <jimix@watson.ibm.com>
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Jimi Xenidis <jimix@watson.ibm.com>
date Fri Sep 29 09:53:39 2006 -0400 (2006-09-29)
parents a69f935eda6c
children 2985a7a12706
files xen/arch/powerpc/domctl.c xen/arch/powerpc/powerpc64/ppc970.c xen/include/asm-powerpc/processor.h
line diff
     1.1 --- a/xen/arch/powerpc/domctl.c	Thu Sep 28 22:31:23 2006 -0400
     1.2 +++ b/xen/arch/powerpc/domctl.c	Fri Sep 29 09:53:39 2006 -0400
     1.3 @@ -96,14 +96,14 @@ long arch_do_domctl(struct xen_domctl *d
     1.4      case XEN_DOMCTL_real_mode_area:
     1.5      {
     1.6          struct domain *d;
     1.7 -        unsigned int log = domctl->u.real_mode_area.log;
     1.8 +        unsigned int order = domctl->u.real_mode_area.log - PAGE_SHIFT;
     1.9  
    1.10          ret = -ESRCH;
    1.11          d = find_domain_by_id(domctl->domain);
    1.12          if (d != NULL) {
    1.13              ret = -EINVAL;
    1.14 -            if (cpu_rma_valid(log))
    1.15 -                ret = allocate_rma(d, log - PAGE_SHIFT);
    1.16 +            if (cpu_rma_valid(order))
    1.17 +                ret = allocate_rma(d, order);
    1.18              put_domain(d);
    1.19          }
    1.20      }
     2.1 --- a/xen/arch/powerpc/powerpc64/ppc970.c	Thu Sep 28 22:31:23 2006 -0400
     2.2 +++ b/xen/arch/powerpc/powerpc64/ppc970.c	Fri Sep 29 09:53:39 2006 -0400
     2.3 @@ -45,42 +45,43 @@ struct cpu_caches cpu_caches = {
     2.4  };
     2.5  
     2.6  struct rma_settings {
     2.7 -    int order;
     2.8 +    int log;
     2.9      int rmlr_0;
    2.10      int rmlr_1_2;
    2.11  };
    2.12  
    2.13 -static struct rma_settings rma_orders[] = {
    2.14 -    { .order = 26, .rmlr_0 = 0, .rmlr_1_2 = 3, }, /*  64 MB */
    2.15 -    { .order = 27, .rmlr_0 = 1, .rmlr_1_2 = 3, }, /* 128 MB */
    2.16 -    { .order = 28, .rmlr_0 = 1, .rmlr_1_2 = 0, }, /* 256 MB */
    2.17 -    { .order = 30, .rmlr_0 = 0, .rmlr_1_2 = 2, }, /*   1 GB */
    2.18 -    { .order = 34, .rmlr_0 = 0, .rmlr_1_2 = 1, }, /*  16 GB */
    2.19 -    { .order = 38, .rmlr_0 = 0, .rmlr_1_2 = 0, }, /* 256 GB */
    2.20 +static struct rma_settings rma_logs[] = {
    2.21 +    { .log = 26, .rmlr_0 = 0, .rmlr_1_2 = 3, }, /*  64 MB */
    2.22 +    { .log = 27, .rmlr_0 = 1, .rmlr_1_2 = 3, }, /* 128 MB */
    2.23 +    { .log = 28, .rmlr_0 = 1, .rmlr_1_2 = 0, }, /* 256 MB */
    2.24 +    { .log = 30, .rmlr_0 = 0, .rmlr_1_2 = 2, }, /*   1 GB */
    2.25 +    { .log = 34, .rmlr_0 = 0, .rmlr_1_2 = 1, }, /*  16 GB */
    2.26 +    { .log = 38, .rmlr_0 = 0, .rmlr_1_2 = 0, }, /* 256 GB */
    2.27  };
    2.28  
    2.29  static uint log_large_page_sizes[] = {
    2.30      4 + 20, /* (1 << 4) == 16M */
    2.31  };
    2.32  
    2.33 -static struct rma_settings *cpu_find_rma(unsigned int order)
    2.34 +static struct rma_settings *cpu_find_rma(unsigned int log)
    2.35  {
    2.36      int i;
    2.37 -    for (i = 0; i < ARRAY_SIZE(rma_orders); i++) {
    2.38 -        if (rma_orders[i].order == order)
    2.39 -            return &rma_orders[i];
    2.40 +
    2.41 +    for (i = 0; i < ARRAY_SIZE(rma_logs); i++) {
    2.42 +        if (rma_logs[i].log == log)
    2.43 +            return &rma_logs[i];
    2.44      }
    2.45      return NULL;
    2.46  }
    2.47  
    2.48  unsigned int cpu_default_rma_order_pages(void)
    2.49  {
    2.50 -    return rma_orders[0].order - PAGE_SHIFT;
    2.51 +    return rma_logs[0].log - PAGE_SHIFT;
    2.52  }
    2.53  
    2.54 -int cpu_rma_valid(unsigned int log)
    2.55 +int cpu_rma_valid(unsigned int order)
    2.56  {
    2.57 -    return cpu_find_rma(log) != NULL;
    2.58 +    return cpu_find_rma(order + PAGE_SHIFT) != NULL;
    2.59  }
    2.60  
    2.61  unsigned int cpu_large_page_orders(uint *sizes, uint max)
     3.1 --- a/xen/include/asm-powerpc/processor.h	Thu Sep 28 22:31:23 2006 -0400
     3.2 +++ b/xen/include/asm-powerpc/processor.h	Fri Sep 29 09:53:39 2006 -0400
     3.3 @@ -120,7 +120,7 @@ extern int cpu_machinecheck(struct cpu_u
     3.4  extern void show_registers(struct cpu_user_regs *);
     3.5  extern unsigned int cpu_extent_order(void);
     3.6  extern unsigned int cpu_default_rma_order_pages(void);
     3.7 -extern int cpu_rma_valid(unsigned int log);
     3.8 +extern int cpu_rma_valid(unsigned int order);
     3.9  extern uint cpu_large_page_orders(uint *sizes, uint max);
    3.10  extern void cpu_initialize(int cpuid);
    3.11  extern void cpu_init_vcpu(struct vcpu *);