debuggers.hg

view linux-2.6-xen-sparse/arch/xen/x86_64/kernel/head64.c @ 6680:d0a4f770a5f4

phys_to_mach and mach_to_phys tables contain long entries, not
32-bit entries.

Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Tue Sep 06 18:01:24 2005 +0000 (2005-09-06)
parents 1f460d0fd6c6
children 8db9c5873b9b
line source
1 /*
2 * linux/arch/x86_64/kernel/head64.c -- prepare to run common code
3 *
4 * Copyright (C) 2000 Andrea Arcangeli <andrea@suse.de> SuSE
5 *
6 * $Id: head64.c,v 1.22 2001/07/06 14:28:20 ak Exp $
7 *
8 * Jun Nakajima <jun.nakajima@intel.com>
9 * Modified for Xen.
10 */
12 #include <linux/init.h>
13 #include <linux/linkage.h>
14 #include <linux/types.h>
15 #include <linux/kernel.h>
16 #include <linux/string.h>
17 #include <linux/percpu.h>
19 #include <asm/processor.h>
20 #include <asm/proto.h>
21 #include <asm/smp.h>
22 #include <asm/bootsetup.h>
23 #include <asm/setup.h>
24 #include <asm/desc.h>
26 unsigned long start_pfn;
28 /* Don't add a printk in there. printk relies on the PDA which is not initialized
29 yet. */
30 #if 0
31 static void __init clear_bss(void)
32 {
33 extern char __bss_start[], __bss_end[];
34 memset(__bss_start, 0,
35 (unsigned long) __bss_end - (unsigned long) __bss_start);
36 }
37 #endif
39 #define NEW_CL_POINTER 0x228 /* Relative to real mode data */
40 #define OLD_CL_MAGIC_ADDR 0x90020
41 #define OLD_CL_MAGIC 0xA33F
42 #define OLD_CL_BASE_ADDR 0x90000
43 #define OLD_CL_OFFSET 0x90022
45 extern char saved_command_line[];
47 #if 0
48 static void __init copy_bootdata(char *real_mode_data)
49 {
50 int new_data;
51 char * command_line;
53 memcpy(x86_boot_params, real_mode_data, BOOT_PARAM_SIZE);
54 new_data = *(int *) (x86_boot_params + NEW_CL_POINTER);
55 if (!new_data) {
56 if (OLD_CL_MAGIC != * (u16 *) OLD_CL_MAGIC_ADDR) {
57 printk("so old bootloader that it does not support commandline?!\n");
58 return;
59 }
60 new_data = OLD_CL_BASE_ADDR + * (u16 *) OLD_CL_OFFSET;
61 printk("old bootloader convention, maybe loadlin?\n");
62 }
63 command_line = (char *) ((u64)(new_data));
64 memcpy(saved_command_line, command_line, COMMAND_LINE_SIZE);
65 printk("Bootdata ok (command line is %s)\n", saved_command_line);
66 }
67 #endif
69 static void __init setup_boot_cpu_data(void)
70 {
71 int dummy, eax;
73 /* get vendor info */
74 cpuid(0, &boot_cpu_data.cpuid_level,
75 (int *)&boot_cpu_data.x86_vendor_id[0],
76 (int *)&boot_cpu_data.x86_vendor_id[8],
77 (int *)&boot_cpu_data.x86_vendor_id[4]);
79 /* get cpu type */
80 cpuid(1, &eax, &dummy, &dummy,
81 (unsigned int *) &boot_cpu_data.x86_capability);
82 boot_cpu_data.x86 = (eax >> 8) & 0xf;
83 boot_cpu_data.x86_model = (eax >> 4) & 0xf;
84 boot_cpu_data.x86_mask = eax & 0xf;
85 }
87 extern char _end[];
89 void __init x86_64_start_kernel(char * real_mode_data)
90 {
91 int i;
93 phys_to_machine_mapping = (unsigned long *)xen_start_info->mfn_list;
94 start_pfn = (__pa(xen_start_info->pt_base) >> PAGE_SHIFT) +
95 xen_start_info->nr_pt_frames;
97 for (i = 0; i < 256; i++)
98 set_intr_gate(i, early_idt_handler);
99 #if 0
100 asm volatile("lidt %0" :: "m" (idt_descr));
101 #endif
102 pda_init(0);
103 /* copy_bootdata(real_mode_data); */
104 #ifdef CONFIG_SMP
105 cpu_set(0, cpu_online_map);
106 #endif
107 #if 0
108 s = strstr(saved_command_line, "earlyprintk=");
109 if (s != NULL)
110 setup_early_printk(s);
111 #endif
113 #ifdef CONFIG_DISCONTIGMEM
114 s = strstr(saved_command_line, "numa=");
115 if (s != NULL)
116 numa_setup(s+5);
117 #endif
118 #ifdef CONFIG_X86_IO_APIC
119 if (strstr(saved_command_line, "disableapic"))
120 disable_apic = 1;
121 #endif
122 /* You need early console to see that */
123 if (__pa_symbol(&_end) >= KERNEL_TEXT_SIZE)
124 panic("Kernel too big for kernel mapping\n");
126 setup_boot_cpu_data();
127 start_kernel();
128 }