ia64/xen-unstable

changeset 17089:f853c0497095

merge with xen-unstable.hg
author Alex Williamson <alex.williamson@hp.com>
date Tue Feb 19 11:14:40 2008 -0700 (2008-02-19)
parents 63b0a8cb56ff 8848d9e07584
children 3f1cf03826fe
files xen/include/public/domctl.h
line diff
     1.1 --- a/tools/console/daemon/io.c	Tue Feb 19 09:28:09 2008 -0700
     1.2 +++ b/tools/console/daemon/io.c	Tue Feb 19 11:14:40 2008 -0700
     1.3 @@ -122,7 +122,7 @@ static int write_with_timestamp(int fd, 
     1.4  	char ts[32];
     1.5  	time_t now = time(NULL);
     1.6  	const struct tm *tmnow = localtime(&now);
     1.7 -	size_t tslen = strftime(ts, sizeof(ts), "[%d-%m-%Y %H:%M:%S] ", tmnow);
     1.8 +	size_t tslen = strftime(ts, sizeof(ts), "[%Y-%m-%d %H:%M:%S] ", tmnow);
     1.9  
    1.10  	memcpy(buf, data, sz);
    1.11  	while (sz > 0 && buf[sz-1] == '\r')
     2.1 --- a/tools/firmware/hvmloader/acpi/dsdt.asl	Tue Feb 19 09:28:09 2008 -0700
     2.2 +++ b/tools/firmware/hvmloader/acpi/dsdt.asl	Tue Feb 19 11:14:40 2008 -0700
     2.3 @@ -27,7 +27,14 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, 
     2.4      Name (\APCL, 0x00010000)
     2.5      Name (\PUID, 0x00)
     2.6  
     2.7 -    /* S5 (power-off) type codes: must match with piix4 emulation! */
     2.8 +    /* S4 (STD) and S5 (power-off) type codes: must match piix4 emulation. */
     2.9 +    Name (\_S4, Package (0x04)
    2.10 +    {
    2.11 +        0x06,  /* PM1a_CNT.SLP_TYP */
    2.12 +        0x06,  /* PM1b_CNT.SLP_TYP */
    2.13 +        0x00,  /* reserved */
    2.14 +        0x00   /* reserved */
    2.15 +    })
    2.16      Name (\_S5, Package (0x04)
    2.17      {
    2.18          0x07,  /* PM1a_CNT.SLP_TYP */
    2.19 @@ -79,7 +86,7 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, 
    2.20             Name (_UID, 0x00)
    2.21             Name (_ADR, 0x00)
    2.22             Name (_BBN, 0x00)
    2.23 - 
    2.24 +
    2.25             Method (_CRS, 0, NotSerialized)
    2.26             {
    2.27                 Name (PRT0, ResourceTemplate ()
    2.28 @@ -713,6 +720,121 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, 
    2.29                      })
    2.30                  } 
    2.31              }
    2.32 +
    2.33 +            /******************************************************************
    2.34 +             * Each PCI hotplug slot needs at least two methods to handle
    2.35 +             * the ACPI event:
    2.36 +             *  _EJ0: eject a device
    2.37 +             *  _STA: return a device's status, e.g. enabled or removed
    2.38 +             * Other methods are optional: 
    2.39 +             *  _PS0/3: put them here for debug purpose
    2.40 +             * 
    2.41 +             * Eject button would generate a general-purpose event, then the
    2.42 +             * control method for this event uses Notify() to inform OSPM which
    2.43 +             * action happened and on which device.
    2.44 +             *
    2.45 +             * Pls. refer "6.3 Device Insertion, Removal, and Status Objects"
    2.46 +             * in ACPI spec 3.0b for details.
    2.47 +             *
    2.48 +             * QEMU provides a simple hotplug controller with some I/O to
    2.49 +             * handle the hotplug action and status, which is beyond the ACPI
    2.50 +             * scope.
    2.51 +             */
    2.52 +
    2.53 +            Device (S1F0)
    2.54 +            {
    2.55 +                Name (_ADR, 0x00060000) /* Dev 6, Func 0 */
    2.56 +                Name (_SUN, 0x00000001)
    2.57 +
    2.58 +                Method (_PS0, 0)
    2.59 +                {
    2.60 +                    Store (0x80, \_GPE.DPT2)
    2.61 +                }
    2.62 +
    2.63 +                Method (_PS3, 0)
    2.64 +                {
    2.65 +                    Store (0x83, \_GPE.DPT2)
    2.66 +                }
    2.67 +
    2.68 +                Method (_EJ0, 1)
    2.69 +                {
    2.70 +                    Store (0x88, \_GPE.DPT2)
    2.71 +                    Store (0x1, \_GPE.PHP1) /* eject php slot 1*/
    2.72 +                }
    2.73 +
    2.74 +                Method (_STA, 0)
    2.75 +                {
    2.76 +                    Store (0x89, \_GPE.DPT2)
    2.77 +                    Return ( \_GPE.PHP1 )   /* IN status as the _STA */
    2.78 +                }
    2.79 +            }
    2.80 +
    2.81 +            Device (S2F0)
    2.82 +            {
    2.83 +                Name (_ADR, 0x00070000) /* Dev 7, Func 0 */
    2.84 +                Name (_SUN, 0x00000002)
    2.85 +
    2.86 +                Method (_PS0, 0)
    2.87 +                {
    2.88 +                    Store (0x90, \_GPE.DPT2)
    2.89 +                }
    2.90 +
    2.91 +                Method (_PS3, 0)
    2.92 +                {
    2.93 +                    Store (0x93, \_GPE.DPT2)
    2.94 +                }
    2.95 +
    2.96 +                Method (_EJ0, 1)
    2.97 +                {
    2.98 +                    Store (0x98, \_GPE.DPT2)
    2.99 +                    Store (0x1, \_GPE.PHP2) /* eject php slot 1*/
   2.100 +                }
   2.101 +
   2.102 +                Method (_STA, 0)
   2.103 +                {
   2.104 +                    Store (0x99, \_GPE.DPT2)
   2.105 +                    Return ( \_GPE.PHP2 )   /* IN status as the _STA */
   2.106 +                }
   2.107 +            }
   2.108 +        }
   2.109 +    }
   2.110 +
   2.111 +    Scope (\_GPE)
   2.112 +    {
   2.113 +        OperationRegion (PHP, SystemIO, 0x10c0, 0x03)
   2.114 +        Field (PHP, ByteAcc, NoLock, Preserve)
   2.115 +        {
   2.116 +            PSTA,   8, /* hotplug controller status reg */
   2.117 +            PHP1,   8, /* hotplug slot 1 control reg */
   2.118 +            PHP2,   8  /* hotplug slot 2 control reg */
   2.119 +        }
   2.120 +        OperationRegion (DG1, SystemIO, 0xb044, 0x04)
   2.121 +        Field (DG1, ByteAcc, NoLock, Preserve)
   2.122 +        {
   2.123 +            DPT1,   8,
   2.124 +            DPT2,   8
   2.125 +        }
   2.126 +        Method (_L03, 0, NotSerialized)
   2.127 +        {
   2.128 +            /* detect slot and event(remove/add) */
   2.129 +            Name (SLT, 0x0)
   2.130 +            Name (EVT, 0x0)
   2.131 +            Store (PSTA, Local1)
   2.132 +            ShiftRight (Local1, 0x4, SLT)
   2.133 +            And (Local1, 0xf, EVT)
   2.134 +
   2.135 +            /* debug */
   2.136 +            Store (SLT, DPT1)
   2.137 +            Store (EVT, DPT2)
   2.138 +
   2.139 +            If ( LEqual(SLT, 0x1) )
   2.140 +            {
   2.141 +                Notify (\_SB.PCI0.S1F0, EVT)
   2.142 +            }
   2.143 +            ElseIf ( LEqual(SLT, 0x2) )
   2.144 +            {
   2.145 +                Notify (\_SB.PCI0.S2F0, EVT)
   2.146 +            }
   2.147          }
   2.148      }
   2.149  }
     3.1 --- a/tools/firmware/hvmloader/acpi/dsdt.c	Tue Feb 19 09:28:09 2008 -0700
     3.2 +++ b/tools/firmware/hvmloader/acpi/dsdt.c	Tue Feb 19 11:14:40 2008 -0700
     3.3 @@ -5,15 +5,15 @@
     3.4   * Copyright (C) 2000 - 2006 Intel Corporation
     3.5   * Supports ACPI Specification Revision 3.0a
     3.6   * 
     3.7 - * Compilation of "dsdt.asl" - Mon Feb 11 13:31:53 2008
     3.8 + * Compilation of "dsdt.asl" - Fri Feb 15 14:07:57 2008
     3.9   * 
    3.10   * C source code output
    3.11   *
    3.12   */
    3.13  unsigned char AmlCode[] =
    3.14  {
    3.15 -    0x44,0x53,0x44,0x54,0x8E,0x0E,0x00,0x00,  /* 00000000    "DSDT...." */
    3.16 -    0x02,0x6E,0x58,0x65,0x6E,0x00,0x00,0x00,  /* 00000008    ".nXen..." */
    3.17 +    0x44,0x53,0x44,0x54,0x5A,0x10,0x00,0x00,  /* 00000000    "DSDTZ..." */
    3.18 +    0x02,0xCC,0x58,0x65,0x6E,0x00,0x00,0x00,  /* 00000008    "..Xen..." */
    3.19      0x48,0x56,0x4D,0x00,0x00,0x00,0x00,0x00,  /* 00000010    "HVM....." */
    3.20      0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
    3.21      0x07,0x07,0x06,0x20,0x08,0x50,0x4D,0x42,  /* 00000020    "... .PMB" */
    3.22 @@ -23,460 +23,518 @@ unsigned char AmlCode[] =
    3.23      0x41,0x50,0x43,0x42,0x0C,0x00,0x00,0xC0,  /* 00000040    "APCB...." */
    3.24      0xFE,0x08,0x41,0x50,0x43,0x4C,0x0C,0x00,  /* 00000048    "..APCL.." */
    3.25      0x00,0x01,0x00,0x08,0x50,0x55,0x49,0x44,  /* 00000050    "....PUID" */
    3.26 -    0x00,0x08,0x5F,0x53,0x35,0x5F,0x12,0x08,  /* 00000058    ".._S5_.." */
    3.27 -    0x04,0x0A,0x07,0x0A,0x07,0x00,0x00,0x08,  /* 00000060    "........" */
    3.28 -    0x50,0x49,0x43,0x44,0x00,0x14,0x0C,0x5F,  /* 00000068    "PICD..._" */
    3.29 -    0x50,0x49,0x43,0x01,0x70,0x68,0x50,0x49,  /* 00000070    "PIC.phPI" */
    3.30 -    0x43,0x44,0x10,0x43,0xE1,0x5F,0x53,0x42,  /* 00000078    "CD.C._SB" */
    3.31 -    0x5F,0x5B,0x80,0x42,0x49,0x4F,0x53,0x00,  /* 00000080    "_[.BIOS." */
    3.32 -    0x0C,0x00,0xA0,0x0E,0x00,0x0A,0x10,0x5B,  /* 00000088    ".......[" */
    3.33 -    0x81,0x21,0x42,0x49,0x4F,0x53,0x01,0x55,  /* 00000090    ".!BIOS.U" */
    3.34 -    0x41,0x52,0x31,0x01,0x55,0x41,0x52,0x32,  /* 00000098    "AR1.UAR2" */
    3.35 -    0x01,0x48,0x50,0x45,0x54,0x01,0x00,0x1D,  /* 000000A0    ".HPET..." */
    3.36 -    0x50,0x4D,0x49,0x4E,0x20,0x50,0x4C,0x45,  /* 000000A8    "PMIN PLE" */
    3.37 -    0x4E,0x20,0x5B,0x82,0x49,0x04,0x4D,0x45,  /* 000000B0    "N [.I.ME" */
    3.38 -    0x4D,0x30,0x08,0x5F,0x48,0x49,0x44,0x0C,  /* 000000B8    "M0._HID." */
    3.39 -    0x41,0xD0,0x0C,0x02,0x08,0x5F,0x43,0x52,  /* 000000C0    "A...._CR" */
    3.40 -    0x53,0x11,0x33,0x0A,0x30,0x8A,0x2B,0x00,  /* 000000C8    "S.3.0.+." */
    3.41 -    0x00,0x0D,0x03,0x00,0x00,0x00,0x00,0x00,  /* 000000D0    "........" */
    3.42 -    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000D8    "........" */
    3.43 -    0x00,0x00,0x00,0xFF,0xFF,0x09,0x00,0x00,  /* 000000E0    "........" */
    3.44 +    0x00,0x08,0x5F,0x53,0x34,0x5F,0x12,0x08,  /* 00000058    ".._S4_.." */
    3.45 +    0x04,0x0A,0x06,0x0A,0x06,0x00,0x00,0x08,  /* 00000060    "........" */
    3.46 +    0x5F,0x53,0x35,0x5F,0x12,0x08,0x04,0x0A,  /* 00000068    "_S5_...." */
    3.47 +    0x07,0x0A,0x07,0x00,0x00,0x08,0x50,0x49,  /* 00000070    "......PI" */
    3.48 +    0x43,0x44,0x00,0x14,0x0C,0x5F,0x50,0x49,  /* 00000078    "CD..._PI" */
    3.49 +    0x43,0x01,0x70,0x68,0x50,0x49,0x43,0x44,  /* 00000080    "C.phPICD" */
    3.50 +    0x10,0x42,0xF1,0x5F,0x53,0x42,0x5F,0x5B,  /* 00000088    ".B._SB_[" */
    3.51 +    0x80,0x42,0x49,0x4F,0x53,0x00,0x0C,0x00,  /* 00000090    ".BIOS..." */
    3.52 +    0xA0,0x0E,0x00,0x0A,0x10,0x5B,0x81,0x21,  /* 00000098    ".....[.!" */
    3.53 +    0x42,0x49,0x4F,0x53,0x01,0x55,0x41,0x52,  /* 000000A0    "BIOS.UAR" */
    3.54 +    0x31,0x01,0x55,0x41,0x52,0x32,0x01,0x48,  /* 000000A8    "1.UAR2.H" */
    3.55 +    0x50,0x45,0x54,0x01,0x00,0x1D,0x50,0x4D,  /* 000000B0    "PET...PM" */
    3.56 +    0x49,0x4E,0x20,0x50,0x4C,0x45,0x4E,0x20,  /* 000000B8    "IN PLEN " */
    3.57 +    0x5B,0x82,0x49,0x04,0x4D,0x45,0x4D,0x30,  /* 000000C0    "[.I.MEM0" */
    3.58 +    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 000000C8    "._HID.A." */
    3.59 +    0x0C,0x02,0x08,0x5F,0x43,0x52,0x53,0x11,  /* 000000D0    "..._CRS." */
    3.60 +    0x33,0x0A,0x30,0x8A,0x2B,0x00,0x00,0x0D,  /* 000000D8    "3.0.+..." */
    3.61 +    0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000E0    "........" */
    3.62      0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000E8    "........" */
    3.63 -    0x00,0x00,0x00,0x00,0x00,0x0A,0x00,0x00,  /* 000000F0    "........" */
    3.64 -    0x00,0x00,0x00,0x79,0x00,0x5B,0x82,0x4F,  /* 000000F8    "...y.[.O" */
    3.65 -    0xD8,0x50,0x43,0x49,0x30,0x08,0x5F,0x48,  /* 00000100    ".PCI0._H" */
    3.66 -    0x49,0x44,0x0C,0x41,0xD0,0x0A,0x03,0x08,  /* 00000108    "ID.A...." */
    3.67 -    0x5F,0x55,0x49,0x44,0x00,0x08,0x5F,0x41,  /* 00000110    "_UID.._A" */
    3.68 -    0x44,0x52,0x00,0x08,0x5F,0x42,0x42,0x4E,  /* 00000118    "DR.._BBN" */
    3.69 -    0x00,0x14,0x4E,0x0C,0x5F,0x43,0x52,0x53,  /* 00000120    "..N._CRS" */
    3.70 -    0x00,0x08,0x50,0x52,0x54,0x30,0x11,0x42,  /* 00000128    "..PRT0.B" */
    3.71 -    0x07,0x0A,0x6E,0x88,0x0D,0x00,0x02,0x0E,  /* 00000130    "..n....." */
    3.72 -    0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,  /* 00000138    "........" */
    3.73 -    0x00,0x00,0x01,0x47,0x01,0xF8,0x0C,0xF8,  /* 00000140    "...G...." */
    3.74 -    0x0C,0x01,0x08,0x88,0x0D,0x00,0x01,0x0C,  /* 00000148    "........" */
    3.75 -    0x03,0x00,0x00,0x00,0x00,0xF7,0x0C,0x00,  /* 00000150    "........" */
    3.76 -    0x00,0xF8,0x0C,0x88,0x0D,0x00,0x01,0x0C,  /* 00000158    "........" */
    3.77 -    0x03,0x00,0x00,0x00,0x0D,0xFF,0xFF,0x00,  /* 00000160    "........" */
    3.78 -    0x00,0x00,0xF3,0x87,0x17,0x00,0x00,0x0C,  /* 00000168    "........" */
    3.79 -    0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x0A,  /* 00000170    "........" */
    3.80 -    0x00,0xFF,0xFF,0x0B,0x00,0x00,0x00,0x00,  /* 00000178    "........" */
    3.81 -    0x00,0x00,0x00,0x02,0x00,0x87,0x17,0x00,  /* 00000180    "........" */
    3.82 -    0x00,0x0C,0x03,0x00,0x00,0x00,0x00,0x00,  /* 00000188    "........" */
    3.83 -    0x00,0x00,0xF0,0xFF,0xFF,0xFF,0xF4,0x00,  /* 00000190    "........" */
    3.84 -    0x00,0x00,0x00,0x00,0x00,0x00,0x05,0x79,  /* 00000198    ".......y" */
    3.85 -    0x00,0x8A,0x50,0x52,0x54,0x30,0x0A,0x5C,  /* 000001A0    "..PRT0.\" */
    3.86 -    0x4D,0x4D,0x49,0x4E,0x8A,0x50,0x52,0x54,  /* 000001A8    "MMIN.PRT" */
    3.87 -    0x30,0x0A,0x60,0x4D,0x4D,0x41,0x58,0x8A,  /* 000001B0    "0.`MMAX." */
    3.88 -    0x50,0x52,0x54,0x30,0x0A,0x68,0x4D,0x4C,  /* 000001B8    "PRT0.hML" */
    3.89 -    0x45,0x4E,0x70,0x50,0x4D,0x49,0x4E,0x4D,  /* 000001C0    "ENpPMINM" */
    3.90 -    0x4D,0x49,0x4E,0x70,0x50,0x4C,0x45,0x4E,  /* 000001C8    "MINpPLEN" */
    3.91 -    0x4D,0x4C,0x45,0x4E,0x72,0x4D,0x4D,0x49,  /* 000001D0    "MLENrMMI" */
    3.92 -    0x4E,0x4D,0x4C,0x45,0x4E,0x4D,0x4D,0x41,  /* 000001D8    "NMLENMMA" */
    3.93 -    0x58,0x74,0x4D,0x4D,0x41,0x58,0x01,0x4D,  /* 000001E0    "XtMMAX.M" */
    3.94 -    0x4D,0x41,0x58,0xA4,0x50,0x52,0x54,0x30,  /* 000001E8    "MAX.PRT0" */
    3.95 -    0x08,0x42,0x55,0x46,0x41,0x11,0x09,0x0A,  /* 000001F0    ".BUFA..." */
    3.96 -    0x06,0x23,0x20,0x0C,0x18,0x79,0x00,0x08,  /* 000001F8    ".# ..y.." */
    3.97 -    0x42,0x55,0x46,0x42,0x11,0x09,0x0A,0x06,  /* 00000200    "BUFB...." */
    3.98 -    0x23,0x00,0x00,0x18,0x79,0x00,0x8B,0x42,  /* 00000208    "#...y..B" */
    3.99 -    0x55,0x46,0x42,0x01,0x49,0x52,0x51,0x56,  /* 00000210    "UFB.IRQV" */
   3.100 -    0x5B,0x82,0x48,0x08,0x4C,0x4E,0x4B,0x41,  /* 00000218    "[.H.LNKA" */
   3.101 -    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 00000220    "._HID.A." */
   3.102 -    0x0C,0x0F,0x08,0x5F,0x55,0x49,0x44,0x01,  /* 00000228    "..._UID." */
   3.103 -    0x14,0x1C,0x5F,0x53,0x54,0x41,0x00,0x7B,  /* 00000230    ".._STA.{" */
   3.104 -    0x50,0x49,0x52,0x41,0x0A,0x80,0x60,0xA0,  /* 00000238    "PIRA..`." */
   3.105 -    0x08,0x93,0x60,0x0A,0x80,0xA4,0x0A,0x09,  /* 00000240    "..`....." */
   3.106 -    0xA1,0x04,0xA4,0x0A,0x0B,0x14,0x0B,0x5F,  /* 00000248    "......._" */
   3.107 -    0x50,0x52,0x53,0x00,0xA4,0x42,0x55,0x46,  /* 00000250    "PRS..BUF" */
   3.108 -    0x41,0x14,0x11,0x5F,0x44,0x49,0x53,0x00,  /* 00000258    "A.._DIS." */
   3.109 -    0x7D,0x50,0x49,0x52,0x41,0x0A,0x80,0x50,  /* 00000260    "}PIRA..P" */
   3.110 -    0x49,0x52,0x41,0x14,0x1A,0x5F,0x43,0x52,  /* 00000268    "IRA.._CR" */
   3.111 -    0x53,0x00,0x7B,0x50,0x49,0x52,0x41,0x0A,  /* 00000270    "S.{PIRA." */
   3.112 -    0x0F,0x60,0x79,0x01,0x60,0x49,0x52,0x51,  /* 00000278    ".`y.`IRQ" */
   3.113 -    0x56,0xA4,0x42,0x55,0x46,0x42,0x14,0x1B,  /* 00000280    "V.BUFB.." */
   3.114 -    0x5F,0x53,0x52,0x53,0x01,0x8B,0x68,0x01,  /* 00000288    "_SRS..h." */
   3.115 -    0x49,0x52,0x51,0x31,0x82,0x49,0x52,0x51,  /* 00000290    "IRQ1.IRQ" */
   3.116 -    0x31,0x60,0x76,0x60,0x70,0x60,0x50,0x49,  /* 00000298    "1`v`p`PI" */
   3.117 -    0x52,0x41,0x5B,0x82,0x49,0x08,0x4C,0x4E,  /* 000002A0    "RA[.I.LN" */
   3.118 -    0x4B,0x42,0x08,0x5F,0x48,0x49,0x44,0x0C,  /* 000002A8    "KB._HID." */
   3.119 -    0x41,0xD0,0x0C,0x0F,0x08,0x5F,0x55,0x49,  /* 000002B0    "A...._UI" */
   3.120 -    0x44,0x0A,0x02,0x14,0x1C,0x5F,0x53,0x54,  /* 000002B8    "D...._ST" */
   3.121 -    0x41,0x00,0x7B,0x50,0x49,0x52,0x42,0x0A,  /* 000002C0    "A.{PIRB." */
   3.122 -    0x80,0x60,0xA0,0x08,0x93,0x60,0x0A,0x80,  /* 000002C8    ".`...`.." */
   3.123 -    0xA4,0x0A,0x09,0xA1,0x04,0xA4,0x0A,0x0B,  /* 000002D0    "........" */
   3.124 -    0x14,0x0B,0x5F,0x50,0x52,0x53,0x00,0xA4,  /* 000002D8    ".._PRS.." */
   3.125 -    0x42,0x55,0x46,0x41,0x14,0x11,0x5F,0x44,  /* 000002E0    "BUFA.._D" */
   3.126 -    0x49,0x53,0x00,0x7D,0x50,0x49,0x52,0x42,  /* 000002E8    "IS.}PIRB" */
   3.127 -    0x0A,0x80,0x50,0x49,0x52,0x42,0x14,0x1A,  /* 000002F0    "..PIRB.." */
   3.128 -    0x5F,0x43,0x52,0x53,0x00,0x7B,0x50,0x49,  /* 000002F8    "_CRS.{PI" */
   3.129 -    0x52,0x42,0x0A,0x0F,0x60,0x79,0x01,0x60,  /* 00000300    "RB..`y.`" */
   3.130 -    0x49,0x52,0x51,0x56,0xA4,0x42,0x55,0x46,  /* 00000308    "IRQV.BUF" */
   3.131 -    0x42,0x14,0x1B,0x5F,0x53,0x52,0x53,0x01,  /* 00000310    "B.._SRS." */
   3.132 -    0x8B,0x68,0x01,0x49,0x52,0x51,0x31,0x82,  /* 00000318    ".h.IRQ1." */
   3.133 -    0x49,0x52,0x51,0x31,0x60,0x76,0x60,0x70,  /* 00000320    "IRQ1`v`p" */
   3.134 -    0x60,0x50,0x49,0x52,0x42,0x5B,0x82,0x49,  /* 00000328    "`PIRB[.I" */
   3.135 -    0x08,0x4C,0x4E,0x4B,0x43,0x08,0x5F,0x48,  /* 00000330    ".LNKC._H" */
   3.136 -    0x49,0x44,0x0C,0x41,0xD0,0x0C,0x0F,0x08,  /* 00000338    "ID.A...." */
   3.137 -    0x5F,0x55,0x49,0x44,0x0A,0x03,0x14,0x1C,  /* 00000340    "_UID...." */
   3.138 -    0x5F,0x53,0x54,0x41,0x00,0x7B,0x50,0x49,  /* 00000348    "_STA.{PI" */
   3.139 -    0x52,0x43,0x0A,0x80,0x60,0xA0,0x08,0x93,  /* 00000350    "RC..`..." */
   3.140 -    0x60,0x0A,0x80,0xA4,0x0A,0x09,0xA1,0x04,  /* 00000358    "`......." */
   3.141 -    0xA4,0x0A,0x0B,0x14,0x0B,0x5F,0x50,0x52,  /* 00000360    "....._PR" */
   3.142 -    0x53,0x00,0xA4,0x42,0x55,0x46,0x41,0x14,  /* 00000368    "S..BUFA." */
   3.143 -    0x11,0x5F,0x44,0x49,0x53,0x00,0x7D,0x50,  /* 00000370    "._DIS.}P" */
   3.144 -    0x49,0x52,0x43,0x0A,0x80,0x50,0x49,0x52,  /* 00000378    "IRC..PIR" */
   3.145 -    0x43,0x14,0x1A,0x5F,0x43,0x52,0x53,0x00,  /* 00000380    "C.._CRS." */
   3.146 -    0x7B,0x50,0x49,0x52,0x43,0x0A,0x0F,0x60,  /* 00000388    "{PIRC..`" */
   3.147 -    0x79,0x01,0x60,0x49,0x52,0x51,0x56,0xA4,  /* 00000390    "y.`IRQV." */
   3.148 -    0x42,0x55,0x46,0x42,0x14,0x1B,0x5F,0x53,  /* 00000398    "BUFB.._S" */
   3.149 -    0x52,0x53,0x01,0x8B,0x68,0x01,0x49,0x52,  /* 000003A0    "RS..h.IR" */
   3.150 -    0x51,0x31,0x82,0x49,0x52,0x51,0x31,0x60,  /* 000003A8    "Q1.IRQ1`" */
   3.151 -    0x76,0x60,0x70,0x60,0x50,0x49,0x52,0x43,  /* 000003B0    "v`p`PIRC" */
   3.152 -    0x5B,0x82,0x49,0x08,0x4C,0x4E,0x4B,0x44,  /* 000003B8    "[.I.LNKD" */
   3.153 -    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 000003C0    "._HID.A." */
   3.154 -    0x0C,0x0F,0x08,0x5F,0x55,0x49,0x44,0x0A,  /* 000003C8    "..._UID." */
   3.155 -    0x04,0x14,0x1C,0x5F,0x53,0x54,0x41,0x00,  /* 000003D0    "..._STA." */
   3.156 -    0x7B,0x50,0x49,0x52,0x44,0x0A,0x80,0x60,  /* 000003D8    "{PIRD..`" */
   3.157 -    0xA0,0x08,0x93,0x60,0x0A,0x80,0xA4,0x0A,  /* 000003E0    "...`...." */
   3.158 -    0x09,0xA1,0x04,0xA4,0x0A,0x0B,0x14,0x0B,  /* 000003E8    "........" */
   3.159 -    0x5F,0x50,0x52,0x53,0x00,0xA4,0x42,0x55,  /* 000003F0    "_PRS..BU" */
   3.160 -    0x46,0x41,0x14,0x11,0x5F,0x44,0x49,0x53,  /* 000003F8    "FA.._DIS" */
   3.161 -    0x00,0x7D,0x50,0x49,0x52,0x44,0x0A,0x80,  /* 00000400    ".}PIRD.." */
   3.162 -    0x50,0x49,0x52,0x44,0x14,0x1A,0x5F,0x43,  /* 00000408    "PIRD.._C" */
   3.163 -    0x52,0x53,0x00,0x7B,0x50,0x49,0x52,0x44,  /* 00000410    "RS.{PIRD" */
   3.164 -    0x0A,0x0F,0x60,0x79,0x01,0x60,0x49,0x52,  /* 00000418    "..`y.`IR" */
   3.165 -    0x51,0x56,0xA4,0x42,0x55,0x46,0x42,0x14,  /* 00000420    "QV.BUFB." */
   3.166 -    0x1B,0x5F,0x53,0x52,0x53,0x01,0x8B,0x68,  /* 00000428    "._SRS..h" */
   3.167 -    0x01,0x49,0x52,0x51,0x31,0x82,0x49,0x52,  /* 00000430    ".IRQ1.IR" */
   3.168 -    0x51,0x31,0x60,0x76,0x60,0x70,0x60,0x50,  /* 00000438    "Q1`v`p`P" */
   3.169 -    0x49,0x52,0x44,0x5B,0x82,0x44,0x05,0x48,  /* 00000440    "IRD[.D.H" */
   3.170 -    0x50,0x45,0x54,0x08,0x5F,0x48,0x49,0x44,  /* 00000448    "PET._HID" */
   3.171 -    0x0C,0x41,0xD0,0x01,0x03,0x08,0x5F,0x55,  /* 00000450    ".A...._U" */
   3.172 -    0x49,0x44,0x00,0x14,0x18,0x5F,0x53,0x54,  /* 00000458    "ID..._ST" */
   3.173 -    0x41,0x00,0xA0,0x0C,0x93,0x5E,0x5E,0x5E,  /* 00000460    "A....^^^" */
   3.174 -    0x48,0x50,0x45,0x54,0x00,0xA4,0x00,0xA1,  /* 00000468    "HPET...." */
   3.175 -    0x04,0xA4,0x0A,0x0F,0x08,0x5F,0x43,0x52,  /* 00000470    "....._CR" */
   3.176 -    0x53,0x11,0x1F,0x0A,0x1C,0x87,0x17,0x00,  /* 00000478    "S......." */
   3.177 -    0x00,0x0D,0x01,0x00,0x00,0x00,0x00,0x00,  /* 00000480    "........" */
   3.178 -    0x00,0xD0,0xFE,0xFF,0x03,0xD0,0xFE,0x00,  /* 00000488    "........" */
   3.179 -    0x00,0x00,0x00,0x00,0x04,0x00,0x00,0x79,  /* 00000490    ".......y" */
   3.180 -    0x00,0x14,0x16,0x5F,0x50,0x52,0x54,0x00,  /* 00000498    "..._PRT." */
   3.181 -    0xA0,0x0A,0x50,0x49,0x43,0x44,0xA4,0x50,  /* 000004A0    "..PICD.P" */
   3.182 -    0x52,0x54,0x41,0xA4,0x50,0x52,0x54,0x50,  /* 000004A8    "RTA.PRTP" */
   3.183 -    0x08,0x50,0x52,0x54,0x50,0x12,0x49,0x36,  /* 000004B0    ".PRTP.I6" */
   3.184 -    0x3C,0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x01,  /* 000004B8    "<......." */
   3.185 -    0x00,0x00,0x4C,0x4E,0x4B,0x42,0x00,0x12,  /* 000004C0    "..LNKB.." */
   3.186 -    0x0D,0x04,0x0C,0xFF,0xFF,0x01,0x00,0x01,  /* 000004C8    "........" */
   3.187 -    0x4C,0x4E,0x4B,0x43,0x00,0x12,0x0E,0x04,  /* 000004D0    "LNKC...." */
   3.188 -    0x0C,0xFF,0xFF,0x01,0x00,0x0A,0x02,0x4C,  /* 000004D8    ".......L" */
   3.189 -    0x4E,0x4B,0x44,0x00,0x12,0x0E,0x04,0x0C,  /* 000004E0    "NKD....." */
   3.190 -    0xFF,0xFF,0x01,0x00,0x0A,0x03,0x4C,0x4E,  /* 000004E8    "......LN" */
   3.191 -    0x4B,0x41,0x00,0x12,0x0D,0x04,0x0C,0xFF,  /* 000004F0    "KA......" */
   3.192 -    0xFF,0x02,0x00,0x00,0x4C,0x4E,0x4B,0x43,  /* 000004F8    "....LNKC" */
   3.193 +    0x00,0xFF,0xFF,0x09,0x00,0x00,0x00,0x00,  /* 000000F0    "........" */
   3.194 +    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000F8    "........" */
   3.195 +    0x00,0x00,0x00,0x0A,0x00,0x00,0x00,0x00,  /* 00000100    "........" */
   3.196 +    0x00,0x79,0x00,0x5B,0x82,0x4E,0xE8,0x50,  /* 00000108    ".y.[.N.P" */
   3.197 +    0x43,0x49,0x30,0x08,0x5F,0x48,0x49,0x44,  /* 00000110    "CI0._HID" */
   3.198 +    0x0C,0x41,0xD0,0x0A,0x03,0x08,0x5F,0x55,  /* 00000118    ".A...._U" */
   3.199 +    0x49,0x44,0x00,0x08,0x5F,0x41,0x44,0x52,  /* 00000120    "ID.._ADR" */
   3.200 +    0x00,0x08,0x5F,0x42,0x42,0x4E,0x00,0x14,  /* 00000128    ".._BBN.." */
   3.201 +    0x4E,0x0C,0x5F,0x43,0x52,0x53,0x00,0x08,  /* 00000130    "N._CRS.." */
   3.202 +    0x50,0x52,0x54,0x30,0x11,0x42,0x07,0x0A,  /* 00000138    "PRT0.B.." */
   3.203 +    0x6E,0x88,0x0D,0x00,0x02,0x0E,0x00,0x00,  /* 00000140    "n......." */
   3.204 +    0x00,0x00,0x00,0xFF,0x00,0x00,0x00,0x00,  /* 00000148    "........" */
   3.205 +    0x01,0x47,0x01,0xF8,0x0C,0xF8,0x0C,0x01,  /* 00000150    ".G......" */
   3.206 +    0x08,0x88,0x0D,0x00,0x01,0x0C,0x03,0x00,  /* 00000158    "........" */
   3.207 +    0x00,0x00,0x00,0xF7,0x0C,0x00,0x00,0xF8,  /* 00000160    "........" */
   3.208 +    0x0C,0x88,0x0D,0x00,0x01,0x0C,0x03,0x00,  /* 00000168    "........" */
   3.209 +    0x00,0x00,0x0D,0xFF,0xFF,0x00,0x00,0x00,  /* 00000170    "........" */
   3.210 +    0xF3,0x87,0x17,0x00,0x00,0x0C,0x03,0x00,  /* 00000178    "........" */
   3.211 +    0x00,0x00,0x00,0x00,0x00,0x0A,0x00,0xFF,  /* 00000180    "........" */
   3.212 +    0xFF,0x0B,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000188    "........" */
   3.213 +    0x00,0x02,0x00,0x87,0x17,0x00,0x00,0x0C,  /* 00000190    "........" */
   3.214 +    0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000198    "........" */
   3.215 +    0xF0,0xFF,0xFF,0xFF,0xF4,0x00,0x00,0x00,  /* 000001A0    "........" */
   3.216 +    0x00,0x00,0x00,0x00,0x05,0x79,0x00,0x8A,  /* 000001A8    ".....y.." */
   3.217 +    0x50,0x52,0x54,0x30,0x0A,0x5C,0x4D,0x4D,  /* 000001B0    "PRT0.\MM" */
   3.218 +    0x49,0x4E,0x8A,0x50,0x52,0x54,0x30,0x0A,  /* 000001B8    "IN.PRT0." */
   3.219 +    0x60,0x4D,0x4D,0x41,0x58,0x8A,0x50,0x52,  /* 000001C0    "`MMAX.PR" */
   3.220 +    0x54,0x30,0x0A,0x68,0x4D,0x4C,0x45,0x4E,  /* 000001C8    "T0.hMLEN" */
   3.221 +    0x70,0x50,0x4D,0x49,0x4E,0x4D,0x4D,0x49,  /* 000001D0    "pPMINMMI" */
   3.222 +    0x4E,0x70,0x50,0x4C,0x45,0x4E,0x4D,0x4C,  /* 000001D8    "NpPLENML" */
   3.223 +    0x45,0x4E,0x72,0x4D,0x4D,0x49,0x4E,0x4D,  /* 000001E0    "ENrMMINM" */
   3.224 +    0x4C,0x45,0x4E,0x4D,0x4D,0x41,0x58,0x74,  /* 000001E8    "LENMMAXt" */
   3.225 +    0x4D,0x4D,0x41,0x58,0x01,0x4D,0x4D,0x41,  /* 000001F0    "MMAX.MMA" */
   3.226 +    0x58,0xA4,0x50,0x52,0x54,0x30,0x08,0x42,  /* 000001F8    "X.PRT0.B" */
   3.227 +    0x55,0x46,0x41,0x11,0x09,0x0A,0x06,0x23,  /* 00000200    "UFA....#" */
   3.228 +    0x20,0x0C,0x18,0x79,0x00,0x08,0x42,0x55,  /* 00000208    " ..y..BU" */
   3.229 +    0x46,0x42,0x11,0x09,0x0A,0x06,0x23,0x00,  /* 00000210    "FB....#." */
   3.230 +    0x00,0x18,0x79,0x00,0x8B,0x42,0x55,0x46,  /* 00000218    "..y..BUF" */
   3.231 +    0x42,0x01,0x49,0x52,0x51,0x56,0x5B,0x82,  /* 00000220    "B.IRQV[." */
   3.232 +    0x48,0x08,0x4C,0x4E,0x4B,0x41,0x08,0x5F,  /* 00000228    "H.LNKA._" */
   3.233 +    0x48,0x49,0x44,0x0C,0x41,0xD0,0x0C,0x0F,  /* 00000230    "HID.A..." */
   3.234 +    0x08,0x5F,0x55,0x49,0x44,0x01,0x14,0x1C,  /* 00000238    "._UID..." */
   3.235 +    0x5F,0x53,0x54,0x41,0x00,0x7B,0x50,0x49,  /* 00000240    "_STA.{PI" */
   3.236 +    0x52,0x41,0x0A,0x80,0x60,0xA0,0x08,0x93,  /* 00000248    "RA..`..." */
   3.237 +    0x60,0x0A,0x80,0xA4,0x0A,0x09,0xA1,0x04,  /* 00000250    "`......." */
   3.238 +    0xA4,0x0A,0x0B,0x14,0x0B,0x5F,0x50,0x52,  /* 00000258    "....._PR" */
   3.239 +    0x53,0x00,0xA4,0x42,0x55,0x46,0x41,0x14,  /* 00000260    "S..BUFA." */
   3.240 +    0x11,0x5F,0x44,0x49,0x53,0x00,0x7D,0x50,  /* 00000268    "._DIS.}P" */
   3.241 +    0x49,0x52,0x41,0x0A,0x80,0x50,0x49,0x52,  /* 00000270    "IRA..PIR" */
   3.242 +    0x41,0x14,0x1A,0x5F,0x43,0x52,0x53,0x00,  /* 00000278    "A.._CRS." */
   3.243 +    0x7B,0x50,0x49,0x52,0x41,0x0A,0x0F,0x60,  /* 00000280    "{PIRA..`" */
   3.244 +    0x79,0x01,0x60,0x49,0x52,0x51,0x56,0xA4,  /* 00000288    "y.`IRQV." */
   3.245 +    0x42,0x55,0x46,0x42,0x14,0x1B,0x5F,0x53,  /* 00000290    "BUFB.._S" */
   3.246 +    0x52,0x53,0x01,0x8B,0x68,0x01,0x49,0x52,  /* 00000298    "RS..h.IR" */
   3.247 +    0x51,0x31,0x82,0x49,0x52,0x51,0x31,0x60,  /* 000002A0    "Q1.IRQ1`" */
   3.248 +    0x76,0x60,0x70,0x60,0x50,0x49,0x52,0x41,  /* 000002A8    "v`p`PIRA" */
   3.249 +    0x5B,0x82,0x49,0x08,0x4C,0x4E,0x4B,0x42,  /* 000002B0    "[.I.LNKB" */
   3.250 +    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 000002B8    "._HID.A." */
   3.251 +    0x0C,0x0F,0x08,0x5F,0x55,0x49,0x44,0x0A,  /* 000002C0    "..._UID." */
   3.252 +    0x02,0x14,0x1C,0x5F,0x53,0x54,0x41,0x00,  /* 000002C8    "..._STA." */
   3.253 +    0x7B,0x50,0x49,0x52,0x42,0x0A,0x80,0x60,  /* 000002D0    "{PIRB..`" */
   3.254 +    0xA0,0x08,0x93,0x60,0x0A,0x80,0xA4,0x0A,  /* 000002D8    "...`...." */
   3.255 +    0x09,0xA1,0x04,0xA4,0x0A,0x0B,0x14,0x0B,  /* 000002E0    "........" */
   3.256 +    0x5F,0x50,0x52,0x53,0x00,0xA4,0x42,0x55,  /* 000002E8    "_PRS..BU" */
   3.257 +    0x46,0x41,0x14,0x11,0x5F,0x44,0x49,0x53,  /* 000002F0    "FA.._DIS" */
   3.258 +    0x00,0x7D,0x50,0x49,0x52,0x42,0x0A,0x80,  /* 000002F8    ".}PIRB.." */
   3.259 +    0x50,0x49,0x52,0x42,0x14,0x1A,0x5F,0x43,  /* 00000300    "PIRB.._C" */
   3.260 +    0x52,0x53,0x00,0x7B,0x50,0x49,0x52,0x42,  /* 00000308    "RS.{PIRB" */
   3.261 +    0x0A,0x0F,0x60,0x79,0x01,0x60,0x49,0x52,  /* 00000310    "..`y.`IR" */
   3.262 +    0x51,0x56,0xA4,0x42,0x55,0x46,0x42,0x14,  /* 00000318    "QV.BUFB." */
   3.263 +    0x1B,0x5F,0x53,0x52,0x53,0x01,0x8B,0x68,  /* 00000320    "._SRS..h" */
   3.264 +    0x01,0x49,0x52,0x51,0x31,0x82,0x49,0x52,  /* 00000328    ".IRQ1.IR" */
   3.265 +    0x51,0x31,0x60,0x76,0x60,0x70,0x60,0x50,  /* 00000330    "Q1`v`p`P" */
   3.266 +    0x49,0x52,0x42,0x5B,0x82,0x49,0x08,0x4C,  /* 00000338    "IRB[.I.L" */
   3.267 +    0x4E,0x4B,0x43,0x08,0x5F,0x48,0x49,0x44,  /* 00000340    "NKC._HID" */
   3.268 +    0x0C,0x41,0xD0,0x0C,0x0F,0x08,0x5F,0x55,  /* 00000348    ".A...._U" */
   3.269 +    0x49,0x44,0x0A,0x03,0x14,0x1C,0x5F,0x53,  /* 00000350    "ID...._S" */
   3.270 +    0x54,0x41,0x00,0x7B,0x50,0x49,0x52,0x43,  /* 00000358    "TA.{PIRC" */
   3.271 +    0x0A,0x80,0x60,0xA0,0x08,0x93,0x60,0x0A,  /* 00000360    "..`...`." */
   3.272 +    0x80,0xA4,0x0A,0x09,0xA1,0x04,0xA4,0x0A,  /* 00000368    "........" */
   3.273 +    0x0B,0x14,0x0B,0x5F,0x50,0x52,0x53,0x00,  /* 00000370    "..._PRS." */
   3.274 +    0xA4,0x42,0x55,0x46,0x41,0x14,0x11,0x5F,  /* 00000378    ".BUFA.._" */
   3.275 +    0x44,0x49,0x53,0x00,0x7D,0x50,0x49,0x52,  /* 00000380    "DIS.}PIR" */
   3.276 +    0x43,0x0A,0x80,0x50,0x49,0x52,0x43,0x14,  /* 00000388    "C..PIRC." */
   3.277 +    0x1A,0x5F,0x43,0x52,0x53,0x00,0x7B,0x50,  /* 00000390    "._CRS.{P" */
   3.278 +    0x49,0x52,0x43,0x0A,0x0F,0x60,0x79,0x01,  /* 00000398    "IRC..`y." */
   3.279 +    0x60,0x49,0x52,0x51,0x56,0xA4,0x42,0x55,  /* 000003A0    "`IRQV.BU" */
   3.280 +    0x46,0x42,0x14,0x1B,0x5F,0x53,0x52,0x53,  /* 000003A8    "FB.._SRS" */
   3.281 +    0x01,0x8B,0x68,0x01,0x49,0x52,0x51,0x31,  /* 000003B0    "..h.IRQ1" */
   3.282 +    0x82,0x49,0x52,0x51,0x31,0x60,0x76,0x60,  /* 000003B8    ".IRQ1`v`" */
   3.283 +    0x70,0x60,0x50,0x49,0x52,0x43,0x5B,0x82,  /* 000003C0    "p`PIRC[." */
   3.284 +    0x49,0x08,0x4C,0x4E,0x4B,0x44,0x08,0x5F,  /* 000003C8    "I.LNKD._" */
   3.285 +    0x48,0x49,0x44,0x0C,0x41,0xD0,0x0C,0x0F,  /* 000003D0    "HID.A..." */
   3.286 +    0x08,0x5F,0x55,0x49,0x44,0x0A,0x04,0x14,  /* 000003D8    "._UID..." */
   3.287 +    0x1C,0x5F,0x53,0x54,0x41,0x00,0x7B,0x50,  /* 000003E0    "._STA.{P" */
   3.288 +    0x49,0x52,0x44,0x0A,0x80,0x60,0xA0,0x08,  /* 000003E8    "IRD..`.." */
   3.289 +    0x93,0x60,0x0A,0x80,0xA4,0x0A,0x09,0xA1,  /* 000003F0    ".`......" */
   3.290 +    0x04,0xA4,0x0A,0x0B,0x14,0x0B,0x5F,0x50,  /* 000003F8    "......_P" */
   3.291 +    0x52,0x53,0x00,0xA4,0x42,0x55,0x46,0x41,  /* 00000400    "RS..BUFA" */
   3.292 +    0x14,0x11,0x5F,0x44,0x49,0x53,0x00,0x7D,  /* 00000408    ".._DIS.}" */
   3.293 +    0x50,0x49,0x52,0x44,0x0A,0x80,0x50,0x49,  /* 00000410    "PIRD..PI" */
   3.294 +    0x52,0x44,0x14,0x1A,0x5F,0x43,0x52,0x53,  /* 00000418    "RD.._CRS" */
   3.295 +    0x00,0x7B,0x50,0x49,0x52,0x44,0x0A,0x0F,  /* 00000420    ".{PIRD.." */
   3.296 +    0x60,0x79,0x01,0x60,0x49,0x52,0x51,0x56,  /* 00000428    "`y.`IRQV" */
   3.297 +    0xA4,0x42,0x55,0x46,0x42,0x14,0x1B,0x5F,  /* 00000430    ".BUFB.._" */
   3.298 +    0x53,0x52,0x53,0x01,0x8B,0x68,0x01,0x49,  /* 00000438    "SRS..h.I" */
   3.299 +    0x52,0x51,0x31,0x82,0x49,0x52,0x51,0x31,  /* 00000440    "RQ1.IRQ1" */
   3.300 +    0x60,0x76,0x60,0x70,0x60,0x50,0x49,0x52,  /* 00000448    "`v`p`PIR" */
   3.301 +    0x44,0x5B,0x82,0x44,0x05,0x48,0x50,0x45,  /* 00000450    "D[.D.HPE" */
   3.302 +    0x54,0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,  /* 00000458    "T._HID.A" */
   3.303 +    0xD0,0x01,0x03,0x08,0x5F,0x55,0x49,0x44,  /* 00000460    "...._UID" */
   3.304 +    0x00,0x14,0x18,0x5F,0x53,0x54,0x41,0x00,  /* 00000468    "..._STA." */
   3.305 +    0xA0,0x0C,0x93,0x5E,0x5E,0x5E,0x48,0x50,  /* 00000470    "...^^^HP" */
   3.306 +    0x45,0x54,0x00,0xA4,0x00,0xA1,0x04,0xA4,  /* 00000478    "ET......" */
   3.307 +    0x0A,0x0F,0x08,0x5F,0x43,0x52,0x53,0x11,  /* 00000480    "..._CRS." */
   3.308 +    0x1F,0x0A,0x1C,0x87,0x17,0x00,0x00,0x0D,  /* 00000488    "........" */
   3.309 +    0x01,0x00,0x00,0x00,0x00,0x00,0x00,0xD0,  /* 00000490    "........" */
   3.310 +    0xFE,0xFF,0x03,0xD0,0xFE,0x00,0x00,0x00,  /* 00000498    "........" */
   3.311 +    0x00,0x00,0x04,0x00,0x00,0x79,0x00,0x14,  /* 000004A0    ".....y.." */
   3.312 +    0x16,0x5F,0x50,0x52,0x54,0x00,0xA0,0x0A,  /* 000004A8    "._PRT..." */
   3.313 +    0x50,0x49,0x43,0x44,0xA4,0x50,0x52,0x54,  /* 000004B0    "PICD.PRT" */
   3.314 +    0x41,0xA4,0x50,0x52,0x54,0x50,0x08,0x50,  /* 000004B8    "A.PRTP.P" */
   3.315 +    0x52,0x54,0x50,0x12,0x49,0x36,0x3C,0x12,  /* 000004C0    "RTP.I6<." */
   3.316 +    0x0D,0x04,0x0C,0xFF,0xFF,0x01,0x00,0x00,  /* 000004C8    "........" */
   3.317 +    0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0D,0x04,  /* 000004D0    "LNKB...." */
   3.318 +    0x0C,0xFF,0xFF,0x01,0x00,0x01,0x4C,0x4E,  /* 000004D8    "......LN" */
   3.319 +    0x4B,0x43,0x00,0x12,0x0E,0x04,0x0C,0xFF,  /* 000004E0    "KC......" */
   3.320 +    0xFF,0x01,0x00,0x0A,0x02,0x4C,0x4E,0x4B,  /* 000004E8    ".....LNK" */
   3.321 +    0x44,0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,  /* 000004F0    "D......." */
   3.322 +    0x01,0x00,0x0A,0x03,0x4C,0x4E,0x4B,0x41,  /* 000004F8    "....LNKA" */
   3.323      0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x02,  /* 00000500    "........" */
   3.324 -    0x00,0x01,0x4C,0x4E,0x4B,0x44,0x00,0x12,  /* 00000508    "..LNKD.." */
   3.325 -    0x0E,0x04,0x0C,0xFF,0xFF,0x02,0x00,0x0A,  /* 00000510    "........" */
   3.326 -    0x02,0x4C,0x4E,0x4B,0x41,0x00,0x12,0x0E,  /* 00000518    ".LNKA..." */
   3.327 -    0x04,0x0C,0xFF,0xFF,0x02,0x00,0x0A,0x03,  /* 00000520    "........" */
   3.328 -    0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0D,0x04,  /* 00000528    "LNKB...." */
   3.329 -    0x0C,0xFF,0xFF,0x03,0x00,0x00,0x4C,0x4E,  /* 00000530    "......LN" */
   3.330 -    0x4B,0x44,0x00,0x12,0x0D,0x04,0x0C,0xFF,  /* 00000538    "KD......" */
   3.331 -    0xFF,0x03,0x00,0x01,0x4C,0x4E,0x4B,0x41,  /* 00000540    "....LNKA" */
   3.332 -    0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x03,  /* 00000548    "........" */
   3.333 -    0x00,0x0A,0x02,0x4C,0x4E,0x4B,0x42,0x00,  /* 00000550    "...LNKB." */
   3.334 -    0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x03,0x00,  /* 00000558    "........" */
   3.335 -    0x0A,0x03,0x4C,0x4E,0x4B,0x43,0x00,0x12,  /* 00000560    "..LNKC.." */
   3.336 -    0x0D,0x04,0x0C,0xFF,0xFF,0x04,0x00,0x00,  /* 00000568    "........" */
   3.337 -    0x4C,0x4E,0x4B,0x41,0x00,0x12,0x0D,0x04,  /* 00000570    "LNKA...." */
   3.338 -    0x0C,0xFF,0xFF,0x04,0x00,0x01,0x4C,0x4E,  /* 00000578    "......LN" */
   3.339 -    0x4B,0x42,0x00,0x12,0x0E,0x04,0x0C,0xFF,  /* 00000580    "KB......" */
   3.340 -    0xFF,0x04,0x00,0x0A,0x02,0x4C,0x4E,0x4B,  /* 00000588    ".....LNK" */
   3.341 -    0x43,0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,  /* 00000590    "C......." */
   3.342 -    0x04,0x00,0x0A,0x03,0x4C,0x4E,0x4B,0x44,  /* 00000598    "....LNKD" */
   3.343 -    0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x05,  /* 000005A0    "........" */
   3.344 -    0x00,0x00,0x4C,0x4E,0x4B,0x42,0x00,0x12,  /* 000005A8    "..LNKB.." */
   3.345 -    0x0D,0x04,0x0C,0xFF,0xFF,0x05,0x00,0x01,  /* 000005B0    "........" */
   3.346 -    0x4C,0x4E,0x4B,0x43,0x00,0x12,0x0E,0x04,  /* 000005B8    "LNKC...." */
   3.347 -    0x0C,0xFF,0xFF,0x05,0x00,0x0A,0x02,0x4C,  /* 000005C0    ".......L" */
   3.348 -    0x4E,0x4B,0x44,0x00,0x12,0x0E,0x04,0x0C,  /* 000005C8    "NKD....." */
   3.349 -    0xFF,0xFF,0x05,0x00,0x0A,0x03,0x4C,0x4E,  /* 000005D0    "......LN" */
   3.350 -    0x4B,0x41,0x00,0x12,0x0D,0x04,0x0C,0xFF,  /* 000005D8    "KA......" */
   3.351 -    0xFF,0x06,0x00,0x00,0x4C,0x4E,0x4B,0x43,  /* 000005E0    "....LNKC" */
   3.352 +    0x00,0x00,0x4C,0x4E,0x4B,0x43,0x00,0x12,  /* 00000508    "..LNKC.." */
   3.353 +    0x0D,0x04,0x0C,0xFF,0xFF,0x02,0x00,0x01,  /* 00000510    "........" */
   3.354 +    0x4C,0x4E,0x4B,0x44,0x00,0x12,0x0E,0x04,  /* 00000518    "LNKD...." */
   3.355 +    0x0C,0xFF,0xFF,0x02,0x00,0x0A,0x02,0x4C,  /* 00000520    ".......L" */
   3.356 +    0x4E,0x4B,0x41,0x00,0x12,0x0E,0x04,0x0C,  /* 00000528    "NKA....." */
   3.357 +    0xFF,0xFF,0x02,0x00,0x0A,0x03,0x4C,0x4E,  /* 00000530    "......LN" */
   3.358 +    0x4B,0x42,0x00,0x12,0x0D,0x04,0x0C,0xFF,  /* 00000538    "KB......" */
   3.359 +    0xFF,0x03,0x00,0x00,0x4C,0x4E,0x4B,0x44,  /* 00000540    "....LNKD" */
   3.360 +    0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x03,  /* 00000548    "........" */
   3.361 +    0x00,0x01,0x4C,0x4E,0x4B,0x41,0x00,0x12,  /* 00000550    "..LNKA.." */
   3.362 +    0x0E,0x04,0x0C,0xFF,0xFF,0x03,0x00,0x0A,  /* 00000558    "........" */
   3.363 +    0x02,0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0E,  /* 00000560    ".LNKB..." */
   3.364 +    0x04,0x0C,0xFF,0xFF,0x03,0x00,0x0A,0x03,  /* 00000568    "........" */
   3.365 +    0x4C,0x4E,0x4B,0x43,0x00,0x12,0x0D,0x04,  /* 00000570    "LNKC...." */
   3.366 +    0x0C,0xFF,0xFF,0x04,0x00,0x00,0x4C,0x4E,  /* 00000578    "......LN" */
   3.367 +    0x4B,0x41,0x00,0x12,0x0D,0x04,0x0C,0xFF,  /* 00000580    "KA......" */
   3.368 +    0xFF,0x04,0x00,0x01,0x4C,0x4E,0x4B,0x42,  /* 00000588    "....LNKB" */
   3.369 +    0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x04,  /* 00000590    "........" */
   3.370 +    0x00,0x0A,0x02,0x4C,0x4E,0x4B,0x43,0x00,  /* 00000598    "...LNKC." */
   3.371 +    0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x04,0x00,  /* 000005A0    "........" */
   3.372 +    0x0A,0x03,0x4C,0x4E,0x4B,0x44,0x00,0x12,  /* 000005A8    "..LNKD.." */
   3.373 +    0x0D,0x04,0x0C,0xFF,0xFF,0x05,0x00,0x00,  /* 000005B0    "........" */
   3.374 +    0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0D,0x04,  /* 000005B8    "LNKB...." */
   3.375 +    0x0C,0xFF,0xFF,0x05,0x00,0x01,0x4C,0x4E,  /* 000005C0    "......LN" */
   3.376 +    0x4B,0x43,0x00,0x12,0x0E,0x04,0x0C,0xFF,  /* 000005C8    "KC......" */
   3.377 +    0xFF,0x05,0x00,0x0A,0x02,0x4C,0x4E,0x4B,  /* 000005D0    ".....LNK" */
   3.378 +    0x44,0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,  /* 000005D8    "D......." */
   3.379 +    0x05,0x00,0x0A,0x03,0x4C,0x4E,0x4B,0x41,  /* 000005E0    "....LNKA" */
   3.380      0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x06,  /* 000005E8    "........" */
   3.381 -    0x00,0x01,0x4C,0x4E,0x4B,0x44,0x00,0x12,  /* 000005F0    "..LNKD.." */
   3.382 -    0x0E,0x04,0x0C,0xFF,0xFF,0x06,0x00,0x0A,  /* 000005F8    "........" */
   3.383 -    0x02,0x4C,0x4E,0x4B,0x41,0x00,0x12,0x0E,  /* 00000600    ".LNKA..." */
   3.384 -    0x04,0x0C,0xFF,0xFF,0x06,0x00,0x0A,0x03,  /* 00000608    "........" */
   3.385 -    0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0D,0x04,  /* 00000610    "LNKB...." */
   3.386 -    0x0C,0xFF,0xFF,0x07,0x00,0x00,0x4C,0x4E,  /* 00000618    "......LN" */
   3.387 -    0x4B,0x44,0x00,0x12,0x0D,0x04,0x0C,0xFF,  /* 00000620    "KD......" */
   3.388 -    0xFF,0x07,0x00,0x01,0x4C,0x4E,0x4B,0x41,  /* 00000628    "....LNKA" */
   3.389 -    0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x07,  /* 00000630    "........" */
   3.390 -    0x00,0x0A,0x02,0x4C,0x4E,0x4B,0x42,0x00,  /* 00000638    "...LNKB." */
   3.391 -    0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x07,0x00,  /* 00000640    "........" */
   3.392 -    0x0A,0x03,0x4C,0x4E,0x4B,0x43,0x00,0x12,  /* 00000648    "..LNKC.." */
   3.393 -    0x0D,0x04,0x0C,0xFF,0xFF,0x08,0x00,0x00,  /* 00000650    "........" */
   3.394 -    0x4C,0x4E,0x4B,0x41,0x00,0x12,0x0D,0x04,  /* 00000658    "LNKA...." */
   3.395 -    0x0C,0xFF,0xFF,0x08,0x00,0x01,0x4C,0x4E,  /* 00000660    "......LN" */
   3.396 -    0x4B,0x42,0x00,0x12,0x0E,0x04,0x0C,0xFF,  /* 00000668    "KB......" */
   3.397 -    0xFF,0x08,0x00,0x0A,0x02,0x4C,0x4E,0x4B,  /* 00000670    ".....LNK" */
   3.398 -    0x43,0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,  /* 00000678    "C......." */
   3.399 -    0x08,0x00,0x0A,0x03,0x4C,0x4E,0x4B,0x44,  /* 00000680    "....LNKD" */
   3.400 -    0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x09,  /* 00000688    "........" */
   3.401 -    0x00,0x00,0x4C,0x4E,0x4B,0x42,0x00,0x12,  /* 00000690    "..LNKB.." */
   3.402 -    0x0D,0x04,0x0C,0xFF,0xFF,0x09,0x00,0x01,  /* 00000698    "........" */
   3.403 -    0x4C,0x4E,0x4B,0x43,0x00,0x12,0x0E,0x04,  /* 000006A0    "LNKC...." */
   3.404 -    0x0C,0xFF,0xFF,0x09,0x00,0x0A,0x02,0x4C,  /* 000006A8    ".......L" */
   3.405 -    0x4E,0x4B,0x44,0x00,0x12,0x0E,0x04,0x0C,  /* 000006B0    "NKD....." */
   3.406 -    0xFF,0xFF,0x09,0x00,0x0A,0x03,0x4C,0x4E,  /* 000006B8    "......LN" */
   3.407 -    0x4B,0x41,0x00,0x12,0x0D,0x04,0x0C,0xFF,  /* 000006C0    "KA......" */
   3.408 -    0xFF,0x0A,0x00,0x00,0x4C,0x4E,0x4B,0x43,  /* 000006C8    "....LNKC" */
   3.409 +    0x00,0x00,0x4C,0x4E,0x4B,0x43,0x00,0x12,  /* 000005F0    "..LNKC.." */
   3.410 +    0x0D,0x04,0x0C,0xFF,0xFF,0x06,0x00,0x01,  /* 000005F8    "........" */
   3.411 +    0x4C,0x4E,0x4B,0x44,0x00,0x12,0x0E,0x04,  /* 00000600    "LNKD...." */
   3.412 +    0x0C,0xFF,0xFF,0x06,0x00,0x0A,0x02,0x4C,  /* 00000608    ".......L" */
   3.413 +    0x4E,0x4B,0x41,0x00,0x12,0x0E,0x04,0x0C,  /* 00000610    "NKA....." */
   3.414 +    0xFF,0xFF,0x06,0x00,0x0A,0x03,0x4C,0x4E,  /* 00000618    "......LN" */
   3.415 +    0x4B,0x42,0x00,0x12,0x0D,0x04,0x0C,0xFF,  /* 00000620    "KB......" */
   3.416 +    0xFF,0x07,0x00,0x00,0x4C,0x4E,0x4B,0x44,  /* 00000628    "....LNKD" */
   3.417 +    0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x07,  /* 00000630    "........" */
   3.418 +    0x00,0x01,0x4C,0x4E,0x4B,0x41,0x00,0x12,  /* 00000638    "..LNKA.." */
   3.419 +    0x0E,0x04,0x0C,0xFF,0xFF,0x07,0x00,0x0A,  /* 00000640    "........" */
   3.420 +    0x02,0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0E,  /* 00000648    ".LNKB..." */
   3.421 +    0x04,0x0C,0xFF,0xFF,0x07,0x00,0x0A,0x03,  /* 00000650    "........" */
   3.422 +    0x4C,0x4E,0x4B,0x43,0x00,0x12,0x0D,0x04,  /* 00000658    "LNKC...." */
   3.423 +    0x0C,0xFF,0xFF,0x08,0x00,0x00,0x4C,0x4E,  /* 00000660    "......LN" */
   3.424 +    0x4B,0x41,0x00,0x12,0x0D,0x04,0x0C,0xFF,  /* 00000668    "KA......" */
   3.425 +    0xFF,0x08,0x00,0x01,0x4C,0x4E,0x4B,0x42,  /* 00000670    "....LNKB" */
   3.426 +    0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x08,  /* 00000678    "........" */
   3.427 +    0x00,0x0A,0x02,0x4C,0x4E,0x4B,0x43,0x00,  /* 00000680    "...LNKC." */
   3.428 +    0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x08,0x00,  /* 00000688    "........" */
   3.429 +    0x0A,0x03,0x4C,0x4E,0x4B,0x44,0x00,0x12,  /* 00000690    "..LNKD.." */
   3.430 +    0x0D,0x04,0x0C,0xFF,0xFF,0x09,0x00,0x00,  /* 00000698    "........" */
   3.431 +    0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0D,0x04,  /* 000006A0    "LNKB...." */
   3.432 +    0x0C,0xFF,0xFF,0x09,0x00,0x01,0x4C,0x4E,  /* 000006A8    "......LN" */
   3.433 +    0x4B,0x43,0x00,0x12,0x0E,0x04,0x0C,0xFF,  /* 000006B0    "KC......" */
   3.434 +    0xFF,0x09,0x00,0x0A,0x02,0x4C,0x4E,0x4B,  /* 000006B8    ".....LNK" */
   3.435 +    0x44,0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,  /* 000006C0    "D......." */
   3.436 +    0x09,0x00,0x0A,0x03,0x4C,0x4E,0x4B,0x41,  /* 000006C8    "....LNKA" */
   3.437      0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x0A,  /* 000006D0    "........" */
   3.438 -    0x00,0x01,0x4C,0x4E,0x4B,0x44,0x00,0x12,  /* 000006D8    "..LNKD.." */
   3.439 -    0x0E,0x04,0x0C,0xFF,0xFF,0x0A,0x00,0x0A,  /* 000006E0    "........" */
   3.440 -    0x02,0x4C,0x4E,0x4B,0x41,0x00,0x12,0x0E,  /* 000006E8    ".LNKA..." */
   3.441 -    0x04,0x0C,0xFF,0xFF,0x0A,0x00,0x0A,0x03,  /* 000006F0    "........" */
   3.442 -    0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0D,0x04,  /* 000006F8    "LNKB...." */
   3.443 -    0x0C,0xFF,0xFF,0x0B,0x00,0x00,0x4C,0x4E,  /* 00000700    "......LN" */
   3.444 -    0x4B,0x44,0x00,0x12,0x0D,0x04,0x0C,0xFF,  /* 00000708    "KD......" */
   3.445 -    0xFF,0x0B,0x00,0x01,0x4C,0x4E,0x4B,0x41,  /* 00000710    "....LNKA" */
   3.446 -    0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x0B,  /* 00000718    "........" */
   3.447 -    0x00,0x0A,0x02,0x4C,0x4E,0x4B,0x42,0x00,  /* 00000720    "...LNKB." */
   3.448 -    0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x0B,0x00,  /* 00000728    "........" */
   3.449 -    0x0A,0x03,0x4C,0x4E,0x4B,0x43,0x00,0x12,  /* 00000730    "..LNKC.." */
   3.450 -    0x0D,0x04,0x0C,0xFF,0xFF,0x0C,0x00,0x00,  /* 00000738    "........" */
   3.451 -    0x4C,0x4E,0x4B,0x41,0x00,0x12,0x0D,0x04,  /* 00000740    "LNKA...." */
   3.452 -    0x0C,0xFF,0xFF,0x0C,0x00,0x01,0x4C,0x4E,  /* 00000748    "......LN" */
   3.453 -    0x4B,0x42,0x00,0x12,0x0E,0x04,0x0C,0xFF,  /* 00000750    "KB......" */
   3.454 -    0xFF,0x0C,0x00,0x0A,0x02,0x4C,0x4E,0x4B,  /* 00000758    ".....LNK" */
   3.455 -    0x43,0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,  /* 00000760    "C......." */
   3.456 -    0x0C,0x00,0x0A,0x03,0x4C,0x4E,0x4B,0x44,  /* 00000768    "....LNKD" */
   3.457 -    0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x0D,  /* 00000770    "........" */
   3.458 -    0x00,0x00,0x4C,0x4E,0x4B,0x42,0x00,0x12,  /* 00000778    "..LNKB.." */
   3.459 -    0x0D,0x04,0x0C,0xFF,0xFF,0x0D,0x00,0x01,  /* 00000780    "........" */
   3.460 -    0x4C,0x4E,0x4B,0x43,0x00,0x12,0x0E,0x04,  /* 00000788    "LNKC...." */
   3.461 -    0x0C,0xFF,0xFF,0x0D,0x00,0x0A,0x02,0x4C,  /* 00000790    ".......L" */
   3.462 -    0x4E,0x4B,0x44,0x00,0x12,0x0E,0x04,0x0C,  /* 00000798    "NKD....." */
   3.463 -    0xFF,0xFF,0x0D,0x00,0x0A,0x03,0x4C,0x4E,  /* 000007A0    "......LN" */
   3.464 -    0x4B,0x41,0x00,0x12,0x0D,0x04,0x0C,0xFF,  /* 000007A8    "KA......" */
   3.465 -    0xFF,0x0E,0x00,0x00,0x4C,0x4E,0x4B,0x43,  /* 000007B0    "....LNKC" */
   3.466 +    0x00,0x00,0x4C,0x4E,0x4B,0x43,0x00,0x12,  /* 000006D8    "..LNKC.." */
   3.467 +    0x0D,0x04,0x0C,0xFF,0xFF,0x0A,0x00,0x01,  /* 000006E0    "........" */
   3.468 +    0x4C,0x4E,0x4B,0x44,0x00,0x12,0x0E,0x04,  /* 000006E8    "LNKD...." */
   3.469 +    0x0C,0xFF,0xFF,0x0A,0x00,0x0A,0x02,0x4C,  /* 000006F0    ".......L" */
   3.470 +    0x4E,0x4B,0x41,0x00,0x12,0x0E,0x04,0x0C,  /* 000006F8    "NKA....." */
   3.471 +    0xFF,0xFF,0x0A,0x00,0x0A,0x03,0x4C,0x4E,  /* 00000700    "......LN" */
   3.472 +    0x4B,0x42,0x00,0x12,0x0D,0x04,0x0C,0xFF,  /* 00000708    "KB......" */
   3.473 +    0xFF,0x0B,0x00,0x00,0x4C,0x4E,0x4B,0x44,  /* 00000710    "....LNKD" */
   3.474 +    0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x0B,  /* 00000718    "........" */
   3.475 +    0x00,0x01,0x4C,0x4E,0x4B,0x41,0x00,0x12,  /* 00000720    "..LNKA.." */
   3.476 +    0x0E,0x04,0x0C,0xFF,0xFF,0x0B,0x00,0x0A,  /* 00000728    "........" */
   3.477 +    0x02,0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0E,  /* 00000730    ".LNKB..." */
   3.478 +    0x04,0x0C,0xFF,0xFF,0x0B,0x00,0x0A,0x03,  /* 00000738    "........" */
   3.479 +    0x4C,0x4E,0x4B,0x43,0x00,0x12,0x0D,0x04,  /* 00000740    "LNKC...." */
   3.480 +    0x0C,0xFF,0xFF,0x0C,0x00,0x00,0x4C,0x4E,  /* 00000748    "......LN" */
   3.481 +    0x4B,0x41,0x00,0x12,0x0D,0x04,0x0C,0xFF,  /* 00000750    "KA......" */
   3.482 +    0xFF,0x0C,0x00,0x01,0x4C,0x4E,0x4B,0x42,  /* 00000758    "....LNKB" */
   3.483 +    0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x0C,  /* 00000760    "........" */
   3.484 +    0x00,0x0A,0x02,0x4C,0x4E,0x4B,0x43,0x00,  /* 00000768    "...LNKC." */
   3.485 +    0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x0C,0x00,  /* 00000770    "........" */
   3.486 +    0x0A,0x03,0x4C,0x4E,0x4B,0x44,0x00,0x12,  /* 00000778    "..LNKD.." */
   3.487 +    0x0D,0x04,0x0C,0xFF,0xFF,0x0D,0x00,0x00,  /* 00000780    "........" */
   3.488 +    0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0D,0x04,  /* 00000788    "LNKB...." */
   3.489 +    0x0C,0xFF,0xFF,0x0D,0x00,0x01,0x4C,0x4E,  /* 00000790    "......LN" */
   3.490 +    0x4B,0x43,0x00,0x12,0x0E,0x04,0x0C,0xFF,  /* 00000798    "KC......" */
   3.491 +    0xFF,0x0D,0x00,0x0A,0x02,0x4C,0x4E,0x4B,  /* 000007A0    ".....LNK" */
   3.492 +    0x44,0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,  /* 000007A8    "D......." */
   3.493 +    0x0D,0x00,0x0A,0x03,0x4C,0x4E,0x4B,0x41,  /* 000007B0    "....LNKA" */
   3.494      0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x0E,  /* 000007B8    "........" */
   3.495 -    0x00,0x01,0x4C,0x4E,0x4B,0x44,0x00,0x12,  /* 000007C0    "..LNKD.." */
   3.496 -    0x0E,0x04,0x0C,0xFF,0xFF,0x0E,0x00,0x0A,  /* 000007C8    "........" */
   3.497 -    0x02,0x4C,0x4E,0x4B,0x41,0x00,0x12,0x0E,  /* 000007D0    ".LNKA..." */
   3.498 -    0x04,0x0C,0xFF,0xFF,0x0E,0x00,0x0A,0x03,  /* 000007D8    "........" */
   3.499 -    0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0D,0x04,  /* 000007E0    "LNKB...." */
   3.500 -    0x0C,0xFF,0xFF,0x0F,0x00,0x00,0x4C,0x4E,  /* 000007E8    "......LN" */
   3.501 -    0x4B,0x44,0x00,0x12,0x0D,0x04,0x0C,0xFF,  /* 000007F0    "KD......" */
   3.502 -    0xFF,0x0F,0x00,0x01,0x4C,0x4E,0x4B,0x41,  /* 000007F8    "....LNKA" */
   3.503 -    0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x0F,  /* 00000800    "........" */
   3.504 -    0x00,0x0A,0x02,0x4C,0x4E,0x4B,0x42,0x00,  /* 00000808    "...LNKB." */
   3.505 -    0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x0F,0x00,  /* 00000810    "........" */
   3.506 -    0x0A,0x03,0x4C,0x4E,0x4B,0x43,0x00,0x08,  /* 00000818    "..LNKC.." */
   3.507 -    0x50,0x52,0x54,0x41,0x12,0x41,0x2F,0x3C,  /* 00000820    "PRTA.A/<" */
   3.508 -    0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x01,0x00,  /* 00000828    "........" */
   3.509 -    0x00,0x00,0x0A,0x14,0x12,0x0B,0x04,0x0C,  /* 00000830    "........" */
   3.510 -    0xFF,0xFF,0x01,0x00,0x01,0x00,0x0A,0x15,  /* 00000838    "........" */
   3.511 -    0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x01,0x00,  /* 00000840    "........" */
   3.512 -    0x0A,0x02,0x00,0x0A,0x16,0x12,0x0C,0x04,  /* 00000848    "........" */
   3.513 -    0x0C,0xFF,0xFF,0x01,0x00,0x0A,0x03,0x00,  /* 00000850    "........" */
   3.514 -    0x0A,0x17,0x12,0x0B,0x04,0x0C,0xFF,0xFF,  /* 00000858    "........" */
   3.515 -    0x02,0x00,0x00,0x00,0x0A,0x18,0x12,0x0B,  /* 00000860    "........" */
   3.516 -    0x04,0x0C,0xFF,0xFF,0x02,0x00,0x01,0x00,  /* 00000868    "........" */
   3.517 -    0x0A,0x19,0x12,0x0C,0x04,0x0C,0xFF,0xFF,  /* 00000870    "........" */
   3.518 -    0x02,0x00,0x0A,0x02,0x00,0x0A,0x1A,0x12,  /* 00000878    "........" */
   3.519 -    0x0C,0x04,0x0C,0xFF,0xFF,0x02,0x00,0x0A,  /* 00000880    "........" */
   3.520 -    0x03,0x00,0x0A,0x1B,0x12,0x0B,0x04,0x0C,  /* 00000888    "........" */
   3.521 -    0xFF,0xFF,0x03,0x00,0x00,0x00,0x0A,0x1C,  /* 00000890    "........" */
   3.522 -    0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x03,0x00,  /* 00000898    "........" */
   3.523 -    0x01,0x00,0x0A,0x1D,0x12,0x0C,0x04,0x0C,  /* 000008A0    "........" */
   3.524 -    0xFF,0xFF,0x03,0x00,0x0A,0x02,0x00,0x0A,  /* 000008A8    "........" */
   3.525 -    0x1E,0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x03,  /* 000008B0    "........" */
   3.526 -    0x00,0x0A,0x03,0x00,0x0A,0x1F,0x12,0x0B,  /* 000008B8    "........" */
   3.527 -    0x04,0x0C,0xFF,0xFF,0x04,0x00,0x00,0x00,  /* 000008C0    "........" */
   3.528 -    0x0A,0x20,0x12,0x0B,0x04,0x0C,0xFF,0xFF,  /* 000008C8    ". ......" */
   3.529 -    0x04,0x00,0x01,0x00,0x0A,0x21,0x12,0x0C,  /* 000008D0    ".....!.." */
   3.530 -    0x04,0x0C,0xFF,0xFF,0x04,0x00,0x0A,0x02,  /* 000008D8    "........" */
   3.531 -    0x00,0x0A,0x22,0x12,0x0C,0x04,0x0C,0xFF,  /* 000008E0    ".."....." */
   3.532 -    0xFF,0x04,0x00,0x0A,0x03,0x00,0x0A,0x23,  /* 000008E8    ".......#" */
   3.533 -    0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x05,0x00,  /* 000008F0    "........" */
   3.534 -    0x00,0x00,0x0A,0x24,0x12,0x0B,0x04,0x0C,  /* 000008F8    "...$...." */
   3.535 -    0xFF,0xFF,0x05,0x00,0x01,0x00,0x0A,0x25,  /* 00000900    ".......%" */
   3.536 -    0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x05,0x00,  /* 00000908    "........" */
   3.537 -    0x0A,0x02,0x00,0x0A,0x26,0x12,0x0C,0x04,  /* 00000910    "....&..." */
   3.538 -    0x0C,0xFF,0xFF,0x05,0x00,0x0A,0x03,0x00,  /* 00000918    "........" */
   3.539 -    0x0A,0x27,0x12,0x0B,0x04,0x0C,0xFF,0xFF,  /* 00000920    ".'......" */
   3.540 -    0x06,0x00,0x00,0x00,0x0A,0x28,0x12,0x0B,  /* 00000928    ".....(.." */
   3.541 -    0x04,0x0C,0xFF,0xFF,0x06,0x00,0x01,0x00,  /* 00000930    "........" */
   3.542 -    0x0A,0x29,0x12,0x0C,0x04,0x0C,0xFF,0xFF,  /* 00000938    ".)......" */
   3.543 -    0x06,0x00,0x0A,0x02,0x00,0x0A,0x2A,0x12,  /* 00000940    "......*." */
   3.544 -    0x0C,0x04,0x0C,0xFF,0xFF,0x06,0x00,0x0A,  /* 00000948    "........" */
   3.545 -    0x03,0x00,0x0A,0x2B,0x12,0x0B,0x04,0x0C,  /* 00000950    "...+...." */
   3.546 -    0xFF,0xFF,0x07,0x00,0x00,0x00,0x0A,0x2C,  /* 00000958    ".......," */
   3.547 -    0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x07,0x00,  /* 00000960    "........" */
   3.548 -    0x01,0x00,0x0A,0x2D,0x12,0x0C,0x04,0x0C,  /* 00000968    "...-...." */
   3.549 -    0xFF,0xFF,0x07,0x00,0x0A,0x02,0x00,0x0A,  /* 00000970    "........" */
   3.550 -    0x2E,0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x07,  /* 00000978    "........" */
   3.551 -    0x00,0x0A,0x03,0x00,0x0A,0x2F,0x12,0x0B,  /* 00000980    "...../.." */
   3.552 -    0x04,0x0C,0xFF,0xFF,0x08,0x00,0x00,0x00,  /* 00000988    "........" */
   3.553 -    0x0A,0x11,0x12,0x0B,0x04,0x0C,0xFF,0xFF,  /* 00000990    "........" */
   3.554 -    0x08,0x00,0x01,0x00,0x0A,0x12,0x12,0x0C,  /* 00000998    "........" */
   3.555 -    0x04,0x0C,0xFF,0xFF,0x08,0x00,0x0A,0x02,  /* 000009A0    "........" */
   3.556 -    0x00,0x0A,0x13,0x12,0x0C,0x04,0x0C,0xFF,  /* 000009A8    "........" */
   3.557 -    0xFF,0x08,0x00,0x0A,0x03,0x00,0x0A,0x14,  /* 000009B0    "........" */
   3.558 -    0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x09,0x00,  /* 000009B8    "........" */
   3.559 -    0x00,0x00,0x0A,0x15,0x12,0x0B,0x04,0x0C,  /* 000009C0    "........" */
   3.560 -    0xFF,0xFF,0x09,0x00,0x01,0x00,0x0A,0x16,  /* 000009C8    "........" */
   3.561 -    0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x09,0x00,  /* 000009D0    "........" */
   3.562 -    0x0A,0x02,0x00,0x0A,0x17,0x12,0x0C,0x04,  /* 000009D8    "........" */
   3.563 -    0x0C,0xFF,0xFF,0x09,0x00,0x0A,0x03,0x00,  /* 000009E0    "........" */
   3.564 -    0x0A,0x18,0x12,0x0B,0x04,0x0C,0xFF,0xFF,  /* 000009E8    "........" */
   3.565 -    0x0A,0x00,0x00,0x00,0x0A,0x19,0x12,0x0B,  /* 000009F0    "........" */
   3.566 -    0x04,0x0C,0xFF,0xFF,0x0A,0x00,0x01,0x00,  /* 000009F8    "........" */
   3.567 -    0x0A,0x1A,0x12,0x0C,0x04,0x0C,0xFF,0xFF,  /* 00000A00    "........" */
   3.568 -    0x0A,0x00,0x0A,0x02,0x00,0x0A,0x1B,0x12,  /* 00000A08    "........" */
   3.569 -    0x0C,0x04,0x0C,0xFF,0xFF,0x0A,0x00,0x0A,  /* 00000A10    "........" */
   3.570 -    0x03,0x00,0x0A,0x1C,0x12,0x0B,0x04,0x0C,  /* 00000A18    "........" */
   3.571 -    0xFF,0xFF,0x0B,0x00,0x00,0x00,0x0A,0x1D,  /* 00000A20    "........" */
   3.572 -    0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x0B,0x00,  /* 00000A28    "........" */
   3.573 -    0x01,0x00,0x0A,0x1E,0x12,0x0C,0x04,0x0C,  /* 00000A30    "........" */
   3.574 -    0xFF,0xFF,0x0B,0x00,0x0A,0x02,0x00,0x0A,  /* 00000A38    "........" */
   3.575 -    0x1F,0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x0B,  /* 00000A40    "........" */
   3.576 -    0x00,0x0A,0x03,0x00,0x0A,0x20,0x12,0x0B,  /* 00000A48    "..... .." */
   3.577 -    0x04,0x0C,0xFF,0xFF,0x0C,0x00,0x00,0x00,  /* 00000A50    "........" */
   3.578 -    0x0A,0x21,0x12,0x0B,0x04,0x0C,0xFF,0xFF,  /* 00000A58    ".!......" */
   3.579 -    0x0C,0x00,0x01,0x00,0x0A,0x22,0x12,0x0C,  /* 00000A60    ".....".." */
   3.580 -    0x04,0x0C,0xFF,0xFF,0x0C,0x00,0x0A,0x02,  /* 00000A68    "........" */
   3.581 -    0x00,0x0A,0x23,0x12,0x0C,0x04,0x0C,0xFF,  /* 00000A70    "..#....." */
   3.582 -    0xFF,0x0C,0x00,0x0A,0x03,0x00,0x0A,0x24,  /* 00000A78    ".......$" */
   3.583 -    0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x0D,0x00,  /* 00000A80    "........" */
   3.584 -    0x00,0x00,0x0A,0x25,0x12,0x0B,0x04,0x0C,  /* 00000A88    "...%...." */
   3.585 -    0xFF,0xFF,0x0D,0x00,0x01,0x00,0x0A,0x26,  /* 00000A90    ".......&" */
   3.586 -    0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x0D,0x00,  /* 00000A98    "........" */
   3.587 -    0x0A,0x02,0x00,0x0A,0x27,0x12,0x0C,0x04,  /* 00000AA0    "....'..." */
   3.588 -    0x0C,0xFF,0xFF,0x0D,0x00,0x0A,0x03,0x00,  /* 00000AA8    "........" */
   3.589 -    0x0A,0x28,0x12,0x0B,0x04,0x0C,0xFF,0xFF,  /* 00000AB0    ".(......" */
   3.590 -    0x0E,0x00,0x00,0x00,0x0A,0x29,0x12,0x0B,  /* 00000AB8    ".....).." */
   3.591 -    0x04,0x0C,0xFF,0xFF,0x0E,0x00,0x01,0x00,  /* 00000AC0    "........" */
   3.592 -    0x0A,0x2A,0x12,0x0C,0x04,0x0C,0xFF,0xFF,  /* 00000AC8    ".*......" */
   3.593 -    0x0E,0x00,0x0A,0x02,0x00,0x0A,0x2B,0x12,  /* 00000AD0    "......+." */
   3.594 -    0x0C,0x04,0x0C,0xFF,0xFF,0x0E,0x00,0x0A,  /* 00000AD8    "........" */
   3.595 -    0x03,0x00,0x0A,0x2C,0x12,0x0B,0x04,0x0C,  /* 00000AE0    "...,...." */
   3.596 -    0xFF,0xFF,0x0F,0x00,0x00,0x00,0x0A,0x2D,  /* 00000AE8    ".......-" */
   3.597 -    0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x0F,0x00,  /* 00000AF0    "........" */
   3.598 -    0x01,0x00,0x0A,0x2E,0x12,0x0C,0x04,0x0C,  /* 00000AF8    "........" */
   3.599 -    0xFF,0xFF,0x0F,0x00,0x0A,0x02,0x00,0x0A,  /* 00000B00    "........" */
   3.600 -    0x2F,0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x0F,  /* 00000B08    "/......." */
   3.601 -    0x00,0x0A,0x03,0x00,0x0A,0x10,0x5B,0x82,  /* 00000B10    "......[." */
   3.602 -    0x46,0x37,0x49,0x53,0x41,0x5F,0x08,0x5F,  /* 00000B18    "F7ISA_._" */
   3.603 -    0x41,0x44,0x52,0x0C,0x00,0x00,0x01,0x00,  /* 00000B20    "ADR....." */
   3.604 -    0x5B,0x80,0x50,0x49,0x52,0x51,0x02,0x0A,  /* 00000B28    "[.PIRQ.." */
   3.605 -    0x60,0x0A,0x04,0x10,0x2E,0x5C,0x00,0x5B,  /* 00000B30    "`....\.[" */
   3.606 -    0x81,0x29,0x5C,0x2F,0x04,0x5F,0x53,0x42,  /* 00000B38    ".)\/._SB" */
   3.607 -    0x5F,0x50,0x43,0x49,0x30,0x49,0x53,0x41,  /* 00000B40    "_PCI0ISA" */
   3.608 -    0x5F,0x50,0x49,0x52,0x51,0x01,0x50,0x49,  /* 00000B48    "_PIRQ.PI" */
   3.609 -    0x52,0x41,0x08,0x50,0x49,0x52,0x42,0x08,  /* 00000B50    "RA.PIRB." */
   3.610 -    0x50,0x49,0x52,0x43,0x08,0x50,0x49,0x52,  /* 00000B58    "PIRC.PIR" */
   3.611 -    0x44,0x08,0x5B,0x82,0x46,0x0B,0x53,0x59,  /* 00000B60    "D.[.F.SY" */
   3.612 -    0x53,0x52,0x08,0x5F,0x48,0x49,0x44,0x0C,  /* 00000B68    "SR._HID." */
   3.613 -    0x41,0xD0,0x0C,0x02,0x08,0x5F,0x55,0x49,  /* 00000B70    "A...._UI" */
   3.614 -    0x44,0x01,0x08,0x43,0x52,0x53,0x5F,0x11,  /* 00000B78    "D..CRS_." */
   3.615 -    0x4E,0x08,0x0A,0x8A,0x47,0x01,0x10,0x00,  /* 00000B80    "N...G..." */
   3.616 -    0x10,0x00,0x00,0x10,0x47,0x01,0x22,0x00,  /* 00000B88    "....G."." */
   3.617 -    0x22,0x00,0x00,0x0C,0x47,0x01,0x30,0x00,  /* 00000B90    ""...G.0." */
   3.618 -    0x30,0x00,0x00,0x10,0x47,0x01,0x44,0x00,  /* 00000B98    "0...G.D." */
   3.619 -    0x44,0x00,0x00,0x1C,0x47,0x01,0x62,0x00,  /* 00000BA0    "D...G.b." */
   3.620 -    0x62,0x00,0x00,0x02,0x47,0x01,0x65,0x00,  /* 00000BA8    "b...G.e." */
   3.621 -    0x65,0x00,0x00,0x0B,0x47,0x01,0x72,0x00,  /* 00000BB0    "e...G.r." */
   3.622 -    0x72,0x00,0x00,0x0E,0x47,0x01,0x80,0x00,  /* 00000BB8    "r...G..." */
   3.623 -    0x80,0x00,0x00,0x01,0x47,0x01,0x84,0x00,  /* 00000BC0    "....G..." */
   3.624 -    0x84,0x00,0x00,0x03,0x47,0x01,0x88,0x00,  /* 00000BC8    "....G..." */
   3.625 -    0x88,0x00,0x00,0x01,0x47,0x01,0x8C,0x00,  /* 00000BD0    "....G..." */
   3.626 -    0x8C,0x00,0x00,0x03,0x47,0x01,0x90,0x00,  /* 00000BD8    "....G..." */
   3.627 -    0x90,0x00,0x00,0x10,0x47,0x01,0xA2,0x00,  /* 00000BE0    "....G..." */
   3.628 -    0xA2,0x00,0x00,0x1C,0x47,0x01,0xE0,0x00,  /* 00000BE8    "....G..." */
   3.629 -    0xE0,0x00,0x00,0x10,0x47,0x01,0xA0,0x08,  /* 00000BF0    "....G..." */
   3.630 -    0xA0,0x08,0x00,0x04,0x47,0x01,0xC0,0x0C,  /* 00000BF8    "....G..." */
   3.631 -    0xC0,0x0C,0x00,0x10,0x47,0x01,0xD0,0x04,  /* 00000C00    "....G..." */
   3.632 -    0xD0,0x04,0x00,0x02,0x79,0x00,0x14,0x0B,  /* 00000C08    "....y..." */
   3.633 -    0x5F,0x43,0x52,0x53,0x00,0xA4,0x43,0x52,  /* 00000C10    "_CRS..CR" */
   3.634 -    0x53,0x5F,0x5B,0x82,0x2B,0x50,0x49,0x43,  /* 00000C18    "S_[.+PIC" */
   3.635 -    0x5F,0x08,0x5F,0x48,0x49,0x44,0x0B,0x41,  /* 00000C20    "_._HID.A" */
   3.636 -    0xD0,0x08,0x5F,0x43,0x52,0x53,0x11,0x18,  /* 00000C28    ".._CRS.." */
   3.637 -    0x0A,0x15,0x47,0x01,0x20,0x00,0x20,0x00,  /* 00000C30    "..G. . ." */
   3.638 -    0x01,0x02,0x47,0x01,0xA0,0x00,0xA0,0x00,  /* 00000C38    "..G....." */
   3.639 -    0x01,0x02,0x22,0x04,0x00,0x79,0x00,0x5B,  /* 00000C40    ".."..y.[" */
   3.640 -    0x82,0x47,0x05,0x44,0x4D,0x41,0x30,0x08,  /* 00000C48    ".G.DMA0." */
   3.641 -    0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,0x02,  /* 00000C50    "_HID.A.." */
   3.642 -    0x00,0x08,0x5F,0x43,0x52,0x53,0x11,0x41,  /* 00000C58    ".._CRS.A" */
   3.643 -    0x04,0x0A,0x3D,0x2A,0x10,0x04,0x47,0x01,  /* 00000C60    "..=*..G." */
   3.644 -    0x00,0x00,0x00,0x00,0x00,0x10,0x47,0x01,  /* 00000C68    "......G." */
   3.645 -    0x81,0x00,0x81,0x00,0x00,0x03,0x47,0x01,  /* 00000C70    "......G." */
   3.646 -    0x87,0x00,0x87,0x00,0x00,0x01,0x47,0x01,  /* 00000C78    "......G." */
   3.647 -    0x89,0x00,0x89,0x00,0x00,0x03,0x47,0x01,  /* 00000C80    "......G." */
   3.648 -    0x8F,0x00,0x8F,0x00,0x00,0x01,0x47,0x01,  /* 00000C88    "......G." */
   3.649 -    0xC0,0x00,0xC0,0x00,0x00,0x20,0x47,0x01,  /* 00000C90    "..... G." */
   3.650 -    0x80,0x04,0x80,0x04,0x00,0x10,0x79,0x00,  /* 00000C98    "......y." */
   3.651 -    0x5B,0x82,0x25,0x54,0x4D,0x52,0x5F,0x08,  /* 00000CA0    "[.%TMR_." */
   3.652 -    0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,0x01,  /* 00000CA8    "_HID.A.." */
   3.653 -    0x00,0x08,0x5F,0x43,0x52,0x53,0x11,0x10,  /* 00000CB0    ".._CRS.." */
   3.654 -    0x0A,0x0D,0x47,0x01,0x40,0x00,0x40,0x00,  /* 00000CB8    "..G.@.@." */
   3.655 -    0x00,0x04,0x22,0x01,0x00,0x79,0x00,0x5B,  /* 00000CC0    ".."..y.[" */
   3.656 -    0x82,0x25,0x52,0x54,0x43,0x5F,0x08,0x5F,  /* 00000CC8    ".%RTC_._" */
   3.657 -    0x48,0x49,0x44,0x0C,0x41,0xD0,0x0B,0x00,  /* 00000CD0    "HID.A..." */
   3.658 -    0x08,0x5F,0x43,0x52,0x53,0x11,0x10,0x0A,  /* 00000CD8    "._CRS..." */
   3.659 -    0x0D,0x47,0x01,0x70,0x00,0x70,0x00,0x00,  /* 00000CE0    ".G.p.p.." */
   3.660 -    0x02,0x22,0x00,0x01,0x79,0x00,0x5B,0x82,  /* 00000CE8    "."..y.[." */
   3.661 -    0x22,0x53,0x50,0x4B,0x52,0x08,0x5F,0x48,  /* 00000CF0    ""SPKR._H" */
   3.662 -    0x49,0x44,0x0C,0x41,0xD0,0x08,0x00,0x08,  /* 00000CF8    "ID.A...." */
   3.663 -    0x5F,0x43,0x52,0x53,0x11,0x0D,0x0A,0x0A,  /* 00000D00    "_CRS...." */
   3.664 -    0x47,0x01,0x61,0x00,0x61,0x00,0x00,0x01,  /* 00000D08    "G.a.a..." */
   3.665 -    0x79,0x00,0x5B,0x82,0x31,0x50,0x53,0x32,  /* 00000D10    "y.[.1PS2" */
   3.666 -    0x4D,0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,  /* 00000D18    "M._HID.A" */
   3.667 -    0xD0,0x0F,0x13,0x08,0x5F,0x43,0x49,0x44,  /* 00000D20    "...._CID" */
   3.668 -    0x0C,0x41,0xD0,0x0F,0x13,0x14,0x09,0x5F,  /* 00000D28    ".A....._" */
   3.669 -    0x53,0x54,0x41,0x00,0xA4,0x0A,0x0F,0x08,  /* 00000D30    "STA....." */
   3.670 -    0x5F,0x43,0x52,0x53,0x11,0x08,0x0A,0x05,  /* 00000D38    "_CRS...." */
   3.671 -    0x22,0x00,0x10,0x79,0x00,0x5B,0x82,0x42,  /* 00000D40    ""..y.[.B" */
   3.672 -    0x04,0x50,0x53,0x32,0x4B,0x08,0x5F,0x48,  /* 00000D48    ".PS2K._H" */
   3.673 -    0x49,0x44,0x0C,0x41,0xD0,0x03,0x03,0x08,  /* 00000D50    "ID.A...." */
   3.674 -    0x5F,0x43,0x49,0x44,0x0C,0x41,0xD0,0x03,  /* 00000D58    "_CID.A.." */
   3.675 -    0x0B,0x14,0x09,0x5F,0x53,0x54,0x41,0x00,  /* 00000D60    "..._STA." */
   3.676 -    0xA4,0x0A,0x0F,0x08,0x5F,0x43,0x52,0x53,  /* 00000D68    "...._CRS" */
   3.677 -    0x11,0x18,0x0A,0x15,0x47,0x01,0x60,0x00,  /* 00000D70    "....G.`." */
   3.678 -    0x60,0x00,0x00,0x01,0x47,0x01,0x64,0x00,  /* 00000D78    "`...G.d." */
   3.679 -    0x64,0x00,0x00,0x01,0x22,0x02,0x00,0x79,  /* 00000D80    "d..."..y" */
   3.680 -    0x00,0x5B,0x82,0x3A,0x46,0x44,0x43,0x30,  /* 00000D88    ".[.:FDC0" */
   3.681 -    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 00000D90    "._HID.A." */
   3.682 -    0x07,0x00,0x14,0x09,0x5F,0x53,0x54,0x41,  /* 00000D98    "...._STA" */
   3.683 -    0x00,0xA4,0x0A,0x0F,0x08,0x5F,0x43,0x52,  /* 00000DA0    "....._CR" */
   3.684 -    0x53,0x11,0x1B,0x0A,0x18,0x47,0x01,0xF0,  /* 00000DA8    "S....G.." */
   3.685 -    0x03,0xF0,0x03,0x01,0x06,0x47,0x01,0xF7,  /* 00000DB0    ".....G.." */
   3.686 -    0x03,0xF7,0x03,0x01,0x01,0x22,0x40,0x00,  /* 00000DB8    "....."@." */
   3.687 -    0x2A,0x04,0x00,0x79,0x00,0x5B,0x82,0x46,  /* 00000DC0    "*..y.[.F" */
   3.688 -    0x04,0x55,0x41,0x52,0x31,0x08,0x5F,0x48,  /* 00000DC8    ".UAR1._H" */
   3.689 -    0x49,0x44,0x0C,0x41,0xD0,0x05,0x01,0x08,  /* 00000DD0    "ID.A...." */
   3.690 -    0x5F,0x55,0x49,0x44,0x01,0x14,0x19,0x5F,  /* 00000DD8    "_UID..._" */
   3.691 -    0x53,0x54,0x41,0x00,0xA0,0x0D,0x93,0x5E,  /* 00000DE0    "STA....^" */
   3.692 -    0x5E,0x5E,0x5E,0x55,0x41,0x52,0x31,0x00,  /* 00000DE8    "^^^UAR1." */
   3.693 -    0xA4,0x00,0xA1,0x04,0xA4,0x0A,0x0F,0x08,  /* 00000DF0    "........" */
   3.694 -    0x5F,0x43,0x52,0x53,0x11,0x10,0x0A,0x0D,  /* 00000DF8    "_CRS...." */
   3.695 -    0x47,0x01,0xF8,0x03,0xF8,0x03,0x08,0x08,  /* 00000E00    "G......." */
   3.696 -    0x22,0x10,0x00,0x79,0x00,0x5B,0x82,0x47,  /* 00000E08    ""..y.[.G" */
   3.697 -    0x04,0x55,0x41,0x52,0x32,0x08,0x5F,0x48,  /* 00000E10    ".UAR2._H" */
   3.698 -    0x49,0x44,0x0C,0x41,0xD0,0x05,0x01,0x08,  /* 00000E18    "ID.A...." */
   3.699 -    0x5F,0x55,0x49,0x44,0x0A,0x02,0x14,0x19,  /* 00000E20    "_UID...." */
   3.700 -    0x5F,0x53,0x54,0x41,0x00,0xA0,0x0D,0x93,  /* 00000E28    "_STA...." */
   3.701 -    0x5E,0x5E,0x5E,0x5E,0x55,0x41,0x52,0x32,  /* 00000E30    "^^^^UAR2" */
   3.702 -    0x00,0xA4,0x00,0xA1,0x04,0xA4,0x0A,0x0F,  /* 00000E38    "........" */
   3.703 -    0x08,0x5F,0x43,0x52,0x53,0x11,0x10,0x0A,  /* 00000E40    "._CRS..." */
   3.704 -    0x0D,0x47,0x01,0xF8,0x02,0xF8,0x02,0x08,  /* 00000E48    ".G......" */
   3.705 -    0x08,0x22,0x08,0x00,0x79,0x00,0x5B,0x82,  /* 00000E50    "."..y.[." */
   3.706 -    0x36,0x4C,0x54,0x50,0x31,0x08,0x5F,0x48,  /* 00000E58    "6LTP1._H" */
   3.707 -    0x49,0x44,0x0C,0x41,0xD0,0x04,0x00,0x08,  /* 00000E60    "ID.A...." */
   3.708 -    0x5F,0x55,0x49,0x44,0x0A,0x02,0x14,0x09,  /* 00000E68    "_UID...." */
   3.709 -    0x5F,0x53,0x54,0x41,0x00,0xA4,0x0A,0x0F,  /* 00000E70    "_STA...." */
   3.710 -    0x08,0x5F,0x43,0x52,0x53,0x11,0x10,0x0A,  /* 00000E78    "._CRS..." */
   3.711 -    0x0D,0x47,0x01,0x78,0x03,0x78,0x03,0x08,  /* 00000E80    ".G.x.x.." */
   3.712 -    0x08,0x22,0x80,0x00,0x79,0x00,
   3.713 +    0x00,0x00,0x4C,0x4E,0x4B,0x43,0x00,0x12,  /* 000007C0    "..LNKC.." */
   3.714 +    0x0D,0x04,0x0C,0xFF,0xFF,0x0E,0x00,0x01,  /* 000007C8    "........" */
   3.715 +    0x4C,0x4E,0x4B,0x44,0x00,0x12,0x0E,0x04,  /* 000007D0    "LNKD...." */
   3.716 +    0x0C,0xFF,0xFF,0x0E,0x00,0x0A,0x02,0x4C,  /* 000007D8    ".......L" */
   3.717 +    0x4E,0x4B,0x41,0x00,0x12,0x0E,0x04,0x0C,  /* 000007E0    "NKA....." */
   3.718 +    0xFF,0xFF,0x0E,0x00,0x0A,0x03,0x4C,0x4E,  /* 000007E8    "......LN" */
   3.719 +    0x4B,0x42,0x00,0x12,0x0D,0x04,0x0C,0xFF,  /* 000007F0    "KB......" */
   3.720 +    0xFF,0x0F,0x00,0x00,0x4C,0x4E,0x4B,0x44,  /* 000007F8    "....LNKD" */
   3.721 +    0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x0F,  /* 00000800    "........" */
   3.722 +    0x00,0x01,0x4C,0x4E,0x4B,0x41,0x00,0x12,  /* 00000808    "..LNKA.." */
   3.723 +    0x0E,0x04,0x0C,0xFF,0xFF,0x0F,0x00,0x0A,  /* 00000810    "........" */
   3.724 +    0x02,0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0E,  /* 00000818    ".LNKB..." */
   3.725 +    0x04,0x0C,0xFF,0xFF,0x0F,0x00,0x0A,0x03,  /* 00000820    "........" */
   3.726 +    0x4C,0x4E,0x4B,0x43,0x00,0x08,0x50,0x52,  /* 00000828    "LNKC..PR" */
   3.727 +    0x54,0x41,0x12,0x41,0x2F,0x3C,0x12,0x0B,  /* 00000830    "TA.A/<.." */
   3.728 +    0x04,0x0C,0xFF,0xFF,0x01,0x00,0x00,0x00,  /* 00000838    "........" */
   3.729 +    0x0A,0x14,0x12,0x0B,0x04,0x0C,0xFF,0xFF,  /* 00000840    "........" */
   3.730 +    0x01,0x00,0x01,0x00,0x0A,0x15,0x12,0x0C,  /* 00000848    "........" */
   3.731 +    0x04,0x0C,0xFF,0xFF,0x01,0x00,0x0A,0x02,  /* 00000850    "........" */
   3.732 +    0x00,0x0A,0x16,0x12,0x0C,0x04,0x0C,0xFF,  /* 00000858    "........" */
   3.733 +    0xFF,0x01,0x00,0x0A,0x03,0x00,0x0A,0x17,  /* 00000860    "........" */
   3.734 +    0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x02,0x00,  /* 00000868    "........" */
   3.735 +    0x00,0x00,0x0A,0x18,0x12,0x0B,0x04,0x0C,  /* 00000870    "........" */
   3.736 +    0xFF,0xFF,0x02,0x00,0x01,0x00,0x0A,0x19,  /* 00000878    "........" */
   3.737 +    0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x02,0x00,  /* 00000880    "........" */
   3.738 +    0x0A,0x02,0x00,0x0A,0x1A,0x12,0x0C,0x04,  /* 00000888    "........" */
   3.739 +    0x0C,0xFF,0xFF,0x02,0x00,0x0A,0x03,0x00,  /* 00000890    "........" */
   3.740 +    0x0A,0x1B,0x12,0x0B,0x04,0x0C,0xFF,0xFF,  /* 00000898    "........" */
   3.741 +    0x03,0x00,0x00,0x00,0x0A,0x1C,0x12,0x0B,  /* 000008A0    "........" */
   3.742 +    0x04,0x0C,0xFF,0xFF,0x03,0x00,0x01,0x00,  /* 000008A8    "........" */
   3.743 +    0x0A,0x1D,0x12,0x0C,0x04,0x0C,0xFF,0xFF,  /* 000008B0    "........" */
   3.744 +    0x03,0x00,0x0A,0x02,0x00,0x0A,0x1E,0x12,  /* 000008B8    "........" */
   3.745 +    0x0C,0x04,0x0C,0xFF,0xFF,0x03,0x00,0x0A,  /* 000008C0    "........" */
   3.746 +    0x03,0x00,0x0A,0x1F,0x12,0x0B,0x04,0x0C,  /* 000008C8    "........" */
   3.747 +    0xFF,0xFF,0x04,0x00,0x00,0x00,0x0A,0x20,  /* 000008D0    "....... " */
   3.748 +    0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x04,0x00,  /* 000008D8    "........" */
   3.749 +    0x01,0x00,0x0A,0x21,0x12,0x0C,0x04,0x0C,  /* 000008E0    "...!...." */
   3.750 +    0xFF,0xFF,0x04,0x00,0x0A,0x02,0x00,0x0A,  /* 000008E8    "........" */
   3.751 +    0x22,0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x04,  /* 000008F0    ""......." */
   3.752 +    0x00,0x0A,0x03,0x00,0x0A,0x23,0x12,0x0B,  /* 000008F8    ".....#.." */
   3.753 +    0x04,0x0C,0xFF,0xFF,0x05,0x00,0x00,0x00,  /* 00000900    "........" */
   3.754 +    0x0A,0x24,0x12,0x0B,0x04,0x0C,0xFF,0xFF,  /* 00000908    ".$......" */
   3.755 +    0x05,0x00,0x01,0x00,0x0A,0x25,0x12,0x0C,  /* 00000910    ".....%.." */
   3.756 +    0x04,0x0C,0xFF,0xFF,0x05,0x00,0x0A,0x02,  /* 00000918    "........" */
   3.757 +    0x00,0x0A,0x26,0x12,0x0C,0x04,0x0C,0xFF,  /* 00000920    "..&....." */
   3.758 +    0xFF,0x05,0x00,0x0A,0x03,0x00,0x0A,0x27,  /* 00000928    ".......'" */
   3.759 +    0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x06,0x00,  /* 00000930    "........" */
   3.760 +    0x00,0x00,0x0A,0x28,0x12,0x0B,0x04,0x0C,  /* 00000938    "...(...." */
   3.761 +    0xFF,0xFF,0x06,0x00,0x01,0x00,0x0A,0x29,  /* 00000940    ".......)" */
   3.762 +    0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x06,0x00,  /* 00000948    "........" */
   3.763 +    0x0A,0x02,0x00,0x0A,0x2A,0x12,0x0C,0x04,  /* 00000950    "....*..." */
   3.764 +    0x0C,0xFF,0xFF,0x06,0x00,0x0A,0x03,0x00,  /* 00000958    "........" */
   3.765 +    0x0A,0x2B,0x12,0x0B,0x04,0x0C,0xFF,0xFF,  /* 00000960    ".+......" */
   3.766 +    0x07,0x00,0x00,0x00,0x0A,0x2C,0x12,0x0B,  /* 00000968    ".....,.." */
   3.767 +    0x04,0x0C,0xFF,0xFF,0x07,0x00,0x01,0x00,  /* 00000970    "........" */
   3.768 +    0x0A,0x2D,0x12,0x0C,0x04,0x0C,0xFF,0xFF,  /* 00000978    ".-......" */
   3.769 +    0x07,0x00,0x0A,0x02,0x00,0x0A,0x2E,0x12,  /* 00000980    "........" */
   3.770 +    0x0C,0x04,0x0C,0xFF,0xFF,0x07,0x00,0x0A,  /* 00000988    "........" */
   3.771 +    0x03,0x00,0x0A,0x2F,0x12,0x0B,0x04,0x0C,  /* 00000990    ".../...." */
   3.772 +    0xFF,0xFF,0x08,0x00,0x00,0x00,0x0A,0x11,  /* 00000998    "........" */
   3.773 +    0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x08,0x00,  /* 000009A0    "........" */
   3.774 +    0x01,0x00,0x0A,0x12,0x12,0x0C,0x04,0x0C,  /* 000009A8    "........" */
   3.775 +    0xFF,0xFF,0x08,0x00,0x0A,0x02,0x00,0x0A,  /* 000009B0    "........" */
   3.776 +    0x13,0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x08,  /* 000009B8    "........" */
   3.777 +    0x00,0x0A,0x03,0x00,0x0A,0x14,0x12,0x0B,  /* 000009C0    "........" */
   3.778 +    0x04,0x0C,0xFF,0xFF,0x09,0x00,0x00,0x00,  /* 000009C8    "........" */
   3.779 +    0x0A,0x15,0x12,0x0B,0x04,0x0C,0xFF,0xFF,  /* 000009D0    "........" */
   3.780 +    0x09,0x00,0x01,0x00,0x0A,0x16,0x12,0x0C,  /* 000009D8    "........" */
   3.781 +    0x04,0x0C,0xFF,0xFF,0x09,0x00,0x0A,0x02,  /* 000009E0    "........" */
   3.782 +    0x00,0x0A,0x17,0x12,0x0C,0x04,0x0C,0xFF,  /* 000009E8    "........" */
   3.783 +    0xFF,0x09,0x00,0x0A,0x03,0x00,0x0A,0x18,  /* 000009F0    "........" */
   3.784 +    0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x0A,0x00,  /* 000009F8    "........" */
   3.785 +    0x00,0x00,0x0A,0x19,0x12,0x0B,0x04,0x0C,  /* 00000A00    "........" */
   3.786 +    0xFF,0xFF,0x0A,0x00,0x01,0x00,0x0A,0x1A,  /* 00000A08    "........" */
   3.787 +    0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x0A,0x00,  /* 00000A10    "........" */
   3.788 +    0x0A,0x02,0x00,0x0A,0x1B,0x12,0x0C,0x04,  /* 00000A18    "........" */
   3.789 +    0x0C,0xFF,0xFF,0x0A,0x00,0x0A,0x03,0x00,  /* 00000A20    "........" */
   3.790 +    0x0A,0x1C,0x12,0x0B,0x04,0x0C,0xFF,0xFF,  /* 00000A28    "........" */
   3.791 +    0x0B,0x00,0x00,0x00,0x0A,0x1D,0x12,0x0B,  /* 00000A30    "........" */
   3.792 +    0x04,0x0C,0xFF,0xFF,0x0B,0x00,0x01,0x00,  /* 00000A38    "........" */
   3.793 +    0x0A,0x1E,0x12,0x0C,0x04,0x0C,0xFF,0xFF,  /* 00000A40    "........" */
   3.794 +    0x0B,0x00,0x0A,0x02,0x00,0x0A,0x1F,0x12,  /* 00000A48    "........" */
   3.795 +    0x0C,0x04,0x0C,0xFF,0xFF,0x0B,0x00,0x0A,  /* 00000A50    "........" */
   3.796 +    0x03,0x00,0x0A,0x20,0x12,0x0B,0x04,0x0C,  /* 00000A58    "... ...." */
   3.797 +    0xFF,0xFF,0x0C,0x00,0x00,0x00,0x0A,0x21,  /* 00000A60    ".......!" */
   3.798 +    0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x0C,0x00,  /* 00000A68    "........" */
   3.799 +    0x01,0x00,0x0A,0x22,0x12,0x0C,0x04,0x0C,  /* 00000A70    "..."...." */
   3.800 +    0xFF,0xFF,0x0C,0x00,0x0A,0x02,0x00,0x0A,  /* 00000A78    "........" */
   3.801 +    0x23,0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x0C,  /* 00000A80    "#......." */
   3.802 +    0x00,0x0A,0x03,0x00,0x0A,0x24,0x12,0x0B,  /* 00000A88    ".....$.." */
   3.803 +    0x04,0x0C,0xFF,0xFF,0x0D,0x00,0x00,0x00,  /* 00000A90    "........" */
   3.804 +    0x0A,0x25,0x12,0x0B,0x04,0x0C,0xFF,0xFF,  /* 00000A98    ".%......" */
   3.805 +    0x0D,0x00,0x01,0x00,0x0A,0x26,0x12,0x0C,  /* 00000AA0    ".....&.." */
   3.806 +    0x04,0x0C,0xFF,0xFF,0x0D,0x00,0x0A,0x02,  /* 00000AA8    "........" */
   3.807 +    0x00,0x0A,0x27,0x12,0x0C,0x04,0x0C,0xFF,  /* 00000AB0    "..'....." */
   3.808 +    0xFF,0x0D,0x00,0x0A,0x03,0x00,0x0A,0x28,  /* 00000AB8    ".......(" */
   3.809 +    0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x0E,0x00,  /* 00000AC0    "........" */
   3.810 +    0x00,0x00,0x0A,0x29,0x12,0x0B,0x04,0x0C,  /* 00000AC8    "...)...." */
   3.811 +    0xFF,0xFF,0x0E,0x00,0x01,0x00,0x0A,0x2A,  /* 00000AD0    ".......*" */
   3.812 +    0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x0E,0x00,  /* 00000AD8    "........" */
   3.813 +    0x0A,0x02,0x00,0x0A,0x2B,0x12,0x0C,0x04,  /* 00000AE0    "....+..." */
   3.814 +    0x0C,0xFF,0xFF,0x0E,0x00,0x0A,0x03,0x00,  /* 00000AE8    "........" */
   3.815 +    0x0A,0x2C,0x12,0x0B,0x04,0x0C,0xFF,0xFF,  /* 00000AF0    ".,......" */
   3.816 +    0x0F,0x00,0x00,0x00,0x0A,0x2D,0x12,0x0B,  /* 00000AF8    ".....-.." */
   3.817 +    0x04,0x0C,0xFF,0xFF,0x0F,0x00,0x01,0x00,  /* 00000B00    "........" */
   3.818 +    0x0A,0x2E,0x12,0x0C,0x04,0x0C,0xFF,0xFF,  /* 00000B08    "........" */
   3.819 +    0x0F,0x00,0x0A,0x02,0x00,0x0A,0x2F,0x12,  /* 00000B10    "....../." */
   3.820 +    0x0C,0x04,0x0C,0xFF,0xFF,0x0F,0x00,0x0A,  /* 00000B18    "........" */
   3.821 +    0x03,0x00,0x0A,0x10,0x5B,0x82,0x46,0x37,  /* 00000B20    "....[.F7" */
   3.822 +    0x49,0x53,0x41,0x5F,0x08,0x5F,0x41,0x44,  /* 00000B28    "ISA_._AD" */
   3.823 +    0x52,0x0C,0x00,0x00,0x01,0x00,0x5B,0x80,  /* 00000B30    "R.....[." */
   3.824 +    0x50,0x49,0x52,0x51,0x02,0x0A,0x60,0x0A,  /* 00000B38    "PIRQ..`." */
   3.825 +    0x04,0x10,0x2E,0x5C,0x00,0x5B,0x81,0x29,  /* 00000B40    "...\.[.)" */
   3.826 +    0x5C,0x2F,0x04,0x5F,0x53,0x42,0x5F,0x50,  /* 00000B48    "\/._SB_P" */
   3.827 +    0x43,0x49,0x30,0x49,0x53,0x41,0x5F,0x50,  /* 00000B50    "CI0ISA_P" */
   3.828 +    0x49,0x52,0x51,0x01,0x50,0x49,0x52,0x41,  /* 00000B58    "IRQ.PIRA" */
   3.829 +    0x08,0x50,0x49,0x52,0x42,0x08,0x50,0x49,  /* 00000B60    ".PIRB.PI" */
   3.830 +    0x52,0x43,0x08,0x50,0x49,0x52,0x44,0x08,  /* 00000B68    "RC.PIRD." */
   3.831 +    0x5B,0x82,0x46,0x0B,0x53,0x59,0x53,0x52,  /* 00000B70    "[.F.SYSR" */
   3.832 +    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 00000B78    "._HID.A." */
   3.833 +    0x0C,0x02,0x08,0x5F,0x55,0x49,0x44,0x01,  /* 00000B80    "..._UID." */
   3.834 +    0x08,0x43,0x52,0x53,0x5F,0x11,0x4E,0x08,  /* 00000B88    ".CRS_.N." */
   3.835 +    0x0A,0x8A,0x47,0x01,0x10,0x00,0x10,0x00,  /* 00000B90    "..G....." */
   3.836 +    0x00,0x10,0x47,0x01,0x22,0x00,0x22,0x00,  /* 00000B98    "..G."."." */
   3.837 +    0x00,0x0C,0x47,0x01,0x30,0x00,0x30,0x00,  /* 00000BA0    "..G.0.0." */
   3.838 +    0x00,0x10,0x47,0x01,0x44,0x00,0x44,0x00,  /* 00000BA8    "..G.D.D." */
   3.839 +    0x00,0x1C,0x47,0x01,0x62,0x00,0x62,0x00,  /* 00000BB0    "..G.b.b." */
   3.840 +    0x00,0x02,0x47,0x01,0x65,0x00,0x65,0x00,  /* 00000BB8    "..G.e.e." */
   3.841 +    0x00,0x0B,0x47,0x01,0x72,0x00,0x72,0x00,  /* 00000BC0    "..G.r.r." */
   3.842 +    0x00,0x0E,0x47,0x01,0x80,0x00,0x80,0x00,  /* 00000BC8    "..G....." */
   3.843 +    0x00,0x01,0x47,0x01,0x84,0x00,0x84,0x00,  /* 00000BD0    "..G....." */
   3.844 +    0x00,0x03,0x47,0x01,0x88,0x00,0x88,0x00,  /* 00000BD8    "..G....." */
   3.845 +    0x00,0x01,0x47,0x01,0x8C,0x00,0x8C,0x00,  /* 00000BE0    "..G....." */
   3.846 +    0x00,0x03,0x47,0x01,0x90,0x00,0x90,0x00,  /* 00000BE8    "..G....." */
   3.847 +    0x00,0x10,0x47,0x01,0xA2,0x00,0xA2,0x00,  /* 00000BF0    "..G....." */
   3.848 +    0x00,0x1C,0x47,0x01,0xE0,0x00,0xE0,0x00,  /* 00000BF8    "..G....." */
   3.849 +    0x00,0x10,0x47,0x01,0xA0,0x08,0xA0,0x08,  /* 00000C00    "..G....." */
   3.850 +    0x00,0x04,0x47,0x01,0xC0,0x0C,0xC0,0x0C,  /* 00000C08    "..G....." */
   3.851 +    0x00,0x10,0x47,0x01,0xD0,0x04,0xD0,0x04,  /* 00000C10    "..G....." */
   3.852 +    0x00,0x02,0x79,0x00,0x14,0x0B,0x5F,0x43,  /* 00000C18    "..y..._C" */
   3.853 +    0x52,0x53,0x00,0xA4,0x43,0x52,0x53,0x5F,  /* 00000C20    "RS..CRS_" */
   3.854 +    0x5B,0x82,0x2B,0x50,0x49,0x43,0x5F,0x08,  /* 00000C28    "[.+PIC_." */
   3.855 +    0x5F,0x48,0x49,0x44,0x0B,0x41,0xD0,0x08,  /* 00000C30    "_HID.A.." */
   3.856 +    0x5F,0x43,0x52,0x53,0x11,0x18,0x0A,0x15,  /* 00000C38    "_CRS...." */
   3.857 +    0x47,0x01,0x20,0x00,0x20,0x00,0x01,0x02,  /* 00000C40    "G. . ..." */
   3.858 +    0x47,0x01,0xA0,0x00,0xA0,0x00,0x01,0x02,  /* 00000C48    "G......." */
   3.859 +    0x22,0x04,0x00,0x79,0x00,0x5B,0x82,0x47,  /* 00000C50    ""..y.[.G" */
   3.860 +    0x05,0x44,0x4D,0x41,0x30,0x08,0x5F,0x48,  /* 00000C58    ".DMA0._H" */
   3.861 +    0x49,0x44,0x0C,0x41,0xD0,0x02,0x00,0x08,  /* 00000C60    "ID.A...." */
   3.862 +    0x5F,0x43,0x52,0x53,0x11,0x41,0x04,0x0A,  /* 00000C68    "_CRS.A.." */
   3.863 +    0x3D,0x2A,0x10,0x04,0x47,0x01,0x00,0x00,  /* 00000C70    "=*..G..." */
   3.864 +    0x00,0x00,0x00,0x10,0x47,0x01,0x81,0x00,  /* 00000C78    "....G..." */
   3.865 +    0x81,0x00,0x00,0x03,0x47,0x01,0x87,0x00,  /* 00000C80    "....G..." */
   3.866 +    0x87,0x00,0x00,0x01,0x47,0x01,0x89,0x00,  /* 00000C88    "....G..." */
   3.867 +    0x89,0x00,0x00,0x03,0x47,0x01,0x8F,0x00,  /* 00000C90    "....G..." */
   3.868 +    0x8F,0x00,0x00,0x01,0x47,0x01,0xC0,0x00,  /* 00000C98    "....G..." */
   3.869 +    0xC0,0x00,0x00,0x20,0x47,0x01,0x80,0x04,  /* 00000CA0    "... G..." */
   3.870 +    0x80,0x04,0x00,0x10,0x79,0x00,0x5B,0x82,  /* 00000CA8    "....y.[." */
   3.871 +    0x25,0x54,0x4D,0x52,0x5F,0x08,0x5F,0x48,  /* 00000CB0    "%TMR_._H" */
   3.872 +    0x49,0x44,0x0C,0x41,0xD0,0x01,0x00,0x08,  /* 00000CB8    "ID.A...." */
   3.873 +    0x5F,0x43,0x52,0x53,0x11,0x10,0x0A,0x0D,  /* 00000CC0    "_CRS...." */
   3.874 +    0x47,0x01,0x40,0x00,0x40,0x00,0x00,0x04,  /* 00000CC8    "G.@.@..." */
   3.875 +    0x22,0x01,0x00,0x79,0x00,0x5B,0x82,0x25,  /* 00000CD0    ""..y.[.%" */
   3.876 +    0x52,0x54,0x43,0x5F,0x08,0x5F,0x48,0x49,  /* 00000CD8    "RTC_._HI" */
   3.877 +    0x44,0x0C,0x41,0xD0,0x0B,0x00,0x08,0x5F,  /* 00000CE0    "D.A...._" */
   3.878 +    0x43,0x52,0x53,0x11,0x10,0x0A,0x0D,0x47,  /* 00000CE8    "CRS....G" */
   3.879 +    0x01,0x70,0x00,0x70,0x00,0x00,0x02,0x22,  /* 00000CF0    ".p.p..."" */
   3.880 +    0x00,0x01,0x79,0x00,0x5B,0x82,0x22,0x53,  /* 00000CF8    "..y.[."S" */
   3.881 +    0x50,0x4B,0x52,0x08,0x5F,0x48,0x49,0x44,  /* 00000D00    "PKR._HID" */
   3.882 +    0x0C,0x41,0xD0,0x08,0x00,0x08,0x5F,0x43,  /* 00000D08    ".A...._C" */
   3.883 +    0x52,0x53,0x11,0x0D,0x0A,0x0A,0x47,0x01,  /* 00000D10    "RS....G." */
   3.884 +    0x61,0x00,0x61,0x00,0x00,0x01,0x79,0x00,  /* 00000D18    "a.a...y." */
   3.885 +    0x5B,0x82,0x31,0x50,0x53,0x32,0x4D,0x08,  /* 00000D20    "[.1PS2M." */
   3.886 +    0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,0x0F,  /* 00000D28    "_HID.A.." */
   3.887 +    0x13,0x08,0x5F,0x43,0x49,0x44,0x0C,0x41,  /* 00000D30    ".._CID.A" */
   3.888 +    0xD0,0x0F,0x13,0x14,0x09,0x5F,0x53,0x54,  /* 00000D38    "....._ST" */
   3.889 +    0x41,0x00,0xA4,0x0A,0x0F,0x08,0x5F,0x43,  /* 00000D40    "A....._C" */
   3.890 +    0x52,0x53,0x11,0x08,0x0A,0x05,0x22,0x00,  /* 00000D48    "RS...."." */
   3.891 +    0x10,0x79,0x00,0x5B,0x82,0x42,0x04,0x50,  /* 00000D50    ".y.[.B.P" */
   3.892 +    0x53,0x32,0x4B,0x08,0x5F,0x48,0x49,0x44,  /* 00000D58    "S2K._HID" */
   3.893 +    0x0C,0x41,0xD0,0x03,0x03,0x08,0x5F,0x43,  /* 00000D60    ".A...._C" */
   3.894 +    0x49,0x44,0x0C,0x41,0xD0,0x03,0x0B,0x14,  /* 00000D68    "ID.A...." */
   3.895 +    0x09,0x5F,0x53,0x54,0x41,0x00,0xA4,0x0A,  /* 00000D70    "._STA..." */
   3.896 +    0x0F,0x08,0x5F,0x43,0x52,0x53,0x11,0x18,  /* 00000D78    ".._CRS.." */
   3.897 +    0x0A,0x15,0x47,0x01,0x60,0x00,0x60,0x00,  /* 00000D80    "..G.`.`." */
   3.898 +    0x00,0x01,0x47,0x01,0x64,0x00,0x64,0x00,  /* 00000D88    "..G.d.d." */
   3.899 +    0x00,0x01,0x22,0x02,0x00,0x79,0x00,0x5B,  /* 00000D90    ".."..y.[" */
   3.900 +    0x82,0x3A,0x46,0x44,0x43,0x30,0x08,0x5F,  /* 00000D98    ".:FDC0._" */
   3.901 +    0x48,0x49,0x44,0x0C,0x41,0xD0,0x07,0x00,  /* 00000DA0    "HID.A..." */
   3.902 +    0x14,0x09,0x5F,0x53,0x54,0x41,0x00,0xA4,  /* 00000DA8    ".._STA.." */
   3.903 +    0x0A,0x0F,0x08,0x5F,0x43,0x52,0x53,0x11,  /* 00000DB0    "..._CRS." */
   3.904 +    0x1B,0x0A,0x18,0x47,0x01,0xF0,0x03,0xF0,  /* 00000DB8    "...G...." */
   3.905 +    0x03,0x01,0x06,0x47,0x01,0xF7,0x03,0xF7,  /* 00000DC0    "...G...." */
   3.906 +    0x03,0x01,0x01,0x22,0x40,0x00,0x2A,0x04,  /* 00000DC8    "..."@.*." */
   3.907 +    0x00,0x79,0x00,0x5B,0x82,0x46,0x04,0x55,  /* 00000DD0    ".y.[.F.U" */
   3.908 +    0x41,0x52,0x31,0x08,0x5F,0x48,0x49,0x44,  /* 00000DD8    "AR1._HID" */
   3.909 +    0x0C,0x41,0xD0,0x05,0x01,0x08,0x5F,0x55,  /* 00000DE0    ".A...._U" */
   3.910 +    0x49,0x44,0x01,0x14,0x19,0x5F,0x53,0x54,  /* 00000DE8    "ID..._ST" */
   3.911 +    0x41,0x00,0xA0,0x0D,0x93,0x5E,0x5E,0x5E,  /* 00000DF0    "A....^^^" */
   3.912 +    0x5E,0x55,0x41,0x52,0x31,0x00,0xA4,0x00,  /* 00000DF8    "^UAR1..." */
   3.913 +    0xA1,0x04,0xA4,0x0A,0x0F,0x08,0x5F,0x43,  /* 00000E00    "......_C" */
   3.914 +    0x52,0x53,0x11,0x10,0x0A,0x0D,0x47,0x01,  /* 00000E08    "RS....G." */
   3.915 +    0xF8,0x03,0xF8,0x03,0x08,0x08,0x22,0x10,  /* 00000E10    "......"." */
   3.916 +    0x00,0x79,0x00,0x5B,0x82,0x47,0x04,0x55,  /* 00000E18    ".y.[.G.U" */
   3.917 +    0x41,0x52,0x32,0x08,0x5F,0x48,0x49,0x44,  /* 00000E20    "AR2._HID" */
   3.918 +    0x0C,0x41,0xD0,0x05,0x01,0x08,0x5F,0x55,  /* 00000E28    ".A...._U" */
   3.919 +    0x49,0x44,0x0A,0x02,0x14,0x19,0x5F,0x53,  /* 00000E30    "ID...._S" */
   3.920 +    0x54,0x41,0x00,0xA0,0x0D,0x93,0x5E,0x5E,  /* 00000E38    "TA....^^" */
   3.921 +    0x5E,0x5E,0x55,0x41,0x52,0x32,0x00,0xA4,  /* 00000E40    "^^UAR2.." */
   3.922 +    0x00,0xA1,0x04,0xA4,0x0A,0x0F,0x08,0x5F,  /* 00000E48    "......._" */
   3.923 +    0x43,0x52,0x53,0x11,0x10,0x0A,0x0D,0x47,  /* 00000E50    "CRS....G" */
   3.924 +    0x01,0xF8,0x02,0xF8,0x02,0x08,0x08,0x22,  /* 00000E58    "......."" */
   3.925 +    0x08,0x00,0x79,0x00,0x5B,0x82,0x36,0x4C,  /* 00000E60    "..y.[.6L" */
   3.926 +    0x54,0x50,0x31,0x08,0x5F,0x48,0x49,0x44,  /* 00000E68    "TP1._HID" */
   3.927 +    0x0C,0x41,0xD0,0x04,0x00,0x08,0x5F,0x55,  /* 00000E70    ".A...._U" */
   3.928 +    0x49,0x44,0x0A,0x02,0x14,0x09,0x5F,0x53,  /* 00000E78    "ID...._S" */
   3.929 +    0x54,0x41,0x00,0xA4,0x0A,0x0F,0x08,0x5F,  /* 00000E80    "TA....._" */
   3.930 +    0x43,0x52,0x53,0x11,0x10,0x0A,0x0D,0x47,  /* 00000E88    "CRS....G" */
   3.931 +    0x01,0x78,0x03,0x78,0x03,0x08,0x08,0x22,  /* 00000E90    ".x.x..."" */
   3.932 +    0x80,0x00,0x79,0x00,0x5B,0x82,0x4D,0x07,  /* 00000E98    "..y.[.M." */
   3.933 +    0x53,0x31,0x46,0x30,0x08,0x5F,0x41,0x44,  /* 00000EA0    "S1F0._AD" */
   3.934 +    0x52,0x0C,0x00,0x00,0x06,0x00,0x08,0x5F,  /* 00000EA8    "R......_" */
   3.935 +    0x53,0x55,0x4E,0x01,0x14,0x13,0x5F,0x50,  /* 00000EB0    "SUN..._P" */
   3.936 +    0x53,0x30,0x00,0x70,0x0A,0x80,0x5C,0x2E,  /* 00000EB8    "S0.p..\." */
   3.937 +    0x5F,0x47,0x50,0x45,0x44,0x50,0x54,0x32,  /* 00000EC0    "_GPEDPT2" */
   3.938 +    0x14,0x13,0x5F,0x50,0x53,0x33,0x00,0x70,  /* 00000EC8    ".._PS3.p" */
   3.939 +    0x0A,0x83,0x5C,0x2E,0x5F,0x47,0x50,0x45,  /* 00000ED0    "..\._GPE" */
   3.940 +    0x44,0x50,0x54,0x32,0x14,0x1F,0x5F,0x45,  /* 00000ED8    "DPT2.._E" */
   3.941 +    0x4A,0x30,0x01,0x70,0x0A,0x88,0x5C,0x2E,  /* 00000EE0    "J0.p..\." */
   3.942 +    0x5F,0x47,0x50,0x45,0x44,0x50,0x54,0x32,  /* 00000EE8    "_GPEDPT2" */
   3.943 +    0x70,0x01,0x5C,0x2E,0x5F,0x47,0x50,0x45,  /* 00000EF0    "p.\._GPE" */
   3.944 +    0x50,0x48,0x50,0x31,0x14,0x1E,0x5F,0x53,  /* 00000EF8    "PHP1.._S" */
   3.945 +    0x54,0x41,0x00,0x70,0x0A,0x89,0x5C,0x2E,  /* 00000F00    "TA.p..\." */
   3.946 +    0x5F,0x47,0x50,0x45,0x44,0x50,0x54,0x32,  /* 00000F08    "_GPEDPT2" */
   3.947 +    0xA4,0x5C,0x2E,0x5F,0x47,0x50,0x45,0x50,  /* 00000F10    ".\._GPEP" */
   3.948 +    0x48,0x50,0x31,0x5B,0x82,0x4E,0x07,0x53,  /* 00000F18    "HP1[.N.S" */
   3.949 +    0x32,0x46,0x30,0x08,0x5F,0x41,0x44,0x52,  /* 00000F20    "2F0._ADR" */
   3.950 +    0x0C,0x00,0x00,0x07,0x00,0x08,0x5F,0x53,  /* 00000F28    "......_S" */
   3.951 +    0x55,0x4E,0x0A,0x02,0x14,0x13,0x5F,0x50,  /* 00000F30    "UN...._P" */
   3.952 +    0x53,0x30,0x00,0x70,0x0A,0x90,0x5C,0x2E,  /* 00000F38    "S0.p..\." */
   3.953 +    0x5F,0x47,0x50,0x45,0x44,0x50,0x54,0x32,  /* 00000F40    "_GPEDPT2" */
   3.954 +    0x14,0x13,0x5F,0x50,0x53,0x33,0x00,0x70,  /* 00000F48    ".._PS3.p" */
   3.955 +    0x0A,0x93,0x5C,0x2E,0x5F,0x47,0x50,0x45,  /* 00000F50    "..\._GPE" */
   3.956 +    0x44,0x50,0x54,0x32,0x14,0x1F,0x5F,0x45,  /* 00000F58    "DPT2.._E" */
   3.957 +    0x4A,0x30,0x01,0x70,0x0A,0x98,0x5C,0x2E,  /* 00000F60    "J0.p..\." */
   3.958 +    0x5F,0x47,0x50,0x45,0x44,0x50,0x54,0x32,  /* 00000F68    "_GPEDPT2" */
   3.959 +    0x70,0x01,0x5C,0x2E,0x5F,0x47,0x50,0x45,  /* 00000F70    "p.\._GPE" */
   3.960 +    0x50,0x48,0x50,0x32,0x14,0x1E,0x5F,0x53,  /* 00000F78    "PHP2.._S" */
   3.961 +    0x54,0x41,0x00,0x70,0x0A,0x99,0x5C,0x2E,  /* 00000F80    "TA.p..\." */
   3.962 +    0x5F,0x47,0x50,0x45,0x44,0x50,0x54,0x32,  /* 00000F88    "_GPEDPT2" */
   3.963 +    0xA4,0x5C,0x2E,0x5F,0x47,0x50,0x45,0x50,  /* 00000F90    ".\._GPEP" */
   3.964 +    0x48,0x50,0x32,0x10,0x4E,0x0B,0x5F,0x47,  /* 00000F98    "HP2.N._G" */
   3.965 +    0x50,0x45,0x5B,0x80,0x50,0x48,0x50,0x5F,  /* 00000FA0    "PE[.PHP_" */
   3.966 +    0x01,0x0B,0xC0,0x10,0x0A,0x03,0x5B,0x81,  /* 00000FA8    "......[." */
   3.967 +    0x15,0x50,0x48,0x50,0x5F,0x01,0x50,0x53,  /* 00000FB0    ".PHP_.PS" */
   3.968 +    0x54,0x41,0x08,0x50,0x48,0x50,0x31,0x08,  /* 00000FB8    "TA.PHP1." */
   3.969 +    0x50,0x48,0x50,0x32,0x08,0x5B,0x80,0x44,  /* 00000FC0    "PHP2.[.D" */
   3.970 +    0x47,0x31,0x5F,0x01,0x0B,0x44,0xB0,0x0A,  /* 00000FC8    "G1_..D.." */
   3.971 +    0x04,0x5B,0x81,0x10,0x44,0x47,0x31,0x5F,  /* 00000FD0    ".[..DG1_" */
   3.972 +    0x01,0x44,0x50,0x54,0x31,0x08,0x44,0x50,  /* 00000FD8    ".DPT1.DP" */
   3.973 +    0x54,0x32,0x08,0x14,0x46,0x07,0x5F,0x4C,  /* 00000FE0    "T2..F._L" */
   3.974 +    0x30,0x33,0x00,0x08,0x53,0x4C,0x54,0x5F,  /* 00000FE8    "03..SLT_" */
   3.975 +    0x00,0x08,0x45,0x56,0x54,0x5F,0x00,0x70,  /* 00000FF0    "..EVT_.p" */
   3.976 +    0x50,0x53,0x54,0x41,0x61,0x7A,0x61,0x0A,  /* 00000FF8    "PSTAaza." */
   3.977 +    0x04,0x53,0x4C,0x54,0x5F,0x7B,0x61,0x0A,  /* 00001000    ".SLT_{a." */
   3.978 +    0x0F,0x45,0x56,0x54,0x5F,0x70,0x53,0x4C,  /* 00001008    ".EVT_pSL" */
   3.979 +    0x54,0x5F,0x44,0x50,0x54,0x31,0x70,0x45,  /* 00001010    "T_DPT1pE" */
   3.980 +    0x56,0x54,0x5F,0x44,0x50,0x54,0x32,0xA0,  /* 00001018    "VT_DPT2." */
   3.981 +    0x1B,0x93,0x53,0x4C,0x54,0x5F,0x01,0x86,  /* 00001020    "..SLT_.." */
   3.982 +    0x5C,0x2F,0x03,0x5F,0x53,0x42,0x5F,0x50,  /* 00001028    "\/._SB_P" */
   3.983 +    0x43,0x49,0x30,0x53,0x31,0x46,0x30,0x45,  /* 00001030    "CI0S1F0E" */
   3.984 +    0x56,0x54,0x5F,0xA1,0x1E,0xA0,0x1C,0x93,  /* 00001038    "VT_....." */
   3.985 +    0x53,0x4C,0x54,0x5F,0x0A,0x02,0x86,0x5C,  /* 00001040    "SLT_...\" */
   3.986 +    0x2F,0x03,0x5F,0x53,0x42,0x5F,0x50,0x43,  /* 00001048    "/._SB_PC" */
   3.987 +    0x49,0x30,0x53,0x32,0x46,0x30,0x45,0x56,  /* 00001050    "I0S2F0EV" */
   3.988 +    0x54,0x5F,
   3.989  };
   3.990  int DsdtLen=sizeof(AmlCode);
     4.1 --- a/tools/firmware/hvmloader/acpi/static_tables.c	Tue Feb 19 09:28:09 2008 -0700
     4.2 +++ b/tools/firmware/hvmloader/acpi/static_tables.c	Tue Feb 19 11:14:40 2008 -0700
     4.3 @@ -59,9 +59,11 @@ struct acpi_20_fadt Fadt = {
     4.4      .pm1a_evt_blk = ACPI_PM1A_EVT_BLK_ADDRESS,
     4.5      .pm1a_cnt_blk = ACPI_PM1A_CNT_BLK_ADDRESS,
     4.6      .pm_tmr_blk = ACPI_PM_TMR_BLK_ADDRESS,
     4.7 +    .gpe0_blk = ACPI_GPE0_BLK_ADDRESS,
     4.8      .pm1_evt_len = ACPI_PM1A_EVT_BLK_BIT_WIDTH / 8,
     4.9      .pm1_cnt_len = ACPI_PM1A_CNT_BLK_BIT_WIDTH / 8,
    4.10      .pm_tmr_len = ACPI_PM_TMR_BLK_BIT_WIDTH / 8,
    4.11 +    .gpe0_blk_len = ACPI_GPE0_BLK_LEN,
    4.12  
    4.13      .p_lvl2_lat = 0x0fff, /* >100,  means we do not support C2 state */
    4.14      .p_lvl3_lat = 0x0fff, /* >1000, means we do not support C3 state */
     5.1 --- a/tools/ioemu/hw/pass-through.c	Tue Feb 19 09:28:09 2008 -0700
     5.2 +++ b/tools/ioemu/hw/pass-through.c	Tue Feb 19 11:14:40 2008 -0700
     5.3 @@ -29,33 +29,161 @@
     5.4  
     5.5  extern FILE *logfile;
     5.6  
     5.7 +struct php_dev {
     5.8 +    struct pt_dev *pt_dev;
     5.9 +    uint8_t valid;
    5.10 +    uint8_t r_bus;
    5.11 +    uint8_t r_dev;
    5.12 +    uint8_t r_func;
    5.13 +};
    5.14 +struct dpci_infos {
    5.15 +
    5.16 +    struct php_dev php_devs[PHP_SLOT_LEN];
    5.17 +
    5.18 +    PCIBus *e_bus;
    5.19 +    struct pci_access *pci_access;
    5.20 +
    5.21 +} dpci_infos;
    5.22 +
    5.23  static int token_value(char *token)
    5.24  {
    5.25 -    token = strchr(token, 'x') + 1;
    5.26      return strtol(token, NULL, 16);
    5.27  }
    5.28  
    5.29  static int next_bdf(char **str, int *seg, int *bus, int *dev, int *func)
    5.30  {
    5.31 -    char *token;
    5.32 +    char *token, *delim = ":.-";
    5.33  
    5.34 -    if ( !(*str) || !strchr(*str, ',') )
    5.35 +    if ( !(*str) ||
    5.36 +          ( !strchr(*str, ':') && !strchr(*str, '.')) )
    5.37          return 0;
    5.38  
    5.39 -    token = *str;
    5.40 -    *seg  = token_value(token);
    5.41 -    token = strchr(token, ',') + 1;
    5.42 +    token  = strsep(str, delim);
    5.43 +    *seg = token_value(token);
    5.44 +
    5.45 +    token  = strsep(str, delim);
    5.46      *bus  = token_value(token);
    5.47 -    token = strchr(token, ',') + 1;
    5.48 +
    5.49 +    token  = strsep(str, delim);
    5.50      *dev  = token_value(token);
    5.51 -    token = strchr(token, ',') + 1;
    5.52 +
    5.53 +    token  = strsep(str, delim);
    5.54      *func  = token_value(token);
    5.55 -    token = strchr(token, ',');
    5.56 -    *str = token ? token + 1 : NULL;
    5.57  
    5.58      return 1;
    5.59  }
    5.60  
    5.61 +/* Insert a new pass-through device into a specific pci slot.
    5.62 + * input  dom:bus:dev.func@slot, chose free one if slot == 0
    5.63 + * return -1: required slot not available
    5.64 + *         0: no free hotplug slots, but normal slot should okay
    5.65 + *        >0: the new hotplug slot
    5.66 + */
    5.67 +static int __insert_to_pci_slot(int bus, int dev, int func, int slot)
    5.68 +{
    5.69 +    int i, php_slot;
    5.70 +
    5.71 +    /* preferred virt pci slot */
    5.72 +    if ( slot >= PHP_SLOT_START && slot < PHP_SLOT_END )
    5.73 +    {
    5.74 +        php_slot = PCI_TO_PHP_SLOT(slot);
    5.75 +        if ( !dpci_infos.php_devs[php_slot].valid )
    5.76 +        {
    5.77 +            goto found;
    5.78 +        }
    5.79 +        else
    5.80 +            return -1;
    5.81 +    }
    5.82 +
    5.83 +    if ( slot != 0 )
    5.84 +        return -1;
    5.85 +
    5.86 +    /* slot == 0, pick up a free one */
    5.87 +    for ( i = 0; i < PHP_SLOT_LEN; i++ )
    5.88 +    {
    5.89 +        if ( !dpci_infos.php_devs[i].valid )
    5.90 +        {
    5.91 +            php_slot = i;
    5.92 +            goto found;
    5.93 +        }
    5.94 +    }
    5.95 +
    5.96 +    /* not found */
    5.97 +    return 0;
    5.98 +
    5.99 +found:
   5.100 +    dpci_infos.php_devs[php_slot].valid  = 1;
   5.101 +    dpci_infos.php_devs[php_slot].r_bus  = bus;
   5.102 +    dpci_infos.php_devs[php_slot].r_dev  = dev;
   5.103 +    dpci_infos.php_devs[php_slot].r_func = func;
   5.104 +    return PHP_TO_PCI_SLOT(php_slot);
   5.105 +}
   5.106 +
   5.107 +/* Insert a new pass-through device into a specific pci slot.
   5.108 + * input  dom:bus:dev.func@slot
   5.109 + */
   5.110 +int insert_to_pci_slot(char *bdf_slt)
   5.111 +{
   5.112 +    int seg, bus, dev, func, slot;
   5.113 +    char *bdf_str, *slt_str, *delim="@";
   5.114 +
   5.115 +    bdf_str = strsep(&bdf_slt, delim);
   5.116 +    slt_str = bdf_slt;
   5.117 +    slot = token_value(slt_str);
   5.118 +
   5.119 +    if ( !next_bdf(&bdf_str, &seg, &bus, &dev, &func))
   5.120 +    {
   5.121 +        return -1;
   5.122 +    }
   5.123 +
   5.124 +    return __insert_to_pci_slot(bus, dev, func, slot);
   5.125 +
   5.126 +}
   5.127 +
   5.128 +/* Test if a pci slot has a device
   5.129 + * 1:  present
   5.130 + * 0:  not present
   5.131 + * -1: invalide pci slot input
   5.132 + */
   5.133 +int test_pci_slot(int slot)
   5.134 +{
   5.135 +    int php_slot;
   5.136 +
   5.137 +    if ( slot < PHP_SLOT_START || slot >= PHP_SLOT_END )
   5.138 +        return -1;
   5.139 +
   5.140 +    php_slot = PCI_TO_PHP_SLOT(slot);
   5.141 +    if ( dpci_infos.php_devs[php_slot].valid )
   5.142 +        return 1;
   5.143 +    else
   5.144 +        return 0;
   5.145 +}
   5.146 +
   5.147 +/* find the pci slot for pass-through dev with specified BDF */
   5.148 +int bdf_to_slot(char *bdf_str)
   5.149 +{
   5.150 +    int seg, bus, dev, func, i;
   5.151 +
   5.152 +    if ( !next_bdf(&bdf_str, &seg, &bus, &dev, &func))
   5.153 +    {
   5.154 +        return -1;
   5.155 +    }
   5.156 +
   5.157 +    /* locate the virtual pci slot for this VTd device */
   5.158 +    for ( i = 0; i < PHP_SLOT_LEN; i++ )
   5.159 +    {
   5.160 +        if ( dpci_infos.php_devs[i].valid &&
   5.161 +           dpci_infos.php_devs[i].r_bus == bus &&
   5.162 +           dpci_infos.php_devs[i].r_dev  == dev &&
   5.163 +           dpci_infos.php_devs[i].r_func == func )
   5.164 +        {
   5.165 +            return PHP_TO_PCI_SLOT(i);
   5.166 +        }
   5.167 +    }
   5.168 +
   5.169 +    return -1;
   5.170 +}
   5.171 +
   5.172  /* Being called each time a mmio region has been updated */
   5.173  void pt_iomem_map(PCIDevice *d, int i, uint32_t e_phys, uint32_t e_size,
   5.174                    int type)
   5.175 @@ -269,15 +397,64 @@ static int pt_register_regions(struct pt
   5.176      return 0;
   5.177  }
   5.178  
   5.179 +static int pt_unregister_regions(struct pt_dev *assigned_device)
   5.180 +{
   5.181 +    int i, type, ret;
   5.182 +    uint32_t e_size;
   5.183 +    PCIDevice *d = (PCIDevice*)assigned_device;
   5.184 +
   5.185 +    for ( i = 0; i < PCI_NUM_REGIONS; i++ )
   5.186 +    {
   5.187 +        e_size = assigned_device->bases[i].e_size;
   5.188 +        if ( e_size == 0 )
   5.189 +            continue;
   5.190 +
   5.191 +        type = d->io_regions[i].type;
   5.192 +
   5.193 +        if ( type == PCI_ADDRESS_SPACE_MEM ||
   5.194 +             type == PCI_ADDRESS_SPACE_MEM_PREFETCH )
   5.195 +        {
   5.196 +            ret = xc_domain_memory_mapping(xc_handle, domid,
   5.197 +                    assigned_device->bases[i].e_physbase >> XC_PAGE_SHIFT,
   5.198 +                    assigned_device->bases[i].access.maddr >> XC_PAGE_SHIFT,
   5.199 +                    (e_size+XC_PAGE_SIZE-1) >> XC_PAGE_SHIFT,
   5.200 +                    DPCI_REMOVE_MAPPING);
   5.201 +            if ( ret != 0 )
   5.202 +            {
   5.203 +                PT_LOG("Error: remove old mem mapping failed!\n");
   5.204 +                continue;
   5.205 +            }
   5.206 +
   5.207 +        }
   5.208 +        else if ( type == PCI_ADDRESS_SPACE_IO )
   5.209 +        {
   5.210 +            ret = xc_domain_ioport_mapping(xc_handle, domid,
   5.211 +                        assigned_device->bases[i].e_physbase,
   5.212 +                        assigned_device->bases[i].access.pio_base,
   5.213 +                        e_size,
   5.214 +                        DPCI_REMOVE_MAPPING);
   5.215 +            if ( ret != 0 )
   5.216 +            {
   5.217 +                PT_LOG("Error: remove old io mapping failed!\n");
   5.218 +                continue;
   5.219 +            }
   5.220 +
   5.221 +        }
   5.222 +        
   5.223 +    }
   5.224 +
   5.225 +}
   5.226 +
   5.227  struct pt_dev * register_real_device(PCIBus *e_bus,
   5.228          const char *e_dev_name, int e_devfn, uint8_t r_bus, uint8_t r_dev,
   5.229          uint8_t r_func, uint32_t machine_irq, struct pci_access *pci_access)
   5.230  {
   5.231 -    int rc, i;
   5.232 +    int rc = -1, i;
   5.233      struct pt_dev *assigned_device = NULL;
   5.234      struct pci_dev *pci_dev;
   5.235      uint8_t e_device, e_intx;
   5.236      struct pci_config_cf8 machine_bdf;
   5.237 +    int free_pci_slot = -1;
   5.238  
   5.239      PT_LOG("Assigning real physical device %02x:%02x.%x ...\n",
   5.240          r_bus, r_dev, r_func);
   5.241 @@ -296,6 +473,15 @@ struct pt_dev * register_real_device(PCI
   5.242          return NULL;
   5.243      }
   5.244  
   5.245 +    if ( e_devfn == PT_VIRT_DEVFN_AUTO ) {
   5.246 +        /*indicate a static assignment(not hotplug), so find a free PCI hot plug slot */
   5.247 +        free_pci_slot = __insert_to_pci_slot(r_bus, r_dev, r_func, 0);
   5.248 +        if ( free_pci_slot > 0 )
   5.249 +            e_devfn = free_pci_slot  << 3;
   5.250 +        else
   5.251 +            PT_LOG("Error: no free virtual PCI hot plug slot, thus no live migration.\n");
   5.252 +    }
   5.253 +
   5.254      /* Register device */
   5.255      assigned_device = (struct pt_dev *) pci_register_device(e_bus, e_dev_name,
   5.256                                  sizeof(struct pt_dev), e_devfn,
   5.257 @@ -306,8 +492,12 @@ struct pt_dev * register_real_device(PCI
   5.258          return NULL;
   5.259      }
   5.260  
   5.261 +    if ( free_pci_slot > 0 )
   5.262 +        dpci_infos.php_devs[PCI_TO_PHP_SLOT(free_pci_slot)].pt_dev = assigned_device;
   5.263 +
   5.264      assigned_device->pci_dev = pci_dev;
   5.265  
   5.266 +
   5.267      /* Assign device */
   5.268      machine_bdf.reg = 0;
   5.269      machine_bdf.bus = r_bus;
   5.270 @@ -355,11 +545,96 @@ struct pt_dev * register_real_device(PCI
   5.271      return assigned_device;
   5.272  }
   5.273  
   5.274 +int unregister_real_device(int php_slot)
   5.275 +{
   5.276 +    struct php_dev *php_dev;
   5.277 +    struct pci_dev *pci_dev;
   5.278 +    uint8_t e_device, e_intx;
   5.279 +    struct pt_dev *assigned_device = NULL;
   5.280 +    uint32_t machine_irq;
   5.281 +    uint32_t bdf = 0;
   5.282 +    int rc = -1;
   5.283 +
   5.284 +    if ( php_slot < 0 || php_slot >= PHP_SLOT_LEN )
   5.285 +       return -1;
   5.286 +
   5.287 +    php_dev = &dpci_infos.php_devs[php_slot];
   5.288 +    assigned_device = php_dev->pt_dev;
   5.289 +
   5.290 +    if ( !assigned_device || !php_dev->valid )
   5.291 +        return -1;
   5.292 +
   5.293 +    pci_dev = assigned_device->pci_dev;
   5.294 +
   5.295 +    /* hide pci dev from qemu */
   5.296 +    pci_hide_device((PCIDevice*)assigned_device);
   5.297 +
   5.298 +    /* Unbind interrupt */
   5.299 +    e_device = (assigned_device->dev.devfn >> 3) & 0x1f;
   5.300 +    e_intx = assigned_device->dev.config[0x3d]-1;
   5.301 +    machine_irq = pci_dev->irq;
   5.302 +
   5.303 +    if ( machine_irq != 0 ) {
   5.304 +        rc = xc_domain_unbind_pt_irq(xc_handle, domid, machine_irq, PT_IRQ_TYPE_PCI, 0,
   5.305 +                                       e_device, e_intx, 0);
   5.306 +        if ( rc < 0 )
   5.307 +        {
   5.308 +            /* TBD: unregister device in case of an error */
   5.309 +            PT_LOG("Error: Unbinding of interrupt failed! rc=%d\n", rc);
   5.310 +        }
   5.311 +    }
   5.312 +
   5.313 +    /* unregister real device's MMIO/PIO BARs */
   5.314 +    pt_unregister_regions(assigned_device);
   5.315 +    
   5.316 +    /* deassign the dev to dom0 */
   5.317 +    bdf |= (pci_dev->bus  & 0xff) << 16;
   5.318 +    bdf |= (pci_dev->dev  & 0x1f) << 11;
   5.319 +    bdf |= (pci_dev->func & 0x1f) << 8;
   5.320 +    if ( (rc = xc_deassign_device(xc_handle, domid, bdf)) != 0)
   5.321 +        PT_LOG("Error: Revoking the device failed! rc=%d\n", rc);
   5.322 +
   5.323 +    /* mark this slot as free */
   5.324 +    php_dev->valid = 0;
   5.325 +    php_dev->pt_dev = NULL;
   5.326 +    qemu_free(assigned_device);
   5.327 +
   5.328 +    return 0;
   5.329 +}
   5.330 +
   5.331 +int power_on_php_slot(int php_slot)
   5.332 +{
   5.333 +    struct php_dev *php_dev = &dpci_infos.php_devs[php_slot];
   5.334 +    int pci_slot = php_slot + PHP_SLOT_START;
   5.335 +    struct pt_dev *pt_dev;
   5.336 +    pt_dev = 
   5.337 +        register_real_device(dpci_infos.e_bus,
   5.338 +            "DIRECT PCI",
   5.339 +            pci_slot << 3,
   5.340 +            php_dev->r_bus,
   5.341 +            php_dev->r_dev,
   5.342 +            php_dev->r_func,
   5.343 +            PT_MACHINE_IRQ_AUTO,
   5.344 +            dpci_infos.pci_access);
   5.345 +
   5.346 +    php_dev->pt_dev = pt_dev;
   5.347 +
   5.348 +    return 0;
   5.349 +
   5.350 +}
   5.351 +
   5.352 +int power_off_php_slot(int php_slot)
   5.353 +{
   5.354 +    return unregister_real_device(php_slot);
   5.355 +}
   5.356 +
   5.357  int pt_init(PCIBus *e_bus, char *direct_pci)
   5.358  {
   5.359 -    int seg, b, d, f;
   5.360 +    int seg, b, d, f, php_slot = 0;
   5.361      struct pt_dev *pt_dev;
   5.362      struct pci_access *pci_access;
   5.363 +    char *vslots;
   5.364 +    char slot_str[8];
   5.365  
   5.366      /* Initialize libpci */
   5.367      pci_access = pci_alloc();
   5.368 @@ -371,6 +646,19 @@ int pt_init(PCIBus *e_bus, char *direct_
   5.369      pci_init(pci_access);
   5.370      pci_scan_bus(pci_access);
   5.371  
   5.372 +    memset(&dpci_infos, 0, sizeof(struct dpci_infos));
   5.373 +    dpci_infos.pci_access = pci_access;
   5.374 +    dpci_infos.e_bus      = e_bus;
   5.375 +
   5.376 +    if ( strlen(direct_pci) == 0 ) {
   5.377 +        return 0;
   5.378 +    }
   5.379 +
   5.380 +    /* the virtual pci slots of all pass-through devs
   5.381 +     * with hex format: xx;xx...;
   5.382 +     */
   5.383 +    vslots = qemu_mallocz ( strlen(direct_pci) / 3 );
   5.384 +
   5.385      /* Assign given devices to guest */
   5.386      while ( next_bdf(&direct_pci, &seg, &b, &d, &f) )
   5.387      {
   5.388 @@ -382,8 +670,25 @@ int pt_init(PCIBus *e_bus, char *direct_
   5.389              PT_LOG("Error: Registration failed (%02x:%02x.%x)\n", b, d, f);
   5.390              return -1;
   5.391          }
   5.392 +
   5.393 +        /* Record the virtual slot info */
   5.394 +        if ( php_slot < PHP_SLOT_LEN &&
   5.395 +              dpci_infos.php_devs[php_slot].pt_dev == pt_dev )
   5.396 +        {
   5.397 +            sprintf(slot_str, "0x%x;", PHP_TO_PCI_SLOT(php_slot));
   5.398 +        }
   5.399 +        else
   5.400 +            sprintf(slot_str, "0x%x;", 0);
   5.401 +
   5.402 +        strcat(vslots, slot_str);
   5.403 +        php_slot++;
   5.404      }
   5.405  
   5.406 +    /* Write virtual slots info to xenstore for Control panel use */
   5.407 +    xenstore_write_vslots(vslots);
   5.408 +
   5.409 +    qemu_free(vslots);
   5.410 +
   5.411      /* Success */
   5.412      return 0;
   5.413  }
     6.1 --- a/tools/ioemu/hw/pc.c	Tue Feb 19 09:28:09 2008 -0700
     6.2 +++ b/tools/ioemu/hw/pc.c	Tue Feb 19 11:14:40 2008 -0700
     6.3 @@ -945,8 +945,10 @@ static void pc_init1(uint64_t ram_size, 
     6.4      }
     6.5  
     6.6  #ifdef CONFIG_PASSTHROUGH
     6.7 -    /* Pass-through Initialization */
     6.8 -    if ( pci_enabled && direct_pci )
     6.9 +    /* Pass-through Initialization
    6.10 +     * init libpci even direct_pci is null, as can hotplug a dev runtime
    6.11 +     */
    6.12 +    if ( pci_enabled )
    6.13      {
    6.14          rc = pt_init(pci_bus, direct_pci); 
    6.15          if ( rc < 0 )
     7.1 --- a/tools/ioemu/hw/pci.c	Tue Feb 19 09:28:09 2008 -0700
     7.2 +++ b/tools/ioemu/hw/pci.c	Tue Feb 19 11:14:40 2008 -0700
     7.3 @@ -107,7 +107,8 @@ PCIDevice *pci_register_device(PCIBus *b
     7.4      
     7.5      if (devfn < 0) {
     7.6          for(devfn = bus->devfn_min ; devfn < 256; devfn += 8) {
     7.7 -            if (!bus->devices[devfn])
     7.8 +            if ( !bus->devices[devfn] &&
     7.9 +                 !( devfn >= PHP_DEVFN_START && devfn < PHP_DEVFN_END ) )
    7.10                  goto found;
    7.11          }
    7.12          return NULL;
    7.13 @@ -132,6 +133,12 @@ PCIDevice *pci_register_device(PCIBus *b
    7.14      return pci_dev;
    7.15  }
    7.16  
    7.17 +void pci_hide_device(PCIDevice *pci_dev)
    7.18 +{
    7.19 +    PCIBus *bus = pci_dev->bus;
    7.20 +    bus->devices[pci_dev->devfn] = NULL;
    7.21 +}
    7.22 +
    7.23  void pci_register_io_region(PCIDevice *pci_dev, int region_num, 
    7.24                              uint32_t size, int type, 
    7.25                              PCIMapIORegionFunc *map_func)
     8.1 --- a/tools/ioemu/hw/piix4acpi.c	Tue Feb 19 09:28:09 2008 -0700
     8.2 +++ b/tools/ioemu/hw/piix4acpi.c	Tue Feb 19 11:14:40 2008 -0700
     8.3 @@ -24,6 +24,7 @@
     8.4   */
     8.5  
     8.6  #include "vl.h"
     8.7 +#include <xen/hvm/ioreq.h>
     8.8  
     8.9  /* PM1a_CNT bits, as defined in the ACPI specification. */
    8.10  #define SCI_EN            (1 <<  0)
    8.11 @@ -33,8 +34,22 @@
    8.12  
    8.13  /* Sleep state type codes as defined by the \_Sx objects in the DSDT. */
    8.14  /* These must be kept in sync with the DSDT (hvmloader/acpi/dsdt.asl) */
    8.15 +#define SLP_TYP_S4        (6 << 10)
    8.16  #define SLP_TYP_S5        (7 << 10)
    8.17  
    8.18 +#define ACPI_DBG_IO_ADDR  0xb044
    8.19 +#define ACPI_PHP_IO_ADDR  0x10c0
    8.20 +
    8.21 +#define PHP_EVT_ADD     0x0
    8.22 +#define PHP_EVT_REMOVE  0x3
    8.23 +
    8.24 +#define ACPI_SCI_IRQ 9
    8.25 +
    8.26 +/* The bit in GPE0_STS/EN to notify the pci hotplug event */
    8.27 +#define ACPI_PHP_GPE_BIT 3
    8.28 +
    8.29 +#define ACPI_PHP_SLOT_NUM PHP_SLOT_LEN
    8.30 +
    8.31  typedef struct AcpiDeviceState AcpiDeviceState;
    8.32  AcpiDeviceState *acpi_device_table;
    8.33  
    8.34 @@ -43,6 +58,27 @@ typedef struct PCIAcpiState {
    8.35      uint16_t pm1_control; /* pm1a_ECNT_BLK */
    8.36  } PCIAcpiState;
    8.37  
    8.38 +typedef struct GPEState {
    8.39 +    /* GPE0 block */
    8.40 +    uint8_t gpe0_sts[ACPI_GPE0_BLK_LEN / 2];
    8.41 +    uint8_t gpe0_en[ACPI_GPE0_BLK_LEN / 2];
    8.42 +
    8.43 +    /* SCI IRQ level */
    8.44 +    uint8_t sci_asserted;
    8.45 +
    8.46 +} GPEState;
    8.47 +
    8.48 +GPEState gpe_state;
    8.49 +
    8.50 +typedef struct PHPSlots {
    8.51 +    struct {
    8.52 +        uint8_t status;    /* Apaptor stats */
    8.53 +    } slot[ACPI_PHP_SLOT_NUM];
    8.54 +    uint8_t plug_evt;      /* slot|event slot:0-no event;1-1st. event:0-remove;1-add */
    8.55 +} PHPSlots;
    8.56 +
    8.57 +PHPSlots php_slots;
    8.58 +
    8.59  static void piix4acpi_save(QEMUFile *f, void *opaque)
    8.60  {
    8.61      PCIAcpiState *s = opaque;
    8.62 @@ -58,7 +94,7 @@ static int piix4acpi_load(QEMUFile *f, v
    8.63          return -EINVAL;
    8.64      ret = pci_device_load(&s->dev, f);
    8.65      if (ret < 0)
    8.66 -	return ret;
    8.67 +        return ret;
    8.68      qemu_get_be16s(f, &s->pm1_control);
    8.69      return 0;
    8.70  }
    8.71 @@ -76,6 +112,21 @@ static uint32_t acpiPm1Control_readb(voi
    8.72      return (uint8_t)(s->pm1_control & ~(GBL_RLS|SLP_EN));
    8.73  }
    8.74  
    8.75 +static void acpi_shutdown(uint32_t val)
    8.76 +{
    8.77 +    if (!(val & SLP_EN))
    8.78 +        return;
    8.79 +
    8.80 +    switch (val & SLP_TYP_Sx) {
    8.81 +    case SLP_TYP_S4:
    8.82 +    case SLP_TYP_S5:
    8.83 +        qemu_system_shutdown_request();
    8.84 +        break;
    8.85 +    default:
    8.86 +        break;
    8.87 +    }
    8.88 +}
    8.89 +
    8.90  static void acpiPm1ControlP1_writeb(void *opaque, uint32_t addr, uint32_t val)
    8.91  {
    8.92      PCIAcpiState *s = opaque;
    8.93 @@ -83,9 +134,7 @@ static void acpiPm1ControlP1_writeb(void
    8.94      val <<= 8;
    8.95      s->pm1_control = ((s->pm1_control & 0xff) | val) & ~SLP_EN;
    8.96  
    8.97 -    /* Check for power off request. */
    8.98 -    if ((val & (SLP_EN|SLP_TYP_Sx)) == (SLP_EN|SLP_TYP_S5))
    8.99 -        qemu_system_shutdown_request();
   8.100 +    acpi_shutdown(val);
   8.101  }
   8.102  
   8.103  static uint32_t acpiPm1ControlP1_readb(void *opaque, uint32_t addr)
   8.104 @@ -101,9 +150,7 @@ static void acpiPm1Control_writew(void *
   8.105  
   8.106      s->pm1_control = val & ~SLP_EN;
   8.107  
   8.108 -    /* Check for power off request. */
   8.109 -    if ((val & (SLP_EN|SLP_TYP_Sx)) == (SLP_EN|SLP_TYP_S5))
   8.110 -        qemu_system_shutdown_request();
   8.111 +    acpi_shutdown(val);
   8.112  }
   8.113  
   8.114  static uint32_t acpiPm1Control_readw(void *opaque, uint32_t addr)
   8.115 @@ -114,7 +161,7 @@ static uint32_t acpiPm1Control_readw(voi
   8.116  }
   8.117  
   8.118  static void acpi_map(PCIDevice *pci_dev, int region_num,
   8.119 -                    uint32_t addr, uint32_t size, int type)
   8.120 +                     uint32_t addr, uint32_t size, int type)
   8.121  {
   8.122      PCIAcpiState *d = (PCIAcpiState *)pci_dev;
   8.123  
   8.124 @@ -129,6 +176,326 @@ static void acpi_map(PCIDevice *pci_dev,
   8.125      register_ioport_read(addr + 4, 2, 2, acpiPm1Control_readw, d);
   8.126  }
   8.127  
   8.128 +#ifdef CONFIG_PASSTHROUGH
   8.129 +
   8.130 +static inline int test_bit(uint8_t *map, int bit)
   8.131 +{
   8.132 +    return ( map[bit / 8] & (1 << (bit % 8)) );
   8.133 +}
   8.134 +
   8.135 +static inline void set_bit(uint8_t *map, int bit)
   8.136 +{
   8.137 +    map[bit / 8] |= (1 << (bit % 8));
   8.138 +}
   8.139 +
   8.140 +static inline void clear_bit(uint8_t *map, int bit)
   8.141 +{
   8.142 +    map[bit / 8] &= ~(1 << (bit % 8));
   8.143 +}
   8.144 +
   8.145 +extern FILE *logfile;
   8.146 +static void acpi_dbg_writel(void *opaque, uint32_t addr, uint32_t val)
   8.147 +{
   8.148 +#if defined(DEBUG)
   8.149 +    printf("ACPI: DBG: 0x%08x\n", val);
   8.150 +#endif
   8.151 +    fprintf(logfile, "ACPI:debug: write addr=0x%x, val=0x%x.\n", addr, val);
   8.152 +}
   8.153 +
   8.154 +/*
   8.155 + * simple PCI hotplug controller IO 
   8.156 + * ACPI_PHP_IO_ADDR + :
   8.157 + * 0 - the hotplug description: slot(|event(remove/add); 
   8.158 + * 1 - 1st php slot ctr/sts reg
   8.159 + * 2 - 2nd php slot ctr/sts reg
   8.160 + * ......
   8.161 + */
   8.162 +static uint32_t acpi_php_readb(void *opaque, uint32_t addr)
   8.163 +{
   8.164 +    PHPSlots *hotplug_slots = opaque;
   8.165 +    int num;
   8.166 +    uint32_t val; 
   8.167 +
   8.168 +    switch (addr)
   8.169 +    {
   8.170 +    case ACPI_PHP_IO_ADDR:
   8.171 +        val = hotplug_slots->plug_evt;
   8.172 +        break;
   8.173 +    default:
   8.174 +        num = addr - ACPI_PHP_IO_ADDR - 1;
   8.175 +        val = hotplug_slots->slot[num].status;
   8.176 +    }
   8.177 +
   8.178 +    fprintf(logfile, "ACPI PCI hotplug: read addr=0x%x, val=0x%x.\n",
   8.179 +            addr, val);
   8.180 +
   8.181 +    return val;
   8.182 +}
   8.183 +
   8.184 +static void acpi_php_writeb(void *opaque, uint32_t addr, uint32_t val)
   8.185 +{
   8.186 +    PHPSlots *hotplug_slots = opaque;
   8.187 +    int php_slot;
   8.188 +
   8.189 +    fprintf(logfile, "ACPI PCI hotplug: write addr=0x%x, val=0x%x.\n",
   8.190 +            addr, val);
   8.191 +
   8.192 +    switch (addr)
   8.193 +    {
   8.194 +    case ACPI_PHP_IO_ADDR:
   8.195 +        break;
   8.196 +    default:
   8.197 +        php_slot = addr - ACPI_PHP_IO_ADDR - 1;
   8.198 +        if ( val == 0x1 ) { /* Eject command */
   8.199 +            /* make _STA of the slot 0 */
   8.200 +            hotplug_slots->slot[php_slot].status = 0;
   8.201 +
   8.202 +            /* clear the hotplug event */
   8.203 +            hotplug_slots->plug_evt = 0;
   8.204 +
   8.205 +            /* power off the slot */
   8.206 +            power_off_php_slot(php_slot);
   8.207 +
   8.208 +            /* signal the CP ACPI hot remove done. */
   8.209 +            xenstore_record_dm_state("pci-removed");
   8.210 +        }
   8.211 +    }
   8.212 +}
   8.213 +
   8.214 +static void pcislots_save(QEMUFile* f, void* opaque)
   8.215 +{
   8.216 +    PHPSlots *s = (PHPSlots*)opaque;
   8.217 +    int i;
   8.218 +    for ( i = 0; i < ACPI_PHP_SLOT_NUM; i++ ) {
   8.219 +        qemu_put_8s( f, &s->slot[i].status);
   8.220 +    }
   8.221 +    qemu_put_8s(f, &s->plug_evt);
   8.222 +}
   8.223 +
   8.224 +static int pcislots_load(QEMUFile* f, void* opaque, int version_id)
   8.225 +{
   8.226 +    PHPSlots *s = (PHPSlots*)opaque;
   8.227 +    int i;
   8.228 +    if (version_id != 1)
   8.229 +        return -EINVAL;
   8.230 +    for ( i = 0; i < ACPI_PHP_SLOT_NUM; i++ ) {
   8.231 +        qemu_get_8s( f, &s->slot[i].status);
   8.232 +    }
   8.233 +    qemu_get_8s(f, &s->plug_evt);
   8.234 +    return 0;
   8.235 +}
   8.236 +
   8.237 +static void php_slots_init(void)
   8.238 +{
   8.239 +    PHPSlots *slots = &php_slots;
   8.240 +    int i;
   8.241 +    memset(slots, 0, sizeof(PHPSlots));
   8.242 +
   8.243 +    /* update the pci slot status */
   8.244 +    for ( i = 0; i < PHP_SLOT_LEN; i++ ) {
   8.245 +        if ( test_pci_slot( PHP_TO_PCI_SLOT(i) ) == 1 )
   8.246 +            slots->slot[i].status = 0xf;
   8.247 +    }
   8.248 +
   8.249 +
   8.250 +    /* ACPI PCI hotplug controller */
   8.251 +    register_ioport_read(ACPI_PHP_IO_ADDR, ACPI_PHP_SLOT_NUM + 1, 1, acpi_php_readb, slots);
   8.252 +    register_ioport_write(ACPI_PHP_IO_ADDR, ACPI_PHP_SLOT_NUM + 1, 1, acpi_php_writeb, slots);
   8.253 +    register_savevm("pcislots", 0, 1, pcislots_save, pcislots_load, slots);
   8.254 +}
   8.255 +
   8.256 +/* GPEx_STS occupy 1st half of the block, while GPEx_EN 2nd half */
   8.257 +static uint32_t gpe_sts_read(void *opaque, uint32_t addr)
   8.258 +{
   8.259 +    GPEState *s = opaque;
   8.260 +
   8.261 +    return s->gpe0_sts[addr - ACPI_GPE0_BLK_ADDRESS];
   8.262 +}
   8.263 +
   8.264 +/* write 1 to clear specific GPE bits */
   8.265 +static void gpe_sts_write(void *opaque, uint32_t addr, uint32_t val)
   8.266 +{
   8.267 +    GPEState *s = opaque;
   8.268 +    int hotplugged = 0;
   8.269 +
   8.270 +    fprintf(logfile, "gpe_sts_write: addr=0x%x, val=0x%x.\n", addr, val);
   8.271 +
   8.272 +    hotplugged = test_bit(&s->gpe0_sts[0], ACPI_PHP_GPE_BIT);
   8.273 +    s->gpe0_sts[addr - ACPI_GPE0_BLK_ADDRESS] &= ~val;
   8.274 +    if ( s->sci_asserted &&
   8.275 +         hotplugged &&
   8.276 +         !test_bit(&s->gpe0_sts[0], ACPI_PHP_GPE_BIT)) {
   8.277 +        fprintf(logfile, "Clear the GPE0_STS bit for ACPI hotplug & deassert the IRQ.\n");
   8.278 +        pic_set_irq(ACPI_SCI_IRQ, 0);
   8.279 +    }
   8.280 +
   8.281 +}
   8.282 +
   8.283 +static uint32_t gpe_en_read(void *opaque, uint32_t addr)
   8.284 +{
   8.285 +    GPEState *s = opaque;
   8.286 +
   8.287 +    return s->gpe0_en[addr - (ACPI_GPE0_BLK_ADDRESS + ACPI_GPE0_BLK_LEN / 2)];
   8.288 +}
   8.289 +
   8.290 +/* write 0 to clear en bit */
   8.291 +static void gpe_en_write(void *opaque, uint32_t addr, uint32_t val)
   8.292 +{
   8.293 +    GPEState *s = opaque;
   8.294 +    int reg_count;
   8.295 +
   8.296 +    fprintf(logfile, "gpe_en_write: addr=0x%x, val=0x%x.\n", addr, val);
   8.297 +    reg_count = addr - (ACPI_GPE0_BLK_ADDRESS + ACPI_GPE0_BLK_LEN / 2);
   8.298 +    s->gpe0_en[reg_count] = val;
   8.299 +    /* If disable GPE bit right after generating SCI on it, 
   8.300 +     * need deassert the intr to avoid redundant intrs
   8.301 +     */
   8.302 +    if ( s->sci_asserted &&
   8.303 +         reg_count == (ACPI_PHP_GPE_BIT / 8) &&
   8.304 +         !(val & (1 << (ACPI_PHP_GPE_BIT % 8))) ) {
   8.305 +        fprintf(logfile, "deassert due to disable GPE bit.\n");
   8.306 +        s->sci_asserted = 0;
   8.307 +        pic_set_irq(ACPI_SCI_IRQ, 0);
   8.308 +    }
   8.309 +
   8.310 +}
   8.311 +
   8.312 +static void gpe_save(QEMUFile* f, void* opaque)
   8.313 +{
   8.314 +    GPEState *s = (GPEState*)opaque;
   8.315 +    int i;
   8.316 +
   8.317 +    for ( i = 0; i < ACPI_GPE0_BLK_LEN / 2; i++ ) {
   8.318 +        qemu_put_8s(f, &s->gpe0_sts[i]);
   8.319 +        qemu_put_8s(f, &s->gpe0_en[i]);
   8.320 +    }
   8.321 +
   8.322 +    qemu_put_8s(f, &s->sci_asserted);
   8.323 +    if ( s->sci_asserted ) {
   8.324 +        fprintf(logfile, "gpe_save with sci asserted!\n");
   8.325 +    }
   8.326 +}
   8.327 +
   8.328 +static int gpe_load(QEMUFile* f, void* opaque, int version_id)
   8.329 +{
   8.330 +    GPEState *s = (GPEState*)opaque;
   8.331 +    int i;
   8.332 +    if (version_id != 1)
   8.333 +        return -EINVAL;
   8.334 +
   8.335 +    for ( i = 0; i < ACPI_GPE0_BLK_LEN / 2; i++ ) {
   8.336 +        qemu_get_8s(f, &s->gpe0_sts[i]);
   8.337 +        qemu_get_8s(f, &s->gpe0_en[i]);
   8.338 +    }
   8.339 +
   8.340 +    qemu_get_8s(f, &s->sci_asserted);
   8.341 +    return 0;
   8.342 +}
   8.343 +
   8.344 +static void gpe_acpi_init(void)
   8.345 +{
   8.346 +    GPEState *s = &gpe_state;
   8.347 +    memset(s, 0, sizeof(GPEState));
   8.348 +
   8.349 +    register_ioport_read(ACPI_GPE0_BLK_ADDRESS,
   8.350 +                         ACPI_GPE0_BLK_LEN / 2,
   8.351 +                         1,
   8.352 +                         gpe_sts_read,
   8.353 +                         s);
   8.354 +    register_ioport_read(ACPI_GPE0_BLK_ADDRESS + ACPI_GPE0_BLK_LEN / 2,
   8.355 +                         ACPI_GPE0_BLK_LEN / 2,
   8.356 +                         1,
   8.357 +                         gpe_en_read,
   8.358 +                         s);
   8.359 +
   8.360 +    register_ioport_write(ACPI_GPE0_BLK_ADDRESS,
   8.361 +                          ACPI_GPE0_BLK_LEN / 2,
   8.362 +                          1,
   8.363 +                          gpe_sts_write,
   8.364 +                          s);
   8.365 +    register_ioport_write(ACPI_GPE0_BLK_ADDRESS + ACPI_GPE0_BLK_LEN / 2,
   8.366 +                          ACPI_GPE0_BLK_LEN / 2,
   8.367 +                          1,
   8.368 +                          gpe_en_write,
   8.369 +                          s);
   8.370 +
   8.371 +    register_savevm("gpe", 0, 1, gpe_save, gpe_load, s);
   8.372 +}
   8.373 +
   8.374 +static void acpi_sci_intr(GPEState *s)
   8.375 +{
   8.376 +    if ( !test_bit(&s->gpe0_sts[0], ACPI_PHP_GPE_BIT) &&
   8.377 +         test_bit(&s->gpe0_en[0], ACPI_PHP_GPE_BIT) ) {
   8.378 +
   8.379 +        set_bit(&s->gpe0_sts[0], ACPI_PHP_GPE_BIT);
   8.380 +        s->sci_asserted = 1;
   8.381 +        pic_set_irq(ACPI_SCI_IRQ, 1);
   8.382 +        fprintf(logfile, "generate a sci for PHP.\n");
   8.383 +    }
   8.384 +}
   8.385 +
   8.386 +void acpi_php_del(int pci_slot)
   8.387 +{
   8.388 +    GPEState *s = &gpe_state;
   8.389 +    PHPSlots *hotplug_slots = &php_slots;
   8.390 +    int php_slot = PCI_TO_PHP_SLOT(pci_slot);
   8.391 +
   8.392 +    if ( pci_slot < PHP_SLOT_START || pci_slot >= PHP_SLOT_END ) {
   8.393 +        fprintf(logfile, "not find the pci slot %d when hot remove.\n", pci_slot);
   8.394 +
   8.395 +        return;
   8.396 +    }
   8.397 +
   8.398 +    /* update the php controller status */
   8.399 +    hotplug_slots->plug_evt = (((php_slot+1) << 4) | PHP_EVT_REMOVE);
   8.400 +
   8.401 +    /* generate a SCI interrupt */
   8.402 +    acpi_sci_intr(s);
   8.403 +}
   8.404 +
   8.405 +void acpi_php_add(int pci_slot)
   8.406 +{
   8.407 +    GPEState *s = &gpe_state;
   8.408 +    PHPSlots *hotplug_slots = &php_slots;
   8.409 +    int php_slot = PCI_TO_PHP_SLOT(pci_slot);
   8.410 +    char ret_str[30];
   8.411 +
   8.412 +    if ( pci_slot < PHP_SLOT_START || pci_slot >= PHP_SLOT_END ) {
   8.413 +        fprintf(logfile, "hot add pci slot %d exceed.\n", pci_slot);
   8.414 +
   8.415 +        if ( pci_slot == 0 )
   8.416 +            sprintf(ret_str, "no free hotplug slots");
   8.417 +        else if ( pci_slot == -1 )
   8.418 +            sprintf(ret_str, "wrong bdf or vslot");
   8.419 +
   8.420 +        if ( strlen(ret_str) > 0 )
   8.421 +            xenstore_record_dm("parameter", ret_str);
   8.422 +
   8.423 +        return;
   8.424 +    }
   8.425 +
   8.426 +    /* update the php controller status */
   8.427 +    hotplug_slots->plug_evt = (((php_slot+1) << 4) | PHP_EVT_ADD);
   8.428 +
   8.429 +    /* update the slot status as present */
   8.430 +    hotplug_slots->slot[php_slot].status = 0xf;
   8.431 +
   8.432 +    /* power on the slot */
   8.433 +    power_on_php_slot(php_slot);
   8.434 +
   8.435 +    /* tell Control panel which slot for the new pass-throgh dev */
   8.436 +    sprintf(ret_str, "0x%x", pci_slot);
   8.437 +    xenstore_record_dm("parameter", ret_str);
   8.438 +
   8.439 +    /* signal the CP ACPI hot insert done */
   8.440 +    xenstore_record_dm_state("pci-inserted");
   8.441 +
   8.442 +    /* generate a SCI interrupt */
   8.443 +    acpi_sci_intr(s);
   8.444 +}
   8.445 +
   8.446 +#endif /* CONFIG_PASSTHROUGH */
   8.447 +
   8.448  /* PIIX4 acpi pci configuration space, func 2 */
   8.449  void pci_piix4_acpi_init(PCIBus *bus, int devfn)
   8.450  {
   8.451 @@ -168,5 +535,11 @@ void pci_piix4_acpi_init(PCIBus *bus, in
   8.452  
   8.453      acpi_map((PCIDevice *)d, 0, 0x1f40, 0x10, PCI_ADDRESS_SPACE_IO);
   8.454  
   8.455 +#ifdef CONFIG_PASSTHROUGH
   8.456 +    gpe_acpi_init();
   8.457 +    php_slots_init();
   8.458 +    register_ioport_write(ACPI_DBG_IO_ADDR, 4, 4, acpi_dbg_writel, d);
   8.459 +#endif
   8.460 +
   8.461      register_savevm("piix4acpi", 0, 1, piix4acpi_save, piix4acpi_load, d);
   8.462  }
     9.1 --- a/tools/ioemu/monitor.c	Tue Feb 19 09:28:09 2008 -0700
     9.2 +++ b/tools/ioemu/monitor.c	Tue Feb 19 11:14:40 2008 -0700
     9.3 @@ -1280,6 +1280,12 @@ static term_cmd_t term_cmds[] = {
     9.4        "device", "add USB device (e.g. 'host:bus.addr' or 'host:vendor_id:product_id')" },
     9.5      { "usb_del", "s", do_usb_del,
     9.6        "device", "remove USB device 'bus.addr'" },
     9.7 +#ifdef CONFIG_PHP_DEBUG
     9.8 +    { "pci_add", "s", do_pci_add,
     9.9 +      "device", "insert PCI pass-through device by BDF,e.g. (dom, bus, dev, func) by hex '0x0, 0x3, 0x0, 0x0'" },
    9.10 +    { "pci_del", "s", do_pci_del,
    9.11 +      "device", "remove PCI pass-through device by BDF,e.g. (dom, bus, dev, func) by hex '0x0, 0x3, 0x0, 0x0'" },
    9.12 +#endif
    9.13  #ifndef CONFIG_DM
    9.14      { "cpu", "i", do_cpu_set, 
    9.15        "index", "set the default CPU" },
    10.1 --- a/tools/ioemu/vl.c	Tue Feb 19 09:28:09 2008 -0700
    10.2 +++ b/tools/ioemu/vl.c	Tue Feb 19 11:14:40 2008 -0700
    10.3 @@ -4382,6 +4382,23 @@ void usb_info(void)
    10.4      }
    10.5  }
    10.6  
    10.7 +void do_pci_del(char *devname)
    10.8 +{
    10.9 +#ifdef CONFIG_PASSTHROUGH
   10.10 +    int pci_slot = bdf_to_slot(devname);
   10.11 +    acpi_php_del(pci_slot);
   10.12 +#endif
   10.13 +}
   10.14 +
   10.15 +void do_pci_add(char *devname)
   10.16 +{
   10.17 +#ifdef CONFIG_PASSTHROUGH
   10.18 +    int pci_slot = insert_to_pci_slot(devname);
   10.19 +    acpi_php_add(pci_slot);
   10.20 +#endif
   10.21 +}
   10.22 +
   10.23 +
   10.24  /***********************************************************/
   10.25  /* pid file */
   10.26  
   10.27 @@ -7067,7 +7084,7 @@ int main(int argc, char **argv)
   10.28  #endif
   10.29      sigset_t set;
   10.30      char qemu_dm_logfilename[128];
   10.31 -    const char *direct_pci = NULL;
   10.32 +    const char *direct_pci = direct_pci_str;
   10.33  
   10.34  #if !defined(__sun__) && !defined(CONFIG_STUBDOM)
   10.35      /* Maximise rlimits. Needed where default constraints are tight (*BSD). */
   10.36 @@ -7590,9 +7607,6 @@ int main(int argc, char **argv)
   10.37              case QEMU_OPTION_vncunused:
   10.38                  vncunused++;
   10.39                  break;
   10.40 -            case QEMU_OPTION_pci:
   10.41 -                direct_pci = optarg;
   10.42 -                break;
   10.43              }
   10.44          }
   10.45      }
    11.1 --- a/tools/ioemu/vl.h	Tue Feb 19 09:28:09 2008 -0700
    11.2 +++ b/tools/ioemu/vl.h	Tue Feb 19 11:14:40 2008 -0700
    11.3 @@ -817,11 +817,15 @@ struct PCIDevice {
    11.4      int irq_state[4];
    11.5  };
    11.6  
    11.7 +extern char direct_pci_str[];
    11.8 +
    11.9  PCIDevice *pci_register_device(PCIBus *bus, const char *name,
   11.10                                 int instance_size, int devfn,
   11.11                                 PCIConfigReadFunc *config_read, 
   11.12                                 PCIConfigWriteFunc *config_write);
   11.13  
   11.14 +void pci_hide_device(PCIDevice *pci_dev);
   11.15 +
   11.16  void pci_register_io_region(PCIDevice *pci_dev, int region_num, 
   11.17                              uint32_t size, int type, 
   11.18                              PCIMapIORegionFunc *map_func);
   11.19 @@ -850,6 +854,21 @@ void pci_info(void);
   11.20  PCIBus *pci_bridge_init(PCIBus *bus, int devfn, uint32_t id,
   11.21                          pci_map_irq_fn map_irq, const char *name);
   11.22  
   11.23 +/* PCI slot 6~7 support ACPI PCI hot plug */
   11.24 +#define PHP_SLOT_START  (6)
   11.25 +#define PHP_SLOT_END    (8)
   11.26 +#define PHP_SLOT_LEN    (PHP_SLOT_END - PHP_SLOT_START)
   11.27 +#define PHP_TO_PCI_SLOT(x) (x + PHP_SLOT_START)
   11.28 +#define PCI_TO_PHP_SLOT(x) (x - PHP_SLOT_START)
   11.29 +#define PHP_DEVFN_START (PHP_SLOT_START << 3)
   11.30 +#define PHP_DEVFN_END   (PHP_SLOT_END << 3)
   11.31 +
   11.32 +int insert_to_pci_slot(char*);
   11.33 +int test_pci_slot(int);
   11.34 +int bdf_to_slot(char*);
   11.35 +int power_on_php_slot(int);
   11.36 +int power_off_php_slot(int);
   11.37 +
   11.38  /* prep_pci.c */
   11.39  PCIBus *pci_prep_init(void);
   11.40  
   11.41 @@ -1120,6 +1139,9 @@ void tpm_tis_init(SetIRQFunc *set_irq, v
   11.42  
   11.43  /* piix4acpi.c */
   11.44  extern void pci_piix4_acpi_init(PCIBus *bus, int devfn);
   11.45 +void acpi_php_add(int);
   11.46 +void acpi_php_del(int);
   11.47 +
   11.48  
   11.49  /* pc.c */
   11.50  extern QEMUMachine pc_machine;
   11.51 @@ -1320,6 +1342,9 @@ void do_usb_add(const char *devname);
   11.52  void do_usb_del(const char *devname);
   11.53  void usb_info(void);
   11.54  
   11.55 +void do_pci_add(char *devname);
   11.56 +void do_pci_del(char *devname);
   11.57 +
   11.58  /* scsi-disk.c */
   11.59  enum scsi_reason {
   11.60      SCSI_REASON_DONE, /* Command complete.  */
   11.61 @@ -1466,10 +1491,12 @@ void readline_start(const char *prompt, 
   11.62  void xenstore_parse_domain_config(int domid);
   11.63  int xenstore_fd(void);
   11.64  void xenstore_process_event(void *opaque);
   11.65 +void xenstore_record_dm(char *subpath, char *state);
   11.66  void xenstore_record_dm_state(char *state);
   11.67  void xenstore_check_new_media_present(int timeout);
   11.68  void xenstore_write_vncport(int vnc_display);
   11.69  void xenstore_read_vncpasswd(int domid, char *pwbuf, size_t pwbuflen);
   11.70 +void xenstore_write_vslots(char *vslots);
   11.71  
   11.72  int xenstore_domain_has_devtype(struct xs_handle *handle,
   11.73                                  const char *devtype);
    12.1 --- a/tools/ioemu/xenstore.c	Tue Feb 19 09:28:09 2008 -0700
    12.2 +++ b/tools/ioemu/xenstore.c	Tue Feb 19 11:14:40 2008 -0700
    12.3 @@ -79,6 +79,8 @@ static void waitForDevice(char *fn)
    12.4      return;
    12.5  }
    12.6  
    12.7 +#define DIRECT_PCI_STR_LEN 160
    12.8 +char direct_pci_str[DIRECT_PCI_STR_LEN];
    12.9  void xenstore_parse_domain_config(int domid)
   12.10  {
   12.11      char **e = NULL;
   12.12 @@ -86,7 +88,7 @@ void xenstore_parse_domain_config(int do
   12.13      char *fpath = NULL, *bpath = NULL,
   12.14          *dev = NULL, *params = NULL, *type = NULL, *drv = NULL;
   12.15      int i, is_scsi, is_hdN = 0;
   12.16 -    unsigned int len, num, hd_index;
   12.17 +    unsigned int len, num, hd_index, pci_devid = 0;
   12.18      BlockDriverState *bs;
   12.19  
   12.20      for(i = 0; i < MAX_DISKS + MAX_SCSI_DISKS; i++)
   12.21 @@ -250,6 +252,38 @@ void xenstore_parse_domain_config(int do
   12.22          fprintf(logfile, "Watching %s\n", buf);
   12.23      }
   12.24  
   12.25 +    /* get the pci pass-through parameter */
   12.26 +    if (pasprintf(&buf, "/local/domain/0/backend/pci/%u/%u/num_devs",
   12.27 +                  domid, pci_devid) == -1)
   12.28 +        goto out;
   12.29 +
   12.30 +    free(params);
   12.31 +    params = xs_read(xsh, XBT_NULL, buf, &len);
   12.32 +    if (params == NULL)
   12.33 +        goto out;
   12.34 +    num = atoi(params);
   12.35 +
   12.36 +    for ( i = 0; i < num; i++ ) {
   12.37 +        if (pasprintf(&buf, "/local/domain/0/backend/pci/%u/%u/dev-%d",
   12.38 +                    domid, pci_devid, i) != -1) {
   12.39 +            free(dev);
   12.40 +            dev = xs_read(xsh, XBT_NULL, buf, &len);
   12.41 +
   12.42 +            if ( strlen(dev) + strlen(direct_pci_str) > DIRECT_PCI_STR_LEN ) {
   12.43 +                fprintf(stderr, "qemu: too many pci pass-through devices\n");
   12.44 +                memset(direct_pci_str, 0, DIRECT_PCI_STR_LEN);
   12.45 +                goto out;
   12.46 +            }
   12.47 +
   12.48 +            /* append to direct_pci_str */
   12.49 +            if ( dev ) {
   12.50 +                strcat(direct_pci_str, dev);
   12.51 +                strcat(direct_pci_str, "-");
   12.52 +            }
   12.53 +        }
   12.54 +    }
   12.55 +
   12.56 +
   12.57   out:
   12.58      free(type);
   12.59      free(params);
   12.60 @@ -388,7 +422,7 @@ void xenstore_process_logdirty_event(voi
   12.61  /* Accept state change commands from the control tools */
   12.62  static void xenstore_process_dm_command_event(void)
   12.63  {
   12.64 -    char *path = NULL, *command = NULL;
   12.65 +    char *path = NULL, *command = NULL, *par = NULL;
   12.66      unsigned int len;
   12.67      extern int suspend_requested;
   12.68  
   12.69 @@ -407,6 +441,34 @@ static void xenstore_process_dm_command_
   12.70      } else if (!strncmp(command, "continue", len)) {
   12.71          fprintf(logfile, "dm-command: continue after state save\n");
   12.72          suspend_requested = 0;
   12.73 +    } else if (!strncmp(command, "pci-rem", len)) {
   12.74 +        fprintf(logfile, "dm-command: hot remove pass-through pci dev \n");
   12.75 +
   12.76 +        if (pasprintf(&path, 
   12.77 +                      "/local/domain/0/device-model/%u/parameter", domid) == -1) {
   12.78 +            fprintf(logfile, "out of memory reading dm command parameter\n");
   12.79 +            goto out;
   12.80 +        }
   12.81 +        par = xs_read(xsh, XBT_NULL, path, &len);
   12.82 +        if (!par)
   12.83 +            goto out;
   12.84 +
   12.85 +        do_pci_del(par);
   12.86 +        free(par);
   12.87 +    } else if (!strncmp(command, "pci-ins", len)) {
   12.88 +        fprintf(logfile, "dm-command: hot insert pass-through pci dev \n");
   12.89 +
   12.90 +        if (pasprintf(&path, 
   12.91 +                      "/local/domain/0/device-model/%u/parameter", domid) == -1) {
   12.92 +            fprintf(logfile, "out of memory reading dm command parameter\n");
   12.93 +            goto out;
   12.94 +        }
   12.95 +        par = xs_read(xsh, XBT_NULL, path, &len);
   12.96 +        if (!par)
   12.97 +            goto out;
   12.98 +
   12.99 +        do_pci_add(par);
  12.100 +        free(par);
  12.101      } else {
  12.102          fprintf(logfile, "dm-command: unknown command\"%*s\"\n", len, command);
  12.103      }
  12.104 @@ -416,22 +478,27 @@ static void xenstore_process_dm_command_
  12.105      free(command);
  12.106  }
  12.107  
  12.108 -void xenstore_record_dm_state(char *state)
  12.109 +void xenstore_record_dm(char *subpath, char *state)
  12.110  {
  12.111      char *path = NULL;
  12.112  
  12.113      if (pasprintf(&path, 
  12.114 -                  "/local/domain/0/device-model/%u/state", domid) == -1) {
  12.115 -        fprintf(logfile, "out of memory recording dm state\n");
  12.116 +                  "/local/domain/0/device-model/%u/%s", domid, subpath) == -1) {
  12.117 +        fprintf(logfile, "out of memory recording dm \n");
  12.118          goto out;
  12.119      }
  12.120      if (!xs_write(xsh, XBT_NULL, path, state, strlen(state)))
  12.121 -        fprintf(logfile, "error recording dm state\n");
  12.122 +        fprintf(logfile, "error recording dm \n");
  12.123  
  12.124   out:
  12.125      free(path);
  12.126  }
  12.127  
  12.128 +void xenstore_record_dm_state(char *state)
  12.129 +{
  12.130 +    xenstore_record_dm("state", state);
  12.131 +}
  12.132 +
  12.133  void xenstore_process_event(void *opaque)
  12.134  {
  12.135      char **vec, *offset, *bpath = NULL, *buf = NULL, *drv = NULL, *image = NULL;
  12.136 @@ -522,6 +589,23 @@ void xenstore_write_vncport(int display)
  12.137      free(buf);
  12.138  }
  12.139  
  12.140 +void xenstore_write_vslots(char *vslots)
  12.141 +{
  12.142 +    char *path = NULL;
  12.143 +    int pci_devid = 0;
  12.144 +
  12.145 +    if (pasprintf(&path, 
  12.146 +                  "/local/domain/0/backend/pci/%u/%u/vslots", domid, pci_devid) == -1) {
  12.147 +        fprintf(logfile, "out of memory when updating vslots.\n");
  12.148 +        goto out;
  12.149 +    }
  12.150 +    if (!xs_write(xsh, XBT_NULL, path, vslots, strlen(vslots)))
  12.151 +        fprintf(logfile, "error updating vslots \n");
  12.152 +
  12.153 + out:
  12.154 +    free(path);
  12.155 +}
  12.156 +
  12.157  void xenstore_read_vncpasswd(int domid, char *pwbuf, size_t pwbuflen)
  12.158  {
  12.159      char *buf = NULL, *path, *uuid = NULL, *passwd = NULL;
    13.1 --- a/tools/libxc/xc_domain.c	Tue Feb 19 09:28:09 2008 -0700
    13.2 +++ b/tools/libxc/xc_domain.c	Tue Feb 19 11:14:40 2008 -0700
    13.3 @@ -762,6 +762,20 @@ int xc_test_assign_device(
    13.4      return do_domctl(xc_handle, &domctl);
    13.5  }
    13.6  
    13.7 +int xc_deassign_device(
    13.8 +    int xc_handle,
    13.9 +    uint32_t domid,
   13.10 +    uint32_t machine_bdf)
   13.11 +{
   13.12 +    DECLARE_DOMCTL;
   13.13 +
   13.14 +    domctl.cmd = XEN_DOMCTL_deassign_device;
   13.15 +    domctl.domain = domid;
   13.16 +    domctl.u.assign_device.machine_bdf = machine_bdf;
   13.17 + 
   13.18 +    return do_domctl(xc_handle, &domctl);
   13.19 +}
   13.20 +
   13.21  /* Pass-through: binds machine irq to guests irq */
   13.22  int xc_domain_bind_pt_irq(
   13.23      int xc_handle,
   13.24 @@ -797,6 +811,36 @@ int xc_domain_bind_pt_irq(
   13.25      return rc;
   13.26  }
   13.27  
   13.28 +int xc_domain_unbind_pt_irq(
   13.29 +    int xc_handle,
   13.30 +    uint32_t domid,
   13.31 +    uint8_t machine_irq,
   13.32 +    uint8_t irq_type,
   13.33 +    uint8_t bus,
   13.34 +    uint8_t device,
   13.35 +    uint8_t intx,
   13.36 +    uint8_t isa_irq)
   13.37 +{
   13.38 +    int rc;
   13.39 +    xen_domctl_bind_pt_irq_t * bind;
   13.40 +    DECLARE_DOMCTL;
   13.41 +
   13.42 +    domctl.cmd = XEN_DOMCTL_unbind_pt_irq;
   13.43 +    domctl.domain = (domid_t)domid;
   13.44 +
   13.45 +    bind = &(domctl.u.bind_pt_irq);
   13.46 +    bind->hvm_domid = domid;
   13.47 +    bind->irq_type = irq_type;
   13.48 +    bind->machine_irq = machine_irq;
   13.49 +    bind->u.pci.bus = bus;
   13.50 +    bind->u.pci.device = device;    
   13.51 +    bind->u.pci.intx = intx;
   13.52 +    bind->u.isa.isa_irq = isa_irq;
   13.53 +    
   13.54 +    rc = do_domctl(xc_handle, &domctl);
   13.55 +    return rc;
   13.56 +}
   13.57 +
   13.58  int xc_domain_bind_pt_pci_irq(
   13.59      int xc_handle,
   13.60      uint32_t domid,
    14.1 --- a/tools/libxc/xenctrl.h	Tue Feb 19 09:28:09 2008 -0700
    14.2 +++ b/tools/libxc/xenctrl.h	Tue Feb 19 11:14:40 2008 -0700
    14.3 @@ -914,6 +914,10 @@ int xc_test_assign_device(int xc_handle,
    14.4                            uint32_t domid,
    14.5                            uint32_t machine_bdf);
    14.6  
    14.7 +int xc_deassign_device(int xc_handle,
    14.8 +                     uint32_t domid,
    14.9 +                     uint32_t machine_bdf);
   14.10 +
   14.11  int xc_domain_memory_mapping(int xc_handle,
   14.12                               uint32_t domid,
   14.13                               unsigned long first_gfn,
   14.14 @@ -937,6 +941,15 @@ int xc_domain_bind_pt_irq(int xc_handle,
   14.15                            uint8_t intx,
   14.16                            uint8_t isa_irq);
   14.17  
   14.18 +int xc_domain_unbind_pt_irq(int xc_handle,
   14.19 +                          uint32_t domid,
   14.20 +                          uint8_t machine_irq,
   14.21 +                          uint8_t irq_type,
   14.22 +                          uint8_t bus,
   14.23 +                          uint8_t device,
   14.24 +                          uint8_t intx,
   14.25 +                          uint8_t isa_irq);
   14.26 +
   14.27  int xc_domain_bind_pt_pci_irq(int xc_handle,
   14.28                                uint32_t domid,
   14.29                                uint8_t machine_irq,
    15.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Tue Feb 19 09:28:09 2008 -0700
    15.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Tue Feb 19 11:14:40 2008 -0700
    15.3 @@ -516,6 +516,131 @@ class XendDomainInfo:
    15.4          asserts.isCharConvertible(key)
    15.5          self.storeDom("control/sysrq", '%c' % key)
    15.6  
    15.7 +    def sync_pcidev_info(self):
    15.8 +
    15.9 +        if not self.info.is_hvm():
   15.10 +            return
   15.11 +
   15.12 +        devid = '0'
   15.13 +        dev_info = self._getDeviceInfo_pci(devid)
   15.14 +        if dev_info is None:
   15.15 +            return
   15.16 +
   15.17 +        # get the virtual slot info from xenstore
   15.18 +        dev_uuid = sxp.child_value(dev_info, 'uuid')
   15.19 +        pci_conf = self.info['devices'][dev_uuid][1]
   15.20 +        pci_devs = pci_conf['devs']
   15.21 +
   15.22 +        count = 0
   15.23 +        vslots = None
   15.24 +        while vslots is None and count < 20:
   15.25 +            vslots = xstransact.Read("/local/domain/0/backend/pci/%u/%s/vslots"
   15.26 +                              % (self.getDomid(), devid))
   15.27 +            time.sleep(0.1)
   15.28 +            count += 1
   15.29 +        if vslots is None:
   15.30 +            log.error("Device model didn't tell the vslots for PCI device")
   15.31 +            return
   15.32 +
   15.33 +        #delete last delim
   15.34 +        if vslots[-1] == ";":
   15.35 +            vslots = vslots[:-1]
   15.36 +
   15.37 +        slot_list = vslots.split(';')
   15.38 +        if len(slot_list) != len(pci_devs):
   15.39 +            log.error("Device model's pci dev num dismatch")
   15.40 +            return
   15.41 +
   15.42 +        #update the vslot info
   15.43 +        count = 0;
   15.44 +        for x in pci_devs:
   15.45 +            x['vslt'] = slot_list[count]
   15.46 +            count += 1
   15.47 +
   15.48 +
   15.49 +    def pci_device_create(self, dev_config):
   15.50 +        log.debug("XendDomainInfo.pci_device_create: %s" % scrub_password(dev_config))
   15.51 +
   15.52 +        if not self.info.is_hvm():
   15.53 +            raise VmError("only HVM guest support pci attach")
   15.54 +
   15.55 +        #all the PCI devs share one conf node
   15.56 +        devid = '0'
   15.57 +
   15.58 +        dev_type = sxp.name(dev_config)
   15.59 +        new_devs = sxp.child_value(dev_config, 'devs')
   15.60 +        new_dev = new_devs[0]
   15.61 +        dev_info = self._getDeviceInfo_pci(devid)#from self.info['devices']
   15.62 +
   15.63 +        #check conflict before trigger hotplug event
   15.64 +        if dev_info is not None:
   15.65 +            dev_uuid = sxp.child_value(dev_info, 'uuid')
   15.66 +            pci_conf = self.info['devices'][dev_uuid][1]
   15.67 +            pci_devs = pci_conf['devs']
   15.68 +            for x in pci_devs:
   15.69 +                if (int(x['vslt'], 16) == int(new_dev['vslt'], 16) and
   15.70 +                   int(x['vslt'], 16) != 0 ):
   15.71 +                    raise VmError("vslot %s already have a device." % (new_dev['vslt']))
   15.72 +
   15.73 +                if (int(x['domain'], 16) == int(new_dev['domain'], 16) and
   15.74 +                   int(x['bus'], 16)    == int(new_dev['bus'], 16) and
   15.75 +                   int(x['slot'], 16)   == int(new_dev['slot'], 16) and
   15.76 +                   int(x['func'], 16)   == int(new_dev['func'], 16) ):
   15.77 +                    raise VmError("device is already inserted")
   15.78 +
   15.79 +        # Test whether the devices can be assigned with VT-d
   15.80 +        pci_str = "%s, %s, %s, %s" % (new_dev['domain'],
   15.81 +                new_dev['bus'],
   15.82 +                new_dev['slot'],
   15.83 +                new_dev['func'])
   15.84 +        bdf = xc.test_assign_device(self.domid, pci_str)
   15.85 +        if bdf != 0:
   15.86 +            bus = (bdf >> 16) & 0xff
   15.87 +            devfn = (bdf >> 8) & 0xff
   15.88 +            dev = (devfn >> 3) & 0x1f
   15.89 +            func = devfn & 0x7
   15.90 +            raise VmError("Fail to hot insert device(%x:%x.%x): maybe VT-d is "
   15.91 +                          "not enabled, or the device is not exist, or it "
   15.92 +                          "has already been assigned to other domain"
   15.93 +                          % (bus, dev, func))
   15.94 +
   15.95 +        bdf_str = "%s:%s:%s.%s@%s" % (new_dev['domain'],
   15.96 +                new_dev['bus'],
   15.97 +                new_dev['slot'],
   15.98 +                new_dev['func'],
   15.99 +                new_dev['vslt'])
  15.100 +        self.image.signalDeviceModel('pci-ins', 'pci-inserted', bdf_str)
  15.101 +
  15.102 +        # update the virtual pci slot
  15.103 +        vslt = xstransact.Read("/local/domain/0/device-model/%i/parameter"
  15.104 +                          % self.getDomid())
  15.105 +        new_dev['vslt'] = vslt
  15.106 +
  15.107 +        if dev_info is None:
  15.108 +            # create a new one from scrach
  15.109 +            dev_cfg_sxp = [dev_type,
  15.110 +                ['dev',
  15.111 +                  ['domain', new_dev['domain']],
  15.112 +                  ['bus',    new_dev['bus']],
  15.113 +                  ['slot',   new_dev['slot']],
  15.114 +                  ['func',   new_dev['func']],
  15.115 +                  ['vslt',   new_dev['vslt']]
  15.116 +                ]]
  15.117 +            dev_uuid = self.info.device_add(dev_type, cfg_sxp = dev_cfg_sxp)
  15.118 +            dev_config_dict = self.info['devices'][dev_uuid][1]
  15.119 +            try:
  15.120 +                dev_config_dict['devid'] = devid = \
  15.121 +                    self._createDevice(dev_type, dev_config_dict)
  15.122 +                self._waitForDevice(dev_type, devid)
  15.123 +            except VmError, ex:
  15.124 +                raise ex
  15.125 +        else:
  15.126 +            # update the pci config to add the new dev
  15.127 +            pci_devs.extend(new_devs)
  15.128 +            self._reconfigureDevice('pci', devid, pci_conf)
  15.129 +
  15.130 +        return self.getDeviceController('pci').sxpr(devid)
  15.131 +
  15.132      def device_create(self, dev_config):
  15.133          """Create a new device.
  15.134  
  15.135 @@ -524,6 +649,11 @@ class XendDomainInfo:
  15.136          """
  15.137          log.debug("XendDomainInfo.device_create: %s" % scrub_password(dev_config))
  15.138          dev_type = sxp.name(dev_config)
  15.139 +
  15.140 +        if dev_type == 'pci':
  15.141 +            rc = self.pci_device_create(dev_config)
  15.142 +            return rc
  15.143 +
  15.144          dev_uuid = self.info.device_add(dev_type, cfg_sxp = dev_config)
  15.145          dev_config_dict = self.info['devices'][dev_uuid][1]
  15.146          log.debug("XendDomainInfo.device_create: %s" % scrub_password(dev_config_dict))
  15.147 @@ -584,10 +714,65 @@ class XendDomainInfo:
  15.148          for devclass in XendDevices.valid_devices():
  15.149              self.getDeviceController(devclass).waitForDevices()
  15.150  
  15.151 +    def destroyPCIDevice(self, vslot):
  15.152 +        log.debug("destroyPCIDevice called %s", vslot)
  15.153 +
  15.154 +        if not self.info.is_hvm():
  15.155 +            raise VmError("only HVM guest support pci detach")
  15.156 +
  15.157 +        #all the PCI devs share one conf node
  15.158 +        devid = '0'
  15.159 +        vslot = int(vslot)
  15.160 +        dev_info = self._getDeviceInfo_pci('0')#from self.info['devices']
  15.161 +        dev_uuid = sxp.child_value(dev_info, 'uuid')
  15.162 +
  15.163 +        #delete the pci bdf config under the pci device
  15.164 +        pci_conf = self.info['devices'][dev_uuid][1]
  15.165 +        pci_len = len(pci_conf['devs'])
  15.166 +
  15.167 +        #find the pass-through device with the virtual slot
  15.168 +        devnum = 0
  15.169 +        for x in pci_conf['devs']:
  15.170 +            if int(x['vslt'], 16) == vslot:
  15.171 +                break
  15.172 +            devnum += 1
  15.173 +
  15.174 +        if devnum >= pci_len:
  15.175 +            raise VmError("Device @ vslot 0x%x doesn't exist." % (vslot))
  15.176 +
  15.177 +        if vslot == 0:
  15.178 +            raise VmError("Device @ vslot 0x%x do not support hotplug." % (vslot))
  15.179 +
  15.180 +        bdf_str = "%s:%s:%s.%s" % (x['domain'], x['bus'], x['slot'], x['func'])
  15.181 +        log.info("destroyPCIDevice:%s:%s!", x, bdf_str)
  15.182 +
  15.183 +        self.image.signalDeviceModel('pci-rem', 'pci-removed', bdf_str)
  15.184 +
  15.185 +        if pci_len > 1:
  15.186 +            del pci_conf['devs'][devnum]
  15.187 +            self._reconfigureDevice('pci', devid, pci_conf)
  15.188 +        else:
  15.189 +            self.getDeviceController('pci').destroyDevice(devid, True)
  15.190 +            del self.info['devices'][dev_uuid]
  15.191 +            platform = self.info['platform']
  15.192 +            orig_dev_num = len(platform['pci'])
  15.193 +
  15.194 +            #need remove the pci config
  15.195 +            #TODO:can use this to keep some info to ask high level management tools to hot insert a new passthrough dev after migration
  15.196 +            if orig_dev_num != 0:
  15.197 +#                platform['pci'] = ["%dDEVs" % orig_dev_num]
  15.198 +                platform['pci'] = []
  15.199 +
  15.200 +        return 0
  15.201 +
  15.202      def destroyDevice(self, deviceClass, devid, force = False, rm_cfg = False):
  15.203          log.debug("XendDomainInfo.destroyDevice: deviceClass = %s, device = %s",
  15.204                    deviceClass, devid)
  15.205  
  15.206 +        if deviceClass == 'dpci':
  15.207 +            rc = self.destroyPCIDevice(devid)
  15.208 +            return rc
  15.209 +
  15.210          if rm_cfg:
  15.211              # Convert devid to device number.  A device number is
  15.212              # needed to remove its configuration.
  15.213 @@ -647,6 +832,14 @@ class XendDomainInfo:
  15.214          return rc
  15.215  
  15.216      def getDeviceSxprs(self, deviceClass):
  15.217 +        if deviceClass == 'pci':
  15.218 +            dev_info = self._getDeviceInfo_pci('0')#from self.info['devices']
  15.219 +            if dev_info is None:
  15.220 +                return []
  15.221 +            dev_uuid = sxp.child_value(dev_info, 'uuid')
  15.222 +            pci_devs = self.info['devices'][dev_uuid][1]['devs']
  15.223 +            pci_len = len(pci_devs)
  15.224 +            return pci_devs
  15.225          if self._stateGet() in (DOM_STATE_RUNNING, DOM_STATE_PAUSED, DOM_STATE_CRASHED):
  15.226              return self.getDeviceController(deviceClass).sxprs()
  15.227          else:
  15.228 @@ -683,6 +876,12 @@ class XendDomainInfo:
  15.229              if devid == dev:
  15.230                  return dev_info
  15.231  
  15.232 +    def _getDeviceInfo_pci(self, devid):
  15.233 +        for dev_type, dev_info in self.info.all_devices_sxpr():
  15.234 +            if dev_type != 'pci':
  15.235 +                continue
  15.236 +            return dev_info
  15.237 +        return None
  15.238  
  15.239      def setMemoryTarget(self, target):
  15.240          """Set the memory target of this domain.
  15.241 @@ -1543,6 +1742,9 @@ class XendDomainInfo:
  15.242          if self.image:
  15.243              self.image.createDeviceModel()
  15.244  
  15.245 +        #if have pass-through devs, need the virtual pci slots info from qemu
  15.246 +        self.sync_pcidev_info()
  15.247 +
  15.248      def _releaseDevices(self, suspend = False):
  15.249          """Release all domain's devices.  Nothrow guarantee."""
  15.250          if self.image:
    16.1 --- a/tools/python/xen/xend/image.py	Tue Feb 19 09:28:09 2008 -0700
    16.2 +++ b/tools/python/xen/xend/image.py	Tue Feb 19 11:14:40 2008 -0700
    16.3 @@ -300,23 +300,42 @@ class ImageHandler:
    16.4          self.vm.storeDom("image/device-model-pid", self.pid)
    16.5          log.info("device model pid: %d", self.pid)
    16.6  
    16.7 -    def saveDeviceModel(self):
    16.8 +    def signalDeviceModel(self, cmd, ret, par = None):
    16.9          if self.device_model is None:
   16.10              return
   16.11 -        # Signal the device model to pause itself and save its state
   16.12 +        # Signal the device model to for action
   16.13 +        if cmd is '' or ret is '':
   16.14 +            raise VmError('need valid command and result when signal device model')
   16.15 +
   16.16 +        orig_state = xstransact.Read("/local/domain/0/device-model/%i/state"
   16.17 +                                % self.vm.getDomid())
   16.18 +
   16.19 +        if par is not None:
   16.20 +            xstransact.Store("/local/domain/0/device-model/%i"
   16.21 +                             % self.vm.getDomid(), ('parameter', par))
   16.22 +
   16.23          xstransact.Store("/local/domain/0/device-model/%i"
   16.24 -                         % self.vm.getDomid(), ('command', 'save'))
   16.25 +                         % self.vm.getDomid(), ('command', cmd))
   16.26          # Wait for confirmation.  Could do this with a watch but we'd
   16.27          # still end up spinning here waiting for the watch to fire. 
   16.28          state = ''
   16.29          count = 0
   16.30 -        while state != 'paused':
   16.31 +        while state != ret:
   16.32              state = xstransact.Read("/local/domain/0/device-model/%i/state"
   16.33                                      % self.vm.getDomid())
   16.34              time.sleep(0.1)
   16.35              count += 1
   16.36              if count > 100:
   16.37 -                raise VmError('Timed out waiting for device model to save')
   16.38 +                raise VmError('Timed out waiting for device model action')
   16.39 +
   16.40 +        #resotre orig state
   16.41 +        xstransact.Store("/local/domain/0/device-model/%i"
   16.42 +                         % self.vm.getDomid(), ('state', orig_state))
   16.43 +        log.info("signalDeviceModel:restore dm state to %s", orig_state)
   16.44 +
   16.45 +    def saveDeviceModel(self):
   16.46 +        # Signal the device model to pause itself and save its state
   16.47 +        self.signalDeviceModel('save', 'paused')
   16.48  
   16.49      def resumeDeviceModel(self):
   16.50          if self.device_model is None:
   16.51 @@ -479,7 +498,7 @@ class HVMImageHandler(ImageHandler):
   16.52  
   16.53          dmargs = [ 'boot', 'fda', 'fdb', 'soundhw',
   16.54                     'localtime', 'serial', 'stdvga', 'isa',
   16.55 -                   'acpi', 'usb', 'usbdevice', 'pci' ]
   16.56 +                   'acpi', 'usb', 'usbdevice' ]
   16.57  
   16.58          for a in dmargs:
   16.59              v = vmConfig['platform'].get(a)
    17.1 --- a/tools/python/xen/xend/server/DevController.py	Tue Feb 19 09:28:09 2008 -0700
    17.2 +++ b/tools/python/xen/xend/server/DevController.py	Tue Feb 19 11:14:40 2008 -0700
    17.3 @@ -412,6 +412,14 @@ class DevController:
    17.4          return result
    17.5  
    17.6  
    17.7 +    def removeBackend(self, devid, *args):
    17.8 +        frontpath = self.frontendPath(devid)
    17.9 +        backpath = xstransact.Read(frontpath, "backend")
   17.10 +        if backpath:
   17.11 +            return xstransact.Remove(backpath, *args)
   17.12 +        else:
   17.13 +            raise VmError("Device %s not connected" % devid)
   17.14 +
   17.15      def readBackend(self, devid, *args):
   17.16          frontpath = self.frontendPath(devid)
   17.17          backpath = xstransact.Read(frontpath, "backend")
    18.1 --- a/tools/python/xen/xend/server/pciif.py	Tue Feb 19 09:28:09 2008 -0700
    18.2 +++ b/tools/python/xen/xend/server/pciif.py	Tue Feb 19 11:14:40 2008 -0700
    18.3 @@ -18,6 +18,7 @@
    18.4  
    18.5  
    18.6  import types
    18.7 +import time
    18.8  
    18.9  from xen.xend import sxp
   18.10  from xen.xend.XendError import VmError
   18.11 @@ -62,25 +63,62 @@ class PciController(DevController):
   18.12              
   18.13          back = {}
   18.14          pcidevid = 0
   18.15 +        vslots = ""
   18.16          for pci_config in config.get('devs', []):
   18.17              domain = parse_hex(pci_config.get('domain', 0))
   18.18              bus = parse_hex(pci_config.get('bus', 0))
   18.19              slot = parse_hex(pci_config.get('slot', 0))
   18.20              func = parse_hex(pci_config.get('func', 0))            
   18.21 +
   18.22 +            vslt = pci_config.get('vslt')
   18.23 +            if vslt is not None:
   18.24 +                vslots = vslots + vslt + ";"
   18.25 +
   18.26              self.setupDevice(domain, bus, slot, func)
   18.27              back['dev-%i' % pcidevid] = "%04x:%02x:%02x.%02x" % \
   18.28                                          (domain, bus, slot, func)
   18.29              pcidevid += 1
   18.30  
   18.31 +        if vslots != "":
   18.32 +            back['vslots'] = vslots
   18.33 +
   18.34          back['num_devs']=str(pcidevid)
   18.35          back['uuid'] = config.get('uuid','')
   18.36          return (0, back, {})
   18.37  
   18.38 +    def reconfigureDevice(self, _, config):
   18.39 +        """@see DevController.reconfigureDevice"""
   18.40 +        #currently only support config changes by hot insert/remove pass-through dev
   18.41 +        #delete all the devices in xenstore
   18.42 +        (devid, new_back, new_front) = self.getDeviceDetails(config)
   18.43 +        num_devs = self.readBackend(devid, 'num_devs')
   18.44 +        for i in range(int(num_devs)):
   18.45 +            self.removeBackend(devid, 'dev-%d' % i)
   18.46 +        self.removeBackend(devid, 'num_devs')
   18.47 +
   18.48 +        #create new devices config
   18.49 +        num_devs = new_back['num_devs']
   18.50 +        for i in range(int(num_devs)):
   18.51 +            dev_no = 'dev-%d' % i
   18.52 +            self.writeBackend(devid, dev_no, new_back[dev_no])
   18.53 +        self.writeBackend(devid, 'num_devs', num_devs)
   18.54 +
   18.55 +        if new_back['vslots'] is not None:
   18.56 +            self.writeBackend(devid, 'vslots', new_back['vslots'])
   18.57 +
   18.58 +        return new_back.get('uuid')
   18.59 +
   18.60      def getDeviceConfiguration(self, devid, transaction = None):
   18.61          result = DevController.getDeviceConfiguration(self, devid, transaction)
   18.62          num_devs = self.readBackend(devid, 'num_devs')
   18.63          pci_devs = []
   18.64          
   18.65 +        vslots = self.readBackend(devid, 'vslots')
   18.66 +        if vslots is not None:
   18.67 +            if vslots[-1] == ";":
   18.68 +                vslots = vslots[:-1]
   18.69 +            slot_list = vslots.split(';')
   18.70 +
   18.71          for i in range(int(num_devs)):
   18.72              dev_config = self.readBackend(devid, 'dev-%d' % i)
   18.73  
   18.74 @@ -91,10 +129,16 @@ class PciController(DevController):
   18.75              
   18.76              if pci_match!=None:
   18.77                  pci_dev_info = pci_match.groupdict()
   18.78 -                pci_devs.append({'domain': '0x%(domain)s' % pci_dev_info,
   18.79 +                dev_dict = {'domain': '0x%(domain)s' % pci_dev_info,
   18.80                                   'bus': '0x%(bus)s' % pci_dev_info,
   18.81                                   'slot': '0x%(slot)s' % pci_dev_info,
   18.82 -                                 'func': '0x%(func)s' % pci_dev_info})
   18.83 +                                 'func': '0x%(func)s' % pci_dev_info}
   18.84 +
   18.85 +                #append vslot info
   18.86 +                if vslots is not None:
   18.87 +                    dev_dict['vslt'] = slot_list[i]
   18.88 +
   18.89 +                pci_devs.append(dev_dict)
   18.90  
   18.91          result['devs'] = pci_devs
   18.92          result['uuid'] = self.readBackend(devid, 'uuid')
    19.1 --- a/tools/python/xen/xm/main.py	Tue Feb 19 09:28:09 2008 -0700
    19.2 +++ b/tools/python/xen/xm/main.py	Tue Feb 19 11:14:40 2008 -0700
    19.3 @@ -175,6 +175,12 @@ SUBCOMMAND_HELP = {
    19.4      'vnet-delete'   :  ('<VnetId>', 'Delete a Vnet.'),
    19.5      'vnet-list'     :  ('[-l|--long]', 'List Vnets.'),
    19.6      'vtpm-list'     :  ('<Domain> [--long]', 'List virtual TPM devices.'),
    19.7 +    'pci-attach '   :  ('<Domain> <dom> <bus> <slot> <func> [virtual slot]',
    19.8 +                        'Insert a new pass-through pci device.'),
    19.9 +    'pci-detach '   :  ('<Domain> <virtual slot>',
   19.10 +                        'Remove a domain\'s pass-through pci device.'),
   19.11 +    'pci-list'     :  ('<Domain>',
   19.12 +                        'List pass-through pci devices for a domain.'),
   19.13  
   19.14      # security
   19.15  
   19.16 @@ -335,6 +341,9 @@ device_commands = [
   19.17      "network-detach",
   19.18      "network-list",
   19.19      "vtpm-list",
   19.20 +    "pci-attach",
   19.21 +    "pci-detach",
   19.22 +    "pci-list",
   19.23      ]
   19.24  
   19.25  vnet_commands = [
   19.26 @@ -2051,6 +2060,31 @@ def xm_vtpm_list(args):
   19.27                     % ni)
   19.28  
   19.29  
   19.30 +def xm_pci_list(args):
   19.31 +    (use_long, params) = arg_check_for_resource_list(args, "pci-list")
   19.32 +
   19.33 +    dom = params[0]
   19.34 +
   19.35 +    devs = server.xend.domain.getDeviceSxprs(dom, 'pci')
   19.36 +
   19.37 +    if len(devs) == 0:
   19.38 +        return
   19.39 +
   19.40 +    has_vslt = devs[0].has_key('vslt')
   19.41 +    if has_vslt:
   19.42 +        hdr_str = 'VSlt domain   bus   slot   func'
   19.43 +        fmt_str =  "%(vslt)-3s    %(domain)-3s  %(bus)-3s   %(slot)-3s    %(func)-3s    "
   19.44 +    else:
   19.45 +        hdr_str = 'domain   bus   slot   func'
   19.46 +        fmt_str =  "%(domain)-3s  %(bus)-3s   %(slot)-3s    %(func)-3s    "
   19.47 +    hdr = 0
   19.48 +
   19.49 +    for x in devs:
   19.50 +        if hdr == 0:
   19.51 +            print (hdr_str)
   19.52 +            hdr = 1
   19.53 +        print ( fmt_str % x )
   19.54 +
   19.55  def parse_block_configuration(args):
   19.56      dom = args[0]
   19.57  
   19.58 @@ -2198,6 +2232,29 @@ def xm_network_attach(args):
   19.59              vif.append(vif_param)
   19.60          server.xend.domain.device_create(dom, vif)
   19.61  
   19.62 +def parse_pci_configuration(args):
   19.63 +    dom = args[0]
   19.64 +
   19.65 +    if len(args) == 6:
   19.66 +        vslt = args[5]
   19.67 +    else:
   19.68 +        vslt = '0x0' #chose a free virtual PCI slot
   19.69 +
   19.70 +    pci = ['pci',
   19.71 +          ['devs',
   19.72 +            [{'domain': "0x%x" % int(args[1], 16),
   19.73 +              'bus':    "0x%x" % int(args[2], 16),
   19.74 +              'slot':   "0x%x" % int(args[3], 16),
   19.75 +              'func':   "0x%x" % int(args[4], 16),
   19.76 +              'vslt':   "0x%x" % int(vslt,    16)}]
   19.77 +          ]]
   19.78 +
   19.79 +    return (dom, pci)
   19.80 +
   19.81 +def xm_pci_attach(args):
   19.82 +    arg_check(args, 'xm_pci_attach', 5, 6)
   19.83 +    (dom, pci) = parse_pci_configuration(args)
   19.84 +    server.xend.domain.device_create(dom, pci)
   19.85  
   19.86  def detach(args, deviceClass):
   19.87      rm_cfg = True
   19.88 @@ -2263,6 +2320,12 @@ def xm_network_detach(args):
   19.89          detach(args, 'vif')
   19.90  
   19.91  
   19.92 +def xm_pci_detach(args):
   19.93 +    arg_check(args, 'xm_pci_detach', 2, 2)
   19.94 +    dom = args[0]
   19.95 +    dev = args[1]
   19.96 +    server.xend.domain.destroyDevice(dom, 'dpci', dev)
   19.97 +
   19.98  def xm_vnet_list(args):
   19.99      xenapi_unsupported()
  19.100      try:
  19.101 @@ -2452,6 +2515,10 @@ commands = {
  19.102      "vnet-delete": xm_vnet_delete,
  19.103      # vtpm
  19.104      "vtpm-list": xm_vtpm_list,
  19.105 +    #pci
  19.106 +    "pci-attach": xm_pci_attach,
  19.107 +    "pci-detach": xm_pci_detach,
  19.108 +    "pci-list": xm_pci_list,
  19.109      }
  19.110  
  19.111  ## The commands supported by a separate argument parser in xend.xm.
    20.1 --- a/xen/arch/x86/domctl.c	Tue Feb 19 09:28:09 2008 -0700
    20.2 +++ b/xen/arch/x86/domctl.c	Tue Feb 19 11:14:40 2008 -0700
    20.3 @@ -580,6 +580,34 @@ long arch_do_domctl(
    20.4      }
    20.5      break;
    20.6  
    20.7 +    case XEN_DOMCTL_deassign_device:
    20.8 +    {
    20.9 +        struct domain *d;
   20.10 +        u8 bus, devfn;
   20.11 +
   20.12 +        ret = -EINVAL;
   20.13 +        if ( !iommu_enabled )
   20.14 +            break;
   20.15 +
   20.16 +        if ( unlikely((d = get_domain_by_id(domctl->domain)) == NULL) )
   20.17 +        {
   20.18 +            gdprintk(XENLOG_ERR,
   20.19 +                "XEN_DOMCTL_deassign_device: get_domain_by_id() failed\n"); 
   20.20 +            break;
   20.21 +        }
   20.22 +        bus = (domctl->u.assign_device.machine_bdf >> 16) & 0xff;
   20.23 +        devfn = (domctl->u.assign_device.machine_bdf >> 8) & 0xff;
   20.24 +
   20.25 +        if ( !device_assigned(bus, devfn) )
   20.26 +            break;
   20.27 +
   20.28 +        deassign_device(d, bus, devfn);
   20.29 +        gdprintk(XENLOG_INFO, "XEN_DOMCTL_deassign_device: bdf = %x:%x:%x\n",
   20.30 +            bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
   20.31 +        put_domain(d);
   20.32 +    }
   20.33 +    break;
   20.34 +
   20.35      case XEN_DOMCTL_bind_pt_irq:
   20.36      {
   20.37          struct domain * d;
   20.38 @@ -595,6 +623,23 @@ long arch_do_domctl(
   20.39              gdprintk(XENLOG_ERR, "pt_irq_create_bind failed!\n");
   20.40          rcu_unlock_domain(d);
   20.41      }
   20.42 +    break;    
   20.43 +
   20.44 +    case XEN_DOMCTL_unbind_pt_irq:
   20.45 +    {
   20.46 +        struct domain * d;
   20.47 +        xen_domctl_bind_pt_irq_t * bind;
   20.48 +
   20.49 +        ret = -ESRCH;
   20.50 +        if ( (d = rcu_lock_domain_by_id(domctl->domain)) == NULL )
   20.51 +            break;
   20.52 +        bind = &(domctl->u.bind_pt_irq);
   20.53 +        if ( iommu_enabled )
   20.54 +            ret = pt_irq_destroy_bind_vtd(d, bind);
   20.55 +        if ( ret < 0 )
   20.56 +            gdprintk(XENLOG_ERR, "pt_irq_destroy_bind failed!\n");
   20.57 +        rcu_unlock_domain(d);
   20.58 +    }
   20.59      break;
   20.60  
   20.61      case XEN_DOMCTL_memory_mapping:
    21.1 --- a/xen/arch/x86/hvm/hvm.c	Tue Feb 19 09:28:09 2008 -0700
    21.2 +++ b/xen/arch/x86/hvm/hvm.c	Tue Feb 19 11:14:40 2008 -0700
    21.3 @@ -1393,20 +1393,18 @@ static enum hvm_copy_result __hvm_copy(
    21.4      int count, todo;
    21.5      uint32_t pfec = PFEC_page_present;
    21.6  
    21.7 -    if ( virt )
    21.8 +    /*
    21.9 +     * We cannot use hvm_get_segment_register() while executing in
   21.10 +     * vmx_realmode() as segment register state is cached. Furthermore,
   21.11 +     * VMREADs on every data access hurts emulation performance.
   21.12 +     * Hence we do not gather extra PFEC flags if CR0.PG == 0.
   21.13 +     */
   21.14 +    if ( virt && (curr->arch.hvm_vcpu.guest_cr[0] & X86_CR0_PG) )
   21.15      {
   21.16 -        /*
   21.17 -         * We cannot use hvm_get_segment_register() while executing in
   21.18 -         * vmx_realmode() as segment register state is cached. Furthermore,
   21.19 -         * VMREADs on every data access hurts emulation performance.
   21.20 -         */
   21.21 -        if ( !curr->arch.hvm_vmx.vmxemul )
   21.22 -        {
   21.23 -            struct segment_register sreg;
   21.24 -            hvm_get_segment_register(curr, x86_seg_ss, &sreg);
   21.25 -            if ( sreg.attr.fields.dpl == 3 )
   21.26 -                pfec |= PFEC_user_mode;
   21.27 -        }
   21.28 +        struct segment_register sreg;
   21.29 +        hvm_get_segment_register(curr, x86_seg_ss, &sreg);
   21.30 +        if ( sreg.attr.fields.dpl == 3 )
   21.31 +            pfec |= PFEC_user_mode;
   21.32  
   21.33          if ( dir ) 
   21.34              pfec |= PFEC_write_access;
    22.1 --- a/xen/arch/x86/hvm/iommu.c	Tue Feb 19 09:28:09 2008 -0700
    22.2 +++ b/xen/arch/x86/hvm/iommu.c	Tue Feb 19 11:14:40 2008 -0700
    22.3 @@ -133,3 +133,13 @@ int iommu_unmap_page(struct domain *d, u
    22.4  
    22.5      return hd->platform_ops->unmap_page(d, gfn);
    22.6  }
    22.7 +
    22.8 +void deassign_device(struct domain *d, u8 bus, u8 devfn)
    22.9 +{
   22.10 +    struct hvm_iommu *hd = domain_hvm_iommu(d);
   22.11 +
   22.12 +    if ( !iommu_enabled || !hd->platform_ops)
   22.13 +        return;
   22.14 +
   22.15 +    return hd->platform_ops->reassign_device(d, dom0, bus, devfn);
   22.16 +}
    23.1 --- a/xen/arch/x86/hvm/irq.c	Tue Feb 19 09:28:09 2008 -0700
    23.2 +++ b/xen/arch/x86/hvm/irq.c	Tue Feb 19 11:14:40 2008 -0700
    23.3 @@ -211,8 +211,7 @@ void hvm_set_pci_link_route(struct domai
    23.4              clear_bit(old_isa_irq, &hvm_irq->dpci->isairq_map);
    23.5  
    23.6          for ( i = 0; i < NR_LINK; i++ )
    23.7 -            if ( test_bit(i, &hvm_irq->dpci->link_map) &&
    23.8 -                 hvm_irq->pci_link.route[i] )
    23.9 +            if ( hvm_irq->dpci->link_cnt[i] && hvm_irq->pci_link.route[i] )
   23.10                  set_bit(hvm_irq->pci_link.route[i],
   23.11                          &hvm_irq->dpci->isairq_map);
   23.12      }
    24.1 --- a/xen/arch/x86/hvm/svm/amd_iommu/pci-amd-iommu.c	Tue Feb 19 09:28:09 2008 -0700
    24.2 +++ b/xen/arch/x86/hvm/svm/amd_iommu/pci-amd-iommu.c	Tue Feb 19 11:14:40 2008 -0700
    24.3 @@ -562,10 +562,17 @@ void amd_iommu_domain_destroy(struct dom
    24.4      release_domain_devices(d);
    24.5  }
    24.6  
    24.7 +void amd_iommu_return_device(struct domain *s, struct domain *t, u8 bus, u8 devfn)
    24.8 +{
    24.9 +    pdev_flr(bus, devfn);
   24.10 +    reassign_device(s, t, bus, devfn);
   24.11 +}
   24.12 +
   24.13  struct iommu_ops amd_iommu_ops = {
   24.14      .init = amd_iommu_domain_init,
   24.15      .assign_device  = amd_iommu_assign_device,
   24.16      .teardown = amd_iommu_domain_destroy,
   24.17      .map_page = amd_iommu_map_page,
   24.18      .unmap_page = amd_iommu_unmap_page,
   24.19 +    .reassign_device = amd_iommu_return_device,
   24.20  };
    25.1 --- a/xen/arch/x86/hvm/vmx/vtd/dmar.c	Tue Feb 19 09:28:09 2008 -0700
    25.2 +++ b/xen/arch/x86/hvm/vmx/vtd/dmar.c	Tue Feb 19 11:14:40 2008 -0700
    25.3 @@ -102,7 +102,7 @@ struct iommu * ioapic_to_iommu(unsigned 
    25.4              return drhd->iommu;
    25.5          }
    25.6      }
    25.7 -    dprintk(XENLOG_WARNING VTDPREFIX, "returning NULL\n");
    25.8 +    dprintk(XENLOG_INFO VTDPREFIX, "returning NULL\n");
    25.9      return NULL;
   25.10  }
   25.11  
    26.1 --- a/xen/arch/x86/hvm/vmx/vtd/intel-iommu.c	Tue Feb 19 09:28:09 2008 -0700
    26.2 +++ b/xen/arch/x86/hvm/vmx/vtd/intel-iommu.c	Tue Feb 19 11:14:40 2008 -0700
    26.3 @@ -1441,6 +1441,8 @@ void reassign_device_ownership(
    26.4               bus, PCI_SLOT(devfn), PCI_FUNC(devfn),
    26.5               source->domain_id, target->domain_id);
    26.6  
    26.7 +    pdev_flr(bus, devfn);
    26.8 +
    26.9      for_each_pdev( source, pdev )
   26.10      {
   26.11          if ( (pdev->bus != bus) || (pdev->devfn != devfn) )
   26.12 @@ -1476,7 +1478,6 @@ void return_devices_to_dom0(struct domai
   26.13          dprintk(XENLOG_INFO VTDPREFIX,
   26.14                  "return_devices_to_dom0: bdf = %x:%x:%x\n",
   26.15                  pdev->bus, PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
   26.16 -        pdev_flr(pdev->bus, pdev->devfn);
   26.17          reassign_device_ownership(d, dom0, pdev->bus, pdev->devfn);
   26.18      }
   26.19  
   26.20 @@ -1811,7 +1812,18 @@ static int init_vtd_hw(void)
   26.21          flush = iommu_get_flush(iommu);
   26.22          flush->context = flush_context_reg;
   26.23          flush->iotlb = flush_iotlb_reg;
   26.24 +    }
   26.25 +    return 0;
   26.26 +}
   26.27  
   26.28 +static int init_vtd2_hw(void)
   26.29 +{
   26.30 +    struct acpi_drhd_unit *drhd;
   26.31 +    struct iommu *iommu;
   26.32 +
   26.33 +    for_each_drhd_unit ( drhd )
   26.34 +    {
   26.35 +        iommu = drhd->iommu;
   26.36          if ( qinval_setup(iommu) != 0 )
   26.37              dprintk(XENLOG_ERR VTDPREFIX,
   26.38                      "Queued Invalidation hardware not found\n");
   26.39 @@ -1883,12 +1895,12 @@ int iommu_setup(void)
   26.40      for ( i = 0; i < max_page; i++ )
   26.41          iommu_map_page(dom0, i, i);
   26.42  
   26.43 -    enable_vtd_translation();
   26.44 -    if ( init_vtd_hw() )
   26.45 -        goto error;
   26.46 +    init_vtd_hw();
   26.47      setup_dom0_devices();
   26.48      setup_dom0_rmrr();
   26.49      iommu_flush_all();
   26.50 +    enable_vtd_translation();
   26.51 +    init_vtd2_hw();
   26.52  
   26.53      return 0;
   26.54  
   26.55 @@ -1930,7 +1942,6 @@ int intel_iommu_assign_device(struct dom
   26.56               "assign_device: bus = %x dev = %x func = %x\n",
   26.57               bus, PCI_SLOT(devfn), PCI_FUNC(devfn));
   26.58  
   26.59 -    pdev_flr(bus, devfn);
   26.60      reassign_device_ownership(dom0, d, bus, devfn);
   26.61  
   26.62      /* Setup rmrr identify mapping */
   26.63 @@ -2153,6 +2164,7 @@ struct iommu_ops intel_iommu_ops = {
   26.64      .teardown = iommu_domain_teardown,
   26.65      .map_page = intel_iommu_map_page,
   26.66      .unmap_page = intel_iommu_unmap_page,
   26.67 +    .reassign_device = reassign_device_ownership,
   26.68  };
   26.69  
   26.70  /*
    27.1 --- a/xen/arch/x86/hvm/vmx/vtd/io.c	Tue Feb 19 09:28:09 2008 -0700
    27.2 +++ b/xen/arch/x86/hvm/vmx/vtd/io.c	Tue Feb 19 11:14:40 2008 -0700
    27.3 @@ -101,7 +101,7 @@ int pt_irq_create_bind_vtd(
    27.4      intx = pt_irq_bind->u.pci.intx;
    27.5      guest_gsi = hvm_pci_intx_gsi(device, intx);
    27.6      link = hvm_pci_intx_link(device, intx);
    27.7 -    set_bit(link, hvm_irq_dpci->link_map);
    27.8 +    hvm_irq_dpci->link_cnt[link]++;
    27.9  
   27.10      digl = xmalloc(struct dev_intx_gsi_link);
   27.11      if ( !digl )
   27.12 @@ -137,6 +137,65 @@ int pt_irq_create_bind_vtd(
   27.13      return 0;
   27.14  }
   27.15  
   27.16 +int pt_irq_destroy_bind_vtd(
   27.17 +    struct domain *d, xen_domctl_bind_pt_irq_t *pt_irq_bind)
   27.18 +{
   27.19 +    struct hvm_irq_dpci *hvm_irq_dpci = d->arch.hvm_domain.irq.dpci;
   27.20 +    uint32_t machine_gsi, guest_gsi;
   27.21 +    uint32_t device, intx, link;
   27.22 +    struct list_head *digl_list, *tmp;
   27.23 +    struct dev_intx_gsi_link *digl;
   27.24 +
   27.25 +    if ( hvm_irq_dpci == NULL )
   27.26 +        return 0;
   27.27 +
   27.28 +    machine_gsi = pt_irq_bind->machine_irq;
   27.29 +    device = pt_irq_bind->u.pci.device;
   27.30 +    intx = pt_irq_bind->u.pci.intx;
   27.31 +    guest_gsi = hvm_pci_intx_gsi(device, intx);
   27.32 +    link = hvm_pci_intx_link(device, intx);
   27.33 +    hvm_irq_dpci->link_cnt[link]--;
   27.34 +
   27.35 +    gdprintk(XENLOG_INFO,
   27.36 +            "pt_irq_destroy_bind_vtd: machine_gsi=%d, guest_gsi=%d, device=%d, intx=%d.\n",
   27.37 +            machine_gsi, guest_gsi, device, intx);
   27.38 +    memset(&hvm_irq_dpci->girq[guest_gsi], 0, sizeof(struct hvm_girq_dpci_mapping));
   27.39 +
   27.40 +    /* clear the mirq info */
   27.41 +    if ( hvm_irq_dpci->mirq[machine_gsi].valid )
   27.42 +    {
   27.43 +
   27.44 +        list_for_each_safe ( digl_list, tmp,
   27.45 +                &hvm_irq_dpci->mirq[machine_gsi].digl_list )
   27.46 +        {
   27.47 +            digl = list_entry(digl_list,
   27.48 +                    struct dev_intx_gsi_link, list);
   27.49 +            if ( digl->device == device &&
   27.50 +                 digl->intx   == intx &&
   27.51 +                 digl->link   == link &&
   27.52 +                 digl->gsi    == guest_gsi )
   27.53 +            {
   27.54 +                list_del(&digl->list);
   27.55 +                xfree(digl);
   27.56 +            }
   27.57 +        }
   27.58 +
   27.59 +        if ( list_empty(&hvm_irq_dpci->mirq[machine_gsi].digl_list) )
   27.60 +        {
   27.61 +            pirq_guest_unbind(d, machine_gsi);
   27.62 +            kill_timer(&hvm_irq_dpci->hvm_timer[irq_to_vector(machine_gsi)]);
   27.63 +            hvm_irq_dpci->mirq[machine_gsi].dom   = NULL;
   27.64 +            hvm_irq_dpci->mirq[machine_gsi].valid = 0;
   27.65 +        }
   27.66 +    }
   27.67 +
   27.68 +    gdprintk(XENLOG_INFO,
   27.69 +             "XEN_DOMCTL_irq_unmapping: m_irq = %x device = %x intx = %x\n",
   27.70 +             machine_gsi, device, intx);
   27.71 +
   27.72 +    return 0;
   27.73 +}
   27.74 +
   27.75  int hvm_do_IRQ_dpci(struct domain *d, unsigned int mirq)
   27.76  {
   27.77      struct hvm_irq *hvm_irq = &d->arch.hvm_domain.irq;
    28.1 --- a/xen/arch/x86/mm.c	Tue Feb 19 09:28:09 2008 -0700
    28.2 +++ b/xen/arch/x86/mm.c	Tue Feb 19 11:14:40 2008 -0700
    28.3 @@ -1443,16 +1443,18 @@ static int mod_l1_entry(l1_pgentry_t *pl
    28.4              return 0;
    28.5          }
    28.6  
    28.7 -        adjust_guest_l1e(nl1e, d);
    28.8 -
    28.9          /* Fast path for identical mapping, r/w and presence. */
   28.10          if ( !l1e_has_changed(ol1e, nl1e, _PAGE_RW | _PAGE_PRESENT) )
   28.11 +        {
   28.12 +            adjust_guest_l1e(nl1e, d);
   28.13              return UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr,
   28.14                                  preserve_ad);
   28.15 +        }
   28.16  
   28.17          if ( unlikely(!get_page_from_l1e(nl1e, FOREIGNDOM)) )
   28.18              return 0;
   28.19          
   28.20 +        adjust_guest_l1e(nl1e, d);
   28.21          if ( unlikely(!UPDATE_ENTRY(l1, pl1e, ol1e, nl1e, gl1mfn, curr,
   28.22                                      preserve_ad)) )
   28.23          {
   28.24 @@ -1501,15 +1503,17 @@ static int mod_l2_entry(l2_pgentry_t *pl
   28.25              return 0;
   28.26          }
   28.27  
   28.28 -        adjust_guest_l2e(nl2e, d);
   28.29 -
   28.30          /* Fast path for identical mapping and presence. */
   28.31 -        if ( !l2e_has_changed(ol2e, nl2e, _PAGE_PRESENT))
   28.32 +        if ( !l2e_has_changed(ol2e, nl2e, _PAGE_PRESENT) )
   28.33 +        {
   28.34 +            adjust_guest_l2e(nl2e, d);
   28.35              return UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, curr, preserve_ad);
   28.36 +        }
   28.37  
   28.38          if ( unlikely(!get_page_from_l2e(nl2e, pfn, d)) )
   28.39              return 0;
   28.40  
   28.41 +        adjust_guest_l2e(nl2e, d);
   28.42          if ( unlikely(!UPDATE_ENTRY(l2, pl2e, ol2e, nl2e, pfn, curr,
   28.43                                      preserve_ad)) )
   28.44          {
   28.45 @@ -1567,15 +1571,17 @@ static int mod_l3_entry(l3_pgentry_t *pl
   28.46              return 0;
   28.47          }
   28.48  
   28.49 -        adjust_guest_l3e(nl3e, d);
   28.50 -
   28.51          /* Fast path for identical mapping and presence. */
   28.52 -        if (!l3e_has_changed(ol3e, nl3e, _PAGE_PRESENT))
   28.53 +        if ( !l3e_has_changed(ol3e, nl3e, _PAGE_PRESENT) )
   28.54 +        {
   28.55 +            adjust_guest_l3e(nl3e, d);
   28.56              return UPDATE_ENTRY(l3, pl3e, ol3e, nl3e, pfn, curr, preserve_ad);
   28.57 +        }
   28.58  
   28.59          if ( unlikely(!get_page_from_l3e(nl3e, pfn, d)) )
   28.60              return 0;
   28.61  
   28.62 +        adjust_guest_l3e(nl3e, d);
   28.63          if ( unlikely(!UPDATE_ENTRY(l3, pl3e, ol3e, nl3e, pfn, curr,
   28.64                                      preserve_ad)) )
   28.65          {
   28.66 @@ -1630,15 +1636,17 @@ static int mod_l4_entry(l4_pgentry_t *pl
   28.67              return 0;
   28.68          }
   28.69  
   28.70 -        adjust_guest_l4e(nl4e, d);
   28.71 -
   28.72          /* Fast path for identical mapping and presence. */
   28.73 -        if (!l4e_has_changed(ol4e, nl4e, _PAGE_PRESENT))
   28.74 +        if ( !l4e_has_changed(ol4e, nl4e, _PAGE_PRESENT) )
   28.75 +        {
   28.76 +            adjust_guest_l4e(nl4e, d);
   28.77              return UPDATE_ENTRY(l4, pl4e, ol4e, nl4e, pfn, curr, preserve_ad);
   28.78 +        }
   28.79  
   28.80          if ( unlikely(!get_page_from_l4e(nl4e, pfn, d)) )
   28.81              return 0;
   28.82  
   28.83 +        adjust_guest_l4e(nl4e, d);
   28.84          if ( unlikely(!UPDATE_ENTRY(l4, pl4e, ol4e, nl4e, pfn, curr,
   28.85                                      preserve_ad)) )
   28.86          {
    29.1 --- a/xen/arch/x86/mm/shadow/common.c	Tue Feb 19 09:28:09 2008 -0700
    29.2 +++ b/xen/arch/x86/mm/shadow/common.c	Tue Feb 19 11:14:40 2008 -0700
    29.3 @@ -1039,13 +1039,18 @@ void shadow_free(struct domain *d, mfn_t
    29.4  
    29.5      for ( i = 0; i < 1<<order; i++ ) 
    29.6      {
    29.7 -#if SHADOW_OPTIMIZATIONS & SHOPT_WRITABLE_HEURISTIC
    29.8 +#if SHADOW_OPTIMIZATIONS & (SHOPT_WRITABLE_HEURISTIC | SHOPT_FAST_EMULATION)
    29.9          struct vcpu *v;
   29.10          for_each_vcpu(d, v) 
   29.11          {
   29.12 +#if SHADOW_OPTIMIZATIONS & SHOPT_WRITABLE_HEURISTIC
   29.13              /* No longer safe to look for a writeable mapping in this shadow */
   29.14              if ( v->arch.paging.shadow.last_writeable_pte_smfn == mfn_x(smfn) + i ) 
   29.15                  v->arch.paging.shadow.last_writeable_pte_smfn = 0;
   29.16 +#endif
   29.17 +#if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
   29.18 +            v->arch.paging.last_write_emul_ok = 0;
   29.19 +#endif
   29.20          }
   29.21  #endif
   29.22          /* Strip out the type: this is now a free shadow page */
    30.1 --- a/xen/arch/x86/mm/shadow/multi.c	Tue Feb 19 09:28:09 2008 -0700
    30.2 +++ b/xen/arch/x86/mm/shadow/multi.c	Tue Feb 19 11:14:40 2008 -0700
    30.3 @@ -2623,13 +2623,13 @@ sh_map_and_validate_gl1e(struct vcpu *v,
    30.4  static inline void check_for_early_unshadow(struct vcpu *v, mfn_t gmfn)
    30.5  {
    30.6  #if SHADOW_OPTIMIZATIONS & SHOPT_EARLY_UNSHADOW
    30.7 -    if ( v->arch.paging.shadow.last_emulated_mfn == mfn_x(gmfn) &&
    30.8 -         sh_mfn_is_a_page_table(gmfn) )
    30.9 +    if ( v->arch.paging.shadow.last_emulated_mfn_for_unshadow == mfn_x(gmfn)
   30.10 +         && sh_mfn_is_a_page_table(gmfn) )
   30.11      {
   30.12          perfc_incr(shadow_early_unshadow);
   30.13          sh_remove_shadows(v, gmfn, 1, 0 /* Fast, can fail to unshadow */ );
   30.14      }
   30.15 -    v->arch.paging.shadow.last_emulated_mfn = mfn_x(gmfn);
   30.16 +    v->arch.paging.shadow.last_emulated_mfn_for_unshadow = mfn_x(gmfn);
   30.17  #endif
   30.18  }
   30.19  
   30.20 @@ -2637,7 +2637,7 @@ static inline void check_for_early_unsha
   30.21  static inline void reset_early_unshadow(struct vcpu *v)
   30.22  {
   30.23  #if SHADOW_OPTIMIZATIONS & SHOPT_EARLY_UNSHADOW
   30.24 -    v->arch.paging.shadow.last_emulated_mfn = INVALID_MFN;
   30.25 +    v->arch.paging.shadow.last_emulated_mfn_for_unshadow = INVALID_MFN;
   30.26  #endif
   30.27  }
   30.28  
   30.29 @@ -2744,12 +2744,39 @@ static int sh_page_fault(struct vcpu *v,
   30.30      int r;
   30.31      fetch_type_t ft = 0;
   30.32      p2m_type_t p2mt;
   30.33 +#if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
   30.34 +    int fast_emul = 0;
   30.35 +#endif
   30.36  
   30.37      SHADOW_PRINTK("d:v=%u:%u va=%#lx err=%u, rip=%lx\n",
   30.38                    v->domain->domain_id, v->vcpu_id, va, regs->error_code,
   30.39                    regs->rip);
   30.40  
   30.41      perfc_incr(shadow_fault);
   30.42 +
   30.43 +#if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
   30.44 +    /* If faulting frame is successfully emulated in last shadow fault
   30.45 +     * it's highly likely to reach same emulation action for this frame.
   30.46 +     * Then try to emulate early to avoid lock aquisition.
   30.47 +     */
   30.48 +    if ( v->arch.paging.last_write_emul_ok
   30.49 +         && v->arch.paging.shadow.last_emulated_frame == (va >> PAGE_SHIFT) ) 
   30.50 +    {
   30.51 +        /* check whether error code is 3, or else fall back to normal path
   30.52 +         * in case of some validation is required
   30.53 +         */
   30.54 +        if ( regs->error_code == (PFEC_write_access | PFEC_page_present) )
   30.55 +        {
   30.56 +            fast_emul = 1;
   30.57 +            gmfn = _mfn(v->arch.paging.shadow.last_emulated_mfn);
   30.58 +            perfc_incr(shadow_fault_fast_emulate);
   30.59 +            goto early_emulation;
   30.60 +        }
   30.61 +        else
   30.62 +            v->arch.paging.last_write_emul_ok = 0;
   30.63 +    }
   30.64 +#endif
   30.65 +
   30.66      //
   30.67      // XXX: Need to think about eventually mapping superpages directly in the
   30.68      //      shadow (when possible), as opposed to splintering them into a
   30.69 @@ -2960,6 +2987,17 @@ static int sh_page_fault(struct vcpu *v,
   30.70          goto done;
   30.71      }
   30.72  
   30.73 +    /*
   30.74 +     * We don't need to hold the lock for the whole emulation; we will
   30.75 +     * take it again when we write to the pagetables.
   30.76 +     */
   30.77 +    sh_audit_gw(v, &gw);
   30.78 +    shadow_audit_tables(v);
   30.79 +    shadow_unlock(d);
   30.80 +
   30.81 +#if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
   30.82 + early_emulation:
   30.83 +#endif
   30.84      if ( is_hvm_domain(d) )
   30.85      {
   30.86          /*
   30.87 @@ -2971,6 +3009,13 @@ static int sh_page_fault(struct vcpu *v,
   30.88           */
   30.89          if ( unlikely(hvm_event_pending(v)) )
   30.90          {
   30.91 +#if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
   30.92 +            if ( fast_emul )
   30.93 +            {
   30.94 +                perfc_incr(shadow_fault_fast_emulate_fail);
   30.95 +                v->arch.paging.last_write_emul_ok = 0;
   30.96 +            }
   30.97 +#endif
   30.98              gdprintk(XENLOG_DEBUG, "write to pagetable during event "
   30.99                       "injection: cr2=%#lx, mfn=%#lx\n", 
  30.100                       va, mfn_x(gmfn));
  30.101 @@ -2982,14 +3027,6 @@ static int sh_page_fault(struct vcpu *v,
  30.102      SHADOW_PRINTK("emulate: eip=%#lx esp=%#lx\n", 
  30.103                    (unsigned long)regs->eip, (unsigned long)regs->esp);
  30.104  
  30.105 -    /*
  30.106 -     * We don't need to hold the lock for the whole emulation; we will
  30.107 -     * take it again when we write to the pagetables.
  30.108 -     */
  30.109 -    sh_audit_gw(v, &gw);
  30.110 -    shadow_audit_tables(v);
  30.111 -    shadow_unlock(d);
  30.112 -
  30.113      emul_ops = shadow_init_emulation(&emul_ctxt, regs);
  30.114  
  30.115      r = x86_emulate(&emul_ctxt.ctxt, emul_ops);
  30.116 @@ -3001,15 +3038,44 @@ static int sh_page_fault(struct vcpu *v,
  30.117       */
  30.118      if ( r == X86EMUL_UNHANDLEABLE )
  30.119      {
  30.120 +        perfc_incr(shadow_fault_emulate_failed);
  30.121 +#if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
  30.122 +        if ( fast_emul )
  30.123 +        {
  30.124 +            perfc_incr(shadow_fault_fast_emulate_fail);
  30.125 +            v->arch.paging.last_write_emul_ok = 0;
  30.126 +        }
  30.127 +#endif
  30.128          SHADOW_PRINTK("emulator failure, unshadowing mfn %#lx\n", 
  30.129                         mfn_x(gmfn));
  30.130 -        perfc_incr(shadow_fault_emulate_failed);
  30.131          /* If this is actually a page table, then we have a bug, and need 
  30.132           * to support more operations in the emulator.  More likely, 
  30.133           * though, this is a hint that this page should not be shadowed. */
  30.134          shadow_remove_all_shadows(v, gmfn);
  30.135      }
  30.136  
  30.137 +#if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
  30.138 +    /* Record successfully emulated information as heuristics to next
  30.139 +     * fault on same frame for acceleration. But be careful to verify
  30.140 +     * its attribute still as page table, or else unshadow triggered
  30.141 +     * in write emulation normally requires a re-sync with guest page
  30.142 +     * table to recover r/w permission. Incorrect record for such case
  30.143 +     * will cause unexpected more shadow faults due to propagation is
  30.144 +     * skipped.
  30.145 +     */
  30.146 +    if ( (r == X86EMUL_OKAY) && sh_mfn_is_a_page_table(gmfn) )
  30.147 +    {
  30.148 +        if ( !fast_emul )
  30.149 +        {
  30.150 +            v->arch.paging.shadow.last_emulated_frame = va >> PAGE_SHIFT;
  30.151 +            v->arch.paging.shadow.last_emulated_mfn = mfn_x(gmfn);
  30.152 +            v->arch.paging.last_write_emul_ok = 1;
  30.153 +        }
  30.154 +    }
  30.155 +    else if ( fast_emul )
  30.156 +        v->arch.paging.last_write_emul_ok = 0;
  30.157 +#endif
  30.158 +
  30.159  #if GUEST_PAGING_LEVELS == 3 /* PAE guest */
  30.160      if ( r == X86EMUL_OKAY ) {
  30.161          int i;
  30.162 @@ -3079,6 +3145,10 @@ sh_invlpg(struct vcpu *v, unsigned long 
  30.163      vtlb_flush(v);
  30.164  #endif
  30.165  
  30.166 +#if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
  30.167 +    v->arch.paging.last_write_emul_ok = 0;
  30.168 +#endif
  30.169 +
  30.170      /* First check that we can safely read the shadow l2e.  SMP/PAE linux can
  30.171       * run as high as 6% of invlpg calls where we haven't shadowed the l2 
  30.172       * yet. */
  30.173 @@ -3815,6 +3885,10 @@ sh_update_cr3(struct vcpu *v, int do_loc
  30.174      vtlb_flush(v);
  30.175  #endif
  30.176  
  30.177 +#if SHADOW_OPTIMIZATIONS & SHOPT_FAST_EMULATION
  30.178 +    v->arch.paging.last_write_emul_ok = 0;
  30.179 +#endif
  30.180 +
  30.181      /* Release the lock, if we took it (otherwise it's the caller's problem) */
  30.182      if ( do_locking ) shadow_unlock(v->domain);
  30.183  }
    31.1 --- a/xen/arch/x86/mm/shadow/private.h	Tue Feb 19 09:28:09 2008 -0700
    31.2 +++ b/xen/arch/x86/mm/shadow/private.h	Tue Feb 19 11:14:40 2008 -0700
    31.3 @@ -62,8 +62,9 @@ extern int shadow_audit_enable;
    31.4  #define SHOPT_LINUX_L3_TOPLEVEL   0x10  /* Pin l3es on early 64bit linux */
    31.5  #define SHOPT_SKIP_VERIFY         0x20  /* Skip PTE v'fy when safe to do so */
    31.6  #define SHOPT_VIRTUAL_TLB         0x40  /* Cache guest v->p translations */
    31.7 +#define SHOPT_FAST_EMULATION      0x80  /* Fast write emulation */
    31.8  
    31.9 -#define SHADOW_OPTIMIZATIONS      0x7f
   31.10 +#define SHADOW_OPTIMIZATIONS      0xff
   31.11  
   31.12  
   31.13  /******************************************************************************
    32.1 --- a/xen/include/asm-x86/domain.h	Tue Feb 19 09:28:09 2008 -0700
    32.2 +++ b/xen/include/asm-x86/domain.h	Tue Feb 19 11:14:40 2008 -0700
    32.3 @@ -108,10 +108,14 @@ struct shadow_vcpu {
    32.4  #endif
    32.5      /* Non-PAE guests: pointer to guest top-level pagetable */
    32.6      void *guest_vtable;
    32.7 -    /* Last MFN that we emulated a write to. */
    32.8 -    unsigned long last_emulated_mfn;
    32.9 +    /* Last MFN that we emulated a write to as unshadow heuristics. */
   32.10 +    unsigned long last_emulated_mfn_for_unshadow;
   32.11      /* MFN of the last shadow that we shot a writeable mapping in */
   32.12      unsigned long last_writeable_pte_smfn;
   32.13 +    /* Last frame number that we emulated a write to. */
   32.14 +    unsigned long last_emulated_frame;
   32.15 +    /* Last MFN that we emulated a write successfully */
   32.16 +    unsigned long last_emulated_mfn;
   32.17  };
   32.18  
   32.19  /************************************************/
   32.20 @@ -189,6 +193,8 @@ struct paging_vcpu {
   32.21      struct paging_mode *mode;
   32.22      /* HVM guest: last emulate was to a pagetable */
   32.23      unsigned int last_write_was_pt:1;
   32.24 +    /* HVM guest: last write emulation succeeds */
   32.25 +    unsigned int last_write_emul_ok:1;
   32.26      /* Translated guest: virtual TLB */
   32.27      struct shadow_vtlb *vtlb;
   32.28      spinlock_t          vtlb_lock;
    33.1 --- a/xen/include/asm-x86/hvm/irq.h	Tue Feb 19 09:28:09 2008 -0700
    33.2 +++ b/xen/include/asm-x86/hvm/irq.h	Tue Feb 19 11:14:40 2008 -0700
    33.3 @@ -64,7 +64,7 @@ struct hvm_irq_dpci {
    33.4      /* Record of mapped ISA IRQs */
    33.5      DECLARE_BITMAP(isairq_map, NR_ISAIRQS);
    33.6      /* Record of mapped Links */
    33.7 -    DECLARE_BITMAP(link_map, NR_LINK);
    33.8 +    uint8_t link_cnt[NR_LINK];
    33.9      struct timer hvm_timer[NR_IRQS];
   33.10  };
   33.11  
    34.1 --- a/xen/include/asm-x86/iommu.h	Tue Feb 19 09:28:09 2008 -0700
    34.2 +++ b/xen/include/asm-x86/iommu.h	Tue Feb 19 11:14:40 2008 -0700
    34.3 @@ -74,6 +74,10 @@ int iommu_domain_init(struct domain *d);
    34.4  void iommu_domain_destroy(struct domain *d);
    34.5  int device_assigned(u8 bus, u8 devfn);
    34.6  int assign_device(struct domain *d, u8 bus, u8 devfn);
    34.7 +void deassign_device(struct domain *d, u8 bus, u8 devfn);
    34.8 +void reassign_device_ownership(struct domain *source,
    34.9 +                               struct domain *target,
   34.10 +                               u8 bus, u8 devfn);
   34.11  int iommu_map_page(struct domain *d, unsigned long gfn, unsigned long mfn);
   34.12  int iommu_unmap_page(struct domain *d, unsigned long gfn);
   34.13  void iommu_flush(struct domain *d, unsigned long gfn, u64 *p2m_entry);
   34.14 @@ -83,6 +87,8 @@ int hvm_do_IRQ_dpci(struct domain *d, un
   34.15  int dpci_ioport_intercept(ioreq_t *p);
   34.16  int pt_irq_create_bind_vtd(struct domain *d,
   34.17                             xen_domctl_bind_pt_irq_t *pt_irq_bind);
   34.18 +int pt_irq_destroy_bind_vtd(struct domain *d,
   34.19 +                            xen_domctl_bind_pt_irq_t *pt_irq_bind);
   34.20  unsigned int io_apic_read_remap_rte(
   34.21      unsigned int apic, unsigned int reg);
   34.22  void io_apic_write_remap_rte(unsigned int apic,
   34.23 @@ -97,6 +103,7 @@ struct iommu_ops {
   34.24      void (*teardown)(struct domain *d);
   34.25      int (*map_page)(struct domain *d, unsigned long gfn, unsigned long mfn);
   34.26      int (*unmap_page)(struct domain *d, unsigned long gfn);
   34.27 +    void (*reassign_device)(struct domain *s, struct domain *t, u8 bus, u8 devfn);
   34.28  };
   34.29  
   34.30  #endif /* _IOMMU_H_ */
    35.1 --- a/xen/include/asm-x86/perfc_defn.h	Tue Feb 19 09:28:09 2008 -0700
    35.2 +++ b/xen/include/asm-x86/perfc_defn.h	Tue Feb 19 11:14:40 2008 -0700
    35.3 @@ -57,6 +57,9 @@ PERFCOUNTER(shadow_fault_emulate_write, 
    35.4  PERFCOUNTER(shadow_fault_emulate_failed, "shadow_fault emulator fails")
    35.5  PERFCOUNTER(shadow_fault_emulate_stack, "shadow_fault emulate stack write")
    35.6  PERFCOUNTER(shadow_fault_emulate_wp, "shadow_fault emulate for CR0.WP=0")
    35.7 +PERFCOUNTER(shadow_fault_fast_emulate, "shadow_fault fast emulate")
    35.8 +PERFCOUNTER(shadow_fault_fast_emulate_fail,
    35.9 +                                   "shadow_fault fast emulate failed")
   35.10  PERFCOUNTER(shadow_fault_mmio,     "shadow_fault handled as mmio")
   35.11  PERFCOUNTER(shadow_fault_fixed,    "shadow_fault fixed fault")
   35.12  PERFCOUNTER(shadow_ptwr_emulate,   "shadow causes ptwr to emulate")
    36.1 --- a/xen/include/public/domctl.h	Tue Feb 19 09:28:09 2008 -0700
    36.2 +++ b/xen/include/public/domctl.h	Tue Feb 19 11:14:40 2008 -0700
    36.3 @@ -441,6 +441,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_sendt
    36.4  /* Assign PCI device to HVM guest. Sets up IOMMU structures. */
    36.5  #define XEN_DOMCTL_assign_device      37
    36.6  #define XEN_DOMCTL_test_assign_device 45
    36.7 +#define XEN_DOMCTL_deassign_device 47
    36.8  struct xen_domctl_assign_device {
    36.9      uint32_t  machine_bdf;   /* machine PCI ID of assigned device */
   36.10  };
   36.11 @@ -450,6 +451,7 @@ DEFINE_XEN_GUEST_HANDLE(xen_domctl_assig
   36.12  
   36.13  /* Pass-through interrupts: bind real irq -> hvm devfn. */
   36.14  #define XEN_DOMCTL_bind_pt_irq       38
   36.15 +#define XEN_DOMCTL_unbind_pt_irq     48
   36.16  typedef enum pt_irq_type_e {
   36.17      PT_IRQ_TYPE_PCI,
   36.18      PT_IRQ_TYPE_ISA
    37.1 --- a/xen/include/public/hvm/ioreq.h	Tue Feb 19 09:28:09 2008 -0700
    37.2 +++ b/xen/include/public/hvm/ioreq.h	Tue Feb 19 11:14:40 2008 -0700
    37.3 @@ -114,11 +114,11 @@ struct buffered_piopage {
    37.4  };
    37.5  #endif /* defined(__ia64__) */
    37.6  
    37.7 -#if defined(__i386__) || defined(__x86_64__)
    37.8  #define ACPI_PM1A_EVT_BLK_ADDRESS           0x0000000000001f40
    37.9  #define ACPI_PM1A_CNT_BLK_ADDRESS           (ACPI_PM1A_EVT_BLK_ADDRESS + 0x04)
   37.10  #define ACPI_PM_TMR_BLK_ADDRESS             (ACPI_PM1A_EVT_BLK_ADDRESS + 0x08)
   37.11 -#endif /* defined(__i386__) || defined(__x86_64__) */
   37.12 +#define ACPI_GPE0_BLK_ADDRESS               (ACPI_PM_TMR_BLK_ADDRESS + 0x20)
   37.13 +#define ACPI_GPE0_BLK_LEN                   0x08
   37.14  
   37.15  #endif /* _IOREQ_H_ */
   37.16