ia64/xen-unstable

changeset 10839:1eb42266de1b

[powerpc] implement per-cpu data areas, based on x86 code
Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
author Hollis Blanchard <hollisb@us.ibm.com>
date Thu Jul 27 17:44:14 2006 -0500 (2006-07-27)
parents 1fc28f62e0ed
children e5c84586c333
files xen/arch/powerpc/Makefile xen/arch/powerpc/setup.c xen/arch/powerpc/xen.lds xen/arch/powerpc/xen.lds.S xen/include/asm-powerpc/percpu.h
line diff
     1.1 --- a/xen/arch/powerpc/Makefile	Thu Jul 27 17:23:42 2006 -0500
     1.2 +++ b/xen/arch/powerpc/Makefile	Thu Jul 27 17:44:14 2006 -0500
     1.3 @@ -109,6 +109,9 @@ boot32.o: boot/boot32.S
     1.4  asm-offsets.s: $(TARGET_SUBARCH)/asm-offsets.c $(HDRS)
     1.5  	$(CC) $(CFLAGS) -S -o $@ $<
     1.6  
     1.7 +xen.lds: xen.lds.S $(HDRS)
     1.8 +	$(CC) $(CFLAGS) -P -E $(AFLAGS) -o $@ $<
     1.9 +
    1.10  dom0.bin: $(DOM0_IMAGE)
    1.11  	cp $< $@
    1.12  
     2.1 --- a/xen/arch/powerpc/setup.c	Thu Jul 27 17:23:42 2006 -0500
     2.2 +++ b/xen/arch/powerpc/setup.c	Thu Jul 27 17:44:14 2006 -0500
     2.3 @@ -40,6 +40,7 @@
     2.4  #include <asm/cache.h>
     2.5  #include <asm/debugger.h>
     2.6  #include <asm/delay.h>
     2.7 +#include <asm/percpu.h>
     2.8  #include "exceptions.h"
     2.9  #include "of-devtree.h"
    2.10  
    2.11 @@ -68,6 +69,7 @@ cpumask_t cpu_online_map; /* missing ifd
    2.12  ulong isa_io_base;
    2.13  struct ns16550_defaults ns16550;
    2.14  
    2.15 +extern char __per_cpu_start[], __per_cpu_data_end[], __per_cpu_end[];
    2.16  extern void idle_loop(void);
    2.17  
    2.18  /* move us to a header file */
    2.19 @@ -117,6 +119,36 @@ static void hw_probe_attn(unsigned char 
    2.20      asm volatile(".long 0x00000200; nop");
    2.21  }
    2.22  
    2.23 +static void percpu_init_areas(void)
    2.24 +{
    2.25 +    unsigned int i, data_size = __per_cpu_data_end - __per_cpu_start;
    2.26 +
    2.27 +    BUG_ON(data_size > PERCPU_SIZE);
    2.28 +
    2.29 +    for ( i = 1; i < NR_CPUS; i++ )
    2.30 +        memcpy(__per_cpu_start + (i << PERCPU_SHIFT),
    2.31 +               __per_cpu_start,
    2.32 +               data_size);
    2.33 +}
    2.34 +
    2.35 +static void percpu_free_unused_areas(void)
    2.36 +{
    2.37 +    unsigned int i, first_unused;
    2.38 +
    2.39 +    /* Find first unused CPU number. */
    2.40 +    for ( i = 0; i < NR_CPUS; i++ )
    2.41 +        if ( !cpu_online(i) )
    2.42 +            break;
    2.43 +    first_unused = i;
    2.44 +
    2.45 +    /* Check that there are no holes in cpu_online_map. */
    2.46 +    for ( ; i < NR_CPUS; i++ )
    2.47 +        BUG_ON(cpu_online(i));
    2.48 +
    2.49 +    init_xenheap_pages((ulong)__per_cpu_start + (first_unused << PERCPU_SHIFT),
    2.50 +                       (ulong)__per_cpu_end);
    2.51 +}
    2.52 +
    2.53  static void __init start_of_day(void)
    2.54  {
    2.55      struct domain *idle_domain;
    2.56 @@ -135,6 +167,8 @@ static void __init start_of_day(void)
    2.57      /* for some reason we need to set our own bit in the thread map */
    2.58      cpu_set(0, cpu_sibling_map[0]);
    2.59  
    2.60 +    percpu_free_unused_areas();
    2.61 +
    2.62      initialize_keytable();
    2.63      /* Register another key that will allow for the the Harware Probe
    2.64       * to be contacted, this works with RiscWatch probes and should
    2.65 @@ -265,6 +299,8 @@ static void __init __start_xen(multiboot
    2.66      ofd_walk((void *)oftree, OFD_ROOT, ofd_dump_props, OFD_DUMP_ALL);
    2.67  #endif
    2.68  
    2.69 +    percpu_init_areas();
    2.70 +
    2.71      /* mark all memory from modules onward as unused */
    2.72      init_boot_pages(freemem, eomem);
    2.73  
     3.1 --- a/xen/arch/powerpc/xen.lds	Thu Jul 27 17:23:42 2006 -0500
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,226 +0,0 @@
     3.4 -/* Script for -z combreloc: combine and sort reloc sections */
     3.5 -OUTPUT_FORMAT("elf64-powerpc", "elf64-powerpc",
     3.6 -	      "elf64-powerpc")
     3.7 -OUTPUT_ARCH(powerpc:common64)
     3.8 -ENTRY(_start)
     3.9 -SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
    3.10 -/* Do we need any of these for elf?
    3.11 -   __DYNAMIC = 0;    */
    3.12 -SECTIONS
    3.13 -{
    3.14 -  /* Read-only sections, merged into text segment: */
    3.15 -  PROVIDE (__executable_start = 0x10000000); . = 0x10000000 + SIZEOF_HEADERS;
    3.16 -  .interp         : { *(.interp) }
    3.17 -  .hash           : { *(.hash) }
    3.18 -  .dynsym         : { *(.dynsym) }
    3.19 -  .dynstr         : { *(.dynstr) }
    3.20 -  .gnu.version    : { *(.gnu.version) }
    3.21 -  .gnu.version_d  : { *(.gnu.version_d) }
    3.22 -  .gnu.version_r  : { *(.gnu.version_r) }
    3.23 -  .rel.dyn        :
    3.24 -    {
    3.25 -      *(.rel.init)
    3.26 -      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
    3.27 -      *(.rel.fini)
    3.28 -      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
    3.29 -      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
    3.30 -      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
    3.31 -      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
    3.32 -      *(.rel.ctors)
    3.33 -      *(.rel.dtors)
    3.34 -      *(.rel.got)
    3.35 -      *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
    3.36 -      *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
    3.37 -      *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
    3.38 -      *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
    3.39 -      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
    3.40 -    }
    3.41 -  .rela.dyn       :
    3.42 -    {
    3.43 -      *(.rela.init)
    3.44 -      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
    3.45 -      *(.rela.fini)
    3.46 -      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
    3.47 -      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
    3.48 -      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
    3.49 -      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
    3.50 -      *(.rela.ctors)
    3.51 -      *(.rela.dtors)
    3.52 -      *(.rela.got)
    3.53 -      *(.rela.toc)
    3.54 -      *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
    3.55 -      *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
    3.56 -      *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
    3.57 -      *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
    3.58 -      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
    3.59 -    }
    3.60 -  .rel.plt        : { *(.rel.plt) }
    3.61 -  .rela.plt       : { *(.rela.plt) }
    3.62 -  .rela.tocbss	  : { *(.rela.tocbss) }
    3.63 -  .init           :
    3.64 -  {
    3.65 -    KEEP (*(.init))
    3.66 -  } =0x60000000
    3.67 -  .text           :
    3.68 -  {
    3.69 -    *(.text .stub .text.* .gnu.linkonce.t.*)
    3.70 -    /* .gnu.warning sections are handled specially by elf32.em.  */
    3.71 -    *(.gnu.warning)
    3.72 -    *(.sfpr .glink)
    3.73 -  } =0x60000000
    3.74 -  .fini           :
    3.75 -  {
    3.76 -    KEEP (*(.fini))
    3.77 -  } =0x60000000
    3.78 -  PROVIDE (__etext = .);
    3.79 -  PROVIDE (_etext = .);
    3.80 -  PROVIDE (etext = .);
    3.81 -  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
    3.82 -  .rodata1        : { *(.rodata1) }
    3.83 -  .sdata2         : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) }
    3.84 -  .sbss2          : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
    3.85 -  .eh_frame_hdr : { *(.eh_frame_hdr) }
    3.86 -  /* Adjust the address for the data segment.  We want to adjust up to
    3.87 -     the same address within the page on the next page up.  */
    3.88 -  . = ALIGN (0x10000) - ((0x10000 - .) & (0x10000 - 1)); . = DATA_SEGMENT_ALIGN (0x10000, 0x1000);
    3.89 -  /* Ensure the __preinit_array_start label is properly aligned.  We
    3.90 -     could instead move the label definition inside the section, but
    3.91 -     the linker would then create the section even if it turns out to
    3.92 -     be empty, which isn't pretty.  */
    3.93 -  . = ALIGN(64 / 8);
    3.94 -  PROVIDE (__preinit_array_start = .);
    3.95 -  .preinit_array     : { *(.preinit_array) }
    3.96 -  PROVIDE (__preinit_array_end = .);
    3.97 -  PROVIDE (__init_array_start = .);
    3.98 -  .init_array     : { *(.init_array) }
    3.99 -  PROVIDE (__init_array_end = .);
   3.100 -  PROVIDE (__fini_array_start = .);
   3.101 -  .fini_array     : { *(.fini_array) }
   3.102 -  PROVIDE (__fini_array_end = .);
   3.103 -  .data           :
   3.104 -  {
   3.105 -    *(.data .data.* .gnu.linkonce.d.*)
   3.106 -    SORT(CONSTRUCTORS)
   3.107 -  }
   3.108 -
   3.109 -  /* Xen addition */
   3.110 -  . = ALIGN(32);
   3.111 -  __setup_start = .;
   3.112 -  .setup.init : { *(.setup.init) }
   3.113 -  __setup_end = .;
   3.114 -  __initcall_start = .;
   3.115 -  .initcall.init : { *(.initcall.init) }
   3.116 -  __initcall_end = .;
   3.117 -  __inithcall_start = .;
   3.118 -  .inithcall.text : { *(.inithcall.text) }
   3.119 -  __inithcall_end = .;
   3.120 -  /* end Xen addition */
   3.121 -
   3.122 -  .data1          : { *(.data1) }
   3.123 -  .tdata	  : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
   3.124 -  .tbss		  : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
   3.125 -  .eh_frame       : { KEEP (*(.eh_frame)) }
   3.126 -  .gcc_except_table   : { *(.gcc_except_table) }
   3.127 -  .toc1		 ALIGN(8) : { *(.toc1) }
   3.128 -  .opd		 ALIGN(8) : { KEEP (*(.opd)) }
   3.129 -  .dynamic        : { *(.dynamic) }
   3.130 -  .ctors          :
   3.131 -  {
   3.132 -    /* gcc uses crtbegin.o to find the start of
   3.133 -       the constructors, so we make sure it is
   3.134 -       first.  Because this is a wildcard, it
   3.135 -       doesn't matter if the user does not
   3.136 -       actually link against crtbegin.o; the
   3.137 -       linker won't look for a file to match a
   3.138 -       wildcard.  The wildcard also means that it
   3.139 -       doesn't matter which directory crtbegin.o
   3.140 -       is in.  */
   3.141 -    KEEP (*crtbegin*.o(.ctors))
   3.142 -    /* We don't want to include the .ctor section from
   3.143 -       from the crtend.o file until after the sorted ctors.
   3.144 -       The .ctor section from the crtend file contains the
   3.145 -       end of ctors marker and it must be last */
   3.146 -    KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
   3.147 -    KEEP (*(SORT(.ctors.*)))
   3.148 -    KEEP (*(.ctors))
   3.149 -  }
   3.150 -  .dtors          :
   3.151 -  {
   3.152 -    KEEP (*crtbegin*.o(.dtors))
   3.153 -    KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
   3.154 -    KEEP (*(SORT(.dtors.*)))
   3.155 -    KEEP (*(.dtors))
   3.156 -  }
   3.157 -  .jcr            : { KEEP (*(.jcr)) }
   3.158 -  .got		ALIGN(8) : { *(.got .toc) }
   3.159 -  /* We want the small data sections together, so single-instruction offsets
   3.160 -     can access them all, and initialized data all before uninitialized, so
   3.161 -     we can shorten the on-disk segment size.  */
   3.162 -  .sdata          :
   3.163 -  {
   3.164 -    *(.sdata .sdata.* .gnu.linkonce.s.*)
   3.165 -  }
   3.166 -  _edata = .;
   3.167 -  PROVIDE (edata = .);
   3.168 -  __bss_start = .;
   3.169 -  .tocbss	 ALIGN(8) : { *(.tocbss)}
   3.170 -  .sbss           :
   3.171 -  {
   3.172 -    PROVIDE (__sbss_start = .);
   3.173 -    PROVIDE (___sbss_start = .);
   3.174 -    *(.dynsbss)
   3.175 -    *(.sbss .sbss.* .gnu.linkonce.sb.*)
   3.176 -    *(.scommon)
   3.177 -    PROVIDE (__sbss_end = .);
   3.178 -    PROVIDE (___sbss_end = .);
   3.179 -  }
   3.180 -  .plt            : { *(.plt) }
   3.181 -  .bss            :
   3.182 -  {
   3.183 -   *(.dynbss)
   3.184 -   *(.bss .bss.* .gnu.linkonce.b.*)
   3.185 -   *(COMMON)
   3.186 -   /* Align here to ensure that the .bss section occupies space up to
   3.187 -      _end.  Align after .bss to ensure correct alignment even if the
   3.188 -      .bss section disappears because there are no input sections.  */
   3.189 -   . = ALIGN(64 / 8);
   3.190 -  }
   3.191 -  . = ALIGN(64 / 8);
   3.192 -  _end = .;
   3.193 -  PROVIDE (end = .);
   3.194 -  . = DATA_SEGMENT_END (.);
   3.195 -  /* Stabs debugging sections.  */
   3.196 -  .stab          0 : { *(.stab) }
   3.197 -  .stabstr       0 : { *(.stabstr) }
   3.198 -  .stab.excl     0 : { *(.stab.excl) }
   3.199 -  .stab.exclstr  0 : { *(.stab.exclstr) }
   3.200 -  .stab.index    0 : { *(.stab.index) }
   3.201 -  .stab.indexstr 0 : { *(.stab.indexstr) }
   3.202 -  .comment       0 : { *(.comment) }
   3.203 -  /* DWARF debug sections.
   3.204 -     Symbols in the DWARF debugging sections are relative to the beginning
   3.205 -     of the section so we begin them at 0.  */
   3.206 -  /* DWARF 1 */
   3.207 -  .debug          0 : { *(.debug) }
   3.208 -  .line           0 : { *(.line) }
   3.209 -  /* GNU DWARF 1 extensions */
   3.210 -  .debug_srcinfo  0 : { *(.debug_srcinfo) }
   3.211 -  .debug_sfnames  0 : { *(.debug_sfnames) }
   3.212 -  /* DWARF 1.1 and DWARF 2 */
   3.213 -  .debug_aranges  0 : { *(.debug_aranges) }
   3.214 -  .debug_pubnames 0 : { *(.debug_pubnames) }
   3.215 -  /* DWARF 2 */
   3.216 -  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
   3.217 -  .debug_abbrev   0 : { *(.debug_abbrev) }
   3.218 -  .debug_line     0 : { *(.debug_line) }
   3.219 -  .debug_frame    0 : { *(.debug_frame) }
   3.220 -  .debug_str      0 : { *(.debug_str) }
   3.221 -  .debug_loc      0 : { *(.debug_loc) }
   3.222 -  .debug_macinfo  0 : { *(.debug_macinfo) }
   3.223 -  /* SGI/MIPS DWARF 2 extensions */
   3.224 -  .debug_weaknames 0 : { *(.debug_weaknames) }
   3.225 -  .debug_funcnames 0 : { *(.debug_funcnames) }
   3.226 -  .debug_typenames 0 : { *(.debug_typenames) }
   3.227 -  .debug_varnames  0 : { *(.debug_varnames) }
   3.228 -  /DISCARD/ : { *(.note.GNU-stack) }
   3.229 -}
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/xen/arch/powerpc/xen.lds.S	Thu Jul 27 17:44:14 2006 -0500
     4.3 @@ -0,0 +1,239 @@
     4.4 +#include <asm/config.h>
     4.5 +#include <asm/page.h>
     4.6 +#include <asm/percpu.h>
     4.7 +
     4.8 +/* Script for -z combreloc: combine and sort reloc sections */
     4.9 +OUTPUT_FORMAT("elf64-powerpc", "elf64-powerpc",
    4.10 +	      "elf64-powerpc")
    4.11 +OUTPUT_ARCH(powerpc:common64)
    4.12 +ENTRY(_start)
    4.13 +SEARCH_DIR("=/usr/local/lib64"); SEARCH_DIR("=/lib64"); SEARCH_DIR("=/usr/lib64"); SEARCH_DIR("=/usr/local/lib"); SEARCH_DIR("=/lib"); SEARCH_DIR("=/usr/lib");
    4.14 +/* Do we need any of these for elf?
    4.15 +   __DYNAMIC = 0;    */
    4.16 +SECTIONS
    4.17 +{
    4.18 +  /* Read-only sections, merged into text segment: */
    4.19 +  PROVIDE (__executable_start = 0x10000000); . = 0x10000000 + SIZEOF_HEADERS;
    4.20 +  .interp         : { *(.interp) }
    4.21 +  .hash           : { *(.hash) }
    4.22 +  .dynsym         : { *(.dynsym) }
    4.23 +  .dynstr         : { *(.dynstr) }
    4.24 +  .gnu.version    : { *(.gnu.version) }
    4.25 +  .gnu.version_d  : { *(.gnu.version_d) }
    4.26 +  .gnu.version_r  : { *(.gnu.version_r) }
    4.27 +  .rel.dyn        :
    4.28 +    {
    4.29 +      *(.rel.init)
    4.30 +      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
    4.31 +      *(.rel.fini)
    4.32 +      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
    4.33 +      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
    4.34 +      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
    4.35 +      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
    4.36 +      *(.rel.ctors)
    4.37 +      *(.rel.dtors)
    4.38 +      *(.rel.got)
    4.39 +      *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
    4.40 +      *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
    4.41 +      *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
    4.42 +      *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
    4.43 +      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
    4.44 +    }
    4.45 +  .rela.dyn       :
    4.46 +    {
    4.47 +      *(.rela.init)
    4.48 +      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
    4.49 +      *(.rela.fini)
    4.50 +      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
    4.51 +      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
    4.52 +      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
    4.53 +      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
    4.54 +      *(.rela.ctors)
    4.55 +      *(.rela.dtors)
    4.56 +      *(.rela.got)
    4.57 +      *(.rela.toc)
    4.58 +      *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
    4.59 +      *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
    4.60 +      *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
    4.61 +      *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
    4.62 +      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
    4.63 +    }
    4.64 +  .rel.plt        : { *(.rel.plt) }
    4.65 +  .rela.plt       : { *(.rela.plt) }
    4.66 +  .rela.tocbss	  : { *(.rela.tocbss) }
    4.67 +  .init           :
    4.68 +  {
    4.69 +    KEEP (*(.init))
    4.70 +  } =0x60000000
    4.71 +  .text           :
    4.72 +  {
    4.73 +    *(.text .stub .text.* .gnu.linkonce.t.*)
    4.74 +    /* .gnu.warning sections are handled specially by elf32.em.  */
    4.75 +    *(.gnu.warning)
    4.76 +    *(.sfpr .glink)
    4.77 +  } =0x60000000
    4.78 +  .fini           :
    4.79 +  {
    4.80 +    KEEP (*(.fini))
    4.81 +  } =0x60000000
    4.82 +  PROVIDE (__etext = .);
    4.83 +  PROVIDE (_etext = .);
    4.84 +  PROVIDE (etext = .);
    4.85 +  .rodata         : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
    4.86 +  .rodata1        : { *(.rodata1) }
    4.87 +  .sdata2         : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) }
    4.88 +  .sbss2          : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
    4.89 +  .eh_frame_hdr : { *(.eh_frame_hdr) }
    4.90 +  /* Adjust the address for the data segment.  We want to adjust up to
    4.91 +     the same address within the page on the next page up.  */
    4.92 +  . = ALIGN (0x10000) - ((0x10000 - .) & (0x10000 - 1)); . = DATA_SEGMENT_ALIGN (0x10000, 0x1000);
    4.93 +  /* Ensure the __preinit_array_start label is properly aligned.  We
    4.94 +     could instead move the label definition inside the section, but
    4.95 +     the linker would then create the section even if it turns out to
    4.96 +     be empty, which isn't pretty.  */
    4.97 +  . = ALIGN(64 / 8);
    4.98 +  PROVIDE (__preinit_array_start = .);
    4.99 +  .preinit_array     : { *(.preinit_array) }
   4.100 +  PROVIDE (__preinit_array_end = .);
   4.101 +  PROVIDE (__init_array_start = .);
   4.102 +  .init_array     : { *(.init_array) }
   4.103 +  PROVIDE (__init_array_end = .);
   4.104 +  PROVIDE (__fini_array_start = .);
   4.105 +  .fini_array     : { *(.fini_array) }
   4.106 +  PROVIDE (__fini_array_end = .);
   4.107 +  .data           :
   4.108 +  {
   4.109 +    *(.data .data.* .gnu.linkonce.d.*)
   4.110 +    SORT(CONSTRUCTORS)
   4.111 +  }
   4.112 +
   4.113 +  /* Xen addition */
   4.114 +
   4.115 +  . = ALIGN(32);
   4.116 +  __setup_start = .;
   4.117 +  .setup.init : { *(.setup.init) }
   4.118 +  __setup_end = .;
   4.119 +  __initcall_start = .;
   4.120 +  .initcall.init : { *(.initcall.init) }
   4.121 +  __initcall_end = .;
   4.122 +  __inithcall_start = .;
   4.123 +  .inithcall.text : { *(.inithcall.text) }
   4.124 +  __inithcall_end = .;
   4.125 +
   4.126 +  __per_cpu_start = .;
   4.127 +  .data.percpu : { *(.data.percpu) } :text
   4.128 +  __per_cpu_data_end = .;
   4.129 +  . = __per_cpu_start + (NR_CPUS << PERCPU_SHIFT);
   4.130 +  . = ALIGN(STACK_SIZE);
   4.131 +  __per_cpu_end = .;
   4.132 +
   4.133 +  /* end Xen addition */
   4.134 +
   4.135 +  .data1          : { *(.data1) }
   4.136 +  .tdata	  : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
   4.137 +  .tbss		  : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
   4.138 +  .eh_frame       : { KEEP (*(.eh_frame)) }
   4.139 +  .gcc_except_table   : { *(.gcc_except_table) }
   4.140 +  .toc1		 ALIGN(8) : { *(.toc1) }
   4.141 +  .opd		 ALIGN(8) : { KEEP (*(.opd)) }
   4.142 +  .dynamic        : { *(.dynamic) }
   4.143 +  .ctors          :
   4.144 +  {
   4.145 +    /* gcc uses crtbegin.o to find the start of
   4.146 +       the constructors, so we make sure it is
   4.147 +       first.  Because this is a wildcard, it
   4.148 +       doesn't matter if the user does not
   4.149 +       actually link against crtbegin.o; the
   4.150 +       linker won't look for a file to match a
   4.151 +       wildcard.  The wildcard also means that it
   4.152 +       doesn't matter which directory crtbegin.o
   4.153 +       is in.  */
   4.154 +    KEEP (*crtbegin*.o(.ctors))
   4.155 +    /* We don't want to include the .ctor section from
   4.156 +       from the crtend.o file until after the sorted ctors.
   4.157 +       The .ctor section from the crtend file contains the
   4.158 +       end of ctors marker and it must be last */
   4.159 +    KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
   4.160 +    KEEP (*(SORT(.ctors.*)))
   4.161 +    KEEP (*(.ctors))
   4.162 +  }
   4.163 +  .dtors          :
   4.164 +  {
   4.165 +    KEEP (*crtbegin*.o(.dtors))
   4.166 +    KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
   4.167 +    KEEP (*(SORT(.dtors.*)))
   4.168 +    KEEP (*(.dtors))
   4.169 +  }
   4.170 +  .jcr            : { KEEP (*(.jcr)) }
   4.171 +  .got		ALIGN(8) : { *(.got .toc) }
   4.172 +  /* We want the small data sections together, so single-instruction offsets
   4.173 +     can access them all, and initialized data all before uninitialized, so
   4.174 +     we can shorten the on-disk segment size.  */
   4.175 +  .sdata          :
   4.176 +  {
   4.177 +    *(.sdata .sdata.* .gnu.linkonce.s.*)
   4.178 +  }
   4.179 +  _edata = .;
   4.180 +  PROVIDE (edata = .);
   4.181 +  __bss_start = .;
   4.182 +  .tocbss	 ALIGN(8) : { *(.tocbss)}
   4.183 +  .sbss           :
   4.184 +  {
   4.185 +    PROVIDE (__sbss_start = .);
   4.186 +    PROVIDE (___sbss_start = .);
   4.187 +    *(.dynsbss)
   4.188 +    *(.sbss .sbss.* .gnu.linkonce.sb.*)
   4.189 +    *(.scommon)
   4.190 +    PROVIDE (__sbss_end = .);
   4.191 +    PROVIDE (___sbss_end = .);
   4.192 +  }
   4.193 +  .plt            : { *(.plt) }
   4.194 +  .bss            :
   4.195 +  {
   4.196 +   *(.dynbss)
   4.197 +   *(.bss .bss.* .gnu.linkonce.b.*)
   4.198 +   *(COMMON)
   4.199 +   /* Align here to ensure that the .bss section occupies space up to
   4.200 +      _end.  Align after .bss to ensure correct alignment even if the
   4.201 +      .bss section disappears because there are no input sections.  */
   4.202 +   . = ALIGN(64 / 8);
   4.203 +  }
   4.204 +  . = ALIGN(64 / 8);
   4.205 +  _end = .;
   4.206 +  PROVIDE (end = .);
   4.207 +  . = DATA_SEGMENT_END (.);
   4.208 +  /* Stabs debugging sections.  */
   4.209 +  .stab          0 : { *(.stab) }
   4.210 +  .stabstr       0 : { *(.stabstr) }
   4.211 +  .stab.excl     0 : { *(.stab.excl) }
   4.212 +  .stab.exclstr  0 : { *(.stab.exclstr) }
   4.213 +  .stab.index    0 : { *(.stab.index) }
   4.214 +  .stab.indexstr 0 : { *(.stab.indexstr) }
   4.215 +  .comment       0 : { *(.comment) }
   4.216 +  /* DWARF debug sections.
   4.217 +     Symbols in the DWARF debugging sections are relative to the beginning
   4.218 +     of the section so we begin them at 0.  */
   4.219 +  /* DWARF 1 */
   4.220 +  .debug          0 : { *(.debug) }
   4.221 +  .line           0 : { *(.line) }
   4.222 +  /* GNU DWARF 1 extensions */
   4.223 +  .debug_srcinfo  0 : { *(.debug_srcinfo) }
   4.224 +  .debug_sfnames  0 : { *(.debug_sfnames) }
   4.225 +  /* DWARF 1.1 and DWARF 2 */
   4.226 +  .debug_aranges  0 : { *(.debug_aranges) }
   4.227 +  .debug_pubnames 0 : { *(.debug_pubnames) }
   4.228 +  /* DWARF 2 */
   4.229 +  .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
   4.230 +  .debug_abbrev   0 : { *(.debug_abbrev) }
   4.231 +  .debug_line     0 : { *(.debug_line) }
   4.232 +  .debug_frame    0 : { *(.debug_frame) }
   4.233 +  .debug_str      0 : { *(.debug_str) }
   4.234 +  .debug_loc      0 : { *(.debug_loc) }
   4.235 +  .debug_macinfo  0 : { *(.debug_macinfo) }
   4.236 +  /* SGI/MIPS DWARF 2 extensions */
   4.237 +  .debug_weaknames 0 : { *(.debug_weaknames) }
   4.238 +  .debug_funcnames 0 : { *(.debug_funcnames) }
   4.239 +  .debug_typenames 0 : { *(.debug_typenames) }
   4.240 +  .debug_varnames  0 : { *(.debug_varnames) }
   4.241 +  /DISCARD/ : { *(.note.GNU-stack) }
   4.242 +}
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/xen/include/asm-powerpc/percpu.h	Thu Jul 27 17:44:14 2006 -0500
     5.3 @@ -0,0 +1,22 @@
     5.4 +/* from xen/include/asm-x86/percpu.h */
     5.5 +
     5.6 +#ifndef __PPC_PERCPU_H__
     5.7 +#define __PPC_PERCPU_H__
     5.8 +
     5.9 +#define PERCPU_SHIFT 12
    5.10 +#define PERCPU_SIZE  (1UL << PERCPU_SHIFT)
    5.11 +
    5.12 +/* Separate out the type, so (int[3], foo) works. */
    5.13 +#define DEFINE_PER_CPU(type, name)                      \
    5.14 +    __attribute__((__section__(".data.percpu")))        \
    5.15 +    __typeof__(type) per_cpu__##name
    5.16 +
    5.17 +/* var is in discarded region: offset to particular copy we want */
    5.18 +#define per_cpu(var, cpu)  \
    5.19 +    (*RELOC_HIDE(&per_cpu__##var, ((unsigned int)(cpu))<<PERCPU_SHIFT))
    5.20 +#define __get_cpu_var(var) \
    5.21 +    (per_cpu(var, smp_processor_id()))
    5.22 +
    5.23 +#define DECLARE_PER_CPU(type, name) extern __typeof__(type) per_cpu__##name
    5.24 +
    5.25 +#endif /* __PPC_PERCPU_H__ */