direct-io.hg

changeset 12517:40a61d01e9dc

[HVM] Set VIOAPIC ID to a value that does not conflict with LAPIC IDs.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kfraser@localhost.localdomain
date Wed Nov 22 11:52:46 2006 +0000 (2006-11-22)
parents 18cd7d886949
children 899fb1b891a9
files tools/firmware/hvmloader/acpi/static_tables.c tools/firmware/hvmloader/config.h tools/firmware/hvmloader/hvmloader.c tools/firmware/hvmloader/mp_tables.c
line diff
     1.1 --- a/tools/firmware/hvmloader/acpi/static_tables.c	Wed Nov 22 10:31:50 2006 +0000
     1.2 +++ b/tools/firmware/hvmloader/acpi/static_tables.c	Wed Nov 22 11:52:46 2006 +0000
     1.3 @@ -17,6 +17,7 @@
     1.4   */
     1.5  
     1.6  #include "acpi2_0.h"
     1.7 +#include "../config.h"
     1.8  #include <xen/hvm/ioreq.h>
     1.9  
    1.10  /*
    1.11 @@ -35,16 +36,17 @@ struct acpi_20_madt Madt = {
    1.12              .creator_id   = ACPI_CREATOR_ID,
    1.13              .creator_revision = ACPI_CREATOR_REVISION
    1.14          },
    1.15 -        .lapic_addr = 0xFEE00000,
    1.16 +        .lapic_addr = LAPIC_BASE_ADDRESS,
    1.17          .flags      = ACPI_PCAT_COMPAT
    1.18      },
    1.19  
    1.20      /* IO APIC */
    1.21      .io_apic = {
    1.22          [0] = {
    1.23 -            .type        = ACPI_IO_APIC,                         
    1.24 +            .type        = ACPI_IO_APIC,
    1.25              .length      = sizeof(struct acpi_20_madt_ioapic),
    1.26 -            .ioapic_addr = 0xFEC00000
    1.27 +            .ioapic_id   = IOAPIC_ID,
    1.28 +            .ioapic_addr = IOAPIC_BASE_ADDRESS
    1.29          }
    1.30      },
    1.31  
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/tools/firmware/hvmloader/config.h	Wed Nov 22 11:52:46 2006 +0000
     2.3 @@ -0,0 +1,10 @@
     2.4 +#ifndef __HVMLOADER_CONFIG_H__
     2.5 +#define __HVMLOADER_CONFIG_H__
     2.6 +
     2.7 +#define IOAPIC_BASE_ADDRESS 0xfec00000
     2.8 +#define IOAPIC_ID           0xfe
     2.9 +#define IOAPIC_VERSION      0x11
    2.10 +
    2.11 +#define LAPIC_BASE_ADDRESS  0xfee00000
    2.12 +
    2.13 +#endif /* __HVMLOADER_CONFIG_H__ */
     3.1 --- a/tools/firmware/hvmloader/hvmloader.c	Wed Nov 22 10:31:50 2006 +0000
     3.2 +++ b/tools/firmware/hvmloader/hvmloader.c	Wed Nov 22 11:52:46 2006 +0000
     3.3 @@ -27,54 +27,51 @@
     3.4  #include "util.h"
     3.5  #include "acpi_utils.h"
     3.6  #include "smbios.h"
     3.7 +#include "config.h"
     3.8  #include <xen/version.h>
     3.9  #include <xen/hvm/params.h>
    3.10  
    3.11  /* memory map */
    3.12 -#define HYPERCALL_PHYSICAL_ADDRESS	0x00080000
    3.13 -#define VGABIOS_PHYSICAL_ADDRESS	0x000C0000
    3.14 -#define	VMXASSIST_PHYSICAL_ADDRESS	0x000D0000
    3.15 -#define	ROMBIOS_PHYSICAL_ADDRESS	0x000F0000
    3.16 +#define HYPERCALL_PHYSICAL_ADDRESS    0x00080000
    3.17 +#define VGABIOS_PHYSICAL_ADDRESS      0x000C0000
    3.18 +#define VMXASSIST_PHYSICAL_ADDRESS    0x000D0000
    3.19 +#define ROMBIOS_PHYSICAL_ADDRESS      0x000F0000
    3.20  
    3.21  /* invoke SVM's paged realmode support */
    3.22 -#define SVM_VMMCALL_RESET_TO_REALMODE	0x80000001
    3.23 +#define SVM_VMMCALL_RESET_TO_REALMODE 0x80000001
    3.24  
    3.25  /*
    3.26   * C runtime start off
    3.27   */
    3.28  asm(
    3.29 -"	.text				\n"
    3.30 -"	.globl	_start			\n"
    3.31 -"_start:				\n"
    3.32 -"	cld				\n"
    3.33 -"	cli				\n"
    3.34 -"	lgdt	gdt_desr		\n"
    3.35 -"	movl	$stack_top, %esp	\n"
    3.36 -"	movl	%esp, %ebp		\n"
    3.37 -"	call	main			\n"
    3.38 -"	jmp	halt			\n"
    3.39 -"					\n"
    3.40 -"gdt_desr:				\n"
    3.41 -"	.word	gdt_end - gdt - 1	\n"
    3.42 -"	.long	gdt			\n"
    3.43 -"					\n"
    3.44 -"	.align	8			\n"
    3.45 -"gdt:					\n"
    3.46 -"	.quad	0x0000000000000000	\n"
    3.47 -"	.quad	0x00CF92000000FFFF	\n"
    3.48 -"	.quad	0x00CF9A000000FFFF	\n"
    3.49 -"gdt_end:				\n"
    3.50 -"					\n"
    3.51 -"halt:					\n"
    3.52 -"	sti				\n"
    3.53 -"	jmp	.			\n"
    3.54 -"					\n"
    3.55 -"	.bss				\n"
    3.56 -"	.align	8			\n"
    3.57 -"stack:					\n"
    3.58 -"	.skip	0x4000			\n"
    3.59 -"stack_top:				\n"
    3.60 -);
    3.61 +    "    .text                       \n"
    3.62 +    "    .globl _start               \n"
    3.63 +    "_start:                         \n"
    3.64 +    "    cld                         \n"
    3.65 +    "    cli                         \n"
    3.66 +    "    lgdt gdt_desr               \n"
    3.67 +    "    movl $stack_top, %esp       \n"
    3.68 +    "    movl %esp, %ebp             \n"
    3.69 +    "    call main                   \n"
    3.70 +    "    ud2                         \n"
    3.71 +    "                                \n"
    3.72 +    "gdt_desr:                       \n"
    3.73 +    "    .word gdt_end - gdt - 1     \n"
    3.74 +    "    .long gdt                   \n"
    3.75 +    "                                \n"
    3.76 +    "    .align 8                    \n"
    3.77 +    "gdt:                            \n"
    3.78 +    "    .quad 0x0000000000000000    \n"
    3.79 +    "    .quad 0x00CF92000000FFFF    \n"
    3.80 +    "    .quad 0x00CF9A000000FFFF    \n"
    3.81 +    "gdt_end:                        \n"
    3.82 +    "                                \n"
    3.83 +    "    .bss                        \n"
    3.84 +    "    .align    8                 \n"
    3.85 +    "stack:                          \n"
    3.86 +    "    .skip    0x4000             \n"
    3.87 +    "stack_top:                      \n"
    3.88 +    );
    3.89  
    3.90  extern int get_acpi_enabled(void);
    3.91  extern int acpi_madt_update(unsigned char* acpi_start);
    3.92 @@ -84,145 +81,176 @@ struct hvm_info_table *get_hvm_info_tabl
    3.93  static int
    3.94  cirrus_check(void)
    3.95  {
    3.96 -	outw(0x3C4, 0x9206);
    3.97 -	return inb(0x3C5) == 0x12;
    3.98 +    outw(0x3C4, 0x9206);
    3.99 +    return inb(0x3C5) == 0x12;
   3.100  }
   3.101  
   3.102  static int
   3.103  vmmcall(int function, int edi, int esi, int edx, int ecx, int ebx)
   3.104  {
   3.105 -        int eax;
   3.106 +    int eax;
   3.107  
   3.108 -        __asm__ __volatile__(
   3.109 -		".byte 0x0F,0x01,0xD9"
   3.110 -                : "=a" (eax)
   3.111 -		: "a"(function),
   3.112 -		  "b"(ebx), "c"(ecx), "d"(edx), "D"(edi), "S"(esi)
   3.113 -	);
   3.114 -        return eax;
   3.115 +    __asm__ __volatile__ (
   3.116 +        ".byte 0x0F,0x01,0xD9"
   3.117 +        : "=a" (eax)
   3.118 +        : "a"(function),
   3.119 +        "b"(ebx), "c"(ecx), "d"(edx), "D"(edi), "S"(esi) );
   3.120 +    return eax;
   3.121  }
   3.122  
   3.123  static int
   3.124  check_amd(void)
   3.125  {
   3.126 -	char id[12];
   3.127 +    char id[12];
   3.128  
   3.129 -        __asm__ __volatile__(
   3.130 -		"cpuid" 
   3.131 -		: "=b" (*(int *)(&id[0])),
   3.132 -		  "=c" (*(int *)(&id[8])),
   3.133 -		  "=d" (*(int *)(&id[4]))
   3.134 -		: "a" (0)
   3.135 -	);
   3.136 -	return __builtin_memcmp(id, "AuthenticAMD", 12) == 0;
   3.137 +    __asm__ __volatile__ (
   3.138 +        "cpuid" 
   3.139 +        : "=b" (*(int *)(&id[0])),
   3.140 +        "=c" (*(int *)(&id[8])),
   3.141 +        "=d" (*(int *)(&id[4]))
   3.142 +        : "a" (0) );
   3.143 +    return __builtin_memcmp(id, "AuthenticAMD", 12) == 0;
   3.144  }
   3.145  
   3.146  static void
   3.147  wrmsr(uint32_t idx, uint64_t v)
   3.148  {
   3.149 -	__asm__ __volatile__(
   3.150 -		"wrmsr"
   3.151 -		: : "c" (idx), "a" ((uint32_t)v), "d" ((uint32_t)(v>>32)) );
   3.152 +    __asm__ __volatile__ (
   3.153 +        "wrmsr"
   3.154 +        : : "c" (idx), "a" ((uint32_t)v), "d" ((uint32_t)(v>>32)) );
   3.155  }
   3.156  
   3.157  static void
   3.158  init_hypercalls(void)
   3.159  {
   3.160 -	uint32_t eax, ebx, ecx, edx;
   3.161 -	unsigned long i;
   3.162 -	char signature[13], number[13];
   3.163 -	xen_extraversion_t extraversion;
   3.164 -
   3.165 -	cpuid(0x40000000, &eax, &ebx, &ecx, &edx);
   3.166 -
   3.167 -	*(uint32_t *)(signature + 0) = ebx;
   3.168 -	*(uint32_t *)(signature + 4) = ecx;
   3.169 -	*(uint32_t *)(signature + 8) = edx;
   3.170 -	signature[12] = '\0';
   3.171 +    uint32_t eax, ebx, ecx, edx;
   3.172 +    unsigned long i;
   3.173 +    char signature[13], number[13];
   3.174 +    xen_extraversion_t extraversion;
   3.175  
   3.176 -	if (strcmp("XenVMMXenVMM", signature) || (eax < 0x40000002)) {
   3.177 -		puts("FATAL: Xen hypervisor not detected\n");
   3.178 -		__asm__ __volatile__( "ud2" );
   3.179 -	}
   3.180 -
   3.181 -	cpuid(0x40000001, &eax, &ebx, &ecx, &edx);
   3.182 +    cpuid(0x40000000, &eax, &ebx, &ecx, &edx);
   3.183  
   3.184 -	puts("Detected Xen v");
   3.185 -	puts(itoa(number, eax >> 16));
   3.186 -	puts(".");
   3.187 -	puts(itoa(number, eax & 0xffff));
   3.188 +    *(uint32_t *)(signature + 0) = ebx;
   3.189 +    *(uint32_t *)(signature + 4) = ecx;
   3.190 +    *(uint32_t *)(signature + 8) = edx;
   3.191 +    signature[12] = '\0';
   3.192  
   3.193 -	cpuid(0x40000002, &eax, &ebx, &ecx, &edx);
   3.194 +    if ( strcmp("XenVMMXenVMM", signature) || (eax < 0x40000002) )
   3.195 +    {
   3.196 +        puts("FATAL: Xen hypervisor not detected\n");
   3.197 +        __asm__ __volatile__( "ud2" );
   3.198 +    }
   3.199  
   3.200 -	for (i = 0; i < eax; i++)
   3.201 -		wrmsr(ebx, HYPERCALL_PHYSICAL_ADDRESS + (i << 12) + i);
   3.202 +    cpuid(0x40000001, &eax, &ebx, &ecx, &edx);
   3.203  
   3.204 -	hypercall_xen_version(XENVER_extraversion, extraversion);
   3.205 -	puts(extraversion);
   3.206 -	puts("\n");
   3.207 +    puts("Detected Xen v");
   3.208 +    puts(itoa(number, eax >> 16));
   3.209 +    puts(".");
   3.210 +    puts(itoa(number, eax & 0xffff));
   3.211 +
   3.212 +    cpuid(0x40000002, &eax, &ebx, &ecx, &edx);
   3.213 +
   3.214 +    for ( i = 0; i < eax; i++ )
   3.215 +        wrmsr(ebx, HYPERCALL_PHYSICAL_ADDRESS + (i << 12) + i);
   3.216 +
   3.217 +    hypercall_xen_version(XENVER_extraversion, extraversion);
   3.218 +    puts(extraversion);
   3.219 +    puts("\n");
   3.220  }
   3.221  
   3.222 -int
   3.223 -main(void)
   3.224 +static void apic_setup(void)
   3.225  {
   3.226 -	puts("HVM Loader\n");
   3.227 -
   3.228 -	init_hypercalls();
   3.229 -
   3.230 -	puts("Writing SMBIOS tables ...\n");
   3.231 -	hvm_write_smbios_tables();
   3.232 -
   3.233 -	puts("Loading ROMBIOS ...\n");
   3.234 -	memcpy((void *)ROMBIOS_PHYSICAL_ADDRESS, rombios, sizeof(rombios));
   3.235 -
   3.236 -	create_mp_tables();
   3.237 -	
   3.238 -	if (cirrus_check()) {
   3.239 -		puts("Loading Cirrus VGABIOS ...\n");
   3.240 -		memcpy((void *)VGABIOS_PHYSICAL_ADDRESS,
   3.241 -			vgabios_cirrusvga, sizeof(vgabios_cirrusvga));
   3.242 -	} else {
   3.243 -		puts("Loading Standard VGABIOS ...\n");
   3.244 -		memcpy((void *)VGABIOS_PHYSICAL_ADDRESS,
   3.245 -			vgabios_stdvga, sizeof(vgabios_stdvga));
   3.246 -	}
   3.247 +    volatile uint32_t *ioregsel;
   3.248 +    volatile uint32_t *iowin;
   3.249  
   3.250 -	if (get_acpi_enabled() != 0) {
   3.251 -		puts("Loading ACPI ...\n");
   3.252 -		acpi_madt_update((unsigned char *) acpi);
   3.253 -		if (ACPI_PHYSICAL_ADDRESS+sizeof(acpi) <= 0xF0000) {
   3.254 -			unsigned char *freemem = (unsigned char *)
   3.255 -			         (ACPI_PHYSICAL_ADDRESS + sizeof(acpi));
   3.256 -			/*
   3.257 -			 * Make sure acpi table does not overlap rombios
   3.258 -			 * currently acpi less than 8K will be OK.
   3.259 -			 */
   3.260 -			 memcpy((void *)ACPI_PHYSICAL_ADDRESS, acpi,
   3.261 -			 					sizeof(acpi));
   3.262 -			acpi_update((unsigned char *)ACPI_PHYSICAL_ADDRESS,
   3.263 -			            sizeof(acpi),
   3.264 -			            (unsigned char *)0xF0000,
   3.265 -			            &freemem);
   3.266 -		}
   3.267 -	}
   3.268 +    /* IOAPIC memory-mapped access window registers. */
   3.269 +    ioregsel = (volatile uint32_t *)(IOAPIC_BASE_ADDRESS + 0x00);
   3.270 +    iowin    = (volatile uint32_t *)(IOAPIC_BASE_ADDRESS + 0x10);
   3.271  
   3.272 -	if (check_amd()) {
   3.273 -		/* AMD implies this is SVM */
   3.274 -                puts("SVM go ...\n");
   3.275 -                vmmcall(SVM_VMMCALL_RESET_TO_REALMODE, 0, 0, 0, 0, 0);
   3.276 -	} else {
   3.277 -		puts("Loading VMXAssist ...\n");
   3.278 -		memcpy((void *)VMXASSIST_PHYSICAL_ADDRESS,
   3.279 -				vmxassist, sizeof(vmxassist));
   3.280 -
   3.281 -		puts("VMX go ...\n");
   3.282 -		__asm__ __volatile__(
   3.283 -			"jmp *%%eax"
   3.284 -			: : "a" (VMXASSIST_PHYSICAL_ADDRESS), "d" (0)
   3.285 -		);
   3.286 -	}
   3.287 -
   3.288 -	puts("Failed to invoke ROMBIOS\n");
   3.289 -	return 0;
   3.290 +    /* Set the IOAPIC ID to tha static value used in the MP/ACPI tables. */
   3.291 +    *ioregsel = 0;
   3.292 +    *iowin    = IOAPIC_ID;
   3.293  }
   3.294  
   3.295 +int main(void)
   3.296 +{
   3.297 +    puts("HVM Loader\n");
   3.298 +
   3.299 +    init_hypercalls();
   3.300 +
   3.301 +    puts("Writing SMBIOS tables ...\n");
   3.302 +    hvm_write_smbios_tables();
   3.303 +
   3.304 +    puts("Loading ROMBIOS ...\n");
   3.305 +    memcpy((void *)ROMBIOS_PHYSICAL_ADDRESS, rombios, sizeof(rombios));
   3.306 +
   3.307 +    apic_setup();
   3.308 +
   3.309 +    create_mp_tables();
   3.310 +
   3.311 +    if ( cirrus_check() )
   3.312 +    {
   3.313 +        puts("Loading Cirrus VGABIOS ...\n");
   3.314 +        memcpy((void *)VGABIOS_PHYSICAL_ADDRESS,
   3.315 +               vgabios_cirrusvga, sizeof(vgabios_cirrusvga));
   3.316 +    }
   3.317 +    else
   3.318 +    {
   3.319 +        puts("Loading Standard VGABIOS ...\n");
   3.320 +        memcpy((void *)VGABIOS_PHYSICAL_ADDRESS,
   3.321 +               vgabios_stdvga, sizeof(vgabios_stdvga));
   3.322 +    }
   3.323 +
   3.324 +    if ( get_acpi_enabled() != 0 )
   3.325 +    {
   3.326 +        puts("Loading ACPI ...\n");
   3.327 +        acpi_madt_update((unsigned char *) acpi);
   3.328 +        if ( (ACPI_PHYSICAL_ADDRESS + sizeof(acpi)) <= 0xF0000 )
   3.329 +        {
   3.330 +            unsigned char *freemem = (unsigned char *)
   3.331 +                (ACPI_PHYSICAL_ADDRESS + sizeof(acpi));
   3.332 +            /*
   3.333 +             * Make sure acpi table does not overlap rombios
   3.334 +             * currently acpi less than 8K will be OK.
   3.335 +             */
   3.336 +            memcpy((void *)ACPI_PHYSICAL_ADDRESS, acpi,
   3.337 +                   sizeof(acpi));
   3.338 +            acpi_update((unsigned char *)ACPI_PHYSICAL_ADDRESS,
   3.339 +                        sizeof(acpi),
   3.340 +                        (unsigned char *)0xF0000,
   3.341 +                        &freemem);
   3.342 +        }
   3.343 +    }
   3.344 +
   3.345 +    if ( check_amd() )
   3.346 +    {
   3.347 +        /* AMD implies this is SVM */
   3.348 +        puts("SVM go ...\n");
   3.349 +        vmmcall(SVM_VMMCALL_RESET_TO_REALMODE, 0, 0, 0, 0, 0);
   3.350 +    }
   3.351 +    else
   3.352 +    {
   3.353 +        puts("Loading VMXAssist ...\n");
   3.354 +        memcpy((void *)VMXASSIST_PHYSICAL_ADDRESS,
   3.355 +               vmxassist, sizeof(vmxassist));
   3.356 +
   3.357 +        puts("VMX go ...\n");
   3.358 +        __asm__ __volatile__(
   3.359 +            "jmp *%%eax"
   3.360 +            : : "a" (VMXASSIST_PHYSICAL_ADDRESS), "d" (0)
   3.361 +            );
   3.362 +    }
   3.363 +
   3.364 +    puts("Failed to invoke ROMBIOS\n");
   3.365 +    return 0;
   3.366 +}
   3.367 +
   3.368 +/*
   3.369 + * Local variables:
   3.370 + * mode: C
   3.371 + * c-set-style: "BSD"
   3.372 + * c-basic-offset: 4
   3.373 + * tab-width: 4
   3.374 + * indent-tabs-mode: nil
   3.375 + * End:
   3.376 + */
     4.1 --- a/tools/firmware/hvmloader/mp_tables.c	Wed Nov 22 10:31:50 2006 +0000
     4.2 +++ b/tools/firmware/hvmloader/mp_tables.c	Wed Nov 22 11:52:46 2006 +0000
     4.3 @@ -29,6 +29,7 @@
     4.4   */
     4.5  
     4.6  #include <acpi_utils.h>
     4.7 +#include "config.h"
     4.8  
     4.9  /* FIXME find a header that already has types defined!!! */
    4.10  typedef unsigned char  uint8_t;
    4.11 @@ -45,11 +46,11 @@ typedef unsigned long uint64_t;
    4.12  typedef   signed long int64_t;
    4.13  #endif
    4.14  
    4.15 -#define ROMBIOS_SEG              0xF000
    4.16 -#define ROMBIOS_BEGIN            0x000F0000
    4.17 -#define ROMBIOS_SIZE             0x00010000 
    4.18 -#define ROMBIOS_MAXOFFSET        0x0000FFFF
    4.19 -#define ROMBIOS_END             (ROMBIOS_BEGIN + ROMBIOS_SIZE)
    4.20 +#define ROMBIOS_SEG            0xF000
    4.21 +#define ROMBIOS_BEGIN          0x000F0000
    4.22 +#define ROMBIOS_SIZE           0x00010000 
    4.23 +#define ROMBIOS_MAXOFFSET      0x0000FFFF
    4.24 +#define ROMBIOS_END            (ROMBIOS_BEGIN + ROMBIOS_SIZE)
    4.25  
    4.26  /* number of non-processor MP table entries */
    4.27  #define NR_NONPROC_ENTRIES     18
    4.28 @@ -78,17 +79,7 @@ typedef   signed long int64_t;
    4.29  
    4.30  #define BUS_TYPE_LENGTH        6
    4.31  #define BUS_TYPE_STR_ISA       "ISA   "
    4.32 -#define BUS_TYPE_STR_PCI       "PCI   "
    4.33 -
    4.34  #define BUS_ID_ISA             0
    4.35 -#define BUS_ID_PCI             1
    4.36 -
    4.37 -#define LAPIC_BASE_ADDR        0xFEE00000
    4.38 -
    4.39 -#define IOAPIC_ID              0
    4.40 -#define IOAPIC_VERSION         0x11
    4.41 -#define IOAPIC_BASE_ADDR       0xFEC00000
    4.42 -#define IOAPIC_FLAG_ENABLED    (1U << 0)
    4.43  
    4.44  #define INTR_TYPE_INT          0
    4.45  #define INTR_TYPE_NMI          1
    4.46 @@ -217,7 +208,7 @@ void fill_mp_config_table(struct mp_conf
    4.47  
    4.48      mpct->nr_entries = vcpu_nr + NR_NONPROC_ENTRIES;
    4.49  
    4.50 -    mpct->lapic = LAPIC_BASE_ADDR;
    4.51 +    mpct->lapic = LAPIC_BASE_ADDRESS;
    4.52      mpct->extended_length = 0;
    4.53      mpct->extended_checksum = 0;
    4.54  
    4.55 @@ -255,13 +246,13 @@ void fill_mp_bus_entry(struct mp_bus_ent
    4.56  
    4.57  
    4.58  /* fills in an MP IOAPIC entry for IOAPIC 'ioapic_id' */
    4.59 -void fill_mp_ioapic_entry(struct mp_ioapic_entry *mpie, int ioapic_id)
    4.60 +void fill_mp_ioapic_entry(struct mp_ioapic_entry *mpie)
    4.61  {
    4.62      mpie->type = ENTRY_TYPE_IOAPIC;
    4.63 -    mpie->ioapic_id = ioapic_id;
    4.64 +    mpie->ioapic_id = IOAPIC_ID;
    4.65      mpie->ioapic_version = IOAPIC_VERSION;
    4.66 -    mpie->ioapic_flags = IOAPIC_FLAG_ENABLED;
    4.67 -    mpie->ioapic_addr = IOAPIC_BASE_ADDR;
    4.68 +    mpie->ioapic_flags = 1; /* enabled */
    4.69 +    mpie->ioapic_addr = IOAPIC_BASE_ADDRESS;
    4.70  }
    4.71  
    4.72  
    4.73 @@ -379,10 +370,7 @@ void create_mp_tables(void)
    4.74      fill_mp_bus_entry((struct mp_bus_entry *)p, BUS_ID_ISA, BUS_TYPE_STR_ISA);
    4.75      p += sizeof(struct mp_bus_entry);
    4.76  
    4.77 -    fill_mp_bus_entry((struct mp_bus_entry *)p, BUS_ID_PCI, BUS_TYPE_STR_PCI);
    4.78 -    p += sizeof(struct mp_bus_entry);
    4.79 -
    4.80 -    fill_mp_ioapic_entry((struct mp_ioapic_entry *)p, IOAPIC_ID);
    4.81 +    fill_mp_ioapic_entry((struct mp_ioapic_entry *)p);
    4.82      p += sizeof(struct mp_ioapic_entry);
    4.83  
    4.84      for ( i = 0; i < 16; i++ )