ia64/xen-unstable

changeset 10057:f8d20c3e4225

Add rudimentary ACPI support which allows a fully virtualized domain
to perform a poweroff via the S5 state. This involves adding S5
information to the ASL file; adding ACPI I/O address processing to
qemu and modifying the FADT to point to these specific I/O addresses.
Note that this is a rudimentary implementation, which is expected
to allow growth over time. Currently, only allow/detect writes
to one of the PM registers, even though the S5 package specifies
data for both. Currently, this is sufficient for the kernels
tested. (Specifically, use of _PST, and _GST and other methods
are unnecessary and not implemented.)

Signed-off-by: Ben Thomas <ben@virtualiron.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon May 15 07:38:32 2006 +0100 (2006-05-15)
parents d056f91cfd95
children 79d28e3505c2
files tools/firmware/acpi/acpi_dsdt.asl tools/firmware/acpi/acpi_dsdt.c tools/firmware/acpi/acpi_fadt.h tools/ioemu/hw/acpi.c tools/ioemu/hw/pc.c tools/ioemu/target-i386-dm/Makefile
line diff
     1.1 --- a/tools/firmware/acpi/acpi_dsdt.asl	Sun May 14 20:13:14 2006 +0100
     1.2 +++ b/tools/firmware/acpi/acpi_dsdt.asl	Mon May 15 07:38:32 2006 +0100
     1.3 @@ -37,6 +37,16 @@ DefinitionBlock ("DSDT.aml", "DSDT", 1, 
     1.4          Processor (CPU3, 0x03, 0x00000000, 0x00) {}
     1.5      }
     1.6  
     1.7 +/* Poweroff support - ties in with qemu emulation */
     1.8 +
     1.9 +    Name (\_S5, Package (0x04)
    1.10 +    {
    1.11 +        0x07, 
    1.12 +        0x07, 
    1.13 +        0x00, 
    1.14 +        0x00
    1.15 +    })
    1.16 +
    1.17      Scope (\_SB)
    1.18      {
    1.19          Device (PCI0)
     2.1 --- a/tools/firmware/acpi/acpi_dsdt.c	Sun May 14 20:13:14 2006 +0100
     2.2 +++ b/tools/firmware/acpi/acpi_dsdt.c	Mon May 15 07:38:32 2006 +0100
     2.3 @@ -1,161 +1,160 @@
     2.4  /*
     2.5   * 
     2.6   * Intel ACPI Component Architecture
     2.7 - * ASL Optimizing Compiler / AML Disassembler version 20050513 [Jun  8 2005]
     2.8 + * ASL Optimizing Compiler / AML Disassembler version 20050624 [Aug 24 2005]
     2.9   * Copyright (C) 2000 - 2005 Intel Corporation
    2.10   * Supports ACPI Specification Revision 3.0
    2.11   * 
    2.12 - * Compilation of "acpi_dsdt.asl" - Wed Jun 15 09:19:49 2005
    2.13 + * Compilation of "acpi_dsdt.asl" - Thu May  4 17:42:00 2006
    2.14   * 
    2.15   * C source code output
    2.16   *
    2.17   */
    2.18  unsigned char AmlCode[] = 
    2.19  {
    2.20 -    0x44,0x53,0x44,0x54,0x87,0x04,0x00,0x00,  /* 00000000    "DSDT...." */
    2.21 -    0x01,0x19,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    "..INTEL " */
    2.22 +    0x44,0x53,0x44,0x54,0x7C,0x04,0x00,0x00,  /* 00000000    "DSDT|..." */
    2.23 +    0x01,0x72,0x49,0x4E,0x54,0x45,0x4C,0x20,  /* 00000008    ".rINTEL " */
    2.24      0x58,0x45,0x4E,0x20,0x20,0x20,0x20,0x20,  /* 00000010    "XEN     " */
    2.25      0x02,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
    2.26 -    0x13,0x05,0x05,0x20,0x08,0x5C,0x50,0x4D,  /* 00000020    "... .\PM" */
    2.27 -    0x42,0x53,0x0B,0x00,0x0C,0x08,0x5C,0x50,  /* 00000028    "BS....\P" */
    2.28 -    0x4D,0x4C,0x4E,0x0A,0x08,0x08,0x5C,0x49,  /* 00000030    "MLN...\I" */
    2.29 -    0x4F,0x42,0x31,0x0A,0x00,0x08,0x5C,0x49,  /* 00000038    "OB1...\I" */
    2.30 -    0x4F,0x4C,0x31,0x0A,0x00,0x08,0x5C,0x41,  /* 00000040    "OL1...\A" */
    2.31 -    0x50,0x43,0x42,0x0C,0x00,0x00,0xC0,0xFE,  /* 00000048    "PCB....." */
    2.32 -    0x08,0x5C,0x41,0x50,0x43,0x4C,0x0C,0x00,  /* 00000050    ".\APCL.." */
    2.33 -    0x00,0x01,0x00,0x08,0x5C,0x50,0x55,0x49,  /* 00000058    "....\PUI" */
    2.34 -    0x44,0x0A,0x00,0x10,0x3A,0x5C,0x5F,0x50,  /* 00000060    "D...:\_P" */
    2.35 -    0x52,0x5F,0x5B,0x83,0x0B,0x43,0x50,0x55,  /* 00000068    "R_[..CPU" */
    2.36 -    0x30,0x00,0x00,0x00,0x00,0x00,0x00,0x5B,  /* 00000070    "0......[" */
    2.37 -    0x83,0x0B,0x43,0x50,0x55,0x31,0x01,0x00,  /* 00000078    "..CPU1.." */
    2.38 -    0x00,0x00,0x00,0x00,0x5B,0x83,0x0B,0x43,  /* 00000080    "....[..C" */
    2.39 -    0x50,0x55,0x32,0x02,0x00,0x00,0x00,0x00,  /* 00000088    "PU2....." */
    2.40 -    0x00,0x5B,0x83,0x0B,0x43,0x50,0x55,0x33,  /* 00000090    ".[..CPU3" */
    2.41 -    0x03,0x00,0x00,0x00,0x00,0x00,0x10,0x48,  /* 00000098    ".......H" */
    2.42 -    0x3E,0x5C,0x5F,0x53,0x42,0x5F,0x5B,0x82,  /* 000000A0    ">\_SB_[." */
    2.43 -    0x4F,0x3D,0x50,0x43,0x49,0x30,0x08,0x5F,  /* 000000A8    "O=PCI0._" */
    2.44 -    0x48,0x49,0x44,0x0C,0x41,0xD0,0x0A,0x03,  /* 000000B0    "HID.A..." */
    2.45 -    0x08,0x5F,0x55,0x49,0x44,0x0A,0x00,0x08,  /* 000000B8    "._UID..." */
    2.46 -    0x5F,0x41,0x44,0x52,0x0A,0x00,0x08,0x5F,  /* 000000C0    "_ADR..._" */
    2.47 -    0x42,0x42,0x4E,0x0A,0x00,0x14,0x4A,0x06,  /* 000000C8    "BBN...J." */
    2.48 -    0x5F,0x43,0x52,0x53,0x00,0x08,0x50,0x52,  /* 000000D0    "_CRS..PR" */
    2.49 -    0x54,0x30,0x11,0x48,0x05,0x0A,0x54,0x88,  /* 000000D8    "T0.H..T." */
    2.50 -    0x0D,0x00,0x02,0x0F,0x00,0x00,0x00,0x00,  /* 000000E0    "........" */
    2.51 -    0x00,0xFF,0x00,0x00,0x00,0x00,0x01,0x47,  /* 000000E8    ".......G" */
    2.52 -    0x01,0xF8,0x0C,0xF8,0x0C,0x01,0x08,0x88,  /* 000000F0    "........" */
    2.53 -    0x0D,0x00,0x01,0x0C,0x03,0x00,0x00,0x00,  /* 000000F8    "........" */
    2.54 -    0x00,0xF7,0x0C,0x00,0x00,0xF8,0x0C,0x88,  /* 00000100    "........" */
    2.55 -    0x0D,0x00,0x01,0x0C,0x03,0x00,0x00,0x00,  /* 00000108    "........" */
    2.56 -    0x0D,0xFF,0x0F,0x00,0x00,0x00,0x03,0x87,  /* 00000110    "........" */
    2.57 -    0x17,0x00,0x00,0x0C,0x02,0x00,0x00,0x00,  /* 00000118    "........" */
    2.58 -    0x00,0x00,0x00,0x0A,0x00,0xFF,0xFF,0x0F,  /* 00000120    "........" */
    2.59 -    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x06,  /* 00000128    "........" */
    2.60 -    0x00,0x79,0x00,0xA4,0x50,0x52,0x54,0x30,  /* 00000130    ".y..PRT0" */
    2.61 -    0x08,0x41,0x49,0x52,0x30,0x12,0x47,0x05,  /* 00000138    ".AIR0.G." */
    2.62 -    0x06,0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x1F,  /* 00000140    "........" */
    2.63 -    0x00,0x0A,0x02,0x0A,0x00,0x0A,0x17,0x12,  /* 00000148    "........" */
    2.64 -    0x0D,0x04,0x0C,0xFF,0xFF,0x1F,0x00,0x0A,  /* 00000150    "........" */
    2.65 -    0x03,0x0A,0x00,0x0A,0x13,0x12,0x0D,0x04,  /* 00000158    "........" */
    2.66 -    0x0C,0xFF,0xFF,0x1D,0x00,0x0A,0x01,0x0A,  /* 00000160    "........" */
    2.67 -    0x00,0x0A,0x13,0x12,0x0D,0x04,0x0C,0xFF,  /* 00000168    "........" */
    2.68 -    0xFF,0x1D,0x00,0x0A,0x00,0x0A,0x00,0x0A,  /* 00000170    "........" */
    2.69 -    0x10,0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x1D,  /* 00000178    "........" */
    2.70 -    0x00,0x0A,0x02,0x0A,0x00,0x0A,0x12,0x12,  /* 00000180    "........" */
    2.71 -    0x0D,0x04,0x0C,0xFF,0xFF,0x1D,0x00,0x0A,  /* 00000188    "........" */
    2.72 -    0x03,0x0A,0x00,0x0A,0x17,0x14,0x0B,0x5F,  /* 00000190    "......._" */
    2.73 -    0x50,0x52,0x54,0x00,0xA4,0x41,0x49,0x52,  /* 00000198    "PRT..AIR" */
    2.74 -    0x30,0x5B,0x82,0x44,0x2E,0x49,0x53,0x41,  /* 000001A0    "0[.D.ISA" */
    2.75 -    0x5F,0x08,0x5F,0x41,0x44,0x52,0x0C,0x00,  /* 000001A8    "_._ADR.." */
    2.76 -    0x00,0x01,0x00,0x5B,0x82,0x47,0x0B,0x53,  /* 000001B0    "...[.G.S" */
    2.77 -    0x59,0x53,0x52,0x08,0x5F,0x48,0x49,0x44,  /* 000001B8    "YSR._HID" */
    2.78 -    0x0C,0x41,0xD0,0x0C,0x02,0x08,0x5F,0x55,  /* 000001C0    ".A...._U" */
    2.79 -    0x49,0x44,0x0A,0x01,0x08,0x43,0x52,0x53,  /* 000001C8    "ID...CRS" */
    2.80 -    0x5F,0x11,0x4E,0x08,0x0A,0x8A,0x47,0x01,  /* 000001D0    "_.N...G." */
    2.81 -    0x10,0x00,0x10,0x00,0x00,0x10,0x47,0x01,  /* 000001D8    "......G." */
    2.82 -    0x22,0x00,0x22,0x00,0x00,0x0C,0x47,0x01,  /* 000001E0    ""."...G." */
    2.83 -    0x30,0x00,0x30,0x00,0x00,0x10,0x47,0x01,  /* 000001E8    "0.0...G." */
    2.84 -    0x44,0x00,0x44,0x00,0x00,0x1C,0x47,0x01,  /* 000001F0    "D.D...G." */
    2.85 -    0x62,0x00,0x62,0x00,0x00,0x02,0x47,0x01,  /* 000001F8    "b.b...G." */
    2.86 -    0x65,0x00,0x65,0x00,0x00,0x0B,0x47,0x01,  /* 00000200    "e.e...G." */
    2.87 -    0x72,0x00,0x72,0x00,0x00,0x0E,0x47,0x01,  /* 00000208    "r.r...G." */
    2.88 -    0x80,0x00,0x80,0x00,0x00,0x01,0x47,0x01,  /* 00000210    "......G." */
    2.89 -    0x84,0x00,0x84,0x00,0x00,0x03,0x47,0x01,  /* 00000218    "......G." */
    2.90 -    0x88,0x00,0x88,0x00,0x00,0x01,0x47,0x01,  /* 00000220    "......G." */
    2.91 -    0x8C,0x00,0x8C,0x00,0x00,0x03,0x47,0x01,  /* 00000228    "......G." */
    2.92 -    0x90,0x00,0x90,0x00,0x00,0x10,0x47,0x01,  /* 00000230    "......G." */
    2.93 -    0xA2,0x00,0xA2,0x00,0x00,0x1C,0x47,0x01,  /* 00000238    "......G." */
    2.94 -    0xE0,0x00,0xE0,0x00,0x00,0x10,0x47,0x01,  /* 00000240    "......G." */
    2.95 -    0xA0,0x08,0xA0,0x08,0x00,0x04,0x47,0x01,  /* 00000248    "......G." */
    2.96 -    0xC0,0x0C,0xC0,0x0C,0x00,0x10,0x47,0x01,  /* 00000250    "......G." */
    2.97 -    0xD0,0x04,0xD0,0x04,0x00,0x02,0x79,0x00,  /* 00000258    "......y." */
    2.98 -    0x14,0x0B,0x5F,0x43,0x52,0x53,0x00,0xA4,  /* 00000260    ".._CRS.." */
    2.99 -    0x43,0x52,0x53,0x5F,0x5B,0x82,0x2B,0x50,  /* 00000268    "CRS_[.+P" */
   2.100 -    0x49,0x43,0x5F,0x08,0x5F,0x48,0x49,0x44,  /* 00000270    "IC_._HID" */
   2.101 -    0x0B,0x41,0xD0,0x08,0x5F,0x43,0x52,0x53,  /* 00000278    ".A.._CRS" */
   2.102 -    0x11,0x18,0x0A,0x15,0x47,0x01,0x20,0x00,  /* 00000280    "....G. ." */
   2.103 -    0x20,0x00,0x01,0x02,0x47,0x01,0xA0,0x00,  /* 00000288    " ...G..." */
   2.104 -    0xA0,0x00,0x01,0x02,0x22,0x04,0x00,0x79,  /* 00000290    "...."..y" */
   2.105 -    0x00,0x5B,0x82,0x47,0x05,0x44,0x4D,0x41,  /* 00000298    ".[.G.DMA" */
   2.106 -    0x30,0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,  /* 000002A0    "0._HID.A" */
   2.107 -    0xD0,0x02,0x00,0x08,0x5F,0x43,0x52,0x53,  /* 000002A8    "...._CRS" */
   2.108 -    0x11,0x41,0x04,0x0A,0x3D,0x2A,0x10,0x04,  /* 000002B0    ".A..=*.." */
   2.109 -    0x47,0x01,0x00,0x00,0x00,0x00,0x00,0x10,  /* 000002B8    "G......." */
   2.110 -    0x47,0x01,0x81,0x00,0x81,0x00,0x00,0x03,  /* 000002C0    "G......." */
   2.111 -    0x47,0x01,0x87,0x00,0x87,0x00,0x00,0x01,  /* 000002C8    "G......." */
   2.112 -    0x47,0x01,0x89,0x00,0x89,0x00,0x00,0x03,  /* 000002D0    "G......." */
   2.113 -    0x47,0x01,0x8F,0x00,0x8F,0x00,0x00,0x01,  /* 000002D8    "G......." */
   2.114 -    0x47,0x01,0xC0,0x00,0xC0,0x00,0x00,0x20,  /* 000002E0    "G...... " */
   2.115 -    0x47,0x01,0x80,0x04,0x80,0x04,0x00,0x10,  /* 000002E8    "G......." */
   2.116 -    0x79,0x00,0x5B,0x82,0x25,0x54,0x4D,0x52,  /* 000002F0    "y.[.%TMR" */
   2.117 -    0x5F,0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,  /* 000002F8    "_._HID.A" */
   2.118 -    0xD0,0x01,0x00,0x08,0x5F,0x43,0x52,0x53,  /* 00000300    "...._CRS" */
   2.119 -    0x11,0x10,0x0A,0x0D,0x47,0x01,0x40,0x00,  /* 00000308    "....G.@." */
   2.120 -    0x40,0x00,0x00,0x04,0x22,0x01,0x00,0x79,  /* 00000310    "@..."..y" */
   2.121 -    0x00,0x5B,0x82,0x25,0x52,0x54,0x43,0x5F,  /* 00000318    ".[.%RTC_" */
   2.122 -    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 00000320    "._HID.A." */
   2.123 -    0x0B,0x00,0x08,0x5F,0x43,0x52,0x53,0x11,  /* 00000328    "..._CRS." */
   2.124 -    0x10,0x0A,0x0D,0x47,0x01,0x70,0x00,0x70,  /* 00000330    "...G.p.p" */
   2.125 -    0x00,0x00,0x02,0x22,0x00,0x01,0x79,0x00,  /* 00000338    "..."..y." */
   2.126 -    0x5B,0x82,0x22,0x53,0x50,0x4B,0x52,0x08,  /* 00000340    "[."SPKR." */
   2.127 -    0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,0x08,  /* 00000348    "_HID.A.." */
   2.128 -    0x00,0x08,0x5F,0x43,0x52,0x53,0x11,0x0D,  /* 00000350    ".._CRS.." */
   2.129 -    0x0A,0x0A,0x47,0x01,0x61,0x00,0x61,0x00,  /* 00000358    "..G.a.a." */
   2.130 -    0x00,0x01,0x79,0x00,0x5B,0x82,0x31,0x50,  /* 00000360    "..y.[.1P" */
   2.131 -    0x53,0x32,0x4D,0x08,0x5F,0x48,0x49,0x44,  /* 00000368    "S2M._HID" */
   2.132 -    0x0C,0x41,0xD0,0x0F,0x13,0x08,0x5F,0x43,  /* 00000370    ".A...._C" */
   2.133 -    0x49,0x44,0x0C,0x41,0xD0,0x0F,0x13,0x14,  /* 00000378    "ID.A...." */
   2.134 -    0x09,0x5F,0x53,0x54,0x41,0x00,0xA4,0x0A,  /* 00000380    "._STA..." */
   2.135 -    0x0F,0x08,0x5F,0x43,0x52,0x53,0x11,0x08,  /* 00000388    ".._CRS.." */
   2.136 -    0x0A,0x05,0x22,0x00,0x10,0x79,0x00,0x5B,  /* 00000390    ".."..y.[" */
   2.137 -    0x82,0x42,0x04,0x50,0x53,0x32,0x4B,0x08,  /* 00000398    ".B.PS2K." */
   2.138 -    0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,0x03,  /* 000003A0    "_HID.A.." */
   2.139 -    0x03,0x08,0x5F,0x43,0x49,0x44,0x0C,0x41,  /* 000003A8    ".._CID.A" */
   2.140 -    0xD0,0x03,0x0B,0x14,0x09,0x5F,0x53,0x54,  /* 000003B0    "....._ST" */
   2.141 -    0x41,0x00,0xA4,0x0A,0x0F,0x08,0x5F,0x43,  /* 000003B8    "A....._C" */
   2.142 -    0x52,0x53,0x11,0x18,0x0A,0x15,0x47,0x01,  /* 000003C0    "RS....G." */
   2.143 -    0x60,0x00,0x60,0x00,0x00,0x01,0x47,0x01,  /* 000003C8    "`.`...G." */
   2.144 -    0x64,0x00,0x64,0x00,0x00,0x01,0x22,0x02,  /* 000003D0    "d.d..."." */
   2.145 -    0x00,0x79,0x00,0x5B,0x82,0x3A,0x46,0x44,  /* 000003D8    ".y.[.:FD" */
   2.146 -    0x43,0x30,0x08,0x5F,0x48,0x49,0x44,0x0C,  /* 000003E0    "C0._HID." */
   2.147 -    0x41,0xD0,0x07,0x00,0x14,0x09,0x5F,0x53,  /* 000003E8    "A....._S" */
   2.148 -    0x54,0x41,0x00,0xA4,0x0A,0x0F,0x08,0x5F,  /* 000003F0    "TA....._" */
   2.149 -    0x43,0x52,0x53,0x11,0x1B,0x0A,0x18,0x47,  /* 000003F8    "CRS....G" */
   2.150 -    0x01,0xF0,0x03,0xF0,0x03,0x01,0x06,0x47,  /* 00000400    ".......G" */
   2.151 -    0x01,0xF7,0x03,0xF7,0x03,0x01,0x01,0x22,  /* 00000408    "......."" */
   2.152 -    0x40,0x00,0x2A,0x04,0x00,0x79,0x00,0x5B,  /* 00000410    "@.*..y.[" */
   2.153 -    0x82,0x36,0x55,0x41,0x52,0x31,0x08,0x5F,  /* 00000418    ".6UAR1._" */
   2.154 -    0x48,0x49,0x44,0x0C,0x41,0xD0,0x05,0x01,  /* 00000420    "HID.A..." */
   2.155 -    0x08,0x5F,0x55,0x49,0x44,0x0A,0x01,0x14,  /* 00000428    "._UID..." */
   2.156 -    0x09,0x5F,0x53,0x54,0x41,0x00,0xA4,0x0A,  /* 00000430    "._STA..." */
   2.157 -    0x0F,0x08,0x5F,0x43,0x52,0x53,0x11,0x10,  /* 00000438    ".._CRS.." */
   2.158 -    0x0A,0x0D,0x47,0x01,0xF8,0x03,0xF8,0x03,  /* 00000440    "..G....." */
   2.159 -    0x01,0x08,0x22,0x10,0x00,0x79,0x00,0x5B,  /* 00000448    ".."..y.[" */
   2.160 -    0x82,0x36,0x55,0x41,0x52,0x32,0x08,0x5F,  /* 00000450    ".6UAR2._" */
   2.161 -    0x48,0x49,0x44,0x0C,0x41,0xD0,0x05,0x01,  /* 00000458    "HID.A..." */
   2.162 -    0x08,0x5F,0x55,0x49,0x44,0x0A,0x02,0x14,  /* 00000460    "._UID..." */
   2.163 -    0x09,0x5F,0x53,0x54,0x41,0x00,0xA4,0x0A,  /* 00000468    "._STA..." */
   2.164 -    0x0F,0x08,0x5F,0x43,0x52,0x53,0x11,0x10,  /* 00000470    ".._CRS.." */
   2.165 -    0x0A,0x0D,0x47,0x01,0xF8,0x02,0xF8,0x02,  /* 00000478    "..G....." */
   2.166 -    0x01,0x08,0x22,0x08,0x00,0x79,0x00,
   2.167 +    0x24,0x06,0x05,0x20,0x08,0x50,0x4D,0x42,  /* 00000020    "$.. .PMB" */
   2.168 +    0x53,0x0B,0x00,0x0C,0x08,0x50,0x4D,0x4C,  /* 00000028    "S....PML" */
   2.169 +    0x4E,0x0A,0x08,0x08,0x49,0x4F,0x42,0x31,  /* 00000030    "N...IOB1" */
   2.170 +    0x00,0x08,0x49,0x4F,0x4C,0x31,0x00,0x08,  /* 00000038    "..IOL1.." */
   2.171 +    0x41,0x50,0x43,0x42,0x0C,0x00,0x00,0xC0,  /* 00000040    "APCB...." */
   2.172 +    0xFE,0x08,0x41,0x50,0x43,0x4C,0x0C,0x00,  /* 00000048    "..APCL.." */
   2.173 +    0x00,0x01,0x00,0x08,0x50,0x55,0x49,0x44,  /* 00000050    "....PUID" */
   2.174 +    0x00,0x10,0x39,0x5F,0x50,0x52,0x5F,0x5B,  /* 00000058    "..9_PR_[" */
   2.175 +    0x83,0x0B,0x43,0x50,0x55,0x30,0x00,0x00,  /* 00000060    "..CPU0.." */
   2.176 +    0x00,0x00,0x00,0x00,0x5B,0x83,0x0B,0x43,  /* 00000068    "....[..C" */
   2.177 +    0x50,0x55,0x31,0x01,0x00,0x00,0x00,0x00,  /* 00000070    "PU1....." */
   2.178 +    0x00,0x5B,0x83,0x0B,0x43,0x50,0x55,0x32,  /* 00000078    ".[..CPU2" */
   2.179 +    0x02,0x00,0x00,0x00,0x00,0x00,0x5B,0x83,  /* 00000080    "......[." */
   2.180 +    0x0B,0x43,0x50,0x55,0x33,0x03,0x00,0x00,  /* 00000088    ".CPU3..." */
   2.181 +    0x00,0x00,0x00,0x08,0x5F,0x53,0x35,0x5F,  /* 00000090    "...._S5_" */
   2.182 +    0x12,0x08,0x04,0x0A,0x07,0x0A,0x07,0x00,  /* 00000098    "........" */
   2.183 +    0x00,0x10,0x4A,0x3D,0x5F,0x53,0x42,0x5F,  /* 000000A0    "..J=_SB_" */
   2.184 +    0x5B,0x82,0x42,0x3D,0x50,0x43,0x49,0x30,  /* 000000A8    "[.B=PCI0" */
   2.185 +    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 000000B0    "._HID.A." */
   2.186 +    0x0A,0x03,0x08,0x5F,0x55,0x49,0x44,0x00,  /* 000000B8    "..._UID." */
   2.187 +    0x08,0x5F,0x41,0x44,0x52,0x00,0x08,0x5F,  /* 000000C0    "._ADR.._" */
   2.188 +    0x42,0x42,0x4E,0x00,0x14,0x4A,0x06,0x5F,  /* 000000C8    "BBN..J._" */
   2.189 +    0x43,0x52,0x53,0x00,0x08,0x50,0x52,0x54,  /* 000000D0    "CRS..PRT" */
   2.190 +    0x30,0x11,0x48,0x05,0x0A,0x54,0x88,0x0D,  /* 000000D8    "0.H..T.." */
   2.191 +    0x00,0x02,0x0F,0x00,0x00,0x00,0x00,0x00,  /* 000000E0    "........" */
   2.192 +    0xFF,0x00,0x00,0x00,0x00,0x01,0x47,0x01,  /* 000000E8    "......G." */
   2.193 +    0xF8,0x0C,0xF8,0x0C,0x01,0x08,0x88,0x0D,  /* 000000F0    "........" */
   2.194 +    0x00,0x01,0x0C,0x03,0x00,0x00,0x00,0x00,  /* 000000F8    "........" */
   2.195 +    0xF7,0x0C,0x00,0x00,0xF8,0x0C,0x88,0x0D,  /* 00000100    "........" */
   2.196 +    0x00,0x01,0x0C,0x03,0x00,0x00,0x00,0x0D,  /* 00000108    "........" */
   2.197 +    0xFF,0x0F,0x00,0x00,0x00,0x03,0x87,0x17,  /* 00000110    "........" */
   2.198 +    0x00,0x00,0x0C,0x02,0x00,0x00,0x00,0x00,  /* 00000118    "........" */
   2.199 +    0x00,0x00,0x0A,0x00,0xFF,0xFF,0x0F,0x00,  /* 00000120    "........" */
   2.200 +    0x00,0x00,0x00,0x00,0x00,0x00,0x06,0x00,  /* 00000128    "........" */
   2.201 +    0x79,0x00,0xA4,0x50,0x52,0x54,0x30,0x08,  /* 00000130    "y..PRT0." */
   2.202 +    0x41,0x49,0x52,0x30,0x12,0x4F,0x04,0x06,  /* 00000138    "AIR0.O.." */
   2.203 +    0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x1F,0x00,  /* 00000140    "........" */
   2.204 +    0x0A,0x02,0x00,0x0A,0x17,0x12,0x0C,0x04,  /* 00000148    "........" */
   2.205 +    0x0C,0xFF,0xFF,0x1F,0x00,0x0A,0x03,0x00,  /* 00000150    "........" */
   2.206 +    0x0A,0x13,0x12,0x0B,0x04,0x0C,0xFF,0xFF,  /* 00000158    "........" */
   2.207 +    0x1D,0x00,0x01,0x00,0x0A,0x13,0x12,0x0B,  /* 00000160    "........" */
   2.208 +    0x04,0x0C,0xFF,0xFF,0x1D,0x00,0x00,0x00,  /* 00000168    "........" */
   2.209 +    0x0A,0x10,0x12,0x0C,0x04,0x0C,0xFF,0xFF,  /* 00000170    "........" */
   2.210 +    0x1D,0x00,0x0A,0x02,0x00,0x0A,0x12,0x12,  /* 00000178    "........" */
   2.211 +    0x0C,0x04,0x0C,0xFF,0xFF,0x1D,0x00,0x0A,  /* 00000180    "........" */
   2.212 +    0x03,0x00,0x0A,0x17,0x14,0x0B,0x5F,0x50,  /* 00000188    "......_P" */
   2.213 +    0x52,0x54,0x00,0xA4,0x41,0x49,0x52,0x30,  /* 00000190    "RT..AIR0" */
   2.214 +    0x5B,0x82,0x42,0x2E,0x49,0x53,0x41,0x5F,  /* 00000198    "[.B.ISA_" */
   2.215 +    0x08,0x5F,0x41,0x44,0x52,0x0C,0x00,0x00,  /* 000001A0    "._ADR..." */
   2.216 +    0x01,0x00,0x5B,0x82,0x46,0x0B,0x53,0x59,  /* 000001A8    "..[.F.SY" */
   2.217 +    0x53,0x52,0x08,0x5F,0x48,0x49,0x44,0x0C,  /* 000001B0    "SR._HID." */
   2.218 +    0x41,0xD0,0x0C,0x02,0x08,0x5F,0x55,0x49,  /* 000001B8    "A...._UI" */
   2.219 +    0x44,0x01,0x08,0x43,0x52,0x53,0x5F,0x11,  /* 000001C0    "D..CRS_." */
   2.220 +    0x4E,0x08,0x0A,0x8A,0x47,0x01,0x10,0x00,  /* 000001C8    "N...G..." */
   2.221 +    0x10,0x00,0x00,0x10,0x47,0x01,0x22,0x00,  /* 000001D0    "....G."." */
   2.222 +    0x22,0x00,0x00,0x0C,0x47,0x01,0x30,0x00,  /* 000001D8    ""...G.0." */
   2.223 +    0x30,0x00,0x00,0x10,0x47,0x01,0x44,0x00,  /* 000001E0    "0...G.D." */
   2.224 +    0x44,0x00,0x00,0x1C,0x47,0x01,0x62,0x00,  /* 000001E8    "D...G.b." */
   2.225 +    0x62,0x00,0x00,0x02,0x47,0x01,0x65,0x00,  /* 000001F0    "b...G.e." */
   2.226 +    0x65,0x00,0x00,0x0B,0x47,0x01,0x72,0x00,  /* 000001F8    "e...G.r." */
   2.227 +    0x72,0x00,0x00,0x0E,0x47,0x01,0x80,0x00,  /* 00000200    "r...G..." */
   2.228 +    0x80,0x00,0x00,0x01,0x47,0x01,0x84,0x00,  /* 00000208    "....G..." */
   2.229 +    0x84,0x00,0x00,0x03,0x47,0x01,0x88,0x00,  /* 00000210    "....G..." */
   2.230 +    0x88,0x00,0x00,0x01,0x47,0x01,0x8C,0x00,  /* 00000218    "....G..." */
   2.231 +    0x8C,0x00,0x00,0x03,0x47,0x01,0x90,0x00,  /* 00000220    "....G..." */
   2.232 +    0x90,0x00,0x00,0x10,0x47,0x01,0xA2,0x00,  /* 00000228    "....G..." */
   2.233 +    0xA2,0x00,0x00,0x1C,0x47,0x01,0xE0,0x00,  /* 00000230    "....G..." */
   2.234 +    0xE0,0x00,0x00,0x10,0x47,0x01,0xA0,0x08,  /* 00000238    "....G..." */
   2.235 +    0xA0,0x08,0x00,0x04,0x47,0x01,0xC0,0x0C,  /* 00000240    "....G..." */
   2.236 +    0xC0,0x0C,0x00,0x10,0x47,0x01,0xD0,0x04,  /* 00000248    "....G..." */
   2.237 +    0xD0,0x04,0x00,0x02,0x79,0x00,0x14,0x0B,  /* 00000250    "....y..." */
   2.238 +    0x5F,0x43,0x52,0x53,0x00,0xA4,0x43,0x52,  /* 00000258    "_CRS..CR" */
   2.239 +    0x53,0x5F,0x5B,0x82,0x2B,0x50,0x49,0x43,  /* 00000260    "S_[.+PIC" */
   2.240 +    0x5F,0x08,0x5F,0x48,0x49,0x44,0x0B,0x41,  /* 00000268    "_._HID.A" */
   2.241 +    0xD0,0x08,0x5F,0x43,0x52,0x53,0x11,0x18,  /* 00000270    ".._CRS.." */
   2.242 +    0x0A,0x15,0x47,0x01,0x20,0x00,0x20,0x00,  /* 00000278    "..G. . ." */
   2.243 +    0x01,0x02,0x47,0x01,0xA0,0x00,0xA0,0x00,  /* 00000280    "..G....." */
   2.244 +    0x01,0x02,0x22,0x04,0x00,0x79,0x00,0x5B,  /* 00000288    ".."..y.[" */
   2.245 +    0x82,0x47,0x05,0x44,0x4D,0x41,0x30,0x08,  /* 00000290    ".G.DMA0." */
   2.246 +    0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,0x02,  /* 00000298    "_HID.A.." */
   2.247 +    0x00,0x08,0x5F,0x43,0x52,0x53,0x11,0x41,  /* 000002A0    ".._CRS.A" */
   2.248 +    0x04,0x0A,0x3D,0x2A,0x10,0x04,0x47,0x01,  /* 000002A8    "..=*..G." */
   2.249 +    0x00,0x00,0x00,0x00,0x00,0x10,0x47,0x01,  /* 000002B0    "......G." */
   2.250 +    0x81,0x00,0x81,0x00,0x00,0x03,0x47,0x01,  /* 000002B8    "......G." */
   2.251 +    0x87,0x00,0x87,0x00,0x00,0x01,0x47,0x01,  /* 000002C0    "......G." */
   2.252 +    0x89,0x00,0x89,0x00,0x00,0x03,0x47,0x01,  /* 000002C8    "......G." */
   2.253 +    0x8F,0x00,0x8F,0x00,0x00,0x01,0x47,0x01,  /* 000002D0    "......G." */
   2.254 +    0xC0,0x00,0xC0,0x00,0x00,0x20,0x47,0x01,  /* 000002D8    "..... G." */
   2.255 +    0x80,0x04,0x80,0x04,0x00,0x10,0x79,0x00,  /* 000002E0    "......y." */
   2.256 +    0x5B,0x82,0x25,0x54,0x4D,0x52,0x5F,0x08,  /* 000002E8    "[.%TMR_." */
   2.257 +    0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,0x01,  /* 000002F0    "_HID.A.." */
   2.258 +    0x00,0x08,0x5F,0x43,0x52,0x53,0x11,0x10,  /* 000002F8    ".._CRS.." */
   2.259 +    0x0A,0x0D,0x47,0x01,0x40,0x00,0x40,0x00,  /* 00000300    "..G.@.@." */
   2.260 +    0x00,0x04,0x22,0x01,0x00,0x79,0x00,0x5B,  /* 00000308    ".."..y.[" */
   2.261 +    0x82,0x25,0x52,0x54,0x43,0x5F,0x08,0x5F,  /* 00000310    ".%RTC_._" */
   2.262 +    0x48,0x49,0x44,0x0C,0x41,0xD0,0x0B,0x00,  /* 00000318    "HID.A..." */
   2.263 +    0x08,0x5F,0x43,0x52,0x53,0x11,0x10,0x0A,  /* 00000320    "._CRS..." */
   2.264 +    0x0D,0x47,0x01,0x70,0x00,0x70,0x00,0x00,  /* 00000328    ".G.p.p.." */
   2.265 +    0x02,0x22,0x00,0x01,0x79,0x00,0x5B,0x82,  /* 00000330    "."..y.[." */
   2.266 +    0x22,0x53,0x50,0x4B,0x52,0x08,0x5F,0x48,  /* 00000338    ""SPKR._H" */
   2.267 +    0x49,0x44,0x0C,0x41,0xD0,0x08,0x00,0x08,  /* 00000340    "ID.A...." */
   2.268 +    0x5F,0x43,0x52,0x53,0x11,0x0D,0x0A,0x0A,  /* 00000348    "_CRS...." */
   2.269 +    0x47,0x01,0x61,0x00,0x61,0x00,0x00,0x01,  /* 00000350    "G.a.a..." */
   2.270 +    0x79,0x00,0x5B,0x82,0x31,0x50,0x53,0x32,  /* 00000358    "y.[.1PS2" */
   2.271 +    0x4D,0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,  /* 00000360    "M._HID.A" */
   2.272 +    0xD0,0x0F,0x13,0x08,0x5F,0x43,0x49,0x44,  /* 00000368    "...._CID" */
   2.273 +    0x0C,0x41,0xD0,0x0F,0x13,0x14,0x09,0x5F,  /* 00000370    ".A....._" */
   2.274 +    0x53,0x54,0x41,0x00,0xA4,0x0A,0x0F,0x08,  /* 00000378    "STA....." */
   2.275 +    0x5F,0x43,0x52,0x53,0x11,0x08,0x0A,0x05,  /* 00000380    "_CRS...." */
   2.276 +    0x22,0x00,0x10,0x79,0x00,0x5B,0x82,0x42,  /* 00000388    ""..y.[.B" */
   2.277 +    0x04,0x50,0x53,0x32,0x4B,0x08,0x5F,0x48,  /* 00000390    ".PS2K._H" */
   2.278 +    0x49,0x44,0x0C,0x41,0xD0,0x03,0x03,0x08,  /* 00000398    "ID.A...." */
   2.279 +    0x5F,0x43,0x49,0x44,0x0C,0x41,0xD0,0x03,  /* 000003A0    "_CID.A.." */
   2.280 +    0x0B,0x14,0x09,0x5F,0x53,0x54,0x41,0x00,  /* 000003A8    "..._STA." */
   2.281 +    0xA4,0x0A,0x0F,0x08,0x5F,0x43,0x52,0x53,  /* 000003B0    "...._CRS" */
   2.282 +    0x11,0x18,0x0A,0x15,0x47,0x01,0x60,0x00,  /* 000003B8    "....G.`." */
   2.283 +    0x60,0x00,0x00,0x01,0x47,0x01,0x64,0x00,  /* 000003C0    "`...G.d." */
   2.284 +    0x64,0x00,0x00,0x01,0x22,0x02,0x00,0x79,  /* 000003C8    "d..."..y" */
   2.285 +    0x00,0x5B,0x82,0x3A,0x46,0x44,0x43,0x30,  /* 000003D0    ".[.:FDC0" */
   2.286 +    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 000003D8    "._HID.A." */
   2.287 +    0x07,0x00,0x14,0x09,0x5F,0x53,0x54,0x41,  /* 000003E0    "...._STA" */
   2.288 +    0x00,0xA4,0x0A,0x0F,0x08,0x5F,0x43,0x52,  /* 000003E8    "....._CR" */
   2.289 +    0x53,0x11,0x1B,0x0A,0x18,0x47,0x01,0xF0,  /* 000003F0    "S....G.." */
   2.290 +    0x03,0xF0,0x03,0x01,0x06,0x47,0x01,0xF7,  /* 000003F8    ".....G.." */
   2.291 +    0x03,0xF7,0x03,0x01,0x01,0x22,0x40,0x00,  /* 00000400    "....."@." */
   2.292 +    0x2A,0x04,0x00,0x79,0x00,0x5B,0x82,0x35,  /* 00000408    "*..y.[.5" */
   2.293 +    0x55,0x41,0x52,0x31,0x08,0x5F,0x48,0x49,  /* 00000410    "UAR1._HI" */
   2.294 +    0x44,0x0C,0x41,0xD0,0x05,0x01,0x08,0x5F,  /* 00000418    "D.A...._" */
   2.295 +    0x55,0x49,0x44,0x01,0x14,0x09,0x5F,0x53,  /* 00000420    "UID..._S" */
   2.296 +    0x54,0x41,0x00,0xA4,0x0A,0x0F,0x08,0x5F,  /* 00000428    "TA....._" */
   2.297 +    0x43,0x52,0x53,0x11,0x10,0x0A,0x0D,0x47,  /* 00000430    "CRS....G" */
   2.298 +    0x01,0xF8,0x03,0xF8,0x03,0x01,0x08,0x22,  /* 00000438    "......."" */
   2.299 +    0x10,0x00,0x79,0x00,0x5B,0x82,0x36,0x55,  /* 00000440    "..y.[.6U" */
   2.300 +    0x41,0x52,0x32,0x08,0x5F,0x48,0x49,0x44,  /* 00000448    "AR2._HID" */
   2.301 +    0x0C,0x41,0xD0,0x05,0x01,0x08,0x5F,0x55,  /* 00000450    ".A...._U" */
   2.302 +    0x49,0x44,0x0A,0x02,0x14,0x09,0x5F,0x53,  /* 00000458    "ID...._S" */
   2.303 +    0x54,0x41,0x00,0xA4,0x0A,0x0F,0x08,0x5F,  /* 00000460    "TA....._" */
   2.304 +    0x43,0x52,0x53,0x11,0x10,0x0A,0x0D,0x47,  /* 00000468    "CRS....G" */
   2.305 +    0x01,0xF8,0x02,0xF8,0x02,0x01,0x08,0x22,  /* 00000470    "......."" */
   2.306 +    0x08,0x00,0x79,0x00,
   2.307  };
   2.308  int DsdtLen=sizeof(AmlCode);
     3.1 --- a/tools/firmware/acpi/acpi_fadt.h	Sun May 14 20:13:14 2006 +0100
     3.2 +++ b/tools/firmware/acpi/acpi_fadt.h	Mon May 15 07:38:32 2006 +0100
     3.3 @@ -59,7 +59,7 @@
     3.4  #define ACPI_PM1A_EVT_BLK_ADDRESS_SPACE_ID  ACPI_SYSTEM_IO
     3.5  #define ACPI_PM1A_EVT_BLK_BIT_WIDTH         0x00
     3.6  #define ACPI_PM1A_EVT_BLK_BIT_OFFSET        0x00
     3.7 -#define ACPI_PM1A_EVT_BLK_ADDRESS           0x0000000000000000
     3.8 +#define ACPI_PM1A_EVT_BLK_ADDRESS           0x0000000000008000
     3.9  
    3.10  //
    3.11  // PM1B Event Register Block Generic Address Information
    3.12 @@ -73,7 +73,7 @@
    3.13  // PM1A Control Register Block Generic Address Information
    3.14  //
    3.15  #define ACPI_PM1A_CNT_BLK_ADDRESS_SPACE_ID  ACPI_SYSTEM_IO
    3.16 -#define ACPI_PM1A_CNT_BLK_BIT_WIDTH         0x10
    3.17 +#define ACPI_PM1A_CNT_BLK_BIT_WIDTH         0x08
    3.18  #define ACPI_PM1A_CNT_BLK_BIT_OFFSET        0x00
    3.19  #define ACPI_PM1A_CNT_BLK_ADDRESS           (ACPI_PM1A_EVT_BLK_ADDRESS + 0x04)
    3.20  
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/tools/ioemu/hw/acpi.c	Mon May 15 07:38:32 2006 +0100
     4.3 @@ -0,0 +1,178 @@
     4.4 +/*
     4.5 + * ACPI emulation
     4.6 + * 
     4.7 + * Copyright (c) 2006 Virtual Iron Software
     4.8 + *
     4.9 + * This module provides the beginnings of some ACPI emulation.
    4.10 + * Initially, this code handles writes to the sleep state
    4.11 + * registers. This is done to detect requests to power-off
    4.12 + * a guest domain.
    4.13 + *
    4.14 + * Later, and driven by empirical evidence, additional capabilities
    4.15 + * and emulation might be added.
    4.16 + *
    4.17 + * Currently, the FADT specifies a small register set, of which
    4.18 + * only PM1_CNTa is available.  In addition, the ASL code specifies
    4.19 + * the proper values to write on an S5 (poweroff) request, which
    4.20 + * this code understands.
    4.21 + *
    4.22 + */
    4.23 +
    4.24 +#include "vl.h"
    4.25 +extern FILE* logfile;
    4.26 +
    4.27 +// Define some basic offsets to ACPI registers
    4.28 +
    4.29 +//#define DEBUG_ACPI
    4.30 +#define	PM1a_STS	0x0
    4.31 +#define	PM1a_EN		0x1
    4.32 +#define	PM1b_STS	0x2
    4.33 +#define	PM1b_EN		0x3
    4.34 +#define	PM1_CNTa	0x4
    4.35 +#define	PM1_CNTb	0x6
    4.36 +
    4.37 +// Values within PM1_CNTa that we need for power handling
    4.38 +
    4.39 +#define	SLP_TYP_MASK	0x1C00
    4.40 +#define	SLP_VAL		0x1C00
    4.41 +#define	SLP_EN		0x2000
    4.42 +
    4.43 +// Base ACPI register address
    4.44 +
    4.45 +static unsigned int acpi_base = 0;
    4.46 +
    4.47 +/* acpi_write_byte - handle byte writes for ACPI I/O region
    4.48 + *
    4.49 + * Input:
    4.50 + *	opaque	pointer to private data structure (currently NULL)
    4.51 + *	addr	I/O space address to be written
    4.52 + *	data	data to be written
    4.53 + *
    4.54 + * Output:
    4.55 + *	none
    4.56 + *
    4.57 + * Returns:
    4.58 + *	none
    4.59 + */
    4.60 +
    4.61 +static void acpi_write_byte(void *opaque, uint32_t addr, uint32_t data) {
    4.62 +
    4.63 +#ifdef DEBUG_ACPI
    4.64 +    fprintf(logfile, "%s - addr 0x%x, data 0x%x\n", __FUNCTION__, addr, data);
    4.65 +#endif
    4.66 +
    4.67 +    // All byte writes are currently ignored
    4.68 +
    4.69 +    return;
    4.70 +}
    4.71 +
    4.72 +/* acpi_write_word - handle word writes for ACPI I/O region
    4.73 + *
    4.74 + * Input:
    4.75 + *	opaque	pointer to private data structure (currently NULL)
    4.76 + *	addr	I/O space address to be written
    4.77 + *	data	data to be written
    4.78 + *
    4.79 + * Output:
    4.80 + *	none
    4.81 + *
    4.82 + * Returns:
    4.83 + *	none
    4.84 + */
    4.85 +
    4.86 +static void acpi_write_word(void *opaque, uint32_t addr, uint32_t data) {
    4.87 +
    4.88 +#ifdef DEBUG_ACPI
    4.89 +    fprintf(logfile, "%s - addr 0x%x, data 0x%x\n", __FUNCTION__, addr, data);
    4.90 +#endif
    4.91 +
    4.92 +    // Only a write to PM1_CNTa for power operations is handled
    4.93 +    // All others are ignored
    4.94 +
    4.95 +    if (addr == acpi_base + PM1_CNTa) {
    4.96 +        if ( ( (data & SLP_EN) != 0) &&
    4.97 +             ( (data & SLP_TYP_MASK) == SLP_VAL) ) {
    4.98 +            qemu_system_shutdown_request();
    4.99 +            fprintf(logfile, "%s - ACPI Power State 5 (poweroff) requested\n", __FUNCTION__);
   4.100 +        }
   4.101 +    }
   4.102 +
   4.103 +    return;
   4.104 +}
   4.105 +
   4.106 +/* acpi_read_byte - handle byte reads for ACPI I/O region
   4.107 + *
   4.108 + * Input:
   4.109 + *	opaque	pointer to private data structure (currently NULL)
   4.110 + *	addr	I/O space address to be written
   4.111 + *
   4.112 + * Output:
   4.113 + *	none
   4.114 + *
   4.115 + * Returns:
   4.116 + *	data read
   4.117 + */
   4.118 +
   4.119 +static uint32_t acpi_read_byte(void *opaque, uint32_t addr) {
   4.120 +
   4.121 +#ifdef DEBUG_ACPI
   4.122 +    fprintf(logfile, "%s - addr 0x%x\n", __FUNCTION__, addr);
   4.123 +#endif
   4.124 +
   4.125 +    // All reads return 0
   4.126 +
   4.127 +    return 0;
   4.128 +}
   4.129 +
   4.130 +/* acpi_read_word - handle word reads for ACPI I/O region
   4.131 + *
   4.132 + * Input:
   4.133 + *	opaque	pointer to private data structure (currently NULL)
   4.134 + *	addr	I/O space address to be written
   4.135 + *
   4.136 + * Output:
   4.137 + *	none
   4.138 + *
   4.139 + * Returns:
   4.140 + *	data read
   4.141 + */
   4.142 +
   4.143 +static uint32_t acpi_read_word(void *opaque, uint32_t addr) {
   4.144 +
   4.145 +#ifdef DEBUG_ACPI
   4.146 +    fprintf(logfile, "%s - addr 0x%x\n", __FUNCTION__, addr);
   4.147 +#endif
   4.148 +
   4.149 +    // All reads return 0
   4.150 +
   4.151 +    return 0;
   4.152 +}
   4.153 +
   4.154 +/* acpi_init - initialize for ACPI I/O space operation handling
   4.155 + *
   4.156 + * Input:
   4.157 + *	base	base I/O address
   4.158 + *
   4.159 + * Output:
   4.160 + *	none
   4.161 + *
   4.162 + * Returns:
   4.163 + *	status
   4.164 + */
   4.165 +
   4.166 +int acpi_init(unsigned int base) {
   4.167 +
   4.168 +    fprintf(logfile, "%s - registering ACPI addresses at 0x%x\n", __FUNCTION__, base);
   4.169 +
   4.170 +    // Map 16 bytes of reads/writes for bytes/words
   4.171 +
   4.172 +    register_ioport_write(base, 16, sizeof(unsigned char), acpi_write_byte, NULL);
   4.173 +    register_ioport_read(base,  16, sizeof(unsigned char), acpi_read_byte,  NULL);
   4.174 +
   4.175 +    register_ioport_write(base, 16, sizeof(unsigned short), acpi_write_word, NULL);
   4.176 +    register_ioport_read(base,  16, sizeof(unsigned short), acpi_read_word,  NULL);
   4.177 +
   4.178 +    acpi_base = base;
   4.179 +
   4.180 +    return 0;
   4.181 +}
     5.1 --- a/tools/ioemu/hw/pc.c	Sun May 14 20:13:14 2006 +0100
     5.2 +++ b/tools/ioemu/hw/pc.c	Mon May 15 07:38:32 2006 +0100
     5.3 @@ -373,6 +373,8 @@ static int ne2000_irq[NE2000_NB_MAX] = {
     5.4  static int serial_io[MAX_SERIAL_PORTS] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 };
     5.5  static int serial_irq[MAX_SERIAL_PORTS] = { 4, 3, 4, 3 };
     5.6  
     5.7 +extern int acpi_init(unsigned int base);
     5.8 +
     5.9  #define NOBIOS 1
    5.10  
    5.11  /* PC hardware initialisation */
    5.12 @@ -576,6 +578,7 @@ void pc_init(uint64_t ram_size, int vga_
    5.13      floppy_controller = fdctrl_init(6, 2, 0, 0x3f0, fd_table);
    5.14  
    5.15      cmos_init(ram_size, boot_device, bs_table);
    5.16 +    acpi_init(0x8000);
    5.17  
    5.18      /* must be done after all PCI devices are instanciated */
    5.19      /* XXX: should be done in the Bochs BIOS */
     6.1 --- a/tools/ioemu/target-i386-dm/Makefile	Sun May 14 20:13:14 2006 +0100
     6.2 +++ b/tools/ioemu/target-i386-dm/Makefile	Mon May 15 07:38:32 2006 +0100
     6.3 @@ -278,7 +278,7 @@ endif
     6.4  # Hardware support
     6.5  VL_OBJS+= ide.o ne2000.o pckbd.o vga.o dma.o
     6.6  VL_OBJS+= fdc.o mc146818rtc.o serial.o i8259_stub.o pc.o port-e9.o
     6.7 -VL_OBJS+= cirrus_vga.o pcnet.o
     6.8 +VL_OBJS+= cirrus_vga.o pcnet.o acpi.o
     6.9  VL_OBJS+= $(SOUND_HW) $(AUDIODRV) mixeng.o
    6.10  
    6.11  ifeq ($(TARGET_ARCH), ppc)
    6.12 @@ -318,7 +318,7 @@ endif
    6.13  endif
    6.14  
    6.15  $(QEMU_SYSTEM): $(VL_OBJS) libqemu.a
    6.16 -	$(CC) $(CFLAGS) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(VNC_LIBS) $(VL_LIBS) -lpthread
    6.17 +	$(CC) $(CFLAGS) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(VNC_LIBS) $(VL_LIBS) -lpthread  -Wl,-Map,qemu-dm.map -Wl,--cref
    6.18  
    6.19  vnc.o: vnc.c keyboard_rdesktop.c
    6.20  	$(CC) $(CFLAGS) $(DEFINES) $(VNC_CFLAGS) -c -o $@ $<