debuggers.hg

view xen/arch/ia64/patch/linux-2.6.11/setup.c @ 4615:58efb3448933

bitkeeper revision 1.1327.1.1 (426536d2PUqtjTi2v06bzD10RFwarg)

Merge bk://xen.bkbits.net/xeno-unstable.bk
into bkbits.net:/repos/x/xen-ia64/xeno-unstable-ia64.bk
author xen-ia64.adm@bkbits.net
date Tue Apr 19 16:50:26 2005 +0000 (2005-04-19)
parents f1c946e1226a
children 5b9e241131fb 593703cf4935
line source
1 setup.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++-------------
2 1 files changed, 58 insertions(+), 14 deletions(-)
4 Index: linux-2.6.11-xendiffs/arch/ia64/kernel/setup.c
5 ===================================================================
6 --- linux-2.6.11-xendiffs.orig/arch/ia64/kernel/setup.c 2005-04-07 17:44:13.294980153 -0500
7 +++ linux-2.6.11-xendiffs/arch/ia64/kernel/setup.c 2005-04-07 17:46:37.157717072 -0500
8 @@ -21,6 +21,9 @@
9 #include <linux/init.h>
11 #include <linux/acpi.h>
12 +#ifdef XEN
13 +#include <xen/sched.h>
14 +#endif
15 #include <linux/bootmem.h>
16 #include <linux/console.h>
17 #include <linux/delay.h>
18 @@ -30,13 +33,17 @@
19 #include <linux/seq_file.h>
20 #include <linux/string.h>
21 #include <linux/threads.h>
22 +#ifndef XEN
23 #include <linux/tty.h>
24 #include <linux/serial.h>
25 #include <linux/serial_core.h>
26 +#endif
27 #include <linux/efi.h>
28 #include <linux/initrd.h>
30 +#ifndef XEN
31 #include <asm/ia32.h>
32 +#endif
33 #include <asm/machvec.h>
34 #include <asm/mca.h>
35 #include <asm/meminit.h>
36 @@ -51,6 +58,12 @@
37 #include <asm/smp.h>
38 #include <asm/system.h>
39 #include <asm/unistd.h>
40 +#ifdef XEN
41 +#include <linux/mm.h>
42 +#include <asm/mmu_context.h>
43 +extern unsigned long loops_per_jiffy; // from linux/init/main.c
44 +char saved_command_line[COMMAND_LINE_SIZE]; // from linux/init/main.c
45 +#endif
47 #if defined(CONFIG_SMP) && (IA64_CPU_SIZE > PAGE_SIZE)
48 # error "struct cpuinfo_ia64 too big!"
49 @@ -66,7 +79,9 @@ DEFINE_PER_CPU(unsigned long, local_per_
50 DEFINE_PER_CPU(unsigned long, ia64_phys_stacked_size_p8);
51 unsigned long ia64_cycles_per_usec;
52 struct ia64_boot_param *ia64_boot_param;
53 +#ifndef XEN
54 struct screen_info screen_info;
55 +#endif
57 unsigned long ia64_max_cacheline_size;
58 unsigned long ia64_iobase; /* virtual address for I/O accesses */
59 @@ -95,7 +110,6 @@ EXPORT_SYMBOL(ia64_max_iommu_merge_mask)
60 struct rsvd_region rsvd_region[IA64_MAX_RSVD_REGIONS + 1];
61 int num_rsvd_regions;
63 -
64 /*
65 * Filter incoming memory segments based on the primitive map created from the boot
66 * parameters. Segments contained in the map are removed from the memory ranges. A
67 @@ -125,9 +139,12 @@ filter_rsvd_memory (unsigned long start,
68 for (i = 0; i < num_rsvd_regions; ++i) {
69 range_start = max(start, prev_start);
70 range_end = min(end, rsvd_region[i].start);
71 -
72 - if (range_start < range_end)
73 - call_pernode_memory(__pa(range_start), range_end - range_start, func);
74 + /* init_boot_pages requires "ps, pe" */
75 + if (range_start < range_end) {
76 + printk("Init boot pages: 0x%lx -> 0x%lx.\n",
77 + __pa(range_start), __pa(range_end));
78 + (*func)(__pa(range_start), __pa(range_end), 0);
79 + }
81 /* nothing more available in this segment */
82 if (range_end == end) return 0;
83 @@ -184,17 +201,17 @@ reserve_memory (void)
84 + strlen(__va(ia64_boot_param->command_line)) + 1);
85 n++;
87 + /* Reserve xen image/bitmap/xen-heap */
88 rsvd_region[n].start = (unsigned long) ia64_imva((void *)KERNEL_START);
89 - rsvd_region[n].end = (unsigned long) ia64_imva(_end);
90 + rsvd_region[n].end = rsvd_region[n].start + xenheap_size;
91 n++;
93 -#ifdef CONFIG_BLK_DEV_INITRD
94 + /* This is actually dom0 image */
95 if (ia64_boot_param->initrd_start) {
96 rsvd_region[n].start = (unsigned long)__va(ia64_boot_param->initrd_start);
97 rsvd_region[n].end = rsvd_region[n].start + ia64_boot_param->initrd_size;
98 n++;
99 }
100 -#endif
102 /* end of memory marker */
103 rsvd_region[n].start = ~0UL;
104 @@ -204,6 +221,16 @@ reserve_memory (void)
105 num_rsvd_regions = n;
107 sort_regions(rsvd_region, num_rsvd_regions);
108 +
109 + {
110 + int i;
111 + printk("Reserved regions: \n");
112 + for (i = 0; i < num_rsvd_regions; i++)
113 + printk(" [%d] -> [0x%lx, 0x%lx]\n",
114 + i,
115 + rsvd_region[i].start,
116 + rsvd_region[i].end);
117 + }
118 }
120 /**
121 @@ -298,18 +325,17 @@ mark_bsp_online (void)
122 #endif
123 }
125 +#ifdef XEN
126 void __init
127 -setup_arch (char **cmdline_p)
128 +early_setup_arch (char **cmdline_p)
129 {
130 unw_init();
132 - ia64_patch_vtop((u64) __start___vtop_patchlist, (u64) __end___vtop_patchlist);
133 -
134 *cmdline_p = __va(ia64_boot_param->command_line);
135 strlcpy(saved_command_line, *cmdline_p, COMMAND_LINE_SIZE);
136 + cmdline_parse(*cmdline_p);
138 efi_init();
139 - io_port_init();
141 #ifdef CONFIG_IA64_GENERIC
142 {
143 @@ -339,6 +365,10 @@ setup_arch (char **cmdline_p)
144 if (early_console_setup(*cmdline_p) == 0)
145 mark_bsp_online();
147 +#ifdef XEN
148 +#undef CONFIG_ACPI_BOOT
149 +#endif
150 +
151 #ifdef CONFIG_ACPI_BOOT
152 /* Initialize the ACPI boot-time table parser */
153 acpi_table_init();
154 @@ -350,9 +380,13 @@ setup_arch (char **cmdline_p)
155 smp_build_cpu_map(); /* happens, e.g., with the Ski simulator */
156 # endif
157 #endif /* CONFIG_APCI_BOOT */
158 + io_port_init();
159 +}
160 +#endif
162 - find_memory();
163 -
164 +void __init
165 +setup_arch (void)
166 +{
167 /* process SAL system table: */
168 ia64_sal_init(efi.sal_systab);
170 @@ -388,7 +422,6 @@ setup_arch (char **cmdline_p)
171 if (!strstr(saved_command_line, "nomca"))
172 ia64_mca_init();
174 - platform_setup(cmdline_p);
175 paging_init();
176 }
178 @@ -448,6 +481,9 @@ show_cpuinfo (struct seq_file *m, void *
179 sprintf(cp, " 0x%lx", mask);
180 }
182 +#ifdef XEN
183 +#define seq_printf(a,b...) printf(b)
184 +#endif
185 seq_printf(m,
186 "processor : %d\n"
187 "vendor : %s\n"
188 @@ -659,11 +695,17 @@ cpu_init (void)
189 | IA64_DCR_DA | IA64_DCR_DD | IA64_DCR_LC));
190 atomic_inc(&init_mm.mm_count);
191 current->active_mm = &init_mm;
192 +#ifdef XEN
193 + if (current->domain->arch.mm)
194 +#else
195 if (current->mm)
196 +#endif
197 BUG();
199 ia64_mmu_init(ia64_imva(cpu_data));
200 +#ifndef XEN
201 ia64_mca_cpu_init(ia64_imva(cpu_data));
202 +#endif
204 #ifdef CONFIG_IA32_SUPPORT
205 ia32_cpu_init();
206 @@ -711,6 +753,8 @@ cpu_init (void)
207 void
208 check_bugs (void)
209 {
210 +#ifndef XEN
211 ia64_patch_mckinley_e9((unsigned long) __start___mckinley_e9_bundles,
212 (unsigned long) __end___mckinley_e9_bundles);
213 +#endif
214 }