ia64/xen-unstable

changeset 16847:603ea719d73a

merge with xen-unstable.hg (staging)
author Alex Williamson <alex.williamson@hp.com>
date Tue Jan 22 08:30:40 2008 -0700 (2008-01-22)
parents 29268e3fc7ab 0ededc85e6b4
children b79802517a75
files
line diff
     1.1 --- a/Makefile	Tue Jan 22 08:27:29 2008 -0700
     1.2 +++ b/Makefile	Tue Jan 22 08:30:40 2008 -0700
     1.3 @@ -188,10 +188,10 @@ uninstall:
     1.4  	rm -rf $(D)/usr/include/xenctrl.h $(D)/usr/include/xenguest.h
     1.5  	rm -rf $(D)/usr/include/xs_lib.h $(D)/usr/include/xs.h
     1.6  	rm -rf $(D)/usr/include/xen
     1.7 -	rm -rf $(D)/usr/$(LIBDIR)/libxenctrl* $(D)/usr/$(LIBDIR)/libxenguest*
     1.8 -	rm -rf $(D)/usr/$(LIBDIR)/libxenstore*
     1.9 -	rm -rf $(D)/usr/$(LIBDIR)/python/xen $(D)/usr/$(LIBDIR)/python/grub
    1.10 -	rm -rf $(D)/usr/$(LIBDIR)/xen/
    1.11 +	rm -rf $(D)$(LIBDIR)/libxenctrl* $(D)$(LIBDIR)/libxenguest*
    1.12 +	rm -rf $(D)$(LIBDIR)/libxenstore*
    1.13 +	rm -rf $(D)$(LIBDIR)/python/xen $(D)$(LIBDIR)/python/grub
    1.14 +	rm -rf $(D)$(LIBDIR)/xen/
    1.15  	rm -rf $(D)/usr/lib/xen/
    1.16  	rm -rf $(D)/usr/local/sbin/setmask $(D)/usr/local/sbin/xen*
    1.17  	rm -rf $(D)/usr/sbin/xen* $(D)/usr/sbin/netfix $(D)/usr/sbin/xm
     2.1 --- a/config/StdGNU.mk	Tue Jan 22 08:27:29 2008 -0700
     2.2 +++ b/config/StdGNU.mk	Tue Jan 22 08:30:40 2008 -0700
     2.3 @@ -17,7 +17,15 @@ INSTALL_DIR  = $(INSTALL) -d -m0755 -p
     2.4  INSTALL_DATA = $(INSTALL) -m0644 -p
     2.5  INSTALL_PROG = $(INSTALL) -m0755 -p
     2.6  
     2.7 -LIB64DIR = lib64
     2.8 +PREFIX ?= /usr
     2.9 +BINDIR = $(PREFIX)/bin
    2.10 +INCLUDEDIR = $(PREFIX)/include
    2.11 +LIBDIR = $(PREFIX)/lib
    2.12 +LIBDIR_x86_64 = $(PREFIX)/lib64
    2.13 +MANDIR = $(PREFIX)/share/man
    2.14 +MAN1DIR = $(MANDIR)/man1
    2.15 +MAN8DIR = $(MANDIR)/man8
    2.16 +SBINDIR = $(PREFIX)/sbin
    2.17  
    2.18  SOCKET_LIBS =
    2.19  CURSES_LIBS = -lncurses
     3.1 --- a/config/SunOS.mk	Tue Jan 22 08:27:29 2008 -0700
     3.2 +++ b/config/SunOS.mk	Tue Jan 22 08:30:40 2008 -0700
     3.3 @@ -18,13 +18,24 @@ INSTALL_DIR  = $(INSTALL) -d -m0755 -p
     3.4  INSTALL_DATA = $(INSTALL) -m0644 -p
     3.5  INSTALL_PROG = $(INSTALL) -m0755 -p
     3.6  
     3.7 -LIB64DIR = lib/amd64
     3.8 +PREFIX ?= /usr
     3.9 +BINDIR = $(PREFIX)/bin
    3.10 +INCLUDEDIR = $(PREFIX)/include
    3.11 +LIBDIR = $(PREFIX)/lib
    3.12 +LIBDIR_x86_64 = $(PREFIX)/lib/amd64
    3.13 +MANDIR = $(PREFIX)/share/man
    3.14 +MAN1DIR = $(MANDIR)/man1
    3.15 +MAN8DIR = $(MANDIR)/man8
    3.16 +SBINDIR = $(PREFIX)/sbin
    3.17 +
    3.18 +SunOS_LIBDIR = /usr/sfw/lib
    3.19 +SunOS_LIBDIR_x86_64 = /usr/sfw/lib/amd64
    3.20  
    3.21  SOCKET_LIBS = -lsocket
    3.22  CURSES_LIBS = -lcurses
    3.23  UTIL_LIBS =
    3.24  SONAME_LDFLAG = -h
    3.25 -SHLIB_CFLAGS = -R /usr/sfw/$(LIBDIR) -shared
    3.26 +SHLIB_CFLAGS = -R $(SunOS_LIBDIR) -shared
    3.27  
    3.28  ifneq ($(debug),y)
    3.29  # Optimisation flags are overridable
     4.1 --- a/config/ia64.mk	Tue Jan 22 08:27:29 2008 -0700
     4.2 +++ b/config/ia64.mk	Tue Jan 22 08:30:40 2008 -0700
     4.3 @@ -4,5 +4,3 @@ CONFIG_IA64_$(XEN_OS) := y
     4.4  CONFIG_IOEMU := y
     4.5  CONFIG_XCUTILS := y
     4.6  CONFIG_XENCOMM := y
     4.7 -
     4.8 -LIBDIR := lib
     5.1 --- a/config/powerpc64.mk	Tue Jan 22 08:27:29 2008 -0700
     5.2 +++ b/config/powerpc64.mk	Tue Jan 22 08:30:40 2008 -0700
     5.3 @@ -4,4 +4,3 @@ CONFIG_POWERPC_$(XEN_OS) := y
     5.4  CONFIG_XENCOMM := y
     5.5  
     5.6  CFLAGS += -DELFSIZE=64
     5.7 -LIBDIR := lib
     6.1 --- a/config/x86_32.mk	Tue Jan 22 08:27:29 2008 -0700
     6.2 +++ b/config/x86_32.mk	Tue Jan 22 08:30:40 2008 -0700
     6.3 @@ -8,7 +8,6 @@ CONFIG_XCUTILS := y
     6.4  CONFIG_IOEMU := y
     6.5  
     6.6  CFLAGS += -m32 -march=i686
     6.7 -LIBDIR := lib
     6.8  
     6.9  # Use only if calling $(LD) directly.
    6.10  LDFLAGS_DIRECT_OpenBSD = _obsd
     7.1 --- a/config/x86_64.mk	Tue Jan 22 08:27:29 2008 -0700
     7.2 +++ b/config/x86_64.mk	Tue Jan 22 08:30:40 2008 -0700
     7.3 @@ -9,7 +9,10 @@ CONFIG_XCUTILS := y
     7.4  CONFIG_IOEMU := y
     7.5  
     7.6  CFLAGS += -m64
     7.7 -LIBDIR = $(LIB64DIR)
     7.8 +
     7.9 +LIBDIR = $(LIBDIR_x86_64)
    7.10 +
    7.11 +SunOS_LIBDIR = $(SunOS_LIBDIR_x86_64)
    7.12  
    7.13  # Use only if calling $(LD) directly.
    7.14  ifeq ($(XEN_OS),OpenBSD)
     8.1 --- a/extras/mini-os/Makefile	Tue Jan 22 08:27:29 2008 -0700
     8.2 +++ b/extras/mini-os/Makefile	Tue Jan 22 08:30:40 2008 -0700
     8.3 @@ -47,9 +47,19 @@ EXTRA_INC =
     8.4  # This must be before include minios.mk!
     8.5  include $(TARGET_ARCH_DIR)/arch.mk
     8.6  
     8.7 +ifneq ($(LWIPDIR),)
     8.8 +lwip=y
     8.9 +DEF_CFLAGS += -DHAVE_LWIP
    8.10 +DEF_CFLAGS += -I$(LWIPDIR)/src/include
    8.11 +DEF_CFLAGS += -I$(LWIPDIR)/src/include/ipv4
    8.12 +endif
    8.13 +
    8.14  # Include common mini-os makerules.
    8.15  include minios.mk
    8.16  
    8.17 +# Set tester flags
    8.18 +# CFLAGS += -DBLKTEST_WRITE
    8.19 +
    8.20  # Define some default flags for linking.
    8.21  LDLIBS := 
    8.22  LDARCHLIB := -L$(TARGET_ARCH_DIR) -l$(ARCH_LIB_NAME)
    8.23 @@ -90,6 +100,24 @@ links:	$(ARCH_LINKS)
    8.24  arch_lib:
    8.25  	$(MAKE) --directory=$(TARGET_ARCH_DIR) || exit 1;
    8.26  
    8.27 +ifeq ($(lwip),y)
    8.28 +# lwIP library
    8.29 +LWC	:= $(shell find $(LWIPDIR)/ -type f -name '*.c')
    8.30 +LWC	:= $(filter-out %6.c %ip6_addr.c %ethernetif.c, $(LWC))
    8.31 +LWC	+= lwip-arch.c lwip-net.c
    8.32 +LWO	:= $(patsubst %.c,%.o,$(LWC))
    8.33 +
    8.34 +lwip.a: $(LWO)
    8.35 +	$(RM) $@
    8.36 +	$(AR) cqs $@ $^
    8.37 +
    8.38 +OBJS += lwip.a
    8.39 +
    8.40 +OBJS := $(filter-out $(LWO), $(OBJS))
    8.41 +else
    8.42 +OBJS := $(filter-out daytime.o lwip%.o, $(OBJS))
    8.43 +endif
    8.44 +
    8.45  $(TARGET): links $(OBJS) arch_lib
    8.46  	$(LD) -r $(LDFLAGS) $(HEAD_OBJ) $(OBJS) $(LDARCHLIB) -o $@.o
    8.47  	$(OBJCOPY) -w -G $(GLOBAL_PREFIX)* -G _start $@.o $@.o
    8.48 @@ -107,6 +135,7 @@ clean:	arch_clean
    8.49  	done
    8.50  	rm -f *.o *~ core $(TARGET).elf $(TARGET).raw $(TARGET) $(TARGET).gz
    8.51  	find . -type l | xargs rm -f
    8.52 +	$(RM) lwip.a $(LWO)
    8.53  	rm -f tags TAGS
    8.54  
    8.55  
     9.1 --- a/extras/mini-os/arch/ia64/time.c	Tue Jan 22 08:27:29 2008 -0700
     9.2 +++ b/extras/mini-os/arch/ia64/time.c	Tue Jan 22 08:30:40 2008 -0700
     9.3 @@ -76,7 +76,7 @@ static uint64_t itm_val;
     9.4   * will already get problems at other places on 2038-01-19 03:14:08)
     9.5   */
     9.6  static unsigned long
     9.7 -mktime(const unsigned int year0, const unsigned int mon0,
     9.8 +_mktime(const unsigned int year0, const unsigned int mon0,
     9.9         const unsigned int day, const unsigned int hour,
    9.10         const unsigned int min, const unsigned int sec)
    9.11  {
    9.12 @@ -147,10 +147,10 @@ calculate_time(void)
    9.13  		new = itc_new - itc_alt;
    9.14  	itc_alt = itc_new;
    9.15  	new = ns_from_cycles(new);
    9.16 -	os_time.ts_nsec += new;
    9.17 -	if (os_time.ts_nsec > 1000000000) {	/* On overflow. */
    9.18 -		os_time.ts_sec++;
    9.19 -		os_time.ts_nsec -= 1000000000;
    9.20 +	os_time.tv_nsec += new;
    9.21 +	if (os_time.tv_nsec > 1000000000) {	/* On overflow. */
    9.22 +		os_time.tv_sec++;
    9.23 +		os_time.tv_nsec -= 1000000000;
    9.24  	}
    9.25  }
    9.26  
    9.27 @@ -177,12 +177,13 @@ monotonic_clock(void)
    9.28  	return delta;
    9.29  }
    9.30  
    9.31 -void
    9.32 -gettimeofday(struct timeval *tv)
    9.33 +int
    9.34 +gettimeofday(struct timeval *tv, void *tz)
    9.35  {
    9.36  	calculate_time();
    9.37 -	tv->tv_sec = os_time.ts_sec;			/* seconds */
    9.38 -	tv->tv_usec = NSEC_TO_USEC(os_time.ts_nsec);	/* microseconds */
    9.39 +	tv->tv_sec = os_time.tv_sec;			/* seconds */
    9.40 +	tv->tv_usec = NSEC_TO_USEC(os_time.tv_nsec);	/* microseconds */
    9.41 +        return 0;
    9.42  };
    9.43  
    9.44  /*
    9.45 @@ -253,16 +254,16 @@ init_time(void)
    9.46  	itm_val = (itc_frequency + HZ/2) / HZ;
    9.47  	printk("  itm_val: %ld\n", itm_val);
    9.48  
    9.49 -	os_time.ts_sec = 0;
    9.50 -	os_time.ts_nsec = 0;
    9.51 +	os_time.tv_sec = 0;
    9.52 +	os_time.tv_nsec = 0;
    9.53  
    9.54  	if (efi_get_time(&tm)) {
    9.55  		printk("  EFI-Time: %d.%d.%d   %d:%d:%d\n", tm.Day,
    9.56  		       tm.Month, tm.Year, tm.Hour, tm.Minute, tm.Second);
    9.57 -		os_time.ts_sec = mktime(SWAP(tm.Year), SWAP(tm.Month),
    9.58 +		os_time.tv_sec = _mktime(SWAP(tm.Year), SWAP(tm.Month),
    9.59  					SWAP(tm.Day), SWAP(tm.Hour),
    9.60  					SWAP(tm.Minute), SWAP(tm.Second));
    9.61 -		os_time.ts_nsec = tm.Nanosecond;
    9.62 +		os_time.tv_nsec = tm.Nanosecond;
    9.63  	} else
    9.64  		printk("efi_get_time() failed\n");
    9.65  
    10.1 --- a/extras/mini-os/arch/x86/mm.c	Tue Jan 22 08:27:29 2008 -0700
    10.2 +++ b/extras/mini-os/arch/x86/mm.c	Tue Jan 22 08:30:40 2008 -0700
    10.3 @@ -497,11 +497,11 @@ static void clear_bootstrap(void)
    10.4      int n = sizeof(mfns)/sizeof(*mfns);
    10.5      pte_t nullpte = { };
    10.6  
    10.7 -    /* Use page 0 as the CoW zero page */
    10.8 -    memset(NULL, 0, PAGE_SIZE);
    10.9 -    mfn_zero = pfn_to_mfn(0);
   10.10 -    if (HYPERVISOR_update_va_mapping(0, nullpte, UVMF_INVLPG))
   10.11 -	printk("Unable to unmap page 0\n");
   10.12 +    /* Use first page as the CoW zero page */
   10.13 +    memset(&_text, 0, PAGE_SIZE);
   10.14 +    mfn_zero = pfn_to_mfn((unsigned long) &_text);
   10.15 +    if (HYPERVISOR_update_va_mapping((unsigned long) &_text, nullpte, UVMF_INVLPG))
   10.16 +	printk("Unable to unmap first page\n");
   10.17  
   10.18      set_xen_guest_handle(reservation.extent_start, mfns);
   10.19      reservation.nr_extents = n;
    11.1 --- a/extras/mini-os/arch/x86/time.c	Tue Jan 22 08:27:29 2008 -0700
    11.2 +++ b/extras/mini-os/arch/x86/time.c	Tue Jan 22 08:30:40 2008 -0700
    11.3 @@ -175,30 +175,32 @@ static void update_wallclock(void)
    11.4  	do {
    11.5  		shadow_ts_version = s->wc_version;
    11.6  		rmb();
    11.7 -		shadow_ts.ts_sec  = s->wc_sec;
    11.8 -		shadow_ts.ts_nsec = s->wc_nsec;
    11.9 +		shadow_ts.tv_sec  = s->wc_sec;
   11.10 +		shadow_ts.tv_nsec = s->wc_nsec;
   11.11  		rmb();
   11.12  	}
   11.13  	while ((s->wc_version & 1) | (shadow_ts_version ^ s->wc_version));
   11.14  }
   11.15  
   11.16  
   11.17 -void gettimeofday(struct timeval *tv)
   11.18 +int gettimeofday(struct timeval *tv, void *tz)
   11.19  {
   11.20      u64 nsec = monotonic_clock();
   11.21 -    nsec += shadow_ts.ts_nsec;
   11.22 +    nsec += shadow_ts.tv_nsec;
   11.23      
   11.24      
   11.25 -    tv->tv_sec = shadow_ts.ts_sec;
   11.26 +    tv->tv_sec = shadow_ts.tv_sec;
   11.27      tv->tv_sec += NSEC_TO_SEC(nsec);
   11.28      tv->tv_usec = NSEC_TO_USEC(nsec % 1000000000UL);
   11.29 +
   11.30 +    return 0;
   11.31  }
   11.32  
   11.33  
   11.34  void block_domain(s_time_t until)
   11.35  {
   11.36      struct timeval tv;
   11.37 -    gettimeofday(&tv);
   11.38 +    gettimeofday(&tv, NULL);
   11.39      if(monotonic_clock() < until)
   11.40      {
   11.41          HYPERVISOR_set_timer_op(until);
    12.1 --- a/extras/mini-os/blkfront.c	Tue Jan 22 08:27:29 2008 -0700
    12.2 +++ b/extras/mini-os/blkfront.c	Tue Jan 22 08:30:40 2008 -0700
    12.3 @@ -71,8 +71,8 @@ struct blkfront_dev *init_blkfront(char 
    12.4  
    12.5      struct blkfront_dev *dev;
    12.6  
    12.7 -    ASSERT(!strncmp(nodename, "/local/domain/", 14));
    12.8 -    nodename = strchr(nodename + 14, '/') + 1;
    12.9 +    if (!nodename)
   12.10 +        nodename = "device/vbd/768";
   12.11  
   12.12      char path[strlen(nodename) + 1 + 10 + 1];
   12.13  
   12.14 @@ -88,7 +88,7 @@ struct blkfront_dev *init_blkfront(char 
   12.15      SHARED_RING_INIT(s);
   12.16      FRONT_RING_INIT(&dev->ring, s, PAGE_SIZE);
   12.17  
   12.18 -    dev->ring_ref = gnttab_grant_access(0,virt_to_mfn(s),0);
   12.19 +    dev->ring_ref = gnttab_grant_access(0,virtual_to_mfn(s),0);
   12.20  
   12.21      evtchn_alloc_unbound_t op;
   12.22      op.dom = DOMID_SELF;
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/extras/mini-os/daytime.c	Tue Jan 22 08:30:40 2008 -0700
    13.3 @@ -0,0 +1,64 @@
    13.4 +/* 
    13.5 + * daytime.c: a simple network service based on lwIP and mini-os
    13.6 + * 
    13.7 + * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
    13.8 + */
    13.9 +
   13.10 +#include <os.h>
   13.11 +#include <xmalloc.h>
   13.12 +#include <console.h>
   13.13 +#include <netfront.h>
   13.14 +#include <lwip/api.h>
   13.15 +
   13.16 +static char message[29];
   13.17 +
   13.18 +void run_server(void *p)
   13.19 +{
   13.20 +    struct ip_addr listenaddr = { 0 };
   13.21 +    struct ip_addr ipaddr = { htonl(0x0a000001) };
   13.22 +    struct ip_addr netmask = { htonl(0xff000000) };
   13.23 +    struct ip_addr gw = { 0 };
   13.24 +    struct netconn *listener;
   13.25 +    struct netconn *session;
   13.26 +    struct timeval tv;
   13.27 +    err_t rc;
   13.28 +
   13.29 +    start_networking();
   13.30 +    networking_set_addr(&ipaddr, &netmask, &gw);
   13.31 +
   13.32 +    tprintk("Opening connection\n");
   13.33 +
   13.34 +    listener = netconn_new(NETCONN_TCP);
   13.35 +    tprintk("Connection at %p\n", listener);
   13.36 +
   13.37 +    rc = netconn_bind(listener, &listenaddr, 13);
   13.38 +    if (rc != ERR_OK) {
   13.39 +        tprintk("Failed to bind connection: %i\n", rc);
   13.40 +        return;
   13.41 +    }
   13.42 +
   13.43 +    rc = netconn_listen(listener);
   13.44 +    if (rc != ERR_OK) {
   13.45 +        tprintk("Failed to listen on connection: %i\n", rc);
   13.46 +        return;
   13.47 +    }
   13.48 +
   13.49 +    while (1) {
   13.50 +        session = netconn_accept(listener);
   13.51 +        if (session == NULL) 
   13.52 +            continue;
   13.53 +
   13.54 +        gettimeofday(&tv, NULL);
   13.55 +        sprintf(message, "%20lu.%6.6lu\n", tv.tv_sec, tv.tv_usec);
   13.56 +        (void) netconn_write(session, message, strlen(message), NETCONN_COPY);
   13.57 +        (void) netconn_disconnect(session);
   13.58 +        (void) netconn_delete(session);
   13.59 +    }
   13.60 +}
   13.61 +
   13.62 +
   13.63 +int app_main(start_info_t *si)
   13.64 +{
   13.65 +    create_thread("server", run_server, NULL);
   13.66 +    return 0;
   13.67 +}
    14.1 --- a/extras/mini-os/fs-front.c	Tue Jan 22 08:27:29 2008 -0700
    14.2 +++ b/extras/mini-os/fs-front.c	Tue Jan 22 08:30:40 2008 -0700
    14.3 @@ -817,7 +817,7 @@ void test_fs_import(void *data)
    14.4      long ret64;
    14.5     
    14.6      /* Sleep for 1s and then try to open a file */
    14.7 -    sleep(1000);
    14.8 +    msleep(1000);
    14.9      ret = fs_create(import, "mini-os-created-directory", 1, 0777);
   14.10      printk("Directory create: %d\n", ret);
   14.11  
   14.12 @@ -1013,7 +1013,7 @@ done:
   14.13              printk("Backend found at %s\n", import->backend);
   14.14              break;
   14.15          }
   14.16 -	sleep(WAIT_PERIOD);
   14.17 +	msleep(WAIT_PERIOD);
   14.18      }        
   14.19      
   14.20      if(!import->backend)
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/extras/mini-os/include/arch/cc.h	Tue Jan 22 08:30:40 2008 -0700
    15.3 @@ -0,0 +1,83 @@
    15.4 +/* 
    15.5 + * lwip/arch/cc.h
    15.6 + *
    15.7 + * Compiler-specific types and macros for lwIP running on mini-os 
    15.8 + *
    15.9 + * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
   15.10 + */
   15.11 +
   15.12 +#ifndef __LWIP_ARCH_CC_H__
   15.13 +#define __LWIP_ARCH_CC_H__
   15.14 +
   15.15 +/*   Typedefs for the types used by lwip - */
   15.16 +#include <os.h>
   15.17 +#include <types.h>
   15.18 +#include <time.h>
   15.19 +typedef  u8  u8_t;
   15.20 +typedef  s8  s8_t;
   15.21 +typedef u16 u16_t;
   15.22 +typedef s16 s16_t;
   15.23 +typedef u32 u32_t;
   15.24 +typedef s32 s32_t;
   15.25 +typedef u64 u64_t;
   15.26 +typedef s64 s64_t;
   15.27 +typedef uintptr_t mem_ptr_t;
   15.28 +
   15.29 +typedef u16 u_short;
   15.30 +
   15.31 +/*   Compiler hints for packing lwip's structures - */
   15.32 +#define PACK_STRUCT_FIELD(_x)  _x
   15.33 +#define PACK_STRUCT_STRUCT     __attribute__ ((packed))
   15.34 +#define PACK_STRUCT_BEGIN 
   15.35 +#define PACK_STRUCT_END
   15.36 +
   15.37 +/*   Platform specific diagnostic output - */
   15.38 +
   15.39 +extern void lwip_printk(char *fmt, ...);
   15.40 +#define LWIP_PLATFORM_DIAG(_x) do { lwip_printk _x ; } while (0)
   15.41 +
   15.42 +extern void lwip_die(char *fmt, ...);
   15.43 +#define LWIP_PLATFORM_ASSERT(_x) do { lwip_die(_x); } while(0)
   15.44 +
   15.45 +/*   "lightweight" synchronization mechanisms - */
   15.46 +/*     SYS_ARCH_DECL_PROTECT(x) - declare a protection state variable. */
   15.47 +/*     SYS_ARCH_PROTECT(x)      - enter protection mode. */
   15.48 +/*     SYS_ARCH_UNPROTECT(x)    - leave protection mode. */
   15.49 +
   15.50 +/*   If the compiler does not provide memset() this file must include a */
   15.51 +/*   definition of it, or include a file which defines it. */
   15.52 +#include <lib.h>
   15.53 +
   15.54 +/*   This file must either include a system-local <errno.h> which defines */
   15.55 +/*   the standard *nix error codes, or it should #define LWIP_PROVIDE_ERRNO */
   15.56 +/*   to make lwip/arch.h define the codes which are used throughout. */
   15.57 +#include <errno.h>
   15.58 +
   15.59 +/*   Not required by the docs, but needed for network-order calculations */
   15.60 +#include <endian.h>
   15.61 +
   15.62 +#include <inttypes.h>
   15.63 +#define S16_F PRIi16
   15.64 +#define U16_F PRIu16
   15.65 +#define X16_F PRIx16
   15.66 +#define S32_F PRIi32
   15.67 +#define U32_F PRIu32
   15.68 +#define X32_F PRIx32
   15.69 +
   15.70 +#if 0
   15.71 +#ifndef DBG_ON
   15.72 +#define DBG_ON	LWIP_DBG_ON
   15.73 +#endif
   15.74 +#define LWIP_DEBUG	DBG_ON
   15.75 +//#define IP_DEBUG	DBG_ON
   15.76 +#define TCP_DEBUG	DBG_ON
   15.77 +#define TCP_INPUT_DEBUG	DBG_ON
   15.78 +#define TCP_QLEN_DEBUG	DBG_ON
   15.79 +#define TCPIP_DEBUG	DBG_ON
   15.80 +#define DBG_TYPES_ON	DBG_ON
   15.81 +#endif
   15.82 +
   15.83 +/* TODO: checksum doesn't work fine?! */
   15.84 +#define CHECKSUM_CHECK_TCP	0
   15.85 +
   15.86 +#endif /* __LWIP_ARCH_CC_H__ */
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/extras/mini-os/include/arch/perf.h	Tue Jan 22 08:30:40 2008 -0700
    16.3 @@ -0,0 +1,15 @@
    16.4 +/* 
    16.5 + * lwip/arch/perf.h
    16.6 + *
    16.7 + * Arch-specific performance measurement for lwIP running on mini-os 
    16.8 + *
    16.9 + * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
   16.10 + */
   16.11 +
   16.12 +#ifndef __LWIP_ARCH_PERF_H__
   16.13 +#define __LWIP_ARCH_PERF_H__
   16.14 +
   16.15 +#define PERF_START    do { } while(0)
   16.16 +#define PERF_STOP(_x) do { (void)(_x); } while (0)
   16.17 +
   16.18 +#endif /* __LWIP_ARCH_PERF_H__ */
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/extras/mini-os/include/arch/sys_arch.h	Tue Jan 22 08:30:40 2008 -0700
    17.3 @@ -0,0 +1,35 @@
    17.4 +/* 
    17.5 + * lwip/arch/sys_arch.h
    17.6 + *
    17.7 + * Arch-specific semaphores and mailboxes for lwIP running on mini-os 
    17.8 + *
    17.9 + * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
   17.10 + */
   17.11 +
   17.12 +#ifndef __LWIP_ARCH_SYS_ARCH_H__
   17.13 +#define __LWIP_ARCH_SYS_ARCH_H__
   17.14 +
   17.15 +#include <os.h>
   17.16 +#include <xmalloc.h>
   17.17 +#include <semaphore.h>
   17.18 +
   17.19 +typedef struct semaphore *sys_sem_t;
   17.20 +#define SYS_SEM_NULL ((sys_sem_t) NULL)
   17.21 +
   17.22 +struct mbox {
   17.23 +    int count;
   17.24 +    void **messages;
   17.25 +    struct semaphore read_sem;
   17.26 +    struct semaphore write_sem;
   17.27 +    int writer;
   17.28 +    int reader;
   17.29 +};
   17.30 +
   17.31 +typedef struct mbox *sys_mbox_t;
   17.32 +#define SYS_MBOX_NULL ((sys_mbox_t) 0)
   17.33 +
   17.34 +typedef struct thread *sys_thread_t;
   17.35 +
   17.36 +typedef unsigned long sys_prot_t;
   17.37 +
   17.38 +#endif /*__LWIP_ARCH_SYS_ARCH_H__ */
    18.1 --- a/extras/mini-os/include/blkfront.h	Tue Jan 22 08:27:29 2008 -0700
    18.2 +++ b/extras/mini-os/include/blkfront.h	Tue Jan 22 08:30:40 2008 -0700
    18.3 @@ -7,7 +7,7 @@ struct blkfront_aiocb
    18.4      struct blkfront_dev *aio_dev;
    18.5      uint8_t *aio_buf;
    18.6      size_t aio_nbytes;
    18.7 -    uint64_t aio_offset;
    18.8 +    off_t aio_offset;
    18.9      void *data;
   18.10  
   18.11      grant_ref_t gref[BLKIF_MAX_SEGMENTS_PER_REQUEST];
   18.12 @@ -15,7 +15,9 @@ struct blkfront_aiocb
   18.13      void (*aio_cb)(struct blkfront_aiocb *aiocb, int ret);
   18.14  };
   18.15  struct blkfront_dev *init_blkfront(char *nodename, uint64_t *sectors, unsigned *sector_size, int *mode);
   18.16 +#ifdef HAVE_LIBC
   18.17  int blkfront_open(struct blkfront_dev *dev);
   18.18 +#endif
   18.19  void blkfront_aio(struct blkfront_aiocb *aiocbp, int write);
   18.20  void blkfront_aio_read(struct blkfront_aiocb *aiocbp);
   18.21  void blkfront_aio_write(struct blkfront_aiocb *aiocbp);
    19.1 --- a/extras/mini-os/include/console.h	Tue Jan 22 08:27:29 2008 -0700
    19.2 +++ b/extras/mini-os/include/console.h	Tue Jan 22 08:30:40 2008 -0700
    19.3 @@ -38,9 +38,12 @@
    19.4  
    19.5  #include<traps.h>
    19.6  
    19.7 +void print(int direct, const char *fmt, va_list args);
    19.8  void printk(const char *fmt, ...);
    19.9  void xprintk(const char *fmt, ...);
   19.10  
   19.11 +#define tprintk(_fmt, _args...) printk("[%s] " _fmt, current->name, ##_args) 
   19.12 +
   19.13  void xencons_rx(char *buf, unsigned len, struct pt_regs *regs);
   19.14  void xencons_tx(void);
   19.15  
    20.1 --- a/extras/mini-os/include/fs.h	Tue Jan 22 08:27:29 2008 -0700
    20.2 +++ b/extras/mini-os/include/fs.h	Tue Jan 22 08:30:40 2008 -0700
    20.3 @@ -3,6 +3,7 @@
    20.4  
    20.5  #include <xen/io/fsif.h>
    20.6  #include <semaphore.h>
    20.7 +#include <types.h>
    20.8  
    20.9  struct fs_import 
   20.10  {
    21.1 --- a/extras/mini-os/include/ia64/arch_mm.h	Tue Jan 22 08:27:29 2008 -0700
    21.2 +++ b/extras/mini-os/include/ia64/arch_mm.h	Tue Jan 22 08:30:40 2008 -0700
    21.3 @@ -25,6 +25,7 @@
    21.4  #define __ARCH_MM_H__
    21.5  
    21.6  #include "page.h"
    21.7 +#include "ia64_cpu.h"
    21.8  
    21.9  #define PFN_PHYS(x)	(pfn_to_page(x))
   21.10  #define PHYS_PFN(x)	(page_to_pfn(x))
   21.11 @@ -32,6 +33,7 @@
   21.12  #define to_phys(x)	__pa(x)
   21.13  
   21.14  #define virt_to_mfn(x)	virt_to_pfn(x)
   21.15 +#define virtual_to_mfn(x)      (ia64_tpa((uint64_t)(x)) >> PAGE_SHIFT)
   21.16  
   21.17  #define STACK_SIZE_PAGE_ORDER   1
   21.18  #define STACK_SIZE              (PAGE_SIZE * (1 << STACK_SIZE_PAGE_ORDER))
    22.1 --- a/extras/mini-os/include/ia64/os.h	Tue Jan 22 08:27:29 2008 -0700
    22.2 +++ b/extras/mini-os/include/ia64/os.h	Tue Jan 22 08:30:40 2008 -0700
    22.3 @@ -38,7 +38,9 @@
    22.4  
    22.5  
    22.6  typedef uint64_t paddr_t;		/* Physical address. */
    22.7 +#ifndef HAVE_LIBC
    22.8  typedef uint64_t caddr_t;		/* rr7/kernel memory address. */
    22.9 +#endif
   22.10  
   22.11  #include "page.h"
   22.12  #include "mm.h"
    23.1 --- a/extras/mini-os/include/lib.h	Tue Jan 22 08:27:29 2008 -0700
    23.2 +++ b/extras/mini-os/include/lib.h	Tue Jan 22 08:30:40 2008 -0700
    23.3 @@ -59,6 +59,9 @@
    23.4  #include <stddef.h>
    23.5  #include <console.h>
    23.6  
    23.7 +#ifdef HAVE_LIBC
    23.8 +#include <stdio.h>
    23.9 +#else
   23.10  /* printing */
   23.11  #define _p(_x) ((void *)(unsigned long)(_x))
   23.12  int vsnprintf(char *buf, size_t size, const char *fmt, va_list args);
   23.13 @@ -69,13 +72,16 @@ int vsprintf(char *buf, const char *fmt,
   23.14  int sprintf(char * buf, const char *fmt, ...);
   23.15  int vsscanf(const char * buf, const char * fmt, va_list args);
   23.16  int sscanf(const char * buf, const char * fmt, ...);
   23.17 +#endif
   23.18  
   23.19  long simple_strtol(const char *cp,char **endp,unsigned int base);
   23.20  unsigned long simple_strtoul(const char *cp,char **endp,unsigned int base);
   23.21  long long simple_strtoll(const char *cp,char **endp,unsigned int base);
   23.22  unsigned long long simple_strtoull(const char *cp,char **endp,unsigned int base);
   23.23  
   23.24 -
   23.25 +#ifdef HAVE_LIBC
   23.26 +#include <string.h>
   23.27 +#else
   23.28  /* string and memory manipulation */
   23.29  int    memcmp(const void *cs, const void *ct, size_t count);
   23.30  void  *memcpy(void *dest, const void *src, size_t count);
   23.31 @@ -91,7 +97,11 @@ char  *strrchr(const char *s, int c);
   23.32  char  *strstr(const char *s1, const char *s2);
   23.33  char * strcat(char * dest, const char * src);
   23.34  char  *strdup(const char *s);
   23.35 +#endif
   23.36  
   23.37 +#define RAND_MIX 2654435769U
   23.38 +
   23.39 +int rand(void);
   23.40  
   23.41  #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
   23.42  
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/extras/mini-os/include/lwipopts.h	Tue Jan 22 08:30:40 2008 -0700
    24.3 @@ -0,0 +1,22 @@
    24.4 +/*
    24.5 + * lwipopts.h
    24.6 + *
    24.7 + * Configuration for lwIP running on mini-os 
    24.8 + *
    24.9 + * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
   24.10 + */
   24.11 +
   24.12 +#ifndef __LWIP_LWIPOPTS_H__
   24.13 +#define __LWIP_LWIPOPTS_H__
   24.14 +
   24.15 +#define SYS_LIGHTWEIGHT_PROT 1
   24.16 +#define MEM_LIBC_MALLOC 1
   24.17 +#define LWIP_TIMEVAL_PRIVATE 0
   24.18 +#define LWIP_DHCP 1
   24.19 +#define LWIP_COMPAT_SOCKETS 0
   24.20 +#define LWIP_IGMP 1
   24.21 +#define MEMP_NUM_SYS_TIMEOUT 10
   24.22 +#define TCP_SND_BUF 3000
   24.23 +#define TCP_MSS 1500
   24.24 +
   24.25 +#endif /* __LWIP_LWIPOPTS_H__ */
    25.1 --- a/extras/mini-os/include/netfront.h	Tue Jan 22 08:27:29 2008 -0700
    25.2 +++ b/extras/mini-os/include/netfront.h	Tue Jan 22 08:30:40 2008 -0700
    25.3 @@ -1,7 +1,19 @@
    25.4  #include <wait.h>
    25.5 +#ifdef HAVE_LWIP
    25.6 +#include <lwip/netif.h>
    25.7 +#endif
    25.8  struct netfront_dev;
    25.9  struct netfront_dev *init_netfront(char *nodename, void (*netif_rx)(unsigned char *data, int len), unsigned char rawmac[6]);
   25.10  void netfront_xmit(struct netfront_dev *dev, unsigned char* data,int len);
   25.11  void shutdown_netfront(struct netfront_dev *dev);
   25.12  
   25.13  extern struct wait_queue_head netfront_queue;
   25.14 +
   25.15 +#ifdef HAVE_LWIP
   25.16 +/* Call this to bring up the netfront interface and the lwIP stack.
   25.17 + * N.B. _must_ be called from a thread; it's not safe to call this from 
   25.18 + * app_main(). */
   25.19 +void start_networking(void);
   25.20 +
   25.21 +void networking_set_addr(struct ip_addr *ipaddr, struct ip_addr *netmask, struct ip_addr *gw);
   25.22 +#endif
    26.1 --- a/extras/mini-os/include/sched.h	Tue Jan 22 08:27:29 2008 -0700
    26.2 +++ b/extras/mini-os/include/sched.h	Tue Jan 22 08:30:40 2008 -0700
    26.3 @@ -47,6 +47,6 @@ void schedule(void);
    26.4  
    26.5  void wake(struct thread *thread);
    26.6  void block(struct thread *thread);
    26.7 -void sleep(u32 millisecs);
    26.8 +void msleep(u32 millisecs);
    26.9  
   26.10  #endif /* __SCHED_H__ */
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/extras/mini-os/include/sys/time.h	Tue Jan 22 08:30:40 2008 -0700
    27.3 @@ -0,0 +1,38 @@
    27.4 +/* -*-  Mode:C; c-basic-offset:4; tab-width:4 -*-
    27.5 + ****************************************************************************
    27.6 + * (C) 2003 - Rolf Neugebauer - Intel Research Cambridge
    27.7 + * (C) 2005 - Grzegorz Milos - Intel Research Cambridge
    27.8 + ****************************************************************************
    27.9 + *
   27.10 + *        File: time.h
   27.11 + *      Author: Rolf Neugebauer (neugebar@dcs.gla.ac.uk)
   27.12 + *     Changes: Grzegorz Milos (gm281@cam.ac.uk)
   27.13 + *              Robert Kaiser (kaiser@informatik.fh-wiesbaden.de)
   27.14 + *              
   27.15 + *        Date: Jul 2003, changes: Jun 2005, Sep 2006
   27.16 + * 
   27.17 + * Environment: Xen Minimal OS
   27.18 + * Description: Time and timer functions
   27.19 + *
   27.20 + ****************************************************************************
   27.21 + */
   27.22 +
   27.23 +#ifndef _MINIOS_SYS_TIME_H_
   27.24 +#define _MINIOS_SYS_TIME_H_
   27.25 +
   27.26 +struct timespec {
   27.27 +    time_t      tv_sec;
   27.28 +    long        tv_nsec;
   27.29 +};
   27.30 +
   27.31 +struct timezone {
   27.32 +};
   27.33 +
   27.34 +struct timeval {
   27.35 +	time_t		tv_sec;		/* seconds */
   27.36 +	suseconds_t	tv_usec;	/* microseconds */
   27.37 +};
   27.38 +
   27.39 +int      gettimeofday(struct timeval *tv, void *tz);
   27.40 +
   27.41 +#endif /* _MINIOS_SYS_TIME_H_ */
    28.1 --- a/extras/mini-os/include/time.h	Tue Jan 22 08:27:29 2008 -0700
    28.2 +++ b/extras/mini-os/include/time.h	Tue Jan 22 08:30:40 2008 -0700
    28.3 @@ -38,20 +38,13 @@ typedef s64 s_time_t;
    28.4  #define Time_Max                ((s_time_t) 0x7fffffffffffffffLL)
    28.5  #define FOREVER                 Time_Max
    28.6  #define NSEC_TO_USEC(_nsec)     ((_nsec) / 1000UL)
    28.7 +#define NSEC_TO_MSEC(_nsec)     ((_nsec) / 1000000ULL)
    28.8  #define NSEC_TO_SEC(_nsec)      ((_nsec) / 1000000000ULL)
    28.9  
   28.10  /* wall clock time  */
   28.11  typedef long time_t;
   28.12  typedef long suseconds_t;
   28.13 -struct timeval {
   28.14 -	time_t		tv_sec;		/* seconds */
   28.15 -	suseconds_t	tv_usec;	/* microseconds */
   28.16 -};
   28.17 -
   28.18 -struct timespec {
   28.19 -    time_t      ts_sec;
   28.20 -    long        ts_nsec;
   28.21 -};
   28.22 +#include <sys/time.h>
   28.23  
   28.24  
   28.25  /* prototypes */
   28.26 @@ -59,7 +52,6 @@ void     init_time(void);
   28.27  s_time_t get_s_time(void);
   28.28  s_time_t get_v_time(void);
   28.29  u64      monotonic_clock(void);
   28.30 -void     gettimeofday(struct timeval *tv);
   28.31  void     block_domain(s_time_t until);
   28.32  
   28.33  #endif /* _TIME_H_ */
    29.1 --- a/extras/mini-os/include/types.h	Tue Jan 22 08:27:29 2008 -0700
    29.2 +++ b/extras/mini-os/include/types.h	Tue Jan 22 08:30:40 2008 -0700
    29.3 @@ -19,6 +19,7 @@
    29.4  
    29.5  #ifndef _TYPES_H_
    29.6  #define _TYPES_H_
    29.7 +#include <stddef.h>
    29.8  
    29.9  typedef signed char         s8;
   29.10  typedef unsigned char       u8;
   29.11 @@ -41,7 +42,6 @@ typedef unsigned long       u_long;
   29.12  #ifdef __i386__
   29.13  typedef long long           quad_t;
   29.14  typedef unsigned long long  u_quad_t;
   29.15 -typedef unsigned int        uintptr_t;
   29.16  
   29.17  #if !defined(CONFIG_X86_PAE)
   29.18  typedef struct { unsigned long pte_low; } pte_t;
   29.19 @@ -52,7 +52,6 @@ typedef struct { unsigned long pte_low, 
   29.20  #elif defined(__x86_64__) || defined(__ia64__)
   29.21  typedef long                quad_t;
   29.22  typedef unsigned long       u_quad_t;
   29.23 -typedef unsigned long       uintptr_t;
   29.24  
   29.25  typedef struct { unsigned long pte; } pte_t;
   29.26  #endif /* __i386__ || __x86_64__ */
   29.27 @@ -64,19 +63,31 @@ typedef struct { unsigned long pte; } pt
   29.28      ((pte_t) {(unsigned long)(_x), (unsigned long)(_x>>32)}); })
   29.29  #endif
   29.30  
   29.31 +#ifdef HAVE_LIBC
   29.32 +#include <limits.h>
   29.33 +#include <stdint.h>
   29.34 +#else
   29.35 +#ifdef __i386__
   29.36 +typedef unsigned int        uintptr_t;
   29.37 +typedef int                 intptr_t;
   29.38 +#elif defined(__x86_64__) || defined(__ia64__)
   29.39 +typedef unsigned long       uintptr_t;
   29.40 +typedef long                intptr_t;
   29.41 +#endif /* __i386__ || __x86_64__ */
   29.42  typedef  u8 uint8_t;
   29.43  typedef  s8 int8_t;
   29.44  typedef u16 uint16_t;
   29.45  typedef s16 int16_t;
   29.46  typedef u32 uint32_t;
   29.47  typedef s32 int32_t;
   29.48 -typedef u64 uint64_t;
   29.49 -typedef s64 int64_t;
   29.50 +typedef u64 uint64_t, uintmax_t;
   29.51 +typedef s64 int64_t, intmax_t;
   29.52 +typedef u64 off_t;
   29.53  
   29.54  
   29.55  #define INT_MAX         ((int)(~0U>>1))
   29.56  #define UINT_MAX            (~0U)
   29.57  
   29.58  typedef long ssize_t;
   29.59 -typedef unsigned long size_t;
   29.60 +#endif
   29.61  #endif /* _TYPES_H_ */
    30.1 --- a/extras/mini-os/include/x86/arch_mm.h	Tue Jan 22 08:27:29 2008 -0700
    30.2 +++ b/extras/mini-os/include/x86/arch_mm.h	Tue Jan 22 08:30:40 2008 -0700
    30.3 @@ -226,6 +226,35 @@ static __inline__ paddr_t machine_to_phy
    30.4  #define pte_to_mfn(_pte)           (((_pte) & (PADDR_MASK&PAGE_MASK)) >> L1_PAGETABLE_SHIFT)
    30.5  #define pte_to_virt(_pte)          to_virt(mfn_to_pfn(pte_to_mfn(_pte)) << PAGE_SHIFT)
    30.6  
    30.7 +
    30.8 +#define PT_BASE			   ((pgentry_t *)start_info.pt_base)
    30.9 +
   30.10 +#ifdef __x86_64__
   30.11 +#define virtual_to_l3(_virt)	   ((pgentry_t *)pte_to_virt(PT_BASE[l4_table_offset(_virt)]))
   30.12 +#else
   30.13 +#define virtual_to_l3(_virt)	   PT_BASE
   30.14 +#endif
   30.15 +
   30.16 +#if defined(__x86_64__) || defined(CONFIG_X86_PAE)
   30.17 +#define virtual_to_l2(_virt)	   ({ \
   30.18 +	unsigned long __virt2 = (_virt); \
   30.19 +	(pgentry_t *) pte_to_virt(virtual_to_l3(__virt2)[l3_table_offset(__virt2)]); \
   30.20 +})
   30.21 +#else
   30.22 +#define virtual_to_l2(_virt)	   PT_BASE
   30.23 +#endif
   30.24 +
   30.25 +#define virtual_to_l1(_virt)	   ({ \
   30.26 +	unsigned long __virt1 = (_virt); \
   30.27 +	(pgentry_t *) pte_to_virt(virtual_to_l2(__virt1)[l2_table_offset(__virt1)]); \
   30.28 +})
   30.29 +
   30.30 +#define virtual_to_pte(_virt)	   ({ \
   30.31 +	unsigned long __virt0 = (unsigned long) (_virt); \
   30.32 +	virtual_to_l1(__virt0)[l1_table_offset(__virt0)]; \
   30.33 +})
   30.34 +#define virtual_to_mfn(_virt)	   pte_to_mfn(virtual_to_pte(_virt))
   30.35 +
   30.36  #define map_frames(f, n) map_frames_ex(f, n, 1, 0, 1, DOMID_SELF, 0, L1_PROT)
   30.37  #define map_zero(n, a) map_frames_ex(&mfn_zero, n, 0, 0, a, DOMID_SELF, 0, L1_PROT_RO)
   30.38  
    31.1 --- a/extras/mini-os/include/x86/arch_sched.h	Tue Jan 22 08:27:29 2008 -0700
    31.2 +++ b/extras/mini-os/include/x86/arch_sched.h	Tue Jan 22 08:30:40 2008 -0700
    31.3 @@ -12,7 +12,7 @@ static inline struct thread* get_current
    31.4  #else
    31.5      register unsigned long sp asm("rsp");
    31.6  #endif 
    31.7 -    current = (void *)(sp & ~(STACK_SIZE-1));
    31.8 +    current = (void *)(unsigned long)(sp & ~(STACK_SIZE-1));
    31.9      return *current;
   31.10  }
   31.11  
    32.1 --- a/extras/mini-os/include/xmalloc.h	Tue Jan 22 08:27:29 2008 -0700
    32.2 +++ b/extras/mini-os/include/xmalloc.h	Tue Jan 22 08:30:40 2008 -0700
    32.3 @@ -1,13 +1,18 @@
    32.4  #ifndef __XMALLOC_H__
    32.5  #define __XMALLOC_H__
    32.6  
    32.7 -/* Allocate space for typed object. */
    32.8 -#define xmalloc(_type) ((_type *)_xmalloc(sizeof(_type), __alignof__(_type)))
    32.9 +#ifdef HAVE_LIBC
   32.10  
   32.11 -/* Allocate space for array of typed objects. */
   32.12 -#define xmalloc_array(_type, _num) ((_type *)_xmalloc_array(sizeof(_type), __alignof__(_type), _num))
   32.13 +#include <stdlib.h>
   32.14 +#include <malloc.h>
   32.15 +/* Allocate space for typed object. */
   32.16 +#define _xmalloc(size, align) memalign(align, size)
   32.17 +#define xfree(ptr) free(ptr)
   32.18  
   32.19 -#define malloc(size) _xmalloc(size, 4)
   32.20 +#else
   32.21 +
   32.22 +#define DEFAULT_ALIGN (sizeof(unsigned long))
   32.23 +#define malloc(size) _xmalloc(size, DEFAULT_ALIGN)
   32.24  #define free(ptr) xfree(ptr)
   32.25  #define realloc(ptr, size) _realloc(ptr, size)
   32.26  
   32.27 @@ -18,6 +23,8 @@ extern void xfree(const void *);
   32.28  extern void *_xmalloc(size_t size, size_t align);
   32.29  extern void *_realloc(void *ptr, size_t size);
   32.30  
   32.31 +#endif
   32.32 +
   32.33  static inline void *_xmalloc_array(size_t size, size_t align, size_t num)
   32.34  {
   32.35  	/* Check for overflow. */
   32.36 @@ -26,4 +33,10 @@ static inline void *_xmalloc_array(size_
   32.37   	return _xmalloc(size * num, align);
   32.38  }
   32.39  
   32.40 +/* Allocate space for typed object. */
   32.41 +#define xmalloc(_type) ((_type *)_xmalloc(sizeof(_type), __alignof__(_type)))
   32.42 +
   32.43 +/* Allocate space for array of typed objects. */
   32.44 +#define xmalloc_array(_type, _num) ((_type *)_xmalloc_array(sizeof(_type), __alignof__(_type), _num))
   32.45 +
   32.46  #endif /* __XMALLOC_H__ */
    33.1 --- a/extras/mini-os/kernel.c	Tue Jan 22 08:27:29 2008 -0700
    33.2 +++ b/extras/mini-os/kernel.c	Tue Jan 22 08:30:40 2008 -0700
    33.3 @@ -38,7 +38,10 @@
    33.4  #include <xenbus.h>
    33.5  #include <gnttab.h>
    33.6  #include <netfront.h>
    33.7 +#include <blkfront.h>
    33.8  #include <fs.h>
    33.9 +#include <xmalloc.h>
   33.10 +#include <fcntl.h>
   33.11  #include <xen/features.h>
   33.12  #include <xen/version.h>
   33.13  
   33.14 @@ -75,9 +78,9 @@ static void periodic_thread(void *p)
   33.15      printk("Periodic thread started.\n");
   33.16      for(;;)
   33.17      {
   33.18 -        gettimeofday(&tv);
   33.19 +        gettimeofday(&tv, NULL);
   33.20          printk("T(s=%ld us=%ld)\n", tv.tv_sec, tv.tv_usec);
   33.21 -        sleep(1000);
   33.22 +        msleep(1000);
   33.23      }
   33.24  }
   33.25  
   33.26 @@ -86,6 +89,165 @@ static void netfront_thread(void *p)
   33.27      init_netfront(NULL, NULL, NULL);
   33.28  }
   33.29  
   33.30 +static struct blkfront_dev *blk_dev;
   33.31 +static uint64_t blk_sectors;
   33.32 +static unsigned blk_sector_size;
   33.33 +static int blk_mode;
   33.34 +static uint64_t blk_size_read;
   33.35 +static uint64_t blk_size_write;
   33.36 +
   33.37 +struct blk_req {
   33.38 +    struct blkfront_aiocb aiocb;
   33.39 +    int rand_value;
   33.40 +    struct blk_req *next;
   33.41 +};
   33.42 +
   33.43 +#ifdef BLKTEST_WRITE
   33.44 +static struct blk_req *blk_to_read;
   33.45 +#endif
   33.46 +
   33.47 +static struct blk_req *blk_alloc_req(uint64_t sector)
   33.48 +{
   33.49 +    struct blk_req *req = xmalloc(struct blk_req);
   33.50 +    req->aiocb.aio_dev = blk_dev;
   33.51 +    req->aiocb.aio_buf = _xmalloc(blk_sector_size, blk_sector_size);
   33.52 +    req->aiocb.aio_nbytes = blk_sector_size;
   33.53 +    req->aiocb.aio_offset = sector * blk_sector_size;
   33.54 +    req->aiocb.data = req;
   33.55 +    req->next = NULL;
   33.56 +    return req;
   33.57 +}
   33.58 +
   33.59 +static void blk_read_completed(struct blkfront_aiocb *aiocb, int ret)
   33.60 +{
   33.61 +    struct blk_req *req = aiocb->data;
   33.62 +    if (ret)
   33.63 +        printk("got error code %d when reading at offset %ld\n", ret, aiocb->aio_offset);
   33.64 +    else
   33.65 +        blk_size_read += blk_sector_size;
   33.66 +    free(aiocb->aio_buf);
   33.67 +    free(req);
   33.68 +}
   33.69 +
   33.70 +static void blk_read_sector(uint64_t sector)
   33.71 +{
   33.72 +    struct blk_req *req;
   33.73 +
   33.74 +    req = blk_alloc_req(sector);
   33.75 +    req->aiocb.aio_cb = blk_read_completed;
   33.76 +
   33.77 +    blkfront_aio_read(&req->aiocb);
   33.78 +}
   33.79 +
   33.80 +#ifdef BLKTEST_WRITE
   33.81 +static void blk_write_read_completed(struct blkfront_aiocb *aiocb, int ret)
   33.82 +{
   33.83 +    struct blk_req *req = aiocb->data;
   33.84 +    int rand_value;
   33.85 +    int i;
   33.86 +    int *buf;
   33.87 +
   33.88 +    if (ret) {
   33.89 +        printk("got error code %d when reading back at offset %ld\n", ret, aiocb->aio_offset);
   33.90 +        free(aiocb->aio_buf);
   33.91 +        free(req);
   33.92 +        return;
   33.93 +    }
   33.94 +    blk_size_read += blk_sector_size;
   33.95 +    buf = (int*) aiocb->aio_buf;
   33.96 +    rand_value = req->rand_value;
   33.97 +    for (i = 0; i < blk_sector_size / sizeof(int); i++) {
   33.98 +        if (buf[i] != rand_value) {
   33.99 +            printk("bogus data at offset %ld\n", aiocb->aio_offset + i);
  33.100 +            break;
  33.101 +        }
  33.102 +        rand_value *= RAND_MIX;
  33.103 +    }
  33.104 +    free(aiocb->aio_buf);
  33.105 +    free(req);
  33.106 +}
  33.107 +
  33.108 +static void blk_write_completed(struct blkfront_aiocb *aiocb, int ret)
  33.109 +{
  33.110 +    struct blk_req *req = aiocb->data;
  33.111 +    if (ret) {
  33.112 +        printk("got error code %d when writing at offset %ld\n", ret, aiocb->aio_offset);
  33.113 +        free(aiocb->aio_buf);
  33.114 +        free(req);
  33.115 +        return;
  33.116 +    }
  33.117 +    blk_size_write += blk_sector_size;
  33.118 +    /* Push write check */
  33.119 +    req->next = blk_to_read;
  33.120 +    blk_to_read = req;
  33.121 +}
  33.122 +
  33.123 +static void blk_write_sector(uint64_t sector)
  33.124 +{
  33.125 +    struct blk_req *req;
  33.126 +    int rand_value;
  33.127 +    int i;
  33.128 +    int *buf;
  33.129 +
  33.130 +    req = blk_alloc_req(sector);
  33.131 +    req->aiocb.aio_cb = blk_write_completed;
  33.132 +    req->rand_value = rand_value = rand();
  33.133 +
  33.134 +    buf = (int*) req->aiocb.aio_buf;
  33.135 +    for (i = 0; i < blk_sector_size / sizeof(int); i++) {
  33.136 +        buf[i] = rand_value;
  33.137 +        rand_value *= RAND_MIX;
  33.138 +    }
  33.139 +
  33.140 +    blkfront_aio_write(&req->aiocb);
  33.141 +}
  33.142 +#endif
  33.143 +
  33.144 +static void blkfront_thread(void *p)
  33.145 +{
  33.146 +    time_t lasttime = 0;
  33.147 +    blk_dev = init_blkfront(NULL, &blk_sectors, &blk_sector_size, &blk_mode);
  33.148 +    if (!blk_dev)
  33.149 +        return;
  33.150 +
  33.151 +#ifdef BLKTEST_WRITE
  33.152 +    if (blk_mode == O_RDWR) {
  33.153 +        blk_write_sector(0);
  33.154 +        blk_write_sector(blk_sectors-1);
  33.155 +    } else
  33.156 +#endif
  33.157 +    {
  33.158 +        blk_read_sector(0);
  33.159 +        blk_read_sector(blk_sectors-1);
  33.160 +    }
  33.161 +
  33.162 +    while (1) {
  33.163 +        uint64_t sector = rand() % blk_sectors;
  33.164 +        struct timeval tv;
  33.165 +#ifdef BLKTEST_WRITE
  33.166 +        if (blk_mode == O_RDWR)
  33.167 +            blk_write_sector(sector);
  33.168 +        else
  33.169 +#endif
  33.170 +            blk_read_sector(sector);
  33.171 +        blkfront_aio_poll(blk_dev);
  33.172 +        gettimeofday(&tv, NULL);
  33.173 +        if (tv.tv_sec > lasttime + 10) {
  33.174 +            printk("%llu read, %llu write\n", blk_size_read, blk_size_write);
  33.175 +            lasttime = tv.tv_sec;
  33.176 +        }
  33.177 +
  33.178 +#ifdef BLKTEST_WRITE
  33.179 +        while (blk_to_read) {
  33.180 +            struct blk_req *req = blk_to_read;
  33.181 +            blk_to_read = blk_to_read->next;
  33.182 +            req->aiocb.aio_cb = blk_write_read_completed;
  33.183 +            blkfront_aio_read(&req->aiocb);
  33.184 +        }
  33.185 +#endif
  33.186 +    }
  33.187 +}
  33.188 +
  33.189  static void fs_thread(void *p)
  33.190  {
  33.191      init_fs_frontend();
  33.192 @@ -98,6 +260,7 @@ static void fs_thread(void *p)
  33.193      create_thread("xenbus_tester", xenbus_tester, si);
  33.194      create_thread("periodic_thread", periodic_thread, si);
  33.195      create_thread("netfront", netfront_thread, si);
  33.196 +    create_thread("blkfront", blkfront_thread, si);
  33.197      create_thread("fs-frontend", fs_thread, si);
  33.198      return 0;
  33.199  }
    34.1 --- a/extras/mini-os/lib/math.c	Tue Jan 22 08:27:29 2008 -0700
    34.2 +++ b/extras/mini-os/lib/math.c	Tue Jan 22 08:30:40 2008 -0700
    34.3 @@ -56,6 +56,8 @@
    34.4  */
    34.5  
    34.6  #include <types.h>
    34.7 +#include <lib.h>
    34.8 +#include <time.h>
    34.9  
   34.10  	/* On ia64 these functions lead to crashes. These are replaced by
   34.11  	 * assembler functions. */
   34.12 @@ -85,7 +87,9 @@ union uu {
   34.13   * These are used for shifting, and also below for halfword extraction
   34.14   * and assembly.
   34.15   */
   34.16 +#ifndef HAVE_LIBC
   34.17  #define CHAR_BIT        8               /* number of bits in a char */
   34.18 +#endif
   34.19  #define QUAD_BITS       (sizeof(s64) * CHAR_BIT)
   34.20  #define LONG_BITS       (sizeof(long) * CHAR_BIT)
   34.21  #define HALF_BITS       (sizeof(long) * CHAR_BIT / 2)
   34.22 @@ -385,3 +389,16 @@ u_quad_t
   34.23  }
   34.24  
   34.25  #endif /* !defined(__ia64__) */
   34.26 +
   34.27 +#ifndef HAVE_LIBC
   34.28 +/* Should be random enough for our uses */
   34.29 +int rand(void)
   34.30 +{
   34.31 +    static unsigned int previous;
   34.32 +    struct timeval tv;
   34.33 +    gettimeofday(&tv, NULL);
   34.34 +    previous += tv.tv_sec + tv.tv_usec;
   34.35 +    previous *= RAND_MIX;
   34.36 +    return previous;
   34.37 +}
   34.38 +#endif
    35.1 --- a/extras/mini-os/lib/xmalloc.c	Tue Jan 22 08:27:29 2008 -0700
    35.2 +++ b/extras/mini-os/lib/xmalloc.c	Tue Jan 22 08:30:40 2008 -0700
    35.3 @@ -5,9 +5,11 @@
    35.4   *
    35.5   *        File: xmaloc.c
    35.6   *      Author: Grzegorz Milos (gm281@cam.ac.uk)
    35.7 + *              Samuel Thibault (samuel.thibault@eu.citrix.com)
    35.8   *     Changes: 
    35.9   *              
   35.10   *        Date: Aug 2005
   35.11 + *              Jan 2008
   35.12   * 
   35.13   * Environment: Xen Minimal OS
   35.14   * Description: simple memory allocator
   35.15 @@ -39,22 +41,26 @@
   35.16  #include <types.h>
   35.17  #include <lib.h>
   35.18  #include <list.h>
   35.19 +#include <xmalloc.h>
   35.20  
   35.21 +#ifndef HAVE_LIBC
   35.22  static LIST_HEAD(freelist);
   35.23  /* static spinlock_t freelist_lock = SPIN_LOCK_UNLOCKED; */
   35.24  
   35.25  struct xmalloc_hdr
   35.26  {
   35.27 -    /* Total including this hdr. */
   35.28 +    /* Total including this hdr, unused padding and second hdr. */
   35.29      size_t size;
   35.30      struct list_head freelist;
   35.31 -#if defined(__ia64__)
   35.32 -		// Needed for ia64 as long as the align parameter in _xmalloc()
   35.33 -		// is not supported.
   35.34 -    uint64_t pad;
   35.35 -#endif
   35.36 +} __cacheline_aligned;
   35.37  
   35.38 -} __cacheline_aligned;
   35.39 +/* Unused padding data between the two hdrs. */
   35.40 +
   35.41 +struct xmalloc_pad
   35.42 +{
   35.43 +    /* Size including both hdrs. */
   35.44 +    size_t hdr_size;
   35.45 +};
   35.46  
   35.47  static void maybe_split(struct xmalloc_hdr *hdr, size_t size, size_t block)
   35.48  {
   35.49 @@ -62,11 +68,13 @@ static void maybe_split(struct xmalloc_h
   35.50      size_t leftover = block - size;
   35.51  
   35.52      /* If enough is left to make a block, put it on free list. */
   35.53 -    if ( leftover >= (2 * sizeof(struct xmalloc_hdr)) )
   35.54 +    if ( leftover >= (2 * (sizeof(struct xmalloc_hdr) + sizeof(struct xmalloc_pad))) )
   35.55      {
   35.56          extra = (struct xmalloc_hdr *)((unsigned long)hdr + size);
   35.57          extra->size = leftover;
   35.58 +        /* spin_lock_irqsave(&freelist_lock, flags); */
   35.59          list_add(&extra->freelist, &freelist);
   35.60 +        /* spin_unlock_irqrestore(&freelist_lock, flags); */
   35.61      }
   35.62      else
   35.63      {
   35.64 @@ -78,7 +86,7 @@ static void maybe_split(struct xmalloc_h
   35.65      hdr->freelist.next = hdr->freelist.prev = NULL;
   35.66  }
   35.67  
   35.68 -static void *xmalloc_new_page(size_t size)
   35.69 +static struct xmalloc_hdr *xmalloc_new_page(size_t size)
   35.70  {
   35.71      struct xmalloc_hdr *hdr;
   35.72      /* unsigned long flags; */
   35.73 @@ -87,18 +95,30 @@ static void *xmalloc_new_page(size_t siz
   35.74      if ( hdr == NULL )
   35.75          return NULL;
   35.76  
   35.77 -    /* spin_lock_irqsave(&freelist_lock, flags); */
   35.78      maybe_split(hdr, size, PAGE_SIZE);
   35.79 -    /* spin_unlock_irqrestore(&freelist_lock, flags); */
   35.80  
   35.81 -    return hdr+1;
   35.82 +    return hdr;
   35.83 +}
   35.84 +
   35.85 +/* Return size, increased to alignment with align. */
   35.86 +static inline size_t align_up(size_t size, size_t align)
   35.87 +{
   35.88 +    return (size + align - 1) & ~(align - 1);
   35.89  }
   35.90  
   35.91  /* Big object?  Just use the page allocator. */
   35.92 -static void *xmalloc_whole_pages(size_t size)
   35.93 +static void *xmalloc_whole_pages(size_t size, size_t align)
   35.94  {
   35.95      struct xmalloc_hdr *hdr;
   35.96 -    unsigned int pageorder = get_order(size);
   35.97 +    struct xmalloc_pad *pad;
   35.98 +    unsigned int pageorder;
   35.99 +    void *ret;
  35.100 +    /* Room for headers */
  35.101 +    size_t hdr_size = sizeof(struct xmalloc_hdr) + sizeof(struct xmalloc_pad);
  35.102 +    /* Align for actual beginning of data */
  35.103 +    hdr_size = align_up(hdr_size, align);
  35.104 +
  35.105 +    pageorder = get_order(hdr_size + size);
  35.106  
  35.107      hdr = (struct xmalloc_hdr *)alloc_pages(pageorder);
  35.108      if ( hdr == NULL )
  35.109 @@ -108,54 +128,82 @@ static void *xmalloc_whole_pages(size_t 
  35.110      /* Debugging aid. */
  35.111      hdr->freelist.next = hdr->freelist.prev = NULL;
  35.112  
  35.113 -    return hdr+1;
  35.114 -}
  35.115 -
  35.116 -/* Return size, increased to alignment with align. */
  35.117 -static inline size_t align_up(size_t size, size_t align)
  35.118 -{
  35.119 -    return (size + align - 1) & ~(align - 1);
  35.120 +    ret = (char*)hdr + hdr_size;
  35.121 +    pad = (struct xmalloc_pad *) ret - 1;
  35.122 +    pad->hdr_size = hdr_size;
  35.123 +    return ret;
  35.124  }
  35.125  
  35.126  void *_xmalloc(size_t size, size_t align)
  35.127  {
  35.128 -    struct xmalloc_hdr *i;
  35.129 +    struct xmalloc_hdr *i, *hdr = NULL;
  35.130 +    uintptr_t data_begin;
  35.131 +    size_t hdr_size;
  35.132      /* unsigned long flags; */
  35.133  
  35.134 -    /* Add room for header, pad to align next header. */
  35.135 -    size += sizeof(struct xmalloc_hdr);
  35.136 -    size = align_up(size, __alignof__(struct xmalloc_hdr));
  35.137 +    hdr_size = sizeof(struct xmalloc_hdr) + sizeof(struct xmalloc_pad);
  35.138 +    /* Align on headers requirements. */
  35.139 +    align = align_up(align, __alignof__(struct xmalloc_hdr));
  35.140 +    align = align_up(align, __alignof__(struct xmalloc_pad));
  35.141  
  35.142      /* For big allocs, give them whole pages. */
  35.143 -    if ( size >= PAGE_SIZE )
  35.144 -        return xmalloc_whole_pages(size);
  35.145 +    if ( size + align_up(hdr_size, align) >= PAGE_SIZE )
  35.146 +        return xmalloc_whole_pages(size, align);
  35.147  
  35.148      /* Search free list. */
  35.149      /* spin_lock_irqsave(&freelist_lock, flags); */
  35.150      list_for_each_entry( i, &freelist, freelist )
  35.151      {
  35.152 -        if ( i->size < size )
  35.153 +        data_begin = align_up((uintptr_t)i + hdr_size, align);
  35.154 +
  35.155 +        if ( data_begin + size > (uintptr_t)i + i->size )
  35.156              continue;
  35.157 +
  35.158          list_del(&i->freelist);
  35.159 -        maybe_split(i, size, i->size);
  35.160          /* spin_unlock_irqrestore(&freelist_lock, flags); */
  35.161 -        return i+1;
  35.162 +
  35.163 +        uintptr_t size_before = (data_begin - hdr_size) - (uintptr_t)i;
  35.164 +
  35.165 +        if (size_before >= 2 * hdr_size) {
  35.166 +            /* Worth splitting the beginning */
  35.167 +            struct xmalloc_hdr *new_i = (void*)(data_begin - hdr_size);
  35.168 +            new_i->size = i->size - size_before;
  35.169 +            i->size = size_before;
  35.170 +            /* spin_lock_irqsave(&freelist_lock, flags); */
  35.171 +            list_add(&i->freelist, &freelist);
  35.172 +            /* spin_unlock_irqrestore(&freelist_lock, flags); */
  35.173 +            i = new_i;
  35.174 +        }
  35.175 +        maybe_split(i, (data_begin + size) - (uintptr_t)i, i->size);
  35.176 +        hdr = i;
  35.177 +        break;
  35.178      }
  35.179 -    /* spin_unlock_irqrestore(&freelist_lock, flags); */
  35.180  
  35.181 -    /* Alloc a new page and return from that. */
  35.182 -    return xmalloc_new_page(size);
  35.183 +    if (!hdr) {
  35.184 +        /* spin_unlock_irqrestore(&freelist_lock, flags); */
  35.185 +
  35.186 +        /* Alloc a new page and return from that. */
  35.187 +        hdr = xmalloc_new_page(align_up(hdr_size, align) + size);
  35.188 +        data_begin = (uintptr_t)hdr + align_up(hdr_size, align);
  35.189 +    }
  35.190 +
  35.191 +    struct xmalloc_pad *pad = (struct xmalloc_pad *) data_begin - 1;
  35.192 +    pad->hdr_size = data_begin - (uintptr_t)hdr;
  35.193 +    BUG_ON(data_begin % align);
  35.194 +    return (void*)data_begin;
  35.195  }
  35.196  
  35.197  void xfree(const void *p)
  35.198  {
  35.199      /* unsigned long flags; */
  35.200      struct xmalloc_hdr *i, *tmp, *hdr;
  35.201 +    struct xmalloc_pad *pad;
  35.202  
  35.203      if ( p == NULL )
  35.204          return;
  35.205  
  35.206 -    hdr = (struct xmalloc_hdr *)p - 1;
  35.207 +    pad = (struct xmalloc_pad *)p - 1;
  35.208 +    hdr = (struct xmalloc_hdr *)((char *)p - pad->hdr_size);
  35.209  
  35.210      /* We know hdr will be on same page. */
  35.211      if(((long)p & PAGE_MASK) != ((long)hdr & PAGE_MASK))
  35.212 @@ -227,15 +275,19 @@ void *_realloc(void *ptr, size_t size)
  35.213  {
  35.214      void *new;
  35.215      struct xmalloc_hdr *hdr;
  35.216 +    struct xmalloc_pad *pad;
  35.217  
  35.218      if (ptr == NULL)
  35.219 -        return _xmalloc(size, 4);
  35.220 +        return _xmalloc(size, DEFAULT_ALIGN);
  35.221  
  35.222 -    hdr = (struct xmalloc_hdr *)ptr - 1;
  35.223 -    if (hdr->size >= size) 
  35.224 +    pad = (struct xmalloc_pad *)ptr - 1;
  35.225 +    hdr = (struct xmalloc_hdr *)((char*)ptr - pad->hdr_size);
  35.226 +    if (hdr->size >= size) {
  35.227 +        maybe_split(hdr, size, hdr->size);
  35.228          return ptr;
  35.229 +    }
  35.230      
  35.231 -    new = _xmalloc(size, 4);
  35.232 +    new = _xmalloc(size, DEFAULT_ALIGN);
  35.233      if (new == NULL) 
  35.234          return NULL;
  35.235  
  35.236 @@ -244,3 +296,4 @@ void *_realloc(void *ptr, size_t size)
  35.237  
  35.238      return new;
  35.239  }
  35.240 +#endif
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/extras/mini-os/lwip-arch.c	Tue Jan 22 08:30:40 2008 -0700
    36.3 @@ -0,0 +1,293 @@
    36.4 +/* 
    36.5 + * lwip-arch.c
    36.6 + *
    36.7 + * Arch-specific semaphores and mailboxes for lwIP running on mini-os 
    36.8 + *
    36.9 + * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
   36.10 + */
   36.11 +
   36.12 +#include <os.h>
   36.13 +#include <time.h>
   36.14 +#include <console.h>
   36.15 +#include <xmalloc.h>
   36.16 +#include <lwip/sys.h>
   36.17 +#include <stdarg.h>
   36.18 +
   36.19 +/* Is called to initialize the sys_arch layer */
   36.20 +void sys_init(void)
   36.21 +{
   36.22 +}
   36.23 +
   36.24 +/* Creates and returns a new semaphore. The "count" argument specifies
   36.25 + * the initial state of the semaphore. */
   36.26 +sys_sem_t sys_sem_new(u8_t count)
   36.27 +{
   36.28 +    struct semaphore *sem = xmalloc(struct semaphore);
   36.29 +    sem->count = count;
   36.30 +    init_waitqueue_head(&sem->wait);
   36.31 +    return sem;
   36.32 +}
   36.33 +
   36.34 +/* Deallocates a semaphore. */
   36.35 +void sys_sem_free(sys_sem_t sem)
   36.36 +{
   36.37 +    xfree(sem);
   36.38 +}
   36.39 +
   36.40 +/* Signals a semaphore. */
   36.41 +void sys_sem_signal(sys_sem_t sem)
   36.42 +{
   36.43 +    up(sem);
   36.44 +}
   36.45 +
   36.46 +/* Blocks the thread while waiting for the semaphore to be
   36.47 + * signaled. If the "timeout" argument is non-zero, the thread should
   36.48 + * only be blocked for the specified time (measured in
   36.49 + * milliseconds).
   36.50 + * 
   36.51 + * If the timeout argument is non-zero, the return value is the number of
   36.52 + * milliseconds spent waiting for the semaphore to be signaled. If the
   36.53 + * semaphore wasn't signaled within the specified time, the return value is
   36.54 + * SYS_ARCH_TIMEOUT. If the thread didn't have to wait for the semaphore
   36.55 + * (i.e., it was already signaled), the function may return zero. */
   36.56 +u32_t sys_arch_sem_wait(sys_sem_t sem, u32_t timeout)
   36.57 +{
   36.58 +    /* Slightly more complicated than the normal minios semaphore:
   36.59 +     * need to wake on timeout *or* signal */
   36.60 +    sys_prot_t prot;
   36.61 +    s64_t then = NOW();
   36.62 +    s64_t deadline;
   36.63 +
   36.64 +    if (timeout == 0)
   36.65 +	deadline = 0;
   36.66 +    else
   36.67 +	deadline = then + MILLISECS(timeout);
   36.68 +
   36.69 +    while(1) {
   36.70 +        wait_event_deadline(sem->wait, (sem->count > 0), deadline);
   36.71 +
   36.72 +        prot = sys_arch_protect();
   36.73 +	/* Atomically check that we can proceed */
   36.74 +	if (sem->count > 0 || (deadline && NOW() >= deadline))
   36.75 +	    break;
   36.76 +        sys_arch_unprotect(prot);
   36.77 +    }
   36.78 +
   36.79 +    if (sem->count > 0) {
   36.80 +        sem->count--;
   36.81 +        sys_arch_unprotect(prot);
   36.82 +        return NSEC_TO_MSEC(NOW() - then); 
   36.83 +    }
   36.84 +    
   36.85 +    sys_arch_unprotect(prot);
   36.86 +    return SYS_ARCH_TIMEOUT;
   36.87 +}
   36.88 +
   36.89 +/* Creates an empty mailbox. */
   36.90 +sys_mbox_t sys_mbox_new(int size)
   36.91 +{
   36.92 +    struct mbox *mbox = xmalloc(struct mbox);
   36.93 +    if (!size)
   36.94 +        size = 32;
   36.95 +    else if (size == 1)
   36.96 +        size = 2;
   36.97 +    mbox->count = size;
   36.98 +    mbox->messages = xmalloc_array(void*, size);
   36.99 +    init_SEMAPHORE(&mbox->read_sem, 0);
  36.100 +    mbox->reader = 0;
  36.101 +    init_SEMAPHORE(&mbox->write_sem, size);
  36.102 +    mbox->writer = 0;
  36.103 +    return mbox;
  36.104 +}
  36.105 +
  36.106 +/* Deallocates a mailbox. If there are messages still present in the
  36.107 + * mailbox when the mailbox is deallocated, it is an indication of a
  36.108 + * programming error in lwIP and the developer should be notified. */
  36.109 +void sys_mbox_free(sys_mbox_t mbox)
  36.110 +{
  36.111 +    ASSERT(mbox->reader == mbox->writer);
  36.112 +    xfree(mbox->messages);
  36.113 +    xfree(mbox);
  36.114 +}
  36.115 +
  36.116 +/* Posts the "msg" to the mailbox, internal version that actually does the
  36.117 + * post. */
  36.118 +static void do_mbox_post(sys_mbox_t mbox, void *msg)
  36.119 +{
  36.120 +    /* The caller got a semaphore token, so we are now allowed to increment
  36.121 +     * writer, but we still need to prevent concurrency between writers
  36.122 +     * (interrupt handler vs main) */
  36.123 +    sys_prot_t prot = sys_arch_protect();
  36.124 +    mbox->messages[mbox->writer] = msg;
  36.125 +    mbox->writer = (mbox->writer + 1) % mbox->count;
  36.126 +    ASSERT(mbox->reader != mbox->writer);
  36.127 +    sys_arch_unprotect(prot);
  36.128 +    up(&mbox->read_sem);
  36.129 +}
  36.130 +
  36.131 +/* Posts the "msg" to the mailbox. */
  36.132 +void sys_mbox_post(sys_mbox_t mbox, void *msg)
  36.133 +{
  36.134 +    if (mbox == SYS_MBOX_NULL)
  36.135 +        return;
  36.136 +    down(&mbox->write_sem);
  36.137 +    do_mbox_post(mbox, msg);
  36.138 +}
  36.139 +
  36.140 +/* Try to post the "msg" to the mailbox. */
  36.141 +err_t sys_mbox_trypost(sys_mbox_t mbox, void *msg)
  36.142 +{
  36.143 +    if (mbox == SYS_MBOX_NULL)
  36.144 +        return ERR_BUF;
  36.145 +    if (!trydown(&mbox->write_sem))
  36.146 +        return ERR_MEM;
  36.147 +    do_mbox_post(mbox, msg);
  36.148 +    return ERR_OK;
  36.149 +}
  36.150 +
  36.151 +/*
  36.152 + * Fetch a message from a mailbox. Internal version that actually does the
  36.153 + * fetch.
  36.154 + */
  36.155 +static void do_mbox_fetch(sys_mbox_t mbox, void **msg)
  36.156 +{
  36.157 +    sys_prot_t prot;
  36.158 +    /* The caller got a semaphore token, so we are now allowed to increment
  36.159 +     * reader, but we may still need to prevent concurrency between readers.
  36.160 +     * FIXME: can there be concurrent readers? */
  36.161 +    prot = sys_arch_protect();
  36.162 +    ASSERT(mbox->reader != mbox->writer);
  36.163 +    if (msg != NULL)
  36.164 +        *msg = mbox->messages[mbox->reader];
  36.165 +    mbox->reader = (mbox->reader + 1) % mbox->count;
  36.166 +    sys_arch_unprotect(prot);
  36.167 +    up(&mbox->write_sem);
  36.168 +}
  36.169 +
  36.170 +/* Blocks the thread until a message arrives in the mailbox, but does
  36.171 + * not block the thread longer than "timeout" milliseconds (similar to
  36.172 + * the sys_arch_sem_wait() function). The "msg" argument is a result
  36.173 + * parameter that is set by the function (i.e., by doing "*msg =
  36.174 + * ptr"). The "msg" parameter maybe NULL to indicate that the message
  36.175 + * should be dropped.
  36.176 + *
  36.177 + * The return values are the same as for the sys_arch_sem_wait() function:
  36.178 + * Number of milliseconds spent waiting or SYS_ARCH_TIMEOUT if there was a
  36.179 + * timeout. */
  36.180 +u32_t sys_arch_mbox_fetch(sys_mbox_t mbox, void **msg, u32_t timeout)
  36.181 +{
  36.182 +    u32 rv;
  36.183 +    if (mbox == SYS_MBOX_NULL)
  36.184 +        return SYS_ARCH_TIMEOUT;
  36.185 +
  36.186 +    rv = sys_arch_sem_wait(&mbox->read_sem, timeout);
  36.187 +    if ( rv == SYS_ARCH_TIMEOUT )
  36.188 +        return rv;
  36.189 +
  36.190 +    do_mbox_fetch(mbox, msg);
  36.191 +    return 0;
  36.192 +}
  36.193 +
  36.194 +/* This is similar to sys_arch_mbox_fetch, however if a message is not
  36.195 + * present in the mailbox, it immediately returns with the code
  36.196 + * SYS_MBOX_EMPTY. On success 0 is returned.
  36.197 + *
  36.198 + * To allow for efficient implementations, this can be defined as a
  36.199 + * function-like macro in sys_arch.h instead of a normal function. For
  36.200 + * example, a naive implementation could be:
  36.201 + *   #define sys_arch_mbox_tryfetch(mbox,msg) \
  36.202 + *     sys_arch_mbox_fetch(mbox,msg,1)
  36.203 + * although this would introduce unnecessary delays. */
  36.204 +
  36.205 +u32_t sys_arch_mbox_tryfetch(sys_mbox_t mbox, void **msg) {
  36.206 +    if (mbox == SYS_MBOX_NULL)
  36.207 +        return SYS_ARCH_TIMEOUT;
  36.208 +
  36.209 +    if (!trydown(&mbox->read_sem))
  36.210 +	return SYS_MBOX_EMPTY;
  36.211 +
  36.212 +    do_mbox_fetch(mbox, msg);
  36.213 +    return 0;
  36.214 +}
  36.215 +
  36.216 +
  36.217 +/* Returns a pointer to the per-thread sys_timeouts structure. In lwIP,
  36.218 + * each thread has a list of timeouts which is repressented as a linked
  36.219 + * list of sys_timeout structures. The sys_timeouts structure holds a
  36.220 + * pointer to a linked list of timeouts. This function is called by
  36.221 + * the lwIP timeout scheduler and must not return a NULL value. 
  36.222 + *
  36.223 + * In a single threadd sys_arch implementation, this function will
  36.224 + * simply return a pointer to a global sys_timeouts variable stored in
  36.225 + * the sys_arch module. */
  36.226 +struct sys_timeouts *sys_arch_timeouts(void) 
  36.227 +{
  36.228 +    static struct sys_timeouts timeout;
  36.229 +    return &timeout;
  36.230 +}
  36.231 +
  36.232 +
  36.233 +/* Starts a new thread with priority "prio" that will begin its execution in the
  36.234 + * function "thread()". The "arg" argument will be passed as an argument to the
  36.235 + * thread() function. The id of the new thread is returned. Both the id and
  36.236 + * the priority are system dependent. */
  36.237 +static struct thread *lwip_thread;
  36.238 +sys_thread_t sys_thread_new(char *name, void (* thread)(void *arg), void *arg, int stacksize, int prio)
  36.239 +{
  36.240 +    struct thread *t;
  36.241 +    if (stacksize > STACK_SIZE) {
  36.242 +	printk("Can't start lwIP thread: stack size %d is too large for our %d\n", stacksize, STACK_SIZE);
  36.243 +	do_exit();
  36.244 +    }
  36.245 +    lwip_thread = t = create_thread(name, thread, arg);
  36.246 +    return t;
  36.247 +}
  36.248 +
  36.249 +/* This optional function does a "fast" critical region protection and returns
  36.250 + * the previous protection level. This function is only called during very short
  36.251 + * critical regions. An embedded system which supports ISR-based drivers might
  36.252 + * want to implement this function by disabling interrupts. Task-based systems
  36.253 + * might want to implement this by using a mutex or disabling tasking. This
  36.254 + * function should support recursive calls from the same task or interrupt. In
  36.255 + * other words, sys_arch_protect() could be called while already protected. In
  36.256 + * that case the return value indicates that it is already protected.
  36.257 + *
  36.258 + * sys_arch_protect() is only required if your port is supporting an operating
  36.259 + * system. */
  36.260 +sys_prot_t sys_arch_protect(void)
  36.261 +{
  36.262 +    unsigned long flags;
  36.263 +    local_irq_save(flags);
  36.264 +    return flags;
  36.265 +}
  36.266 +
  36.267 +/* This optional function does a "fast" set of critical region protection to the
  36.268 + * value specified by pval. See the documentation for sys_arch_protect() for
  36.269 + * more information. This function is only required if your port is supporting
  36.270 + * an operating system. */
  36.271 +void sys_arch_unprotect(sys_prot_t pval)
  36.272 +{
  36.273 +    local_irq_restore(pval);
  36.274 +}
  36.275 +
  36.276 +/* non-fatal, print a message. */
  36.277 +void lwip_printk(char *fmt, ...)
  36.278 +{
  36.279 +    va_list args;
  36.280 +    va_start(args, fmt);
  36.281 +    printk("lwIP: ");
  36.282 +    print(0, fmt, args);
  36.283 +    va_end(args);
  36.284 +}
  36.285 +
  36.286 +/* fatal, print message and abandon execution. */
  36.287 +void lwip_die(char *fmt, ...)
  36.288 +{
  36.289 +    va_list args;
  36.290 +    va_start(args, fmt);
  36.291 +    printk("lwIP assertion failed: ");
  36.292 +    print(0, fmt, args);
  36.293 +    va_end(args);
  36.294 +    printk("\n");
  36.295 +    BUG();
  36.296 +}
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/extras/mini-os/lwip-net.c	Tue Jan 22 08:30:40 2008 -0700
    37.3 @@ -0,0 +1,360 @@
    37.4 +/* 
    37.5 + * lwip-net.c
    37.6 + *
    37.7 + * interface between lwIP's ethernet and Mini-os's netfront.
    37.8 + * For now, support only one network interface, as mini-os does.
    37.9 + *
   37.10 + * Tim Deegan <Tim.Deegan@eu.citrix.net>, July 2007
   37.11 + * based on lwIP's ethernetif.c skeleton file, copyrights as below.
   37.12 + */
   37.13 +
   37.14 +
   37.15 +/*
   37.16 + * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
   37.17 + * All rights reserved. 
   37.18 + * 
   37.19 + * Redistribution and use in source and binary forms, with or without modification, 
   37.20 + * are permitted provided that the following conditions are met:
   37.21 + *
   37.22 + * 1. Redistributions of source code must retain the above copyright notice,
   37.23 + *    this list of conditions and the following disclaimer.
   37.24 + * 2. Redistributions in binary form must reproduce the above copyright notice,
   37.25 + *    this list of conditions and the following disclaimer in the documentation
   37.26 + *    and/or other materials provided with the distribution.
   37.27 + * 3. The name of the author may not be used to endorse or promote products
   37.28 + *    derived from this software without specific prior written permission. 
   37.29 + *
   37.30 + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 
   37.31 + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 
   37.32 + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT 
   37.33 + * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 
   37.34 + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT 
   37.35 + * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
   37.36 + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
   37.37 + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 
   37.38 + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 
   37.39 + * OF SUCH DAMAGE.
   37.40 + *
   37.41 + * This file is part of the lwIP TCP/IP stack.
   37.42 + * 
   37.43 + * Author: Adam Dunkels <adam@sics.se>
   37.44 + *
   37.45 + */
   37.46 +
   37.47 +#include <os.h>
   37.48 +
   37.49 +#include "lwip/opt.h"
   37.50 +#include "lwip/def.h"
   37.51 +#include "lwip/mem.h"
   37.52 +#include "lwip/pbuf.h"
   37.53 +#include "lwip/sys.h"
   37.54 +
   37.55 +#include <lwip/stats.h>
   37.56 +#include <lwip/sys.h>
   37.57 +#include <lwip/mem.h>
   37.58 +#include <lwip/memp.h>
   37.59 +#include <lwip/pbuf.h>
   37.60 +#include <netif/etharp.h>
   37.61 +#include <lwip/tcpip.h>
   37.62 +#include <lwip/tcp.h>
   37.63 +#include <lwip/netif.h>
   37.64 +#include <lwip/dhcp.h>
   37.65 +
   37.66 +#include "netif/etharp.h"
   37.67 +
   37.68 +#include <netfront.h>
   37.69 +
   37.70 +/* Define those to better describe your network interface. */
   37.71 +#define IFNAME0 'e'
   37.72 +#define IFNAME1 'n'
   37.73 +
   37.74 +#define IF_IPADDR	0x00000000
   37.75 +#define IF_NETMASK	0x00000000
   37.76 +
   37.77 +/* Only have one network interface at a time. */
   37.78 +static struct netif *the_interface = NULL;
   37.79 +
   37.80 +static unsigned char rawmac[6];
   37.81 +static struct netfront_dev *dev;
   37.82 +
   37.83 +/* Forward declarations. */
   37.84 +static err_t netfront_output(struct netif *netif, struct pbuf *p,
   37.85 +             struct ip_addr *ipaddr);
   37.86 +
   37.87 +/*
   37.88 + * low_level_output():
   37.89 + *
   37.90 + * Should do the actual transmission of the packet. The packet is
   37.91 + * contained in the pbuf that is passed to the function. This pbuf
   37.92 + * might be chained.
   37.93 + *
   37.94 + */
   37.95 +
   37.96 +static err_t
   37.97 +low_level_output(struct netif *netif, struct pbuf *p)
   37.98 +{
   37.99 +#ifdef ETH_PAD_SIZE
  37.100 +  pbuf_header(p, -ETH_PAD_SIZE); /* drop the padding word */
  37.101 +#endif
  37.102 +
  37.103 +  /* Send the data from the pbuf to the interface, one pbuf at a
  37.104 +     time. The size of the data in each pbuf is kept in the ->len
  37.105 +     variable. */
  37.106 +  if (!p->next) {
  37.107 +    /* Only one fragment, can send it directly */
  37.108 +      netfront_xmit(dev, p->payload, p->len);
  37.109 +  } else {
  37.110 +    unsigned char data[p->tot_len], *cur;
  37.111 +    struct pbuf *q;
  37.112 +
  37.113 +    for(q = p, cur = data; q != NULL; cur += q->len, q = q->next)
  37.114 +      memcpy(cur, q->payload, q->len);
  37.115 +    netfront_xmit(dev, data, p->tot_len);
  37.116 +  }
  37.117 +
  37.118 +#if ETH_PAD_SIZE
  37.119 +  pbuf_header(p, ETH_PAD_SIZE);			/* reclaim the padding word */
  37.120 +#endif
  37.121 +  
  37.122 +  LINK_STATS_INC(link.xmit);
  37.123 +
  37.124 +  return ERR_OK;
  37.125 +}
  37.126 +
  37.127 +
  37.128 +
  37.129 +/*
  37.130 + * netfront_output():
  37.131 + *
  37.132 + * This function is called by the TCP/IP stack when an IP packet
  37.133 + * should be sent. It calls the function called low_level_output() to
  37.134 + * do the actual transmission of the packet.
  37.135 + *
  37.136 + */
  37.137 +
  37.138 +static err_t
  37.139 +netfront_output(struct netif *netif, struct pbuf *p,
  37.140 +      struct ip_addr *ipaddr)
  37.141 +{
  37.142 +  
  37.143 + /* resolve hardware address, then send (or queue) packet */
  37.144 +  return etharp_output(netif, p, ipaddr);
  37.145 + 
  37.146 +}
  37.147 +
  37.148 +/*
  37.149 + * netfront_input():
  37.150 + *
  37.151 + * This function should be called when a packet is ready to be read
  37.152 + * from the interface. 
  37.153 + *
  37.154 + */
  37.155 +
  37.156 +static void
  37.157 +netfront_input(struct netif *netif, unsigned char* data, int len)
  37.158 +{
  37.159 +  struct eth_hdr *ethhdr;
  37.160 +  struct pbuf *p, *q;
  37.161 +
  37.162 +#if ETH_PAD_SIZE
  37.163 +  len += ETH_PAD_SIZE; /* allow room for Ethernet padding */
  37.164 +#endif
  37.165 +  
  37.166 +  /* move received packet into a new pbuf */
  37.167 +  p = pbuf_alloc(PBUF_RAW, len, PBUF_POOL);
  37.168 +  if (p == NULL) {
  37.169 +    LINK_STATS_INC(link.memerr);
  37.170 +    LINK_STATS_INC(link.drop);
  37.171 +    return;
  37.172 +  }
  37.173 +
  37.174 +#if ETH_PAD_SIZE
  37.175 +  pbuf_header(p, -ETH_PAD_SIZE); /* drop the padding word */
  37.176 +#endif
  37.177 +  
  37.178 +  /* We iterate over the pbuf chain until we have read the entire
  37.179 +   * packet into the pbuf. */
  37.180 +  for(q = p; q != NULL && len > 0; q = q->next) {
  37.181 +    /* Read enough bytes to fill this pbuf in the chain. The
  37.182 +     * available data in the pbuf is given by the q->len
  37.183 +     * variable. */
  37.184 +    memcpy(q->payload, data, len < q->len ? len : q->len);
  37.185 +    data += q->len;
  37.186 +    len -= q->len;
  37.187 +  }
  37.188 +
  37.189 +#if ETH_PAD_SIZE
  37.190 +  pbuf_header(p, ETH_PAD_SIZE); /* reclaim the padding word */
  37.191 +#endif
  37.192 +
  37.193 +  LINK_STATS_INC(link.recv);
  37.194 +
  37.195 +  /* points to packet payload, which starts with an Ethernet header */
  37.196 +  ethhdr = p->payload;
  37.197 +
  37.198 +  ethhdr = p->payload;
  37.199 +    
  37.200 +  switch (htons(ethhdr->type)) {
  37.201 +  /* IP packet? */
  37.202 +  case ETHTYPE_IP:
  37.203 +#if 0
  37.204 +/* CSi disabled ARP table update on ingress IP packets.
  37.205 +   This seems to work but needs thorough testing. */
  37.206 +    /* update ARP table */
  37.207 +    etharp_ip_input(netif, p);
  37.208 +#endif
  37.209 +    /* skip Ethernet header */
  37.210 +    pbuf_header(p, -(s16)sizeof(struct eth_hdr));
  37.211 +    /* pass to network layer */
  37.212 +    tcpip_input(p, netif);
  37.213 +    break;
  37.214 +      
  37.215 +  case ETHTYPE_ARP:
  37.216 +    /* pass p to ARP module  */
  37.217 +    etharp_arp_input(netif, (struct eth_addr *) netif->hwaddr, p);
  37.218 +    break;
  37.219 +  default:
  37.220 +    pbuf_free(p);
  37.221 +    p = NULL;
  37.222 +    break;
  37.223 +  }
  37.224 +}
  37.225 +
  37.226 +
  37.227 +/* 
  37.228 + * netif_rx(): overrides the default netif_rx behaviour in the netfront driver.
  37.229 + * 
  37.230 + * Pull received packets into a pbuf queue for the low_level_input() 
  37.231 + * function to pass up to lwIP.
  37.232 + */
  37.233 +
  37.234 +void netif_rx(unsigned char* data, int len)
  37.235 +{
  37.236 +  if (the_interface != NULL) {
  37.237 +    netfront_input(the_interface, data, len);
  37.238 +    wake_up(&netfront_queue);
  37.239 +  }
  37.240 +  /* By returning, we ack the packet and relinquish the RX ring slot */
  37.241 +}
  37.242 +
  37.243 +/*
  37.244 + * Set the IP, mask and gateway of the IF
  37.245 + */
  37.246 +void networking_set_addr(struct ip_addr *ipaddr, struct ip_addr *netmask, struct ip_addr *gw)
  37.247 +{
  37.248 +  netif_set_ipaddr(the_interface, ipaddr);
  37.249 +  netif_set_netmask(the_interface, netmask);
  37.250 +  netif_set_gw(the_interface, gw);
  37.251 +}
  37.252 +
  37.253 +
  37.254 +static void
  37.255 +arp_timer(void *arg)
  37.256 +{
  37.257 +  etharp_tmr();
  37.258 +  sys_timeout(ARP_TMR_INTERVAL, arp_timer, NULL);
  37.259 +}
  37.260 +
  37.261 +/*
  37.262 + * netif_netfront_init():
  37.263 + *
  37.264 + * Should be called at the beginning of the program to set up the
  37.265 + * network interface. It calls the function low_level_init() to do the
  37.266 + * actual setup of the hardware.
  37.267 + *
  37.268 + */
  37.269 +
  37.270 +err_t
  37.271 +netif_netfront_init(struct netif *netif)
  37.272 +{
  37.273 +  unsigned char *mac = netif->state;
  37.274 +
  37.275 +#if LWIP_SNMP
  37.276 +  /* ifType ethernetCsmacd(6) @see RFC1213 */
  37.277 +  netif->link_type = 6;
  37.278 +  /* your link speed here */
  37.279 +  netif->link_speed = ;
  37.280 +  netif->ts = 0;
  37.281 +  netif->ifinoctets = 0;
  37.282 +  netif->ifinucastpkts = 0;
  37.283 +  netif->ifinnucastpkts = 0;
  37.284 +  netif->ifindiscards = 0;
  37.285 +  netif->ifoutoctets = 0;
  37.286 +  netif->ifoutucastpkts = 0;
  37.287 +  netif->ifoutnucastpkts = 0;
  37.288 +  netif->ifoutdiscards = 0;
  37.289 +#endif
  37.290 +  
  37.291 +  netif->name[0] = IFNAME0;
  37.292 +  netif->name[1] = IFNAME1;
  37.293 +  netif->output = netfront_output;
  37.294 +  netif->linkoutput = low_level_output;
  37.295 +  
  37.296 +  the_interface = netif;
  37.297 +  
  37.298 +  /* set MAC hardware address */
  37.299 +  netif->hwaddr_len = 6;
  37.300 +  netif->hwaddr[0] = mac[0];
  37.301 +  netif->hwaddr[1] = mac[1];
  37.302 +  netif->hwaddr[2] = mac[2];
  37.303 +  netif->hwaddr[3] = mac[3];
  37.304 +  netif->hwaddr[4] = mac[4];
  37.305 +  netif->hwaddr[5] = mac[5];
  37.306 +
  37.307 +  /* No interesting per-interface state */
  37.308 +  netif->state = NULL;
  37.309 +
  37.310 +  /* maximum transfer unit */
  37.311 +  netif->mtu = 1500;
  37.312 +  
  37.313 +  /* broadcast capability */
  37.314 +  netif->flags = NETIF_FLAG_BROADCAST;
  37.315 +
  37.316 +  etharp_init();
  37.317 +
  37.318 +  sys_timeout(ARP_TMR_INTERVAL, arp_timer, NULL);
  37.319 +
  37.320 +  return ERR_OK;
  37.321 +}
  37.322 +
  37.323 +/*
  37.324 + * Thread run by netfront: bring up the IP address and fire lwIP timers.
  37.325 + */
  37.326 +static __DECLARE_SEMAPHORE_GENERIC(tcpip_is_up, 0);
  37.327 +static void tcpip_bringup_finished(void *p)
  37.328 +{
  37.329 +  tprintk("TCP/IP bringup ends.\n");
  37.330 +  up(&tcpip_is_up);
  37.331 +}
  37.332 +
  37.333 +/* 
  37.334 + * Utility function to bring the whole lot up.  Call this from app_main() 
  37.335 + * or similar -- it starts netfront and have lwIP start its thread,
  37.336 + * which calls back to tcpip_bringup_finished(), which 
  37.337 + * lets us know it's OK to continue.
  37.338 + */
  37.339 +void start_networking(void)
  37.340 +{
  37.341 +  struct netif *netif;
  37.342 +  struct ip_addr ipaddr = { htonl(IF_IPADDR) };
  37.343 +  struct ip_addr netmask = { htonl(IF_NETMASK) };
  37.344 +  struct ip_addr gw = { 0 };
  37.345 +
  37.346 +  tprintk("Waiting for network.\n");
  37.347 +
  37.348 +  dev = init_netfront(NULL, NULL, rawmac);
  37.349 +  
  37.350 +  tprintk("TCP/IP bringup begins.\n");
  37.351 +  
  37.352 +  netif = xmalloc(struct netif);
  37.353 +  tcpip_init(tcpip_bringup_finished, netif);
  37.354 +    
  37.355 +  netif_add(netif, &ipaddr, &netmask, &gw, rawmac, 
  37.356 +            netif_netfront_init, ip_input);
  37.357 +  netif_set_default(netif);
  37.358 +  netif_set_up(netif);
  37.359 +
  37.360 +  down(&tcpip_is_up);
  37.361 +
  37.362 +  tprintk("Network is ready.\n");
  37.363 +}
    38.1 --- a/extras/mini-os/minios.mk	Tue Jan 22 08:27:29 2008 -0700
    38.2 +++ b/extras/mini-os/minios.mk	Tue Jan 22 08:30:40 2008 -0700
    38.3 @@ -6,7 +6,7 @@ debug = y
    38.4  
    38.5  # Define some default flags.
    38.6  # NB. '-Wcast-qual' is nasty, so I omitted it.
    38.7 -DEF_CFLAGS := -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format
    38.8 +DEF_CFLAGS += -fno-builtin -Wall -Werror -Wredundant-decls -Wno-format
    38.9  DEF_CFLAGS += $(call cc-option,$(CC),-fno-stack-protector,)
   38.10  DEF_CFLAGS += -Wstrict-prototypes -Wnested-externs -Wpointer-arith -Winline
   38.11  DEF_CFLAGS += -D__XEN_INTERFACE_VERSION__=$(XEN_INTERFACE_VERSION)
    39.1 --- a/extras/mini-os/sched.c	Tue Jan 22 08:27:29 2008 -0700
    39.2 +++ b/extras/mini-os/sched.c	Tue Jan 22 08:30:40 2008 -0700
    39.3 @@ -211,7 +211,7 @@ void block(struct thread *thread)
    39.4      clear_runnable(thread);
    39.5  }
    39.6  
    39.7 -void sleep(u32 millisecs)
    39.8 +void msleep(u32 millisecs)
    39.9  {
   39.10      struct thread *thread = get_current();
   39.11      thread->wakeup_time = NOW()  + MILLISECS(millisecs);
   39.12 @@ -270,10 +270,10 @@ void th_f1(void *data)
   39.13          up(&mutex);
   39.14          
   39.15          
   39.16 -        gettimeofday(&tv1);
   39.17 +        gettimeofday(&tv1, NULL);
   39.18          for(;;)
   39.19          {
   39.20 -            gettimeofday(&tv2);
   39.21 +            gettimeofday(&tv2, NULL);
   39.22              if(tv2.tv_sec - tv1.tv_sec > 2) break;
   39.23          }
   39.24                  
    40.1 --- a/tools/Makefile	Tue Jan 22 08:27:29 2008 -0700
    40.2 +++ b/tools/Makefile	Tue Jan 22 08:30:40 2008 -0700
    40.3 @@ -28,6 +28,12 @@ SUBDIRS-$(PYTHON_TOOLS) += python
    40.4  SUBDIRS-$(PYTHON_TOOLS) += pygrub
    40.5  endif
    40.6  
    40.7 +# For the sake of linking, set the sys-root
    40.8 +ifneq ($(CROSS_COMPILE),)
    40.9 +CROSS_SYS_ROOT ?= /usr/$(CROSS_COMPILE:-=)/sys-root
   40.10 +export CROSS_SYS_ROOT
   40.11 +endif
   40.12 +
   40.13  .PHONY: all
   40.14  all: check
   40.15  	@set -e; for subdir in $(SUBDIRS-y); do \
   40.16 @@ -65,10 +71,15 @@ check_clean:
   40.17  
   40.18  .PHONY: ioemu ioemuinstall ioemuclean
   40.19  ifeq ($(CONFIG_IOEMU),y)
   40.20 -export IOEMU_DIR ?= ioemu
   40.21 +IOEMU_DIR ?= ioemu
   40.22 +ifneq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
   40.23 +IOEMU_CONFIGURE_CROSS ?= --cross-prefix=$(CROSS_COMPILE) \
   40.24 +			 --interp-prefix=$(CROSS_SYS_ROOT)
   40.25 +endif
   40.26  ioemu ioemuinstall:
   40.27  	[ -f $(IOEMU_DIR)/config-host.mak ] || \
   40.28 -	  (cd $(IOEMU_DIR) && sh configure --prefix=/usr)
   40.29 +	  ( cd $(IOEMU_DIR) && XEN_TARGET_ARCH=$(XEN_TARGET_ARCH) sh configure --prefix=/usr \
   40.30 +		$(IOEMU_CONFIGURE_CROSS) )
   40.31  	$(MAKE) -C $(IOEMU_DIR) $(patsubst ioemu%,%,$@)
   40.32  ioemuclean:
   40.33  	$(MAKE) -C $(IOEMU_DIR) distclean
    41.1 --- a/tools/blktap/drivers/Makefile	Tue Jan 22 08:27:29 2008 -0700
    41.2 +++ b/tools/blktap/drivers/Makefile	Tue Jan 22 08:30:40 2008 -0700
    41.3 @@ -5,7 +5,6 @@ INCLUDES += -I.. -I../lib
    41.4  
    41.5  IBIN         = blktapctrl tapdisk
    41.6  QCOW_UTIL    = img2qcow qcow2raw qcow-create
    41.7 -INST_DIR     = /usr/sbin
    41.8  LIBAIO_DIR   = ../../libaio/src
    41.9  
   41.10  CFLAGS   += -Werror
   41.11 @@ -53,7 +52,7 @@ img2qcow qcow2raw qcow-create: %: $(BLK-
   41.12  	$(CC) $(CFLAGS) -o $* $(BLK-OBJS-y) $*.c $(LDFLAGS) $(AIOLIBS) $(LIBS)
   41.13  
   41.14  install: all
   41.15 -	$(INSTALL_PROG) $(IBIN) $(QCOW_UTIL) $(VHD_UTIL) $(DESTDIR)$(INST_DIR)
   41.16 +	$(INSTALL_PROG) $(IBIN) $(QCOW_UTIL) $(VHD_UTIL) $(DESTDIR)$(SBINDIR)
   41.17  
   41.18  clean:
   41.19  	rm -rf *.o *~ $(DEPS) xen TAGS $(IBIN) $(LIB) $(QCOW_UTIL) $(VHD_UTIL)
    42.1 --- a/tools/blktap/lib/Makefile	Tue Jan 22 08:27:29 2008 -0700
    42.2 +++ b/tools/blktap/lib/Makefile	Tue Jan 22 08:30:40 2008 -0700
    42.3 @@ -5,8 +5,6 @@ MAJOR    = 3.0
    42.4  MINOR    = 0
    42.5  SONAME   = libblktap.so.$(MAJOR)
    42.6  
    42.7 -BLKTAP_INSTALL_DIR = /usr/sbin
    42.8 -
    42.9  INCLUDES += -I. -I.. -I $(XEN_LIBXC) -I $(XEN_XENSTORE)
   42.10  
   42.11  LIBS     := -lz
   42.12 @@ -40,12 +38,12 @@ build: libblktap.a
   42.13  libblktap: libblktap.a
   42.14  
   42.15  install: all
   42.16 -	$(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
   42.17 -	$(INSTALL_DIR) $(DESTDIR)/usr/include
   42.18 -	$(INSTALL_DATA) $(LIB) $(DESTDIR)/usr/$(LIBDIR)
   42.19 -	ln -sf libblktap.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libblktap.so.$(MAJOR)
   42.20 -	ln -sf libblktap.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libblktap.so
   42.21 -	$(INSTALL_DATA) blktaplib.h $(DESTDIR)/usr/include
   42.22 +	$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
   42.23 +	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
   42.24 +	$(INSTALL_DATA) $(LIB) $(DESTDIR)$(LIBDIR)
   42.25 +	ln -sf libblktap.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libblktap.so.$(MAJOR)
   42.26 +	ln -sf libblktap.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libblktap.so
   42.27 +	$(INSTALL_DATA) blktaplib.h $(DESTDIR)$(INCLUDEDIR)
   42.28  
   42.29  clean:
   42.30  	rm -rf *.a *.so* *.o *.rpm $(LIB) *~ $(DEPS) xen TAGS
    43.1 --- a/tools/check/check_brctl	Tue Jan 22 08:27:29 2008 -0700
    43.2 +++ b/tools/check/check_brctl	Tue Jan 22 08:30:40 2008 -0700
    43.3 @@ -1,27 +1,13 @@
    43.4  #!/bin/sh
    43.5  # CHECK-INSTALL
    43.6  
    43.7 -RC=0
    43.8 +. funcs.sh
    43.9  
   43.10 -case ${OS} in
   43.11 +case $OS in
   43.12  OpenBSD|NetBSD|FreeBSD)
   43.13 -	# These systems have a bridge builtin
   43.14 -	TOOL="brconfig"
   43.15 -	which ${TOOL} 1>/dev/null 2>&1 || RC=1 
   43.16 -	;;
   43.17 +	has_or_fail brconfig ;;
   43.18  Linux)
   43.19 -	TOOL="brctl"
   43.20 -	which ${TOOL} 1>/dev/null 2>&1 || RC=1
   43.21 -	;;
   43.22 +	has_or_fail brctl ;;
   43.23  *)
   43.24 -	TOOL=""
   43.25 -	echo "Unknown OS" && RC=1
   43.26 -	;;
   43.27 +	fail "unknown OS" ;;
   43.28  esac
   43.29 -
   43.30 -if test ${RC} -ne 0; then
   43.31 -	echo
   43.32 -	echo " *** Check for the bridge control utils (${TOOL}) FAILED"
   43.33 -fi
   43.34 -
   43.35 -exit ${RC} 
    44.1 --- a/tools/check/check_crypto_lib	Tue Jan 22 08:27:29 2008 -0700
    44.2 +++ b/tools/check/check_crypto_lib	Tue Jan 22 08:30:40 2008 -0700
    44.3 @@ -1,23 +1,11 @@
    44.4  #!/bin/sh
    44.5  # CHECK-BUILD CHECK-INSTALL
    44.6  
    44.7 -RC=0
    44.8 +. funcs.sh
    44.9  
   44.10 -case $(uname -s) in
   44.11 +case $OS in
   44.12  FreeBSD|NetBSD|OpenBSD)
   44.13 -	exit 0
   44.14 -	;;
   44.15 -*)
   44.16 -	;;
   44.17 +	exit 0 ;;
   44.18  esac
   44.19  
   44.20 -PATH=/sbin:$PATH
   44.21 -set -e
   44.22 -ldconfig -p 2>&1 | grep -q libcrypto.so || RC=1
   44.23 -
   44.24 -if test ${RC} -ne 0; then
   44.25 -        echo
   44.26 -        echo " *** Check for crypto library FAILED"
   44.27 -fi
   44.28 -
   44.29 -exit ${RC}
   44.30 +has_lib libcrypto.so || fail "missing libcrypto.so"
    45.1 --- a/tools/check/check_curl	Tue Jan 22 08:27:29 2008 -0700
    45.2 +++ b/tools/check/check_curl	Tue Jan 22 08:30:40 2008 -0700
    45.3 @@ -1,38 +1,13 @@
    45.4  #!/bin/sh
    45.5  # CHECK-BUILD CHECK-INSTALL
    45.6  
    45.7 -if [ ! "$LIBXENAPI_BINDINGS" = "y" ]
    45.8 -then
    45.9 -    echo -n "unused, "
   45.10 -    exit 0
   45.11 +. funcs.sh
   45.12 +
   45.13 +if [ "$LIBXENAPI_BINDINGS" != "y" ]; then
   45.14 +	echo -n "unused, "
   45.15 +	exit 0
   45.16  fi
   45.17  
   45.18 -RC=0
   45.19 -
   45.20 -CURL_CONFIG="$(which curl-config)"
   45.21 -tmpfile=$(mktemp)
   45.22 -
   45.23 -if test -z ${CURL_CONFIG}; then
   45.24 -    RC=1
   45.25 -else
   45.26 -    ${CURL_CONFIG} --libs 2>&1 > /dev/null
   45.27 -    RC=$?
   45.28 -fi
   45.29 -
   45.30 -if test $RC -ne 0; then
   45.31 -    echo "FAILED"
   45.32 -	echo " *** curl-config is missing. "
   45.33 -    echo " *** Please install curl-devel."
   45.34 -elif ! ld $($CURL_CONFIG --libs) -o $tmpfile >/dev/null 2>&1; then
   45.35 -    echo "FAILED"
   45.36 -    echo " *** dependency libraries for curl are missing: "
   45.37 -    RC=1
   45.38 -    for i in $(ld $($CURL_CONFIG --libs) -o $tmpfile 2>&1 >/dev/null); do
   45.39 -        case $i in
   45.40 -        -l*) echo lib${i#-l}
   45.41 -        esac
   45.42 -    done
   45.43 -fi
   45.44 -rm -f $tmpfile
   45.45 -
   45.46 -exit $RC
   45.47 +has_or_fail curl-config
   45.48 +curl_libs=`curl-config --libs` || fail "curl-config --libs failed"
   45.49 +test_link $curl_libs || fail "dependency libraries for curl are missing"
    46.1 --- a/tools/check/check_iproute	Tue Jan 22 08:27:29 2008 -0700
    46.2 +++ b/tools/check/check_iproute	Tue Jan 22 08:30:40 2008 -0700
    46.3 @@ -1,26 +1,15 @@
    46.4  #!/bin/sh
    46.5  # CHECK-INSTALL
    46.6  
    46.7 -RC=0
    46.8 +. funcs.sh
    46.9  
   46.10 -case ${OS} in
   46.11 +PATH=/sbin:$PATH
   46.12 +
   46.13 +case $OS in
   46.14  OpenBSD|NetBSD|FreeBSD)
   46.15 -	TOOL="ifconfig"
   46.16 -	eval ${TOOL} -a 1>/dev/null 2>&1 || RC=1 
   46.17 -	;;
   46.18 +	has_or_fail ifconfig ;;
   46.19  Linux)
   46.20 -	TOOL="ip addr"
   46.21 -	eval ${TOOL} list 1>/dev/null 2>&1 || RC=1 
   46.22 -	;;
   46.23 +	has_or_fail ip ;;
   46.24  *)
   46.25 -	TOOL=""
   46.26 -	echo "Unknown OS" && RC=1 
   46.27 -	;;
   46.28 +	fail "unknown OS" ;;
   46.29  esac
   46.30 -
   46.31 -if test ${RC} -ne 0; then
   46.32 -	echo
   46.33 -	echo " *** Check for iproute (${TOOL}) FAILED"
   46.34 -fi
   46.35 -
   46.36 -exit ${RC} 
    47.1 --- a/tools/check/check_openssl_devel	Tue Jan 22 08:27:29 2008 -0700
    47.2 +++ b/tools/check/check_openssl_devel	Tue Jan 22 08:30:40 2008 -0700
    47.3 @@ -1,14 +1,6 @@
    47.4  #!/bin/sh
    47.5  # CHECK-BUILD
    47.6  
    47.7 -RC=0
    47.8 -
    47.9 -set -e
   47.10 -test -r /usr/include/openssl/md5.h || RC=1 
   47.11 +. funcs.sh
   47.12  
   47.13 -if test ${RC} -ne 0; then
   47.14 -	echo
   47.15 -	echo " *** Check for openssl headers FAILED"
   47.16 -fi
   47.17 -
   47.18 -exit ${RC}
   47.19 +has_header openssl/md5.h || fail "missing openssl headers"
    48.1 --- a/tools/check/check_python	Tue Jan 22 08:27:29 2008 -0700
    48.2 +++ b/tools/check/check_python	Tue Jan 22 08:30:40 2008 -0700
    48.3 @@ -1,16 +1,9 @@
    48.4  #!/bin/sh
    48.5  # CHECK-BUILD CHECK-INSTALL
    48.6  
    48.7 -RC=0
    48.8 +. funcs.sh
    48.9  
   48.10  python -c '
   48.11  import sys
   48.12  sys.exit(sys.version_info[0] < 2 or sys.version_info[1] < 2)
   48.13 -' || RC=1
   48.14 -
   48.15 -if test ${RC} -ne 0; then
   48.16 -	echo
   48.17 -	echo " *** Check for Python version >= 2.2 FAILED"
   48.18 -fi
   48.19 -
   48.20 -exit ${RC} 
   48.21 +' || fail "need python version >= 2.2"
    49.1 --- a/tools/check/check_python_devel	Tue Jan 22 08:27:29 2008 -0700
    49.2 +++ b/tools/check/check_python_devel	Tue Jan 22 08:30:40 2008 -0700
    49.3 @@ -1,7 +1,7 @@
    49.4  #!/bin/sh
    49.5  # CHECK-BUILD
    49.6  
    49.7 -RC=0
    49.8 +. funcs.sh
    49.9  
   49.10  python -c '
   49.11  import os.path, sys
   49.12 @@ -9,11 +9,4 @@ for p in sys.path:
   49.13  	if os.path.exists(p + "/config/Makefile"):
   49.14  		sys.exit(0)
   49.15  sys.exit(1)
   49.16 -' || RC=1 
   49.17 -
   49.18 -if test ${RC} -ne 0; then
   49.19 -	echo
   49.20 -	echo " *** Check for python development environment FAILED"
   49.21 -fi
   49.22 -
   49.23 -exit ${RC}
   49.24 +' || fail "can't find python devel files"
    50.1 --- a/tools/check/check_python_xml	Tue Jan 22 08:27:29 2008 -0700
    50.2 +++ b/tools/check/check_python_xml	Tue Jan 22 08:30:40 2008 -0700
    50.3 @@ -1,8 +1,7 @@
    50.4  #!/bin/sh
    50.5  # CHECK-INSTALL
    50.6  
    50.7 -python -c 'import xml.dom.minidom' 2>/dev/null || {
    50.8 -    echo
    50.9 -    echo "  *** Check for python-xml package FAILED"
   50.10 -    exit 1
   50.11 -}
   50.12 +. funcs.sh
   50.13 +
   50.14 +python -c 'import xml.dom.minidom' 2>/dev/null || \
   50.15 +fail "can't import xml.dom.minidom"
    51.1 --- a/tools/check/check_udev	Tue Jan 22 08:27:29 2008 -0700
    51.2 +++ b/tools/check/check_udev	Tue Jan 22 08:30:40 2008 -0700
    51.3 @@ -1,34 +1,19 @@
    51.4  #!/bin/sh
    51.5  # CHECK-INSTALL
    51.6  
    51.7 -RC=0
    51.8 +. funcs.sh
    51.9  
   51.10 -case ${OS} in
   51.11 +case $OS in
   51.12  OpenBSD|NetBSD|FreeBSD)
   51.13 -	TOOL="vnconfig"
   51.14 -	which ${TOOL} 1>/dev/null 2>&1 || RC=1
   51.15 +	has_or_fail vnconfig
   51.16  	;;
   51.17  Linux)
   51.18 -	TOOL="udevinfo"
   51.19 -	UDEV_VERSION="0"
   51.20 -	test -x "$(which ${TOOL} 2>/dev/null)" && \
   51.21 -		UDEV_VERSION=$(${TOOL} -V | sed -e 's/^[^0-9]* \([0-9]\{1,\}\)[^0-9]\{0,\}/\1/')
   51.22 -	if test "${UDEV_VERSION}" -ge 059; then
   51.23 -		RC=0
   51.24 -	else
   51.25 -		TOOL="hotplug"
   51.26 -		which ${TOOL} 1>/dev/null 2>&1 || RC=1
   51.27 -	fi
   51.28 +	has_or_fail udevinfo
   51.29 +	[ "`udevinfo -V | awk '{print $NF}'`" -ge 59 ] 2>/dev/null || \
   51.30 +		has hotplug || \
   51.31 +		fail "udev is too old, upgrade to version 59 or later"
   51.32  	;;
   51.33  *)
   51.34 -	TOOL=""
   51.35 -	echo "Unknown OS" && RC=1
   51.36 +	fail "unknown OS"
   51.37  	;;
   51.38  esac
   51.39 -
   51.40 -if test ${RC} -ne 0; then
   51.41 -	echo
   51.42 -	echo " *** Check for ${TOOL} FAILED"
   51.43 -fi
   51.44 -
   51.45 -exit ${RC}
    52.1 --- a/tools/check/check_x11_devel	Tue Jan 22 08:27:29 2008 -0700
    52.2 +++ b/tools/check/check_x11_devel	Tue Jan 22 08:30:40 2008 -0700
    52.3 @@ -1,15 +1,8 @@
    52.4  #!/bin/sh
    52.5  # CHECK-BUILD
    52.6  
    52.7 -RC=0
    52.8 -
    52.9 -set -e
   52.10 -test -r /usr/include/X11/keysymdef.h || \
   52.11 -test -r /usr/X11R6/include/X11/keysymdef.h || RC=1
   52.12 +. funcs.sh
   52.13  
   52.14 -if test ${RC} -ne 0; then
   52.15 -	echo
   52.16 -	echo " *** Check for x11 headers FAILED"
   52.17 -fi
   52.18 -
   52.19 -exit ${RC}
   52.20 +has_header X11/keysymdef.h || \
   52.21 +has_header /usr/X11R6/include/X11/keysymdef.h || \
   52.22 +fail "can't find X11 headers"
    53.1 --- a/tools/check/check_xgettext	Tue Jan 22 08:27:29 2008 -0700
    53.2 +++ b/tools/check/check_xgettext	Tue Jan 22 08:30:40 2008 -0700
    53.3 @@ -1,14 +1,6 @@
    53.4  #!/bin/sh
    53.5  # CHECK-BUILD
    53.6  
    53.7 -RC=0
    53.8 -
    53.9 -TOOL="xgettext"
   53.10 -which ${TOOL} 1>/dev/null 2>&1 || RC=1 
   53.11 +. funcs.sh
   53.12  
   53.13 -if test ${RC} -ne 0; then
   53.14 -	echo
   53.15 -	echo " *** Check for the gettext utility (${TOOL}) FAILED"
   53.16 -fi
   53.17 -
   53.18 -exit ${RC} 
   53.19 +has_or_fail xgettext
    54.1 --- a/tools/check/check_xml2	Tue Jan 22 08:27:29 2008 -0700
    54.2 +++ b/tools/check/check_xml2	Tue Jan 22 08:30:40 2008 -0700
    54.3 @@ -1,38 +1,14 @@
    54.4  #!/bin/sh
    54.5  # CHECK-BUILD CHECK-INSTALL
    54.6  
    54.7 +. funcs.sh
    54.8 +
    54.9  if [ ! "$LIBXENAPI_BINDINGS" = "y" -a ! "$ACM_SECURITY" = "y" ]
   54.10  then
   54.11      echo -n "unused, "
   54.12      exit 0
   54.13  fi
   54.14  
   54.15 -RC=0
   54.16 -
   54.17 -XML2_CONFIG="$(which xml2-config)"
   54.18 -tmpfile=$(mktemp)
   54.19 -
   54.20 -if test -z ${XML2_CONFIG}; then
   54.21 -    RC=1
   54.22 -else
   54.23 -    ${XML2_CONFIG} --libs 2>&1 > /dev/null
   54.24 -    RC=$?
   54.25 -fi
   54.26 -
   54.27 -if test $RC -ne 0; then
   54.28 -    echo "FAILED"
   54.29 -	echo " *** xml2-config is missing. "
   54.30 -    echo " *** Please install libxml2-devel."
   54.31 -elif ! ld $($XML2_CONFIG --libs) -o $tmpfile >/dev/null 2>&1; then
   54.32 -    echo "FAILED"
   54.33 -    echo " *** dependency libraries for xml2 are missing: "
   54.34 -    RC=1
   54.35 -    for i in $(ld $($XML2_CONFIG --libs) -o $tmpfile 2>&1 >/dev/null); do
   54.36 -        case $i in
   54.37 -        -l*) echo lib${i#-l}
   54.38 -        esac
   54.39 -    done
   54.40 -fi
   54.41 -rm -f $tmpfile
   54.42 -
   54.43 -exit $RC
   54.44 +has_or_fail xml2-config
   54.45 +xml2_libs=`xml2-config --libs` || fail "xml2-config --libs failed"
   54.46 +test_link $xml2_libs || fail "dependency libraries for xml2 are missing"
    55.1 --- a/tools/check/check_zlib_devel	Tue Jan 22 08:27:29 2008 -0700
    55.2 +++ b/tools/check/check_zlib_devel	Tue Jan 22 08:30:40 2008 -0700
    55.3 @@ -1,14 +1,6 @@
    55.4  #!/bin/sh
    55.5  # CHECK-BUILD
    55.6  
    55.7 -RC=0
    55.8 -
    55.9 -set -e
   55.10 -test -r /usr/include/zlib.h || RC=1
   55.11 +. funcs.sh
   55.12  
   55.13 -if test ${RC} -ne 0; then
   55.14 -	echo
   55.15 -	echo " *** Check for zlib headers FAILED"
   55.16 -fi 
   55.17 -
   55.18 -exit ${RC}
   55.19 +has_header zlib.h || fail "can't find zlib headers"
    56.1 --- a/tools/check/check_zlib_lib	Tue Jan 22 08:27:29 2008 -0700
    56.2 +++ b/tools/check/check_zlib_lib	Tue Jan 22 08:30:40 2008 -0700
    56.3 @@ -1,24 +1,12 @@
    56.4  #!/bin/sh
    56.5  # CHECK-BUILD CHECK-INSTALL
    56.6  
    56.7 -RC=0
    56.8 +. funcs.sh
    56.9  
   56.10 -case $(uname -s) in
   56.11 +case $OS in
   56.12  FreeBSD|NetBSD|OpenBSD)
   56.13  	exit 0
   56.14  	;;
   56.15 -*)
   56.16 -	;;
   56.17  esac
   56.18  
   56.19 -PATH=/sbin:$PATH
   56.20 -
   56.21 -set -e
   56.22 -ldconfig -p 2>&1 | grep -q libz.so || RC=1
   56.23 -
   56.24 -if test ${RC} -ne 0; then
   56.25 -	echo
   56.26 -	echo " *** Check for zlib library FAILED"
   56.27 -fi
   56.28 -
   56.29 -exit ${RC} 
   56.30 +has_lib libz.so || fail "can't find zlib"
    57.1 --- a/tools/check/chk	Tue Jan 22 08:27:29 2008 -0700
    57.2 +++ b/tools/check/chk	Tue Jan 22 08:30:40 2008 -0700
    57.3 @@ -7,17 +7,16 @@ func_usage ()
    57.4      echo
    57.5      echo "Check suitability for Xen build or install."
    57.6      echo "Exit with 0 if OK, 1 if not."
    57.7 -    echo "Prints only failed tests."
    57.8      echo
    57.9      echo "Calling with 'clean' removes generated files."
   57.10      exit 1
   57.11  }
   57.12  
   57.13 -PATH=${PATH}:/sbin:/usr/sbin
   57.14 +PATH=$PATH:/sbin:/usr/sbin
   57.15  OS=`uname -s`
   57.16  export PATH OS
   57.17  
   57.18 -if test "${OS}" = "SunOS"; then
   57.19 +if [ "$OS" = "SunOS" ]; then
   57.20  	exit 0
   57.21  fi
   57.22  
   57.23 @@ -38,7 +37,7 @@ esac
   57.24  
   57.25  failed=0
   57.26  
   57.27 -echo "Xen ${check} " $(date)
   57.28 +echo "Xen ${check} " `date`
   57.29  for f in check_* ; do
   57.30      case $f in
   57.31          *~)
   57.32 @@ -50,7 +49,7 @@ for f in check_* ; do
   57.33      if ! [ -x $f ] ; then
   57.34          continue
   57.35      fi
   57.36 -    if ! grep -q ${check} $f ; then
   57.37 +    if ! grep -Fq "$check" $f ; then
   57.38          continue
   57.39      fi
   57.40      echo -n "Checking $f: "
    58.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    58.2 +++ b/tools/check/funcs.sh	Tue Jan 22 08:30:40 2008 -0700
    58.3 @@ -0,0 +1,85 @@
    58.4 +# has is the same as which, except it handles cross environments
    58.5 +has() {
    58.6 +	if [ -z "$CROSS_COMPILE" ]; then
    58.7 +		command which "$@"
    58.8 +		return $?
    58.9 +	fi
   58.10 +
   58.11 +	check_sys_root || return 1
   58.12 +
   58.13 +	# subshell to prevent pollution of caller's IFS
   58.14 +	(
   58.15 +	IFS=:
   58.16 +	for p in $PATH; do
   58.17 +		if [ -x "$CROSS_SYS_ROOT/$p/$1" ]; then
   58.18 +			echo "$CROSS_SYS_ROOT/$p/$1"
   58.19 +			return 0
   58.20 +		fi
   58.21 +	done
   58.22 +	return 1
   58.23 +	)
   58.24 +}
   58.25 +
   58.26 +has_or_fail() {
   58.27 +	has "$1" >/dev/null || fail "can't find $1"
   58.28 +}
   58.29 +
   58.30 +has_header() {
   58.31 +	case $1 in
   58.32 +		/*) ;;
   58.33 +		*) set -- "/usr/include/$1" ;;
   58.34 +	esac
   58.35 +
   58.36 +	check_sys_root || return 1
   58.37 +
   58.38 +	test -r "$CROSS_SYS_ROOT$1"
   58.39 +	return $?
   58.40 +}
   58.41 +
   58.42 +has_lib() {
   58.43 +	check_sys_root || return 1
   58.44 +
   58.45 +	# subshell to prevent pollution of caller's environment
   58.46 +	(
   58.47 +	PATH=/sbin:$PATH        # for ldconfig
   58.48 +
   58.49 +	# This relatively common in a sys-root; libs are installed but
   58.50 +	# ldconfig hasn't run there, so ldconfig -p won't work.
   58.51 +	if [ "$OS" = Linux -a ! -f "$CROSS_SYS_ROOT/etc/ld.so.cache" ]; then
   58.52 +	    echo "Please run ldconfig -r \"$CROSS_SYS_ROOT\" to generate ld.so.cache"
   58.53 +	    # fall through; ldconfig test below should fail
   58.54 +	fi
   58.55 +	ldconfig -p ${CROSS_SYS_ROOT+-r "$CROSS_SYS_ROOT"} | grep -Fq "$1"
   58.56 +	return $?
   58.57 +	)
   58.58 +}
   58.59 +
   58.60 +test_link() {
   58.61 +	# subshell to trap removal of tmpfile
   58.62 +	(
   58.63 +	unset tmpfile
   58.64 +	trap 'rm -f "$tmpfile"; exit' 0 1 2 15
   58.65 +	tmpfile=`mktemp` || return 1
   58.66 +	ld "$@" -o "$tmpfile" >/dev/null 2>&1
   58.67 +	return $?
   58.68 +	)
   58.69 +}
   58.70 +
   58.71 +# this function is used commonly above
   58.72 +check_sys_root() {
   58.73 +	[ -z "$CROSS_COMPILE" ] && return 0
   58.74 +	if [ -z "$CROSS_SYS_ROOT" ]; then
   58.75 +		echo "please set CROSS_SYS_ROOT in the environment"
   58.76 +		return 1
   58.77 +	fi
   58.78 +	if [ ! -d "$CROSS_SYS_ROOT" ]; then
   58.79 +		echo "no sys-root found at $CROSS_SYS_ROOT"
   58.80 +		return 1
   58.81 +	fi
   58.82 +}
   58.83 +
   58.84 +fail() {
   58.85 +	echo
   58.86 +	echo " *** `basename "$0"` FAILED${*+: $*}"
   58.87 +	exit 1
   58.88 +}
    59.1 --- a/tools/console/Makefile	Tue Jan 22 08:27:29 2008 -0700
    59.2 +++ b/tools/console/Makefile	Tue Jan 22 08:30:40 2008 -0700
    59.3 @@ -2,8 +2,7 @@
    59.4  XEN_ROOT=../..
    59.5  include $(XEN_ROOT)/tools/Rules.mk
    59.6  
    59.7 -DAEMON_INSTALL_DIR = /usr/sbin
    59.8 -CLIENT_INSTALL_DIR = /usr/$(LIBDIR)/xen/bin
    59.9 +CLIENT_INSTALL_DIR = $(LIBDIR)/xen/bin
   59.10  
   59.11  CFLAGS  += -Werror
   59.12  
   59.13 @@ -30,7 +29,7 @@ xenconsole: $(patsubst %.c,%.o,$(wildcar
   59.14  
   59.15  .PHONY: install
   59.16  install: $(BIN)
   59.17 -	$(INSTALL_DIR) $(DESTDIR)/$(DAEMON_INSTALL_DIR)
   59.18 -	$(INSTALL_PROG) xenconsoled $(DESTDIR)/$(DAEMON_INSTALL_DIR)
   59.19 +	$(INSTALL_DIR) $(DESTDIR)/$(SBINDIR)
   59.20 +	$(INSTALL_PROG) xenconsoled $(DESTDIR)/$(SBINDIR)
   59.21  	$(INSTALL_DIR) $(DESTDIR)/$(CLIENT_INSTALL_DIR)
   59.22  	$(INSTALL_PROG) xenconsole $(DESTDIR)/$(CLIENT_INSTALL_DIR)
    60.1 --- a/tools/debugger/xenitp/Makefile	Tue Jan 22 08:27:29 2008 -0700
    60.2 +++ b/tools/debugger/xenitp/Makefile	Tue Jan 22 08:30:40 2008 -0700
    60.3 @@ -26,17 +26,14 @@ build: $(BIN) $(LIBBIN)
    60.4  
    60.5  .PHONY: install
    60.6  install: build
    60.7 -	[ -d $(DESTDIR)/usr/bin ] || $(INSTALL_DIR) $(DESTDIR)/usr/bin
    60.8 -	[ -z "$(LIBBIN)" ] || [ -d $(DESTDIR)/usr/$(LIBDIR)/xen/bin ] || \
    60.9 -		$(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)/xen/bin
   60.10 -	[ -d $(DESTDIR)/usr/share/man/man1 ] || \
   60.11 -		$(INSTALL_DIR) $(DESTDIR)/usr/share/man/man1
   60.12 -	[ -d $(DESTDIR)/usr/share/man/man8 ] || \
   60.13 -		$(INSTALL_DIR) $(DESTDIR)/usr/share/man/man8
   60.14 -	$(INSTALL_PROG) $(BIN) $(SCRIPTS) $(DESTDIR)/usr/bin
   60.15 -	[ -z "$(LIBBIN)" ] || $(INSTALL_PROG) $(LIBBIN) $(DESTDIR)/usr/$(LIBDIR)/xen/bin
   60.16 -	$(INSTALL_DATA) $(MAN1) $(DESTDIR)/usr/share/man/man1
   60.17 -	$(INSTALL_DATA) $(MAN8) $(DESTDIR)/usr/share/man/man8
   60.18 +	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
   60.19 +	[ -z "$(LIBBIN)" ] || $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)/xen/bin
   60.20 +	$(INSTALL_DIR) $(DESTDIR)$(MAN1DIR)
   60.21 +	$(INSTALL_DIR) $(DESTDIR)$(MAN8DIR)
   60.22 +	$(INSTALL_PROG) $(BIN) $(SCRIPTS) $(DESTDIR)$(BINDIR)
   60.23 +	[ -z "$(LIBBIN)" ] || $(INSTALL_PROG) $(LIBBIN) $(DESTDIR)$(LIBDIR)/xen/bin
   60.24 +	$(INSTALL_DATA) $(MAN1) $(DESTDIR)$(MAN1DIR)
   60.25 +	$(INSTALL_DATA) $(MAN8) $(DESTDIR)$(MAN8DIR)
   60.26  
   60.27  .PHONY: clean
   60.28  clean:
    61.1 --- a/tools/firmware/hvmloader/acpi/Makefile	Tue Jan 22 08:27:29 2008 -0700
    61.2 +++ b/tools/firmware/hvmloader/acpi/Makefile	Tue Jan 22 08:30:40 2008 -0700
    61.3 @@ -60,7 +60,7 @@ iasl:
    61.4  	wget $(IASL_URL)
    61.5  	tar xzf $(IASL_VER).tar.gz
    61.6  	make -C $(IASL_VER)/compiler
    61.7 -	$(INSTALL_PROG) $(IASL_VER)/compiler/iasl /usr/bin/iasl
    61.8 +	$(INSTALL_PROG) $(IASL_VER)/compiler/iasl $(DESTDIR)$(BINDIR)/iasl
    61.9  
   61.10  acpi.a: $(OBJS)
   61.11  	$(AR) rc $@ $(OBJS)
    62.1 --- a/tools/firmware/hvmloader/acpi/build.c	Tue Jan 22 08:27:29 2008 -0700
    62.2 +++ b/tools/firmware/hvmloader/acpi/build.c	Tue Jan 22 08:30:40 2008 -0700
    62.3 @@ -65,8 +65,9 @@ static int uart_exists(uint16_t uart_bas
    62.4  static int construct_bios_info_table(uint8_t *buf)
    62.5  {
    62.6      struct bios_info {
    62.7 -        uint8_t com1_present:1;
    62.8 -        uint8_t com2_present:1;
    62.9 +        uint8_t  com1_present:1;
   62.10 +        uint8_t  com2_present:1;
   62.11 +        uint32_t pci_min, pci_len;
   62.12      } *bios_info = (struct bios_info *)buf;
   62.13  
   62.14      memset(bios_info, 0, sizeof(*bios_info));
   62.15 @@ -74,6 +75,9 @@ static int construct_bios_info_table(uin
   62.16      bios_info->com1_present = uart_exists(0x3f8);
   62.17      bios_info->com2_present = uart_exists(0x2f8);
   62.18  
   62.19 +    bios_info->pci_min = 0xf0000000;
   62.20 +    bios_info->pci_len = 0x0c000000;
   62.21 +
   62.22      return align16(sizeof(*bios_info));
   62.23  }
   62.24  
    63.1 --- a/tools/firmware/hvmloader/acpi/dsdt.asl	Tue Jan 22 08:27:29 2008 -0700
    63.2 +++ b/tools/firmware/hvmloader/acpi/dsdt.asl	Tue Jan 22 08:30:40 2008 -0700
    63.3 @@ -48,7 +48,10 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, 
    63.4         OperationRegion(BIOS, SystemMemory, 0xEA000, 16)
    63.5         Field(BIOS, ByteAcc, NoLock, Preserve) {
    63.6             UAR1, 1,
    63.7 -           UAR2, 1
    63.8 +           UAR2, 1,
    63.9 +           Offset(4),
   63.10 +           PMIN, 32,
   63.11 +           PLEN, 32
   63.12         }
   63.13  
   63.14          /* Fix HCT test for 0x400 pci memory:
   63.15 @@ -82,7 +85,7 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, 
   63.16                 {
   63.17                     /* bus number is from 0 - 255*/
   63.18                     WordBusNumber(
   63.19 -                        ResourceConsumer, MinFixed, MaxFixed, SubDecode,
   63.20 +                        ResourceProducer, MinFixed, MaxFixed, SubDecode,
   63.21                          0x0000,
   63.22                          0x0000,
   63.23                          0x00FF,
   63.24 @@ -117,14 +120,25 @@ DefinitionBlock ("DSDT.aml", "DSDT", 2, 
   63.25                          0x00020000)
   63.26  
   63.27                      DWordMemory(
   63.28 -                        ResourceConsumer, PosDecode, MinFixed, MaxFixed,
   63.29 +                        ResourceProducer, PosDecode, MinFixed, MaxFixed,
   63.30                          Cacheable, ReadWrite,
   63.31                          0x00000000,
   63.32                          0xF0000000,
   63.33                          0xF4FFFFFF,
   63.34                          0x00000000,
   63.35 -                        0x05000000)
   63.36 +                        0x05000000,
   63.37 +                        ,, _Y01)
   63.38                  })
   63.39 +
   63.40 +                CreateDWordField(PRT0, \_SB.PCI0._CRS._Y01._MIN, MMIN)
   63.41 +                CreateDWordField(PRT0, \_SB.PCI0._CRS._Y01._MAX, MMAX)
   63.42 +                CreateDWordField(PRT0, \_SB.PCI0._CRS._Y01._LEN, MLEN)
   63.43 +
   63.44 +                Store(\_SB.PMIN, MMIN)
   63.45 +                Store(\_SB.PLEN, MLEN)
   63.46 +                Add(MMIN, MLEN, MMAX)
   63.47 +                Subtract(MMAX, One, MMAX)
   63.48 +
   63.49                  Return (PRT0)
   63.50              }
   63.51  
    64.1 --- a/tools/firmware/hvmloader/acpi/dsdt.c	Tue Jan 22 08:27:29 2008 -0700
    64.2 +++ b/tools/firmware/hvmloader/acpi/dsdt.c	Tue Jan 22 08:30:40 2008 -0700
    64.3 @@ -5,15 +5,15 @@
    64.4   * Copyright (C) 2000 - 2006 Intel Corporation
    64.5   * Supports ACPI Specification Revision 3.0a
    64.6   * 
    64.7 - * Compilation of "dsdt.asl" - Tue Sep 11 16:12:28 2007
    64.8 + * Compilation of "dsdt.asl" - Mon Jan 21 14:11:31 2008
    64.9   * 
   64.10   * C source code output
   64.11   *
   64.12   */
   64.13  unsigned char AmlCode[] =
   64.14  {
   64.15 -    0x44,0x53,0x44,0x54,0x19,0x0E,0x00,0x00,  /* 00000000    "DSDT...." */
   64.16 -    0x02,0x6A,0x58,0x65,0x6E,0x00,0x00,0x00,  /* 00000008    ".jXen..." */
   64.17 +    0x44,0x53,0x44,0x54,0x6F,0x0E,0x00,0x00,  /* 00000000    "DSDTo..." */
   64.18 +    0x02,0xE1,0x58,0x65,0x6E,0x00,0x00,0x00,  /* 00000008    "..Xen..." */
   64.19      0x48,0x56,0x4D,0x00,0x00,0x00,0x00,0x00,  /* 00000010    "HVM....." */
   64.20      0x00,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C,  /* 00000018    "....INTL" */
   64.21      0x07,0x07,0x06,0x20,0x08,0x50,0x4D,0x42,  /* 00000020    "... .PMB" */
   64.22 @@ -27,442 +27,452 @@ unsigned char AmlCode[] =
   64.23      0x04,0x0A,0x07,0x0A,0x07,0x00,0x00,0x08,  /* 00000060    "........" */
   64.24      0x50,0x49,0x43,0x44,0x00,0x14,0x0C,0x5F,  /* 00000068    "PICD..._" */
   64.25      0x50,0x49,0x43,0x01,0x70,0x68,0x50,0x49,  /* 00000070    "PIC.phPI" */
   64.26 -    0x43,0x44,0x10,0x4E,0xD9,0x5F,0x53,0x42,  /* 00000078    "CD.N._SB" */
   64.27 +    0x43,0x44,0x10,0x44,0xDF,0x5F,0x53,0x42,  /* 00000078    "CD.D._SB" */
   64.28      0x5F,0x5B,0x80,0x42,0x49,0x4F,0x53,0x00,  /* 00000080    "_[.BIOS." */
   64.29      0x0C,0x00,0xA0,0x0E,0x00,0x0A,0x10,0x5B,  /* 00000088    ".......[" */
   64.30 -    0x81,0x10,0x42,0x49,0x4F,0x53,0x01,0x55,  /* 00000090    "..BIOS.U" */
   64.31 +    0x81,0x1C,0x42,0x49,0x4F,0x53,0x01,0x55,  /* 00000090    "..BIOS.U" */
   64.32      0x41,0x52,0x31,0x01,0x55,0x41,0x52,0x32,  /* 00000098    "AR1.UAR2" */
   64.33 -    0x01,0x5B,0x82,0x49,0x04,0x4D,0x45,0x4D,  /* 000000A0    ".[.I.MEM" */
   64.34 -    0x30,0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,  /* 000000A8    "0._HID.A" */
   64.35 -    0xD0,0x0C,0x02,0x08,0x5F,0x43,0x52,0x53,  /* 000000B0    "...._CRS" */
   64.36 -    0x11,0x33,0x0A,0x30,0x8A,0x2B,0x00,0x00,  /* 000000B8    ".3.0.+.." */
   64.37 -    0x0D,0x03,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000C0    "........" */
   64.38 -    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000C8    "........" */
   64.39 -    0x00,0x00,0xFF,0xFF,0x09,0x00,0x00,0x00,  /* 000000D0    "........" */
   64.40 -    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000D8    "........" */
   64.41 -    0x00,0x00,0x00,0x00,0x0A,0x00,0x00,0x00,  /* 000000E0    "........" */
   64.42 -    0x00,0x00,0x79,0x00,0x5B,0x82,0x4B,0xD2,  /* 000000E8    "..y.[.K." */
   64.43 -    0x50,0x43,0x49,0x30,0x08,0x5F,0x48,0x49,  /* 000000F0    "PCI0._HI" */
   64.44 -    0x44,0x0C,0x41,0xD0,0x0A,0x03,0x08,0x5F,  /* 000000F8    "D.A...._" */
   64.45 -    0x55,0x49,0x44,0x00,0x08,0x5F,0x41,0x44,  /* 00000100    "UID.._AD" */
   64.46 -    0x52,0x00,0x08,0x5F,0x42,0x42,0x4E,0x00,  /* 00000108    "R.._BBN." */
   64.47 -    0x14,0x44,0x08,0x5F,0x43,0x52,0x53,0x00,  /* 00000110    ".D._CRS." */
   64.48 -    0x08,0x50,0x52,0x54,0x30,0x11,0x42,0x07,  /* 00000118    ".PRT0.B." */
   64.49 -    0x0A,0x6E,0x88,0x0D,0x00,0x02,0x0F,0x00,  /* 00000120    ".n......" */
   64.50 -    0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,  /* 00000128    "........" */
   64.51 -    0x00,0x01,0x47,0x01,0xF8,0x0C,0xF8,0x0C,  /* 00000130    "..G....." */
   64.52 -    0x01,0x08,0x88,0x0D,0x00,0x01,0x0C,0x03,  /* 00000138    "........" */
   64.53 -    0x00,0x00,0x00,0x00,0xF7,0x0C,0x00,0x00,  /* 00000140    "........" */
   64.54 -    0xF8,0x0C,0x88,0x0D,0x00,0x01,0x0C,0x03,  /* 00000148    "........" */
   64.55 -    0x00,0x00,0x00,0x0D,0xFF,0xFF,0x00,0x00,  /* 00000150    "........" */
   64.56 -    0x00,0xF3,0x87,0x17,0x00,0x00,0x0C,0x03,  /* 00000158    "........" */
   64.57 -    0x00,0x00,0x00,0x00,0x00,0x00,0x0A,0x00,  /* 00000160    "........" */
   64.58 -    0xFF,0xFF,0x0B,0x00,0x00,0x00,0x00,0x00,  /* 00000168    "........" */
   64.59 -    0x00,0x00,0x02,0x00,0x87,0x17,0x00,0x00,  /* 00000170    "........" */
   64.60 -    0x0D,0x03,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000178    "........" */
   64.61 -    0x00,0xF0,0xFF,0xFF,0xFF,0xF4,0x00,0x00,  /* 00000180    "........" */
   64.62 -    0x00,0x00,0x00,0x00,0x00,0x05,0x79,0x00,  /* 00000188    "......y." */
   64.63 -    0xA4,0x50,0x52,0x54,0x30,0x08,0x42,0x55,  /* 00000190    ".PRT0.BU" */
   64.64 -    0x46,0x41,0x11,0x09,0x0A,0x06,0x23,0x20,  /* 00000198    "FA....# " */
   64.65 -    0x0C,0x18,0x79,0x00,0x08,0x42,0x55,0x46,  /* 000001A0    "..y..BUF" */
   64.66 -    0x42,0x11,0x09,0x0A,0x06,0x23,0x00,0x00,  /* 000001A8    "B....#.." */
   64.67 -    0x18,0x79,0x00,0x8B,0x42,0x55,0x46,0x42,  /* 000001B0    ".y..BUFB" */
   64.68 -    0x01,0x49,0x52,0x51,0x56,0x5B,0x82,0x48,  /* 000001B8    ".IRQV[.H" */
   64.69 -    0x08,0x4C,0x4E,0x4B,0x41,0x08,0x5F,0x48,  /* 000001C0    ".LNKA._H" */
   64.70 -    0x49,0x44,0x0C,0x41,0xD0,0x0C,0x0F,0x08,  /* 000001C8    "ID.A...." */
   64.71 -    0x5F,0x55,0x49,0x44,0x01,0x14,0x1C,0x5F,  /* 000001D0    "_UID..._" */
   64.72 -    0x53,0x54,0x41,0x00,0x7B,0x50,0x49,0x52,  /* 000001D8    "STA.{PIR" */
   64.73 -    0x41,0x0A,0x80,0x60,0xA0,0x08,0x93,0x60,  /* 000001E0    "A..`...`" */
   64.74 -    0x0A,0x80,0xA4,0x0A,0x09,0xA1,0x04,0xA4,  /* 000001E8    "........" */
   64.75 -    0x0A,0x0B,0x14,0x0B,0x5F,0x50,0x52,0x53,  /* 000001F0    "...._PRS" */
   64.76 -    0x00,0xA4,0x42,0x55,0x46,0x41,0x14,0x11,  /* 000001F8    "..BUFA.." */
   64.77 -    0x5F,0x44,0x49,0x53,0x00,0x7D,0x50,0x49,  /* 00000200    "_DIS.}PI" */
   64.78 -    0x52,0x41,0x0A,0x80,0x50,0x49,0x52,0x41,  /* 00000208    "RA..PIRA" */
   64.79 -    0x14,0x1A,0x5F,0x43,0x52,0x53,0x00,0x7B,  /* 00000210    ".._CRS.{" */
   64.80 -    0x50,0x49,0x52,0x41,0x0A,0x0F,0x60,0x79,  /* 00000218    "PIRA..`y" */
   64.81 -    0x01,0x60,0x49,0x52,0x51,0x56,0xA4,0x42,  /* 00000220    ".`IRQV.B" */
   64.82 -    0x55,0x46,0x42,0x14,0x1B,0x5F,0x53,0x52,  /* 00000228    "UFB.._SR" */
   64.83 -    0x53,0x01,0x8B,0x68,0x01,0x49,0x52,0x51,  /* 00000230    "S..h.IRQ" */
   64.84 -    0x31,0x82,0x49,0x52,0x51,0x31,0x60,0x76,  /* 00000238    "1.IRQ1`v" */
   64.85 -    0x60,0x70,0x60,0x50,0x49,0x52,0x41,0x5B,  /* 00000240    "`p`PIRA[" */
   64.86 -    0x82,0x49,0x08,0x4C,0x4E,0x4B,0x42,0x08,  /* 00000248    ".I.LNKB." */
   64.87 -    0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,0x0C,  /* 00000250    "_HID.A.." */
   64.88 -    0x0F,0x08,0x5F,0x55,0x49,0x44,0x0A,0x02,  /* 00000258    ".._UID.." */
   64.89 -    0x14,0x1C,0x5F,0x53,0x54,0x41,0x00,0x7B,  /* 00000260    ".._STA.{" */
   64.90 -    0x50,0x49,0x52,0x42,0x0A,0x80,0x60,0xA0,  /* 00000268    "PIRB..`." */
   64.91 -    0x08,0x93,0x60,0x0A,0x80,0xA4,0x0A,0x09,  /* 00000270    "..`....." */
   64.92 -    0xA1,0x04,0xA4,0x0A,0x0B,0x14,0x0B,0x5F,  /* 00000278    "......._" */
   64.93 -    0x50,0x52,0x53,0x00,0xA4,0x42,0x55,0x46,  /* 00000280    "PRS..BUF" */
   64.94 -    0x41,0x14,0x11,0x5F,0x44,0x49,0x53,0x00,  /* 00000288    "A.._DIS." */
   64.95 -    0x7D,0x50,0x49,0x52,0x42,0x0A,0x80,0x50,  /* 00000290    "}PIRB..P" */
   64.96 -    0x49,0x52,0x42,0x14,0x1A,0x5F,0x43,0x52,  /* 00000298    "IRB.._CR" */
   64.97 -    0x53,0x00,0x7B,0x50,0x49,0x52,0x42,0x0A,  /* 000002A0    "S.{PIRB." */
   64.98 -    0x0F,0x60,0x79,0x01,0x60,0x49,0x52,0x51,  /* 000002A8    ".`y.`IRQ" */
   64.99 -    0x56,0xA4,0x42,0x55,0x46,0x42,0x14,0x1B,  /* 000002B0    "V.BUFB.." */
  64.100 -    0x5F,0x53,0x52,0x53,0x01,0x8B,0x68,0x01,  /* 000002B8    "_SRS..h." */
  64.101 -    0x49,0x52,0x51,0x31,0x82,0x49,0x52,0x51,  /* 000002C0    "IRQ1.IRQ" */
  64.102 -    0x31,0x60,0x76,0x60,0x70,0x60,0x50,0x49,  /* 000002C8    "1`v`p`PI" */
  64.103 -    0x52,0x42,0x5B,0x82,0x49,0x08,0x4C,0x4E,  /* 000002D0    "RB[.I.LN" */
  64.104 -    0x4B,0x43,0x08,0x5F,0x48,0x49,0x44,0x0C,  /* 000002D8    "KC._HID." */
  64.105 -    0x41,0xD0,0x0C,0x0F,0x08,0x5F,0x55,0x49,  /* 000002E0    "A...._UI" */
  64.106 -    0x44,0x0A,0x03,0x14,0x1C,0x5F,0x53,0x54,  /* 000002E8    "D...._ST" */
  64.107 -    0x41,0x00,0x7B,0x50,0x49,0x52,0x43,0x0A,  /* 000002F0    "A.{PIRC." */
  64.108 -    0x80,0x60,0xA0,0x08,0x93,0x60,0x0A,0x80,  /* 000002F8    ".`...`.." */
  64.109 -    0xA4,0x0A,0x09,0xA1,0x04,0xA4,0x0A,0x0B,  /* 00000300    "........" */
  64.110 -    0x14,0x0B,0x5F,0x50,0x52,0x53,0x00,0xA4,  /* 00000308    ".._PRS.." */
  64.111 -    0x42,0x55,0x46,0x41,0x14,0x11,0x5F,0x44,  /* 00000310    "BUFA.._D" */
  64.112 -    0x49,0x53,0x00,0x7D,0x50,0x49,0x52,0x43,  /* 00000318    "IS.}PIRC" */
  64.113 -    0x0A,0x80,0x50,0x49,0x52,0x43,0x14,0x1A,  /* 00000320    "..PIRC.." */
  64.114 -    0x5F,0x43,0x52,0x53,0x00,0x7B,0x50,0x49,  /* 00000328    "_CRS.{PI" */
  64.115 -    0x52,0x43,0x0A,0x0F,0x60,0x79,0x01,0x60,  /* 00000330    "RC..`y.`" */
  64.116 -    0x49,0x52,0x51,0x56,0xA4,0x42,0x55,0x46,  /* 00000338    "IRQV.BUF" */
  64.117 -    0x42,0x14,0x1B,0x5F,0x53,0x52,0x53,0x01,  /* 00000340    "B.._SRS." */
  64.118 -    0x8B,0x68,0x01,0x49,0x52,0x51,0x31,0x82,  /* 00000348    ".h.IRQ1." */
  64.119 -    0x49,0x52,0x51,0x31,0x60,0x76,0x60,0x70,  /* 00000350    "IRQ1`v`p" */
  64.120 -    0x60,0x50,0x49,0x52,0x43,0x5B,0x82,0x49,  /* 00000358    "`PIRC[.I" */
  64.121 -    0x08,0x4C,0x4E,0x4B,0x44,0x08,0x5F,0x48,  /* 00000360    ".LNKD._H" */
  64.122 -    0x49,0x44,0x0C,0x41,0xD0,0x0C,0x0F,0x08,  /* 00000368    "ID.A...." */
  64.123 -    0x5F,0x55,0x49,0x44,0x0A,0x04,0x14,0x1C,  /* 00000370    "_UID...." */
  64.124 -    0x5F,0x53,0x54,0x41,0x00,0x7B,0x50,0x49,  /* 00000378    "_STA.{PI" */
  64.125 -    0x52,0x44,0x0A,0x80,0x60,0xA0,0x08,0x93,  /* 00000380    "RD..`..." */
  64.126 -    0x60,0x0A,0x80,0xA4,0x0A,0x09,0xA1,0x04,  /* 00000388    "`......." */
  64.127 -    0xA4,0x0A,0x0B,0x14,0x0B,0x5F,0x50,0x52,  /* 00000390    "....._PR" */
  64.128 -    0x53,0x00,0xA4,0x42,0x55,0x46,0x41,0x14,  /* 00000398    "S..BUFA." */
  64.129 -    0x11,0x5F,0x44,0x49,0x53,0x00,0x7D,0x50,  /* 000003A0    "._DIS.}P" */
  64.130 -    0x49,0x52,0x44,0x0A,0x80,0x50,0x49,0x52,  /* 000003A8    "IRD..PIR" */
  64.131 -    0x44,0x14,0x1A,0x5F,0x43,0x52,0x53,0x00,  /* 000003B0    "D.._CRS." */
  64.132 -    0x7B,0x50,0x49,0x52,0x44,0x0A,0x0F,0x60,  /* 000003B8    "{PIRD..`" */
  64.133 -    0x79,0x01,0x60,0x49,0x52,0x51,0x56,0xA4,  /* 000003C0    "y.`IRQV." */
  64.134 -    0x42,0x55,0x46,0x42,0x14,0x1B,0x5F,0x53,  /* 000003C8    "BUFB.._S" */
  64.135 -    0x52,0x53,0x01,0x8B,0x68,0x01,0x49,0x52,  /* 000003D0    "RS..h.IR" */
  64.136 -    0x51,0x31,0x82,0x49,0x52,0x51,0x31,0x60,  /* 000003D8    "Q1.IRQ1`" */
  64.137 -    0x76,0x60,0x70,0x60,0x50,0x49,0x52,0x44,  /* 000003E0    "v`p`PIRD" */
  64.138 -    0x5B,0x82,0x3A,0x48,0x50,0x45,0x54,0x08,  /* 000003E8    "[.:HPET." */
  64.139 -    0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,0x01,  /* 000003F0    "_HID.A.." */
  64.140 -    0x03,0x08,0x5F,0x55,0x49,0x44,0x00,0x08,  /* 000003F8    ".._UID.." */
  64.141 -    0x5F,0x43,0x52,0x53,0x11,0x1F,0x0A,0x1C,  /* 00000400    "_CRS...." */
  64.142 -    0x87,0x17,0x00,0x00,0x0D,0x01,0x00,0x00,  /* 00000408    "........" */
  64.143 -    0x00,0x00,0x00,0x00,0xD0,0xFE,0xFF,0x03,  /* 00000410    "........" */
  64.144 -    0xD0,0xFE,0x00,0x00,0x00,0x00,0x00,0x04,  /* 00000418    "........" */
  64.145 -    0x00,0x00,0x79,0x00,0x14,0x16,0x5F,0x50,  /* 00000420    "..y..._P" */
  64.146 -    0x52,0x54,0x00,0xA0,0x0A,0x50,0x49,0x43,  /* 00000428    "RT...PIC" */
  64.147 -    0x44,0xA4,0x50,0x52,0x54,0x41,0xA4,0x50,  /* 00000430    "D.PRTA.P" */
  64.148 -    0x52,0x54,0x50,0x08,0x50,0x52,0x54,0x50,  /* 00000438    "RTP.PRTP" */
  64.149 -    0x12,0x49,0x36,0x3C,0x12,0x0D,0x04,0x0C,  /* 00000440    ".I6<...." */
  64.150 -    0xFF,0xFF,0x01,0x00,0x00,0x4C,0x4E,0x4B,  /* 00000448    ".....LNK" */
  64.151 -    0x42,0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,  /* 00000450    "B......." */
  64.152 -    0x01,0x00,0x01,0x4C,0x4E,0x4B,0x43,0x00,  /* 00000458    "...LNKC." */
  64.153 -    0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x01,0x00,  /* 00000460    "........" */
  64.154 -    0x0A,0x02,0x4C,0x4E,0x4B,0x44,0x00,0x12,  /* 00000468    "..LNKD.." */
  64.155 -    0x0E,0x04,0x0C,0xFF,0xFF,0x01,0x00,0x0A,  /* 00000470    "........" */
  64.156 -    0x03,0x4C,0x4E,0x4B,0x41,0x00,0x12,0x0D,  /* 00000478    ".LNKA..." */
  64.157 -    0x04,0x0C,0xFF,0xFF,0x02,0x00,0x00,0x4C,  /* 00000480    ".......L" */
  64.158 -    0x4E,0x4B,0x43,0x00,0x12,0x0D,0x04,0x0C,  /* 00000488    "NKC....." */
  64.159 -    0xFF,0xFF,0x02,0x00,0x01,0x4C,0x4E,0x4B,  /* 00000490    ".....LNK" */
  64.160 -    0x44,0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,  /* 00000498    "D......." */
  64.161 -    0x02,0x00,0x0A,0x02,0x4C,0x4E,0x4B,0x41,  /* 000004A0    "....LNKA" */
  64.162 -    0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x02,  /* 000004A8    "........" */
  64.163 -    0x00,0x0A,0x03,0x4C,0x4E,0x4B,0x42,0x00,  /* 000004B0    "...LNKB." */
  64.164 -    0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x03,0x00,  /* 000004B8    "........" */
  64.165 -    0x00,0x4C,0x4E,0x4B,0x44,0x00,0x12,0x0D,  /* 000004C0    ".LNKD..." */
  64.166 -    0x04,0x0C,0xFF,0xFF,0x03,0x00,0x01,0x4C,  /* 000004C8    ".......L" */
  64.167 -    0x4E,0x4B,0x41,0x00,0x12,0x0E,0x04,0x0C,  /* 000004D0    "NKA....." */
  64.168 -    0xFF,0xFF,0x03,0x00,0x0A,0x02,0x4C,0x4E,  /* 000004D8    "......LN" */
  64.169 -    0x4B,0x42,0x00,0x12,0x0E,0x04,0x0C,0xFF,  /* 000004E0    "KB......" */
  64.170 -    0xFF,0x03,0x00,0x0A,0x03,0x4C,0x4E,0x4B,  /* 000004E8    ".....LNK" */
  64.171 -    0x43,0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,  /* 000004F0    "C......." */
  64.172 -    0x04,0x00,0x00,0x4C,0x4E,0x4B,0x41,0x00,  /* 000004F8    "...LNKA." */
  64.173 -    0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x04,0x00,  /* 00000500    "........" */
  64.174 -    0x01,0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0E,  /* 00000508    ".LNKB..." */
  64.175 -    0x04,0x0C,0xFF,0xFF,0x04,0x00,0x0A,0x02,  /* 00000510    "........" */
  64.176 -    0x4C,0x4E,0x4B,0x43,0x00,0x12,0x0E,0x04,  /* 00000518    "LNKC...." */
  64.177 -    0x0C,0xFF,0xFF,0x04,0x00,0x0A,0x03,0x4C,  /* 00000520    ".......L" */
  64.178 -    0x4E,0x4B,0x44,0x00,0x12,0x0D,0x04,0x0C,  /* 00000528    "NKD....." */
  64.179 -    0xFF,0xFF,0x05,0x00,0x00,0x4C,0x4E,0x4B,  /* 00000530    ".....LNK" */
  64.180 -    0x42,0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,  /* 00000538    "B......." */
  64.181 -    0x05,0x00,0x01,0x4C,0x4E,0x4B,0x43,0x00,  /* 00000540    "...LNKC." */
  64.182 -    0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x05,0x00,  /* 00000548    "........" */
  64.183 -    0x0A,0x02,0x4C,0x4E,0x4B,0x44,0x00,0x12,  /* 00000550    "..LNKD.." */
  64.184 -    0x0E,0x04,0x0C,0xFF,0xFF,0x05,0x00,0x0A,  /* 00000558    "........" */
  64.185 -    0x03,0x4C,0x4E,0x4B,0x41,0x00,0x12,0x0D,  /* 00000560    ".LNKA..." */
  64.186 -    0x04,0x0C,0xFF,0xFF,0x06,0x00,0x00,0x4C,  /* 00000568    ".......L" */
  64.187 -    0x4E,0x4B,0x43,0x00,0x12,0x0D,0x04,0x0C,  /* 00000570    "NKC....." */
  64.188 -    0xFF,0xFF,0x06,0x00,0x01,0x4C,0x4E,0x4B,  /* 00000578    ".....LNK" */
  64.189 -    0x44,0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,  /* 00000580    "D......." */
  64.190 -    0x06,0x00,0x0A,0x02,0x4C,0x4E,0x4B,0x41,  /* 00000588    "....LNKA" */
  64.191 -    0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x06,  /* 00000590    "........" */
  64.192 -    0x00,0x0A,0x03,0x4C,0x4E,0x4B,0x42,0x00,  /* 00000598    "...LNKB." */
  64.193 -    0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x07,0x00,  /* 000005A0    "........" */
  64.194 -    0x00,0x4C,0x4E,0x4B,0x44,0x00,0x12,0x0D,  /* 000005A8    ".LNKD..." */
  64.195 -    0x04,0x0C,0xFF,0xFF,0x07,0x00,0x01,0x4C,  /* 000005B0    ".......L" */
  64.196 -    0x4E,0x4B,0x41,0x00,0x12,0x0E,0x04,0x0C,  /* 000005B8    "NKA....." */
  64.197 -    0xFF,0xFF,0x07,0x00,0x0A,0x02,0x4C,0x4E,  /* 000005C0    "......LN" */
  64.198 -    0x4B,0x42,0x00,0x12,0x0E,0x04,0x0C,0xFF,  /* 000005C8    "KB......" */
  64.199 -    0xFF,0x07,0x00,0x0A,0x03,0x4C,0x4E,0x4B,  /* 000005D0    ".....LNK" */
  64.200 -    0x43,0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,  /* 000005D8    "C......." */
  64.201 -    0x08,0x00,0x00,0x4C,0x4E,0x4B,0x41,0x00,  /* 000005E0    "...LNKA." */
  64.202 -    0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x08,0x00,  /* 000005E8    "........" */
  64.203 -    0x01,0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0E,  /* 000005F0    ".LNKB..." */
  64.204 -    0x04,0x0C,0xFF,0xFF,0x08,0x00,0x0A,0x02,  /* 000005F8    "........" */
  64.205 -    0x4C,0x4E,0x4B,0x43,0x00,0x12,0x0E,0x04,  /* 00000600    "LNKC...." */
  64.206 -    0x0C,0xFF,0xFF,0x08,0x00,0x0A,0x03,0x4C,  /* 00000608    ".......L" */
  64.207 -    0x4E,0x4B,0x44,0x00,0x12,0x0D,0x04,0x0C,  /* 00000610    "NKD....." */
  64.208 -    0xFF,0xFF,0x09,0x00,0x00,0x4C,0x4E,0x4B,  /* 00000618    ".....LNK" */
  64.209 -    0x42,0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,  /* 00000620    "B......." */
  64.210 -    0x09,0x00,0x01,0x4C,0x4E,0x4B,0x43,0x00,  /* 00000628    "...LNKC." */
  64.211 -    0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x09,0x00,  /* 00000630    "........" */
  64.212 -    0x0A,0x02,0x4C,0x4E,0x4B,0x44,0x00,0x12,  /* 00000638    "..LNKD.." */
  64.213 -    0x0E,0x04,0x0C,0xFF,0xFF,0x09,0x00,0x0A,  /* 00000640    "........" */
  64.214 -    0x03,0x4C,0x4E,0x4B,0x41,0x00,0x12,0x0D,  /* 00000648    ".LNKA..." */
  64.215 -    0x04,0x0C,0xFF,0xFF,0x0A,0x00,0x00,0x4C,  /* 00000650    ".......L" */
  64.216 -    0x4E,0x4B,0x43,0x00,0x12,0x0D,0x04,0x0C,  /* 00000658    "NKC....." */
  64.217 -    0xFF,0xFF,0x0A,0x00,0x01,0x4C,0x4E,0x4B,  /* 00000660    ".....LNK" */
  64.218 -    0x44,0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,  /* 00000668    "D......." */
  64.219 -    0x0A,0x00,0x0A,0x02,0x4C,0x4E,0x4B,0x41,  /* 00000670    "....LNKA" */
  64.220 -    0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x0A,  /* 00000678    "........" */
  64.221 -    0x00,0x0A,0x03,0x4C,0x4E,0x4B,0x42,0x00,  /* 00000680    "...LNKB." */
  64.222 -    0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x0B,0x00,  /* 00000688    "........" */
  64.223 -    0x00,0x4C,0x4E,0x4B,0x44,0x00,0x12,0x0D,  /* 00000690    ".LNKD..." */
  64.224 -    0x04,0x0C,0xFF,0xFF,0x0B,0x00,0x01,0x4C,  /* 00000698    ".......L" */
  64.225 -    0x4E,0x4B,0x41,0x00,0x12,0x0E,0x04,0x0C,  /* 000006A0    "NKA....." */
  64.226 -    0xFF,0xFF,0x0B,0x00,0x0A,0x02,0x4C,0x4E,  /* 000006A8    "......LN" */
  64.227 -    0x4B,0x42,0x00,0x12,0x0E,0x04,0x0C,0xFF,  /* 000006B0    "KB......" */
  64.228 -    0xFF,0x0B,0x00,0x0A,0x03,0x4C,0x4E,0x4B,  /* 000006B8    ".....LNK" */
  64.229 -    0x43,0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,  /* 000006C0    "C......." */
  64.230 -    0x0C,0x00,0x00,0x4C,0x4E,0x4B,0x41,0x00,  /* 000006C8    "...LNKA." */
  64.231 -    0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x0C,0x00,  /* 000006D0    "........" */
  64.232 -    0x01,0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0E,  /* 000006D8    ".LNKB..." */
  64.233 -    0x04,0x0C,0xFF,0xFF,0x0C,0x00,0x0A,0x02,  /* 000006E0    "........" */
  64.234 -    0x4C,0x4E,0x4B,0x43,0x00,0x12,0x0E,0x04,  /* 000006E8    "LNKC...." */
  64.235 -    0x0C,0xFF,0xFF,0x0C,0x00,0x0A,0x03,0x4C,  /* 000006F0    ".......L" */
  64.236 -    0x4E,0x4B,0x44,0x00,0x12,0x0D,0x04,0x0C,  /* 000006F8    "NKD....." */
  64.237 -    0xFF,0xFF,0x0D,0x00,0x00,0x4C,0x4E,0x4B,  /* 00000700    ".....LNK" */
  64.238 -    0x42,0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,  /* 00000708    "B......." */
  64.239 -    0x0D,0x00,0x01,0x4C,0x4E,0x4B,0x43,0x00,  /* 00000710    "...LNKC." */
  64.240 -    0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x0D,0x00,  /* 00000718    "........" */
  64.241 -    0x0A,0x02,0x4C,0x4E,0x4B,0x44,0x00,0x12,  /* 00000720    "..LNKD.." */
  64.242 -    0x0E,0x04,0x0C,0xFF,0xFF,0x0D,0x00,0x0A,  /* 00000728    "........" */
  64.243 -    0x03,0x4C,0x4E,0x4B,0x41,0x00,0x12,0x0D,  /* 00000730    ".LNKA..." */
  64.244 -    0x04,0x0C,0xFF,0xFF,0x0E,0x00,0x00,0x4C,  /* 00000738    ".......L" */
  64.245 -    0x4E,0x4B,0x43,0x00,0x12,0x0D,0x04,0x0C,  /* 00000740    "NKC....." */
  64.246 -    0xFF,0xFF,0x0E,0x00,0x01,0x4C,0x4E,0x4B,  /* 00000748    ".....LNK" */
  64.247 -    0x44,0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,  /* 00000750    "D......." */
  64.248 -    0x0E,0x00,0x0A,0x02,0x4C,0x4E,0x4B,0x41,  /* 00000758    "....LNKA" */
  64.249 -    0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x0E,  /* 00000760    "........" */
  64.250 -    0x00,0x0A,0x03,0x4C,0x4E,0x4B,0x42,0x00,  /* 00000768    "...LNKB." */
  64.251 -    0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x0F,0x00,  /* 00000770    "........" */
  64.252 -    0x00,0x4C,0x4E,0x4B,0x44,0x00,0x12,0x0D,  /* 00000778    ".LNKD..." */
  64.253 -    0x04,0x0C,0xFF,0xFF,0x0F,0x00,0x01,0x4C,  /* 00000780    ".......L" */
  64.254 -    0x4E,0x4B,0x41,0x00,0x12,0x0E,0x04,0x0C,  /* 00000788    "NKA....." */
  64.255 -    0xFF,0xFF,0x0F,0x00,0x0A,0x02,0x4C,0x4E,  /* 00000790    "......LN" */
  64.256 -    0x4B,0x42,0x00,0x12,0x0E,0x04,0x0C,0xFF,  /* 00000798    "KB......" */
  64.257 -    0xFF,0x0F,0x00,0x0A,0x03,0x4C,0x4E,0x4B,  /* 000007A0    ".....LNK" */
  64.258 -    0x43,0x00,0x08,0x50,0x52,0x54,0x41,0x12,  /* 000007A8    "C..PRTA." */
  64.259 -    0x41,0x2F,0x3C,0x12,0x0B,0x04,0x0C,0xFF,  /* 000007B0    "A/<....." */
  64.260 -    0xFF,0x01,0x00,0x00,0x00,0x0A,0x14,0x12,  /* 000007B8    "........" */
  64.261 -    0x0B,0x04,0x0C,0xFF,0xFF,0x01,0x00,0x01,  /* 000007C0    "........" */
  64.262 -    0x00,0x0A,0x15,0x12,0x0C,0x04,0x0C,0xFF,  /* 000007C8    "........" */
  64.263 -    0xFF,0x01,0x00,0x0A,0x02,0x00,0x0A,0x16,  /* 000007D0    "........" */
  64.264 -    0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x01,0x00,  /* 000007D8    "........" */
  64.265 -    0x0A,0x03,0x00,0x0A,0x17,0x12,0x0B,0x04,  /* 000007E0    "........" */
  64.266 -    0x0C,0xFF,0xFF,0x02,0x00,0x00,0x00,0x0A,  /* 000007E8    "........" */
  64.267 -    0x18,0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x02,  /* 000007F0    "........" */
  64.268 -    0x00,0x01,0x00,0x0A,0x19,0x12,0x0C,0x04,  /* 000007F8    "........" */
  64.269 -    0x0C,0xFF,0xFF,0x02,0x00,0x0A,0x02,0x00,  /* 00000800    "........" */
  64.270 -    0x0A,0x1A,0x12,0x0C,0x04,0x0C,0xFF,0xFF,  /* 00000808    "........" */
  64.271 -    0x02,0x00,0x0A,0x03,0x00,0x0A,0x1B,0x12,  /* 00000810    "........" */
  64.272 -    0x0B,0x04,0x0C,0xFF,0xFF,0x03,0x00,0x00,  /* 00000818    "........" */
  64.273 -    0x00,0x0A,0x1C,0x12,0x0B,0x04,0x0C,0xFF,  /* 00000820    "........" */
  64.274 -    0xFF,0x03,0x00,0x01,0x00,0x0A,0x1D,0x12,  /* 00000828    "........" */
  64.275 -    0x0C,0x04,0x0C,0xFF,0xFF,0x03,0x00,0x0A,  /* 00000830    "........" */
  64.276 -    0x02,0x00,0x0A,0x1E,0x12,0x0C,0x04,0x0C,  /* 00000838    "........" */
  64.277 -    0xFF,0xFF,0x03,0x00,0x0A,0x03,0x00,0x0A,  /* 00000840    "........" */
  64.278 -    0x1F,0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x04,  /* 00000848    "........" */
  64.279 -    0x00,0x00,0x00,0x0A,0x20,0x12,0x0B,0x04,  /* 00000850    ".... ..." */
  64.280 -    0x0C,0xFF,0xFF,0x04,0x00,0x01,0x00,0x0A,  /* 00000858    "........" */
  64.281 -    0x21,0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x04,  /* 00000860    "!......." */
  64.282 -    0x00,0x0A,0x02,0x00,0x0A,0x22,0x12,0x0C,  /* 00000868    ".....".." */
  64.283 -    0x04,0x0C,0xFF,0xFF,0x04,0x00,0x0A,0x03,  /* 00000870    "........" */
  64.284 -    0x00,0x0A,0x23,0x12,0x0B,0x04,0x0C,0xFF,  /* 00000878    "..#....." */
  64.285 -    0xFF,0x05,0x00,0x00,0x00,0x0A,0x24,0x12,  /* 00000880    "......$." */
  64.286 -    0x0B,0x04,0x0C,0xFF,0xFF,0x05,0x00,0x01,  /* 00000888    "........" */
  64.287 -    0x00,0x0A,0x25,0x12,0x0C,0x04,0x0C,0xFF,  /* 00000890    "..%....." */
  64.288 -    0xFF,0x05,0x00,0x0A,0x02,0x00,0x0A,0x26,  /* 00000898    ".......&" */
  64.289 -    0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x05,0x00,  /* 000008A0    "........" */
  64.290 -    0x0A,0x03,0x00,0x0A,0x27,0x12,0x0B,0x04,  /* 000008A8    "....'..." */
  64.291 -    0x0C,0xFF,0xFF,0x06,0x00,0x00,0x00,0x0A,  /* 000008B0    "........" */
  64.292 -    0x28,0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x06,  /* 000008B8    "(......." */
  64.293 -    0x00,0x01,0x00,0x0A,0x29,0x12,0x0C,0x04,  /* 000008C0    "....)..." */
  64.294 -    0x0C,0xFF,0xFF,0x06,0x00,0x0A,0x02,0x00,  /* 000008C8    "........" */
  64.295 -    0x0A,0x2A,0x12,0x0C,0x04,0x0C,0xFF,0xFF,  /* 000008D0    ".*......" */
  64.296 -    0x06,0x00,0x0A,0x03,0x00,0x0A,0x2B,0x12,  /* 000008D8    "......+." */
  64.297 -    0x0B,0x04,0x0C,0xFF,0xFF,0x07,0x00,0x00,  /* 000008E0    "........" */
  64.298 -    0x00,0x0A,0x2C,0x12,0x0B,0x04,0x0C,0xFF,  /* 000008E8    "..,....." */
  64.299 -    0xFF,0x07,0x00,0x01,0x00,0x0A,0x2D,0x12,  /* 000008F0    "......-." */
  64.300 -    0x0C,0x04,0x0C,0xFF,0xFF,0x07,0x00,0x0A,  /* 000008F8    "........" */
  64.301 -    0x02,0x00,0x0A,0x2E,0x12,0x0C,0x04,0x0C,  /* 00000900    "........" */
  64.302 -    0xFF,0xFF,0x07,0x00,0x0A,0x03,0x00,0x0A,  /* 00000908    "........" */
  64.303 -    0x2F,0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x08,  /* 00000910    "/......." */
  64.304 -    0x00,0x00,0x00,0x0A,0x11,0x12,0x0B,0x04,  /* 00000918    "........" */
  64.305 -    0x0C,0xFF,0xFF,0x08,0x00,0x01,0x00,0x0A,  /* 00000920    "........" */
  64.306 -    0x12,0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x08,  /* 00000928    "........" */
  64.307 -    0x00,0x0A,0x02,0x00,0x0A,0x13,0x12,0x0C,  /* 00000930    "........" */
  64.308 -    0x04,0x0C,0xFF,0xFF,0x08,0x00,0x0A,0x03,  /* 00000938    "........" */
  64.309 -    0x00,0x0A,0x14,0x12,0x0B,0x04,0x0C,0xFF,  /* 00000940    "........" */
  64.310 -    0xFF,0x09,0x00,0x00,0x00,0x0A,0x15,0x12,  /* 00000948    "........" */
  64.311 -    0x0B,0x04,0x0C,0xFF,0xFF,0x09,0x00,0x01,  /* 00000950    "........" */
  64.312 -    0x00,0x0A,0x16,0x12,0x0C,0x04,0x0C,0xFF,  /* 00000958    "........" */
  64.313 -    0xFF,0x09,0x00,0x0A,0x02,0x00,0x0A,0x17,  /* 00000960    "........" */
  64.314 -    0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x09,0x00,  /* 00000968    "........" */
  64.315 -    0x0A,0x03,0x00,0x0A,0x18,0x12,0x0B,0x04,  /* 00000970    "........" */
  64.316 -    0x0C,0xFF,0xFF,0x0A,0x00,0x00,0x00,0x0A,  /* 00000978    "........" */
  64.317 -    0x19,0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x0A,  /* 00000980    "........" */
  64.318 -    0x00,0x01,0x00,0x0A,0x1A,0x12,0x0C,0x04,  /* 00000988    "........" */
  64.319 -    0x0C,0xFF,0xFF,0x0A,0x00,0x0A,0x02,0x00,  /* 00000990    "........" */
  64.320 -    0x0A,0x1B,0x12,0x0C,0x04,0x0C,0xFF,0xFF,  /* 00000998    "........" */
  64.321 -    0x0A,0x00,0x0A,0x03,0x00,0x0A,0x1C,0x12,  /* 000009A0    "........" */
  64.322 -    0x0B,0x04,0x0C,0xFF,0xFF,0x0B,0x00,0x00,  /* 000009A8    "........" */
  64.323 -    0x00,0x0A,0x1D,0x12,0x0B,0x04,0x0C,0xFF,  /* 000009B0    "........" */
  64.324 -    0xFF,0x0B,0x00,0x01,0x00,0x0A,0x1E,0x12,  /* 000009B8    "........" */
  64.325 -    0x0C,0x04,0x0C,0xFF,0xFF,0x0B,0x00,0x0A,  /* 000009C0    "........" */
  64.326 -    0x02,0x00,0x0A,0x1F,0x12,0x0C,0x04,0x0C,  /* 000009C8    "........" */
  64.327 -    0xFF,0xFF,0x0B,0x00,0x0A,0x03,0x00,0x0A,  /* 000009D0    "........" */
  64.328 -    0x20,0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x0C,  /* 000009D8    " ......." */
  64.329 -    0x00,0x00,0x00,0x0A,0x21,0x12,0x0B,0x04,  /* 000009E0    "....!..." */
  64.330 -    0x0C,0xFF,0xFF,0x0C,0x00,0x01,0x00,0x0A,  /* 000009E8    "........" */
  64.331 -    0x22,0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x0C,  /* 000009F0    ""......." */
  64.332 -    0x00,0x0A,0x02,0x00,0x0A,0x23,0x12,0x0C,  /* 000009F8    ".....#.." */
  64.333 -    0x04,0x0C,0xFF,0xFF,0x0C,0x00,0x0A,0x03,  /* 00000A00    "........" */
  64.334 -    0x00,0x0A,0x24,0x12,0x0B,0x04,0x0C,0xFF,  /* 00000A08    "..$....." */
  64.335 -    0xFF,0x0D,0x00,0x00,0x00,0x0A,0x25,0x12,  /* 00000A10    "......%." */
  64.336 -    0x0B,0x04,0x0C,0xFF,0xFF,0x0D,0x00,0x01,  /* 00000A18    "........" */
  64.337 -    0x00,0x0A,0x26,0x12,0x0C,0x04,0x0C,0xFF,  /* 00000A20    "..&....." */
  64.338 -    0xFF,0x0D,0x00,0x0A,0x02,0x00,0x0A,0x27,  /* 00000A28    ".......'" */
  64.339 -    0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x0D,0x00,  /* 00000A30    "........" */
  64.340 -    0x0A,0x03,0x00,0x0A,0x28,0x12,0x0B,0x04,  /* 00000A38    "....(..." */
  64.341 -    0x0C,0xFF,0xFF,0x0E,0x00,0x00,0x00,0x0A,  /* 00000A40    "........" */
  64.342 -    0x29,0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x0E,  /* 00000A48    ")......." */
  64.343 -    0x00,0x01,0x00,0x0A,0x2A,0x12,0x0C,0x04,  /* 00000A50    "....*..." */
  64.344 -    0x0C,0xFF,0xFF,0x0E,0x00,0x0A,0x02,0x00,  /* 00000A58    "........" */
  64.345 -    0x0A,0x2B,0x12,0x0C,0x04,0x0C,0xFF,0xFF,  /* 00000A60    ".+......" */
  64.346 -    0x0E,0x00,0x0A,0x03,0x00,0x0A,0x2C,0x12,  /* 00000A68    "......,." */
  64.347 -    0x0B,0x04,0x0C,0xFF,0xFF,0x0F,0x00,0x00,  /* 00000A70    "........" */
  64.348 -    0x00,0x0A,0x2D,0x12,0x0B,0x04,0x0C,0xFF,  /* 00000A78    "..-....." */
  64.349 -    0xFF,0x0F,0x00,0x01,0x00,0x0A,0x2E,0x12,  /* 00000A80    "........" */
  64.350 -    0x0C,0x04,0x0C,0xFF,0xFF,0x0F,0x00,0x0A,  /* 00000A88    "........" */
  64.351 -    0x02,0x00,0x0A,0x2F,0x12,0x0C,0x04,0x0C,  /* 00000A90    ".../...." */
  64.352 -    0xFF,0xFF,0x0F,0x00,0x0A,0x03,0x00,0x0A,  /* 00000A98    "........" */
  64.353 -    0x10,0x5B,0x82,0x46,0x37,0x49,0x53,0x41,  /* 00000AA0    ".[.F7ISA" */
  64.354 -    0x5F,0x08,0x5F,0x41,0x44,0x52,0x0C,0x00,  /* 00000AA8    "_._ADR.." */
  64.355 -    0x00,0x01,0x00,0x5B,0x80,0x50,0x49,0x52,  /* 00000AB0    "...[.PIR" */
  64.356 -    0x51,0x02,0x0A,0x60,0x0A,0x04,0x10,0x2E,  /* 00000AB8    "Q..`...." */
  64.357 -    0x5C,0x00,0x5B,0x81,0x29,0x5C,0x2F,0x04,  /* 00000AC0    "\.[.)\/." */
  64.358 -    0x5F,0x53,0x42,0x5F,0x50,0x43,0x49,0x30,  /* 00000AC8    "_SB_PCI0" */
  64.359 -    0x49,0x53,0x41,0x5F,0x50,0x49,0x52,0x51,  /* 00000AD0    "ISA_PIRQ" */
  64.360 -    0x01,0x50,0x49,0x52,0x41,0x08,0x50,0x49,  /* 00000AD8    ".PIRA.PI" */
  64.361 -    0x52,0x42,0x08,0x50,0x49,0x52,0x43,0x08,  /* 00000AE0    "RB.PIRC." */
  64.362 -    0x50,0x49,0x52,0x44,0x08,0x5B,0x82,0x46,  /* 00000AE8    "PIRD.[.F" */
  64.363 -    0x0B,0x53,0x59,0x53,0x52,0x08,0x5F,0x48,  /* 00000AF0    ".SYSR._H" */
  64.364 -    0x49,0x44,0x0C,0x41,0xD0,0x0C,0x02,0x08,  /* 00000AF8    "ID.A...." */
  64.365 -    0x5F,0x55,0x49,0x44,0x01,0x08,0x43,0x52,  /* 00000B00    "_UID..CR" */
  64.366 -    0x53,0x5F,0x11,0x4E,0x08,0x0A,0x8A,0x47,  /* 00000B08    "S_.N...G" */
  64.367 -    0x01,0x10,0x00,0x10,0x00,0x00,0x10,0x47,  /* 00000B10    ".......G" */
  64.368 -    0x01,0x22,0x00,0x22,0x00,0x00,0x0C,0x47,  /* 00000B18    "."."...G" */
  64.369 -    0x01,0x30,0x00,0x30,0x00,0x00,0x10,0x47,  /* 00000B20    ".0.0...G" */
  64.370 -    0x01,0x44,0x00,0x44,0x00,0x00,0x1C,0x47,  /* 00000B28    ".D.D...G" */
  64.371 -    0x01,0x62,0x00,0x62,0x00,0x00,0x02,0x47,  /* 00000B30    ".b.b...G" */
  64.372 -    0x01,0x65,0x00,0x65,0x00,0x00,0x0B,0x47,  /* 00000B38    ".e.e...G" */
  64.373 -    0x01,0x72,0x00,0x72,0x00,0x00,0x0E,0x47,  /* 00000B40    ".r.r...G" */
  64.374 -    0x01,0x80,0x00,0x80,0x00,0x00,0x01,0x47,  /* 00000B48    ".......G" */
  64.375 -    0x01,0x84,0x00,0x84,0x00,0x00,0x03,0x47,  /* 00000B50    ".......G" */
  64.376 -    0x01,0x88,0x00,0x88,0x00,0x00,0x01,0x47,  /* 00000B58    ".......G" */
  64.377 -    0x01,0x8C,0x00,0x8C,0x00,0x00,0x03,0x47,  /* 00000B60    ".......G" */
  64.378 -    0x01,0x90,0x00,0x90,0x00,0x00,0x10,0x47,  /* 00000B68    ".......G" */
  64.379 -    0x01,0xA2,0x00,0xA2,0x00,0x00,0x1C,0x47,  /* 00000B70    ".......G" */
  64.380 -    0x01,0xE0,0x00,0xE0,0x00,0x00,0x10,0x47,  /* 00000B78    ".......G" */
  64.381 -    0x01,0xA0,0x08,0xA0,0x08,0x00,0x04,0x47,  /* 00000B80    ".......G" */
  64.382 -    0x01,0xC0,0x0C,0xC0,0x0C,0x00,0x10,0x47,  /* 00000B88    ".......G" */
  64.383 -    0x01,0xD0,0x04,0xD0,0x04,0x00,0x02,0x79,  /* 00000B90    ".......y" */
  64.384 -    0x00,0x14,0x0B,0x5F,0x43,0x52,0x53,0x00,  /* 00000B98    "..._CRS." */
  64.385 -    0xA4,0x43,0x52,0x53,0x5F,0x5B,0x82,0x2B,  /* 00000BA0    ".CRS_[.+" */
  64.386 -    0x50,0x49,0x43,0x5F,0x08,0x5F,0x48,0x49,  /* 00000BA8    "PIC_._HI" */
  64.387 -    0x44,0x0B,0x41,0xD0,0x08,0x5F,0x43,0x52,  /* 00000BB0    "D.A.._CR" */
  64.388 -    0x53,0x11,0x18,0x0A,0x15,0x47,0x01,0x20,  /* 00000BB8    "S....G. " */
  64.389 -    0x00,0x20,0x00,0x01,0x02,0x47,0x01,0xA0,  /* 00000BC0    ". ...G.." */
  64.390 -    0x00,0xA0,0x00,0x01,0x02,0x22,0x04,0x00,  /* 00000BC8    ".....".." */
  64.391 -    0x79,0x00,0x5B,0x82,0x47,0x05,0x44,0x4D,  /* 00000BD0    "y.[.G.DM" */
  64.392 -    0x41,0x30,0x08,0x5F,0x48,0x49,0x44,0x0C,  /* 00000BD8    "A0._HID." */
  64.393 -    0x41,0xD0,0x02,0x00,0x08,0x5F,0x43,0x52,  /* 00000BE0    "A...._CR" */
  64.394 -    0x53,0x11,0x41,0x04,0x0A,0x3D,0x2A,0x10,  /* 00000BE8    "S.A..=*." */
  64.395 -    0x04,0x47,0x01,0x00,0x00,0x00,0x00,0x00,  /* 00000BF0    ".G......" */
  64.396 -    0x10,0x47,0x01,0x81,0x00,0x81,0x00,0x00,  /* 00000BF8    ".G......" */
  64.397 -    0x03,0x47,0x01,0x87,0x00,0x87,0x00,0x00,  /* 00000C00    ".G......" */
  64.398 -    0x01,0x47,0x01,0x89,0x00,0x89,0x00,0x00,  /* 00000C08    ".G......" */
  64.399 -    0x03,0x47,0x01,0x8F,0x00,0x8F,0x00,0x00,  /* 00000C10    ".G......" */
  64.400 -    0x01,0x47,0x01,0xC0,0x00,0xC0,0x00,0x00,  /* 00000C18    ".G......" */
  64.401 -    0x20,0x47,0x01,0x80,0x04,0x80,0x04,0x00,  /* 00000C20    " G......" */
  64.402 -    0x10,0x79,0x00,0x5B,0x82,0x25,0x54,0x4D,  /* 00000C28    ".y.[.%TM" */
  64.403 -    0x52,0x5F,0x08,0x5F,0x48,0x49,0x44,0x0C,  /* 00000C30    "R_._HID." */
  64.404 -    0x41,0xD0,0x01,0x00,0x08,0x5F,0x43,0x52,  /* 00000C38    "A...._CR" */
  64.405 -    0x53,0x11,0x10,0x0A,0x0D,0x47,0x01,0x40,  /* 00000C40    "S....G.@" */
  64.406 -    0x00,0x40,0x00,0x00,0x04,0x22,0x01,0x00,  /* 00000C48    ".@...".." */
  64.407 -    0x79,0x00,0x5B,0x82,0x25,0x52,0x54,0x43,  /* 00000C50    "y.[.%RTC" */
  64.408 -    0x5F,0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,  /* 00000C58    "_._HID.A" */
  64.409 -    0xD0,0x0B,0x00,0x08,0x5F,0x43,0x52,0x53,  /* 00000C60    "...._CRS" */
  64.410 -    0x11,0x10,0x0A,0x0D,0x47,0x01,0x70,0x00,  /* 00000C68    "....G.p." */
  64.411 -    0x70,0x00,0x00,0x02,0x22,0x00,0x01,0x79,  /* 00000C70    "p..."..y" */
  64.412 -    0x00,0x5B,0x82,0x22,0x53,0x50,0x4B,0x52,  /* 00000C78    ".[."SPKR" */
  64.413 -    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 00000C80    "._HID.A." */
  64.414 -    0x08,0x00,0x08,0x5F,0x43,0x52,0x53,0x11,  /* 00000C88    "..._CRS." */
  64.415 -    0x0D,0x0A,0x0A,0x47,0x01,0x61,0x00,0x61,  /* 00000C90    "...G.a.a" */
  64.416 -    0x00,0x00,0x01,0x79,0x00,0x5B,0x82,0x31,  /* 00000C98    "...y.[.1" */
  64.417 -    0x50,0x53,0x32,0x4D,0x08,0x5F,0x48,0x49,  /* 00000CA0    "PS2M._HI" */
  64.418 -    0x44,0x0C,0x41,0xD0,0x0F,0x13,0x08,0x5F,  /* 00000CA8    "D.A...._" */
  64.419 -    0x43,0x49,0x44,0x0C,0x41,0xD0,0x0F,0x13,  /* 00000CB0    "CID.A..." */
  64.420 -    0x14,0x09,0x5F,0x53,0x54,0x41,0x00,0xA4,  /* 00000CB8    ".._STA.." */
  64.421 -    0x0A,0x0F,0x08,0x5F,0x43,0x52,0x53,0x11,  /* 00000CC0    "..._CRS." */
  64.422 -    0x08,0x0A,0x05,0x22,0x00,0x10,0x79,0x00,  /* 00000CC8    "..."..y." */
  64.423 -    0x5B,0x82,0x42,0x04,0x50,0x53,0x32,0x4B,  /* 00000CD0    "[.B.PS2K" */
  64.424 -    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 00000CD8    "._HID.A." */
  64.425 -    0x03,0x03,0x08,0x5F,0x43,0x49,0x44,0x0C,  /* 00000CE0    "..._CID." */
  64.426 -    0x41,0xD0,0x03,0x0B,0x14,0x09,0x5F,0x53,  /* 00000CE8    "A....._S" */
  64.427 -    0x54,0x41,0x00,0xA4,0x0A,0x0F,0x08,0x5F,  /* 00000CF0    "TA....._" */
  64.428 -    0x43,0x52,0x53,0x11,0x18,0x0A,0x15,0x47,  /* 00000CF8    "CRS....G" */
  64.429 -    0x01,0x60,0x00,0x60,0x00,0x00,0x01,0x47,  /* 00000D00    ".`.`...G" */
  64.430 -    0x01,0x64,0x00,0x64,0x00,0x00,0x01,0x22,  /* 00000D08    ".d.d..."" */
  64.431 -    0x02,0x00,0x79,0x00,0x5B,0x82,0x3A,0x46,  /* 00000D10    "..y.[.:F" */
  64.432 -    0x44,0x43,0x30,0x08,0x5F,0x48,0x49,0x44,  /* 00000D18    "DC0._HID" */
  64.433 -    0x0C,0x41,0xD0,0x07,0x00,0x14,0x09,0x5F,  /* 00000D20    ".A....._" */
  64.434 -    0x53,0x54,0x41,0x00,0xA4,0x0A,0x0F,0x08,  /* 00000D28    "STA....." */
  64.435 -    0x5F,0x43,0x52,0x53,0x11,0x1B,0x0A,0x18,  /* 00000D30    "_CRS...." */
  64.436 -    0x47,0x01,0xF0,0x03,0xF0,0x03,0x01,0x06,  /* 00000D38    "G......." */
  64.437 -    0x47,0x01,0xF7,0x03,0xF7,0x03,0x01,0x01,  /* 00000D40    "G......." */
  64.438 -    0x22,0x40,0x00,0x2A,0x04,0x00,0x79,0x00,  /* 00000D48    ""@.*..y." */
  64.439 -    0x5B,0x82,0x46,0x04,0x55,0x41,0x52,0x31,  /* 00000D50    "[.F.UAR1" */
  64.440 -    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 00000D58    "._HID.A." */
  64.441 -    0x05,0x01,0x08,0x5F,0x55,0x49,0x44,0x01,  /* 00000D60    "..._UID." */
  64.442 -    0x14,0x19,0x5F,0x53,0x54,0x41,0x00,0xA0,  /* 00000D68    ".._STA.." */
  64.443 -    0x0D,0x93,0x5E,0x5E,0x5E,0x5E,0x55,0x41,  /* 00000D70    "..^^^^UA" */
  64.444 -    0x52,0x31,0x00,0xA4,0x00,0xA1,0x04,0xA4,  /* 00000D78    "R1......" */
  64.445 -    0x0A,0x0F,0x08,0x5F,0x43,0x52,0x53,0x11,  /* 00000D80    "..._CRS." */
  64.446 -    0x10,0x0A,0x0D,0x47,0x01,0xF8,0x03,0xF8,  /* 00000D88    "...G...." */
  64.447 -    0x03,0x08,0x08,0x22,0x10,0x00,0x79,0x00,  /* 00000D90    "..."..y." */
  64.448 -    0x5B,0x82,0x47,0x04,0x55,0x41,0x52,0x32,  /* 00000D98    "[.G.UAR2" */
  64.449 -    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 00000DA0    "._HID.A." */
  64.450 -    0x05,0x01,0x08,0x5F,0x55,0x49,0x44,0x0A,  /* 00000DA8    "..._UID." */
  64.451 -    0x02,0x14,0x19,0x5F,0x53,0x54,0x41,0x00,  /* 00000DB0    "..._STA." */
  64.452 -    0xA0,0x0D,0x93,0x5E,0x5E,0x5E,0x5E,0x55,  /* 00000DB8    "...^^^^U" */
  64.453 -    0x41,0x52,0x32,0x00,0xA4,0x00,0xA1,0x04,  /* 00000DC0    "AR2....." */
  64.454 -    0xA4,0x0A,0x0F,0x08,0x5F,0x43,0x52,0x53,  /* 00000DC8    "...._CRS" */
  64.455 -    0x11,0x10,0x0A,0x0D,0x47,0x01,0xF8,0x02,  /* 00000DD0    "....G..." */
  64.456 -    0xF8,0x02,0x08,0x08,0x22,0x08,0x00,0x79,  /* 00000DD8    "...."..y" */
  64.457 -    0x00,0x5B,0x82,0x36,0x4C,0x54,0x50,0x31,  /* 00000DE0    ".[.6LTP1" */
  64.458 -    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 00000DE8    "._HID.A." */
  64.459 -    0x04,0x00,0x08,0x5F,0x55,0x49,0x44,0x0A,  /* 00000DF0    "..._UID." */
  64.460 -    0x02,0x14,0x09,0x5F,0x53,0x54,0x41,0x00,  /* 00000DF8    "..._STA." */
  64.461 -    0xA4,0x0A,0x0F,0x08,0x5F,0x43,0x52,0x53,  /* 00000E00    "...._CRS" */
  64.462 -    0x11,0x10,0x0A,0x0D,0x47,0x01,0x78,0x03,  /* 00000E08    "....G.x." */
  64.463 -    0x78,0x03,0x08,0x08,0x22,0x80,0x00,0x79,  /* 00000E10    "x..."..y" */
  64.464 -    0x00,
  64.465 +    0x01,0x00,0x1E,0x50,0x4D,0x49,0x4E,0x20,  /* 000000A0    "...PMIN " */
  64.466 +    0x50,0x4C,0x45,0x4E,0x20,0x5B,0x82,0x49,  /* 000000A8    "PLEN [.I" */
  64.467 +    0x04,0x4D,0x45,0x4D,0x30,0x08,0x5F,0x48,  /* 000000B0    ".MEM0._H" */
  64.468 +    0x49,0x44,0x0C,0x41,0xD0,0x0C,0x02,0x08,  /* 000000B8    "ID.A...." */
  64.469 +    0x5F,0x43,0x52,0x53,0x11,0x33,0x0A,0x30,  /* 000000C0    "_CRS.3.0" */
  64.470 +    0x8A,0x2B,0x00,0x00,0x0D,0x03,0x00,0x00,  /* 000000C8    ".+......" */
  64.471 +    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000D0    "........" */
  64.472 +    0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0xFF,  /* 000000D8    "........" */
  64.473 +    0x09,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000E0    "........" */
  64.474 +    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,  /* 000000E8    "........" */
  64.475 +    0x0A,0x00,0x00,0x00,0x00,0x00,0x79,0x00,  /* 000000F0    "......y." */
  64.476 +    0x5B,0x82,0x45,0xD7,0x50,0x43,0x49,0x30,  /* 000000F8    "[.E.PCI0" */
  64.477 +    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 00000100    "._HID.A." */
  64.478 +    0x0A,0x03,0x08,0x5F,0x55,0x49,0x44,0x00,  /* 00000108    "..._UID." */
  64.479 +    0x08,0x5F,0x41,0x44,0x52,0x00,0x08,0x5F,  /* 00000110    "._ADR.._" */
  64.480 +    0x42,0x42,0x4E,0x00,0x14,0x4E,0x0C,0x5F,  /* 00000118    "BBN..N._" */
  64.481 +    0x43,0x52,0x53,0x00,0x08,0x50,0x52,0x54,  /* 00000120    "CRS..PRT" */
  64.482 +    0x30,0x11,0x42,0x07,0x0A,0x6E,0x88,0x0D,  /* 00000128    "0.B..n.." */
  64.483 +    0x00,0x02,0x0E,0x00,0x00,0x00,0x00,0x00,  /* 00000130    "........" */
  64.484 +    0xFF,0x00,0x00,0x00,0x00,0x01,0x47,0x01,  /* 00000138    "......G." */
  64.485 +    0xF8,0x0C,0xF8,0x0C,0x01,0x08,0x88,0x0D,  /* 00000140    "........" */
  64.486 +    0x00,0x01,0x0C,0x03,0x00,0x00,0x00,0x00,  /* 00000148    "........" */
  64.487 +    0xF7,0x0C,0x00,0x00,0xF8,0x0C,0x88,0x0D,  /* 00000150    "........" */
  64.488 +    0x00,0x01,0x0C,0x03,0x00,0x00,0x00,0x0D,  /* 00000158    "........" */
  64.489 +    0xFF,0xFF,0x00,0x00,0x00,0xF3,0x87,0x17,  /* 00000160    "........" */
  64.490 +    0x00,0x00,0x0C,0x03,0x00,0x00,0x00,0x00,  /* 00000168    "........" */
  64.491 +    0x00,0x00,0x0A,0x00,0xFF,0xFF,0x0B,0x00,  /* 00000170    "........" */
  64.492 +    0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x00,  /* 00000178    "........" */
  64.493 +    0x87,0x17,0x00,0x00,0x0C,0x03,0x00,0x00,  /* 00000180    "........" */
  64.494 +    0x00,0x00,0x00,0x00,0x00,0xF0,0xFF,0xFF,  /* 00000188    "........" */
  64.495 +    0xFF,0xF4,0x00,0x00,0x00,0x00,0x00,0x00,  /* 00000190    "........" */
  64.496 +    0x00,0x05,0x79,0x00,0x8A,0x50,0x52,0x54,  /* 00000198    "..y..PRT" */
  64.497 +    0x30,0x0A,0x5C,0x4D,0x4D,0x49,0x4E,0x8A,  /* 000001A0    "0.\MMIN." */
  64.498 +    0x50,0x52,0x54,0x30,0x0A,0x60,0x4D,0x4D,  /* 000001A8    "PRT0.`MM" */
  64.499 +    0x41,0x58,0x8A,0x50,0x52,0x54,0x30,0x0A,  /* 000001B0    "AX.PRT0." */
  64.500 +    0x68,0x4D,0x4C,0x45,0x4E,0x70,0x50,0x4D,  /* 000001B8    "hMLENpPM" */
  64.501 +    0x49,0x4E,0x4D,0x4D,0x49,0x4E,0x70,0x50,  /* 000001C0    "INMMINpP" */
  64.502 +    0x4C,0x45,0x4E,0x4D,0x4C,0x45,0x4E,0x72,  /* 000001C8    "LENMLENr" */
  64.503 +    0x4D,0x4D,0x49,0x4E,0x4D,0x4C,0x45,0x4E,  /* 000001D0    "MMINMLEN" */
  64.504 +    0x4D,0x4D,0x41,0x58,0x74,0x4D,0x4D,0x41,  /* 000001D8    "MMAXtMMA" */
  64.505 +    0x58,0x01,0x4D,0x4D,0x41,0x58,0xA4,0x50,  /* 000001E0    "X.MMAX.P" */
  64.506 +    0x52,0x54,0x30,0x08,0x42,0x55,0x46,0x41,  /* 000001E8    "RT0.BUFA" */
  64.507 +    0x11,0x09,0x0A,0x06,0x23,0x20,0x0C,0x18,  /* 000001F0    "....# .." */
  64.508 +    0x79,0x00,0x08,0x42,0x55,0x46,0x42,0x11,  /* 000001F8    "y..BUFB." */
  64.509 +    0x09,0x0A,0x06,0x23,0x00,0x00,0x18,0x79,  /* 00000200    "...#...y" */
  64.510 +    0x00,0x8B,0x42,0x55,0x46,0x42,0x01,0x49,  /* 00000208    "..BUFB.I" */
  64.511 +    0x52,0x51,0x56,0x5B,0x82,0x48,0x08,0x4C,  /* 00000210    "RQV[.H.L" */
  64.512 +    0x4E,0x4B,0x41,0x08,0x5F,0x48,0x49,0x44,  /* 00000218    "NKA._HID" */
  64.513 +    0x0C,0x41,0xD0,0x0C,0x0F,0x08,0x5F,0x55,  /* 00000220    ".A...._U" */
  64.514 +    0x49,0x44,0x01,0x14,0x1C,0x5F,0x53,0x54,  /* 00000228    "ID..._ST" */
  64.515 +    0x41,0x00,0x7B,0x50,0x49,0x52,0x41,0x0A,  /* 00000230    "A.{PIRA." */
  64.516 +    0x80,0x60,0xA0,0x08,0x93,0x60,0x0A,0x80,  /* 00000238    ".`...`.." */
  64.517 +    0xA4,0x0A,0x09,0xA1,0x04,0xA4,0x0A,0x0B,  /* 00000240    "........" */
  64.518 +    0x14,0x0B,0x5F,0x50,0x52,0x53,0x00,0xA4,  /* 00000248    ".._PRS.." */
  64.519 +    0x42,0x55,0x46,0x41,0x14,0x11,0x5F,0x44,  /* 00000250    "BUFA.._D" */
  64.520 +    0x49,0x53,0x00,0x7D,0x50,0x49,0x52,0x41,  /* 00000258    "IS.}PIRA" */
  64.521 +    0x0A,0x80,0x50,0x49,0x52,0x41,0x14,0x1A,  /* 00000260    "..PIRA.." */
  64.522 +    0x5F,0x43,0x52,0x53,0x00,0x7B,0x50,0x49,  /* 00000268    "_CRS.{PI" */
  64.523 +    0x52,0x41,0x0A,0x0F,0x60,0x79,0x01,0x60,  /* 00000270    "RA..`y.`" */
  64.524 +    0x49,0x52,0x51,0x56,0xA4,0x42,0x55,0x46,  /* 00000278    "IRQV.BUF" */
  64.525 +    0x42,0x14,0x1B,0x5F,0x53,0x52,0x53,0x01,  /* 00000280    "B.._SRS." */
  64.526 +    0x8B,0x68,0x01,0x49,0x52,0x51,0x31,0x82,  /* 00000288    ".h.IRQ1." */
  64.527 +    0x49,0x52,0x51,0x31,0x60,0x76,0x60,0x70,  /* 00000290    "IRQ1`v`p" */
  64.528 +    0x60,0x50,0x49,0x52,0x41,0x5B,0x82,0x49,  /* 00000298    "`PIRA[.I" */
  64.529 +    0x08,0x4C,0x4E,0x4B,0x42,0x08,0x5F,0x48,  /* 000002A0    ".LNKB._H" */
  64.530 +    0x49,0x44,0x0C,0x41,0xD0,0x0C,0x0F,0x08,  /* 000002A8    "ID.A...." */
  64.531 +    0x5F,0x55,0x49,0x44,0x0A,0x02,0x14,0x1C,  /* 000002B0    "_UID...." */
  64.532 +    0x5F,0x53,0x54,0x41,0x00,0x7B,0x50,0x49,  /* 000002B8    "_STA.{PI" */
  64.533 +    0x52,0x42,0x0A,0x80,0x60,0xA0,0x08,0x93,  /* 000002C0    "RB..`..." */
  64.534 +    0x60,0x0A,0x80,0xA4,0x0A,0x09,0xA1,0x04,  /* 000002C8    "`......." */
  64.535 +    0xA4,0x0A,0x0B,0x14,0x0B,0x5F,0x50,0x52,  /* 000002D0    "....._PR" */
  64.536 +    0x53,0x00,0xA4,0x42,0x55,0x46,0x41,0x14,  /* 000002D8    "S..BUFA." */
  64.537 +    0x11,0x5F,0x44,0x49,0x53,0x00,0x7D,0x50,  /* 000002E0    "._DIS.}P" */
  64.538 +    0x49,0x52,0x42,0x0A,0x80,0x50,0x49,0x52,  /* 000002E8    "IRB..PIR" */
  64.539 +    0x42,0x14,0x1A,0x5F,0x43,0x52,0x53,0x00,  /* 000002F0    "B.._CRS." */
  64.540 +    0x7B,0x50,0x49,0x52,0x42,0x0A,0x0F,0x60,  /* 000002F8    "{PIRB..`" */
  64.541 +    0x79,0x01,0x60,0x49,0x52,0x51,0x56,0xA4,  /* 00000300    "y.`IRQV." */
  64.542 +    0x42,0x55,0x46,0x42,0x14,0x1B,0x5F,0x53,  /* 00000308    "BUFB.._S" */
  64.543 +    0x52,0x53,0x01,0x8B,0x68,0x01,0x49,0x52,  /* 00000310    "RS..h.IR" */
  64.544 +    0x51,0x31,0x82,0x49,0x52,0x51,0x31,0x60,  /* 00000318    "Q1.IRQ1`" */
  64.545 +    0x76,0x60,0x70,0x60,0x50,0x49,0x52,0x42,  /* 00000320    "v`p`PIRB" */
  64.546 +    0x5B,0x82,0x49,0x08,0x4C,0x4E,0x4B,0x43,  /* 00000328    "[.I.LNKC" */
  64.547 +    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 00000330    "._HID.A." */
  64.548 +    0x0C,0x0F,0x08,0x5F,0x55,0x49,0x44,0x0A,  /* 00000338    "..._UID." */
  64.549 +    0x03,0x14,0x1C,0x5F,0x53,0x54,0x41,0x00,  /* 00000340    "..._STA." */
  64.550 +    0x7B,0x50,0x49,0x52,0x43,0x0A,0x80,0x60,  /* 00000348    "{PIRC..`" */
  64.551 +    0xA0,0x08,0x93,0x60,0x0A,0x80,0xA4,0x0A,  /* 00000350    "...`...." */
  64.552 +    0x09,0xA1,0x04,0xA4,0x0A,0x0B,0x14,0x0B,  /* 00000358    "........" */
  64.553 +    0x5F,0x50,0x52,0x53,0x00,0xA4,0x42,0x55,  /* 00000360    "_PRS..BU" */
  64.554 +    0x46,0x41,0x14,0x11,0x5F,0x44,0x49,0x53,  /* 00000368    "FA.._DIS" */
  64.555 +    0x00,0x7D,0x50,0x49,0x52,0x43,0x0A,0x80,  /* 00000370    ".}PIRC.." */
  64.556 +    0x50,0x49,0x52,0x43,0x14,0x1A,0x5F,0x43,  /* 00000378    "PIRC.._C" */
  64.557 +    0x52,0x53,0x00,0x7B,0x50,0x49,0x52,0x43,  /* 00000380    "RS.{PIRC" */
  64.558 +    0x0A,0x0F,0x60,0x79,0x01,0x60,0x49,0x52,  /* 00000388    "..`y.`IR" */
  64.559 +    0x51,0x56,0xA4,0x42,0x55,0x46,0x42,0x14,  /* 00000390    "QV.BUFB." */
  64.560 +    0x1B,0x5F,0x53,0x52,0x53,0x01,0x8B,0x68,  /* 00000398    "._SRS..h" */
  64.561 +    0x01,0x49,0x52,0x51,0x31,0x82,0x49,0x52,  /* 000003A0    ".IRQ1.IR" */
  64.562 +    0x51,0x31,0x60,0x76,0x60,0x70,0x60,0x50,  /* 000003A8    "Q1`v`p`P" */
  64.563 +    0x49,0x52,0x43,0x5B,0x82,0x49,0x08,0x4C,  /* 000003B0    "IRC[.I.L" */
  64.564 +    0x4E,0x4B,0x44,0x08,0x5F,0x48,0x49,0x44,  /* 000003B8    "NKD._HID" */
  64.565 +    0x0C,0x41,0xD0,0x0C,0x0F,0x08,0x5F,0x55,  /* 000003C0    ".A...._U" */
  64.566 +    0x49,0x44,0x0A,0x04,0x14,0x1C,0x5F,0x53,  /* 000003C8    "ID...._S" */
  64.567 +    0x54,0x41,0x00,0x7B,0x50,0x49,0x52,0x44,  /* 000003D0    "TA.{PIRD" */
  64.568 +    0x0A,0x80,0x60,0xA0,0x08,0x93,0x60,0x0A,  /* 000003D8    "..`...`." */
  64.569 +    0x80,0xA4,0x0A,0x09,0xA1,0x04,0xA4,0x0A,  /* 000003E0    "........" */
  64.570 +    0x0B,0x14,0x0B,0x5F,0x50,0x52,0x53,0x00,  /* 000003E8    "..._PRS." */
  64.571 +    0xA4,0x42,0x55,0x46,0x41,0x14,0x11,0x5F,  /* 000003F0    ".BUFA.._" */
  64.572 +    0x44,0x49,0x53,0x00,0x7D,0x50,0x49,0x52,  /* 000003F8    "DIS.}PIR" */
  64.573 +    0x44,0x0A,0x80,0x50,0x49,0x52,0x44,0x14,  /* 00000400    "D..PIRD." */
  64.574 +    0x1A,0x5F,0x43,0x52,0x53,0x00,0x7B,0x50,  /* 00000408    "._CRS.{P" */
  64.575 +    0x49,0x52,0x44,0x0A,0x0F,0x60,0x79,0x01,  /* 00000410    "IRD..`y." */
  64.576 +    0x60,0x49,0x52,0x51,0x56,0xA4,0x42,0x55,  /* 00000418    "`IRQV.BU" */
  64.577 +    0x46,0x42,0x14,0x1B,0x5F,0x53,0x52,0x53,  /* 00000420    "FB.._SRS" */
  64.578 +    0x01,0x8B,0x68,0x01,0x49,0x52,0x51,0x31,  /* 00000428    "..h.IRQ1" */
  64.579 +    0x82,0x49,0x52,0x51,0x31,0x60,0x76,0x60,  /* 00000430    ".IRQ1`v`" */
  64.580 +    0x70,0x60,0x50,0x49,0x52,0x44,0x5B,0x82,  /* 00000438    "p`PIRD[." */
  64.581 +    0x3A,0x48,0x50,0x45,0x54,0x08,0x5F,0x48,  /* 00000440    ":HPET._H" */
  64.582 +    0x49,0x44,0x0C,0x41,0xD0,0x01,0x03,0x08,  /* 00000448    "ID.A...." */
  64.583 +    0x5F,0x55,0x49,0x44,0x00,0x08,0x5F,0x43,  /* 00000450    "_UID.._C" */
  64.584 +    0x52,0x53,0x11,0x1F,0x0A,0x1C,0x87,0x17,  /* 00000458    "RS......" */
  64.585 +    0x00,0x00,0x0D,0x01,0x00,0x00,0x00,0x00,  /* 00000460    "........" */
  64.586 +    0x00,0x00,0xD0,0xFE,0xFF,0x03,0xD0,0xFE,  /* 00000468    "........" */
  64.587 +    0x00,0x00,0x00,0x00,0x00,0x04,0x00,0x00,  /* 00000470    "........" */
  64.588 +    0x79,0x00,0x14,0x16,0x5F,0x50,0x52,0x54,  /* 00000478    "y..._PRT" */
  64.589 +    0x00,0xA0,0x0A,0x50,0x49,0x43,0x44,0xA4,  /* 00000480    "...PICD." */
  64.590 +    0x50,0x52,0x54,0x41,0xA4,0x50,0x52,0x54,  /* 00000488    "PRTA.PRT" */
  64.591 +    0x50,0x08,0x50,0x52,0x54,0x50,0x12,0x49,  /* 00000490    "P.PRTP.I" */
  64.592 +    0x36,0x3C,0x12,0x0D,0x04,0x0C,0xFF,0xFF,  /* 00000498    "6<......" */
  64.593 +    0x01,0x00,0x00,0x4C,0x4E,0x4B,0x42,0x00,  /* 000004A0    "...LNKB." */
  64.594 +    0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x01,0x00,  /* 000004A8    "........" */
  64.595 +    0x01,0x4C,0x4E,0x4B,0x43,0x00,0x12,0x0E,  /* 000004B0    ".LNKC..." */
  64.596 +    0x04,0x0C,0xFF,0xFF,0x01,0x00,0x0A,0x02,  /* 000004B8    "........" */
  64.597 +    0x4C,0x4E,0x4B,0x44,0x00,0x12,0x0E,0x04,  /* 000004C0    "LNKD...." */
  64.598 +    0x0C,0xFF,0xFF,0x01,0x00,0x0A,0x03,0x4C,  /* 000004C8    ".......L" */
  64.599 +    0x4E,0x4B,0x41,0x00,0x12,0x0D,0x04,0x0C,  /* 000004D0    "NKA....." */
  64.600 +    0xFF,0xFF,0x02,0x00,0x00,0x4C,0x4E,0x4B,  /* 000004D8    ".....LNK" */
  64.601 +    0x43,0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,  /* 000004E0    "C......." */
  64.602 +    0x02,0x00,0x01,0x4C,0x4E,0x4B,0x44,0x00,  /* 000004E8    "...LNKD." */
  64.603 +    0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x02,0x00,  /* 000004F0    "........" */
  64.604 +    0x0A,0x02,0x4C,0x4E,0x4B,0x41,0x00,0x12,  /* 000004F8    "..LNKA.." */
  64.605 +    0x0E,0x04,0x0C,0xFF,0xFF,0x02,0x00,0x0A,  /* 00000500    "........" */
  64.606 +    0x03,0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0D,  /* 00000508    ".LNKB..." */
  64.607 +    0x04,0x0C,0xFF,0xFF,0x03,0x00,0x00,0x4C,  /* 00000510    ".......L" */
  64.608 +    0x4E,0x4B,0x44,0x00,0x12,0x0D,0x04,0x0C,  /* 00000518    "NKD....." */
  64.609 +    0xFF,0xFF,0x03,0x00,0x01,0x4C,0x4E,0x4B,  /* 00000520    ".....LNK" */
  64.610 +    0x41,0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,  /* 00000528    "A......." */
  64.611 +    0x03,0x00,0x0A,0x02,0x4C,0x4E,0x4B,0x42,  /* 00000530    "....LNKB" */
  64.612 +    0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x03,  /* 00000538    "........" */
  64.613 +    0x00,0x0A,0x03,0x4C,0x4E,0x4B,0x43,0x00,  /* 00000540    "...LNKC." */
  64.614 +    0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x04,0x00,  /* 00000548    "........" */
  64.615 +    0x00,0x4C,0x4E,0x4B,0x41,0x00,0x12,0x0D,  /* 00000550    ".LNKA..." */
  64.616 +    0x04,0x0C,0xFF,0xFF,0x04,0x00,0x01,0x4C,  /* 00000558    ".......L" */
  64.617 +    0x4E,0x4B,0x42,0x00,0x12,0x0E,0x04,0x0C,  /* 00000560    "NKB....." */
  64.618 +    0xFF,0xFF,0x04,0x00,0x0A,0x02,0x4C,0x4E,  /* 00000568    "......LN" */
  64.619 +    0x4B,0x43,0x00,0x12,0x0E,0x04,0x0C,0xFF,  /* 00000570    "KC......" */
  64.620 +    0xFF,0x04,0x00,0x0A,0x03,0x4C,0x4E,0x4B,  /* 00000578    ".....LNK" */
  64.621 +    0x44,0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,  /* 00000580    "D......." */
  64.622 +    0x05,0x00,0x00,0x4C,0x4E,0x4B,0x42,0x00,  /* 00000588    "...LNKB." */
  64.623 +    0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x05,0x00,  /* 00000590    "........" */
  64.624 +    0x01,0x4C,0x4E,0x4B,0x43,0x00,0x12,0x0E,  /* 00000598    ".LNKC..." */
  64.625 +    0x04,0x0C,0xFF,0xFF,0x05,0x00,0x0A,0x02,  /* 000005A0    "........" */
  64.626 +    0x4C,0x4E,0x4B,0x44,0x00,0x12,0x0E,0x04,  /* 000005A8    "LNKD...." */
  64.627 +    0x0C,0xFF,0xFF,0x05,0x00,0x0A,0x03,0x4C,  /* 000005B0    ".......L" */
  64.628 +    0x4E,0x4B,0x41,0x00,0x12,0x0D,0x04,0x0C,  /* 000005B8    "NKA....." */
  64.629 +    0xFF,0xFF,0x06,0x00,0x00,0x4C,0x4E,0x4B,  /* 000005C0    ".....LNK" */
  64.630 +    0x43,0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,  /* 000005C8    "C......." */
  64.631 +    0x06,0x00,0x01,0x4C,0x4E,0x4B,0x44,0x00,  /* 000005D0    "...LNKD." */
  64.632 +    0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x06,0x00,  /* 000005D8    "........" */
  64.633 +    0x0A,0x02,0x4C,0x4E,0x4B,0x41,0x00,0x12,  /* 000005E0    "..LNKA.." */
  64.634 +    0x0E,0x04,0x0C,0xFF,0xFF,0x06,0x00,0x0A,  /* 000005E8    "........" */
  64.635 +    0x03,0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0D,  /* 000005F0    ".LNKB..." */
  64.636 +    0x04,0x0C,0xFF,0xFF,0x07,0x00,0x00,0x4C,  /* 000005F8    ".......L" */
  64.637 +    0x4E,0x4B,0x44,0x00,0x12,0x0D,0x04,0x0C,  /* 00000600    "NKD....." */
  64.638 +    0xFF,0xFF,0x07,0x00,0x01,0x4C,0x4E,0x4B,  /* 00000608    ".....LNK" */
  64.639 +    0x41,0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,  /* 00000610    "A......." */
  64.640 +    0x07,0x00,0x0A,0x02,0x4C,0x4E,0x4B,0x42,  /* 00000618    "....LNKB" */
  64.641 +    0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x07,  /* 00000620    "........" */
  64.642 +    0x00,0x0A,0x03,0x4C,0x4E,0x4B,0x43,0x00,  /* 00000628    "...LNKC." */
  64.643 +    0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x08,0x00,  /* 00000630    "........" */
  64.644 +    0x00,0x4C,0x4E,0x4B,0x41,0x00,0x12,0x0D,  /* 00000638    ".LNKA..." */
  64.645 +    0x04,0x0C,0xFF,0xFF,0x08,0x00,0x01,0x4C,  /* 00000640    ".......L" */
  64.646 +    0x4E,0x4B,0x42,0x00,0x12,0x0E,0x04,0x0C,  /* 00000648    "NKB....." */
  64.647 +    0xFF,0xFF,0x08,0x00,0x0A,0x02,0x4C,0x4E,  /* 00000650    "......LN" */
  64.648 +    0x4B,0x43,0x00,0x12,0x0E,0x04,0x0C,0xFF,  /* 00000658    "KC......" */
  64.649 +    0xFF,0x08,0x00,0x0A,0x03,0x4C,0x4E,0x4B,  /* 00000660    ".....LNK" */
  64.650 +    0x44,0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,  /* 00000668    "D......." */
  64.651 +    0x09,0x00,0x00,0x4C,0x4E,0x4B,0x42,0x00,  /* 00000670    "...LNKB." */
  64.652 +    0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x09,0x00,  /* 00000678    "........" */
  64.653 +    0x01,0x4C,0x4E,0x4B,0x43,0x00,0x12,0x0E,  /* 00000680    ".LNKC..." */
  64.654 +    0x04,0x0C,0xFF,0xFF,0x09,0x00,0x0A,0x02,  /* 00000688    "........" */
  64.655 +    0x4C,0x4E,0x4B,0x44,0x00,0x12,0x0E,0x04,  /* 00000690    "LNKD...." */
  64.656 +    0x0C,0xFF,0xFF,0x09,0x00,0x0A,0x03,0x4C,  /* 00000698    ".......L" */
  64.657 +    0x4E,0x4B,0x41,0x00,0x12,0x0D,0x04,0x0C,  /* 000006A0    "NKA....." */
  64.658 +    0xFF,0xFF,0x0A,0x00,0x00,0x4C,0x4E,0x4B,  /* 000006A8    ".....LNK" */
  64.659 +    0x43,0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,  /* 000006B0    "C......." */
  64.660 +    0x0A,0x00,0x01,0x4C,0x4E,0x4B,0x44,0x00,  /* 000006B8    "...LNKD." */
  64.661 +    0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x0A,0x00,  /* 000006C0    "........" */
  64.662 +    0x0A,0x02,0x4C,0x4E,0x4B,0x41,0x00,0x12,  /* 000006C8    "..LNKA.." */
  64.663 +    0x0E,0x04,0x0C,0xFF,0xFF,0x0A,0x00,0x0A,  /* 000006D0    "........" */
  64.664 +    0x03,0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0D,  /* 000006D8    ".LNKB..." */
  64.665 +    0x04,0x0C,0xFF,0xFF,0x0B,0x00,0x00,0x4C,  /* 000006E0    ".......L" */
  64.666 +    0x4E,0x4B,0x44,0x00,0x12,0x0D,0x04,0x0C,  /* 000006E8    "NKD....." */
  64.667 +    0xFF,0xFF,0x0B,0x00,0x01,0x4C,0x4E,0x4B,  /* 000006F0    ".....LNK" */
  64.668 +    0x41,0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,  /* 000006F8    "A......." */
  64.669 +    0x0B,0x00,0x0A,0x02,0x4C,0x4E,0x4B,0x42,  /* 00000700    "....LNKB" */
  64.670 +    0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x0B,  /* 00000708    "........" */
  64.671 +    0x00,0x0A,0x03,0x4C,0x4E,0x4B,0x43,0x00,  /* 00000710    "...LNKC." */
  64.672 +    0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x0C,0x00,  /* 00000718    "........" */
  64.673 +    0x00,0x4C,0x4E,0x4B,0x41,0x00,0x12,0x0D,  /* 00000720    ".LNKA..." */
  64.674 +    0x04,0x0C,0xFF,0xFF,0x0C,0x00,0x01,0x4C,  /* 00000728    ".......L" */
  64.675 +    0x4E,0x4B,0x42,0x00,0x12,0x0E,0x04,0x0C,  /* 00000730    "NKB....." */
  64.676 +    0xFF,0xFF,0x0C,0x00,0x0A,0x02,0x4C,0x4E,  /* 00000738    "......LN" */
  64.677 +    0x4B,0x43,0x00,0x12,0x0E,0x04,0x0C,0xFF,  /* 00000740    "KC......" */
  64.678 +    0xFF,0x0C,0x00,0x0A,0x03,0x4C,0x4E,0x4B,  /* 00000748    ".....LNK" */
  64.679 +    0x44,0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,  /* 00000750    "D......." */
  64.680 +    0x0D,0x00,0x00,0x4C,0x4E,0x4B,0x42,0x00,  /* 00000758    "...LNKB." */
  64.681 +    0x12,0x0D,0x04,0x0C,0xFF,0xFF,0x0D,0x00,  /* 00000760    "........" */
  64.682 +    0x01,0x4C,0x4E,0x4B,0x43,0x00,0x12,0x0E,  /* 00000768    ".LNKC..." */
  64.683 +    0x04,0x0C,0xFF,0xFF,0x0D,0x00,0x0A,0x02,  /* 00000770    "........" */
  64.684 +    0x4C,0x4E,0x4B,0x44,0x00,0x12,0x0E,0x04,  /* 00000778    "LNKD...." */
  64.685 +    0x0C,0xFF,0xFF,0x0D,0x00,0x0A,0x03,0x4C,  /* 00000780    ".......L" */
  64.686 +    0x4E,0x4B,0x41,0x00,0x12,0x0D,0x04,0x0C,  /* 00000788    "NKA....." */
  64.687 +    0xFF,0xFF,0x0E,0x00,0x00,0x4C,0x4E,0x4B,  /* 00000790    ".....LNK" */
  64.688 +    0x43,0x00,0x12,0x0D,0x04,0x0C,0xFF,0xFF,  /* 00000798    "C......." */
  64.689 +    0x0E,0x00,0x01,0x4C,0x4E,0x4B,0x44,0x00,  /* 000007A0    "...LNKD." */
  64.690 +    0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x0E,0x00,  /* 000007A8    "........" */
  64.691 +    0x0A,0x02,0x4C,0x4E,0x4B,0x41,0x00,0x12,  /* 000007B0    "..LNKA.." */
  64.692 +    0x0E,0x04,0x0C,0xFF,0xFF,0x0E,0x00,0x0A,  /* 000007B8    "........" */
  64.693 +    0x03,0x4C,0x4E,0x4B,0x42,0x00,0x12,0x0D,  /* 000007C0    ".LNKB..." */
  64.694 +    0x04,0x0C,0xFF,0xFF,0x0F,0x00,0x00,0x4C,  /* 000007C8    ".......L" */
  64.695 +    0x4E,0x4B,0x44,0x00,0x12,0x0D,0x04,0x0C,  /* 000007D0    "NKD....." */
  64.696 +    0xFF,0xFF,0x0F,0x00,0x01,0x4C,0x4E,0x4B,  /* 000007D8    ".....LNK" */
  64.697 +    0x41,0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,  /* 000007E0    "A......." */
  64.698 +    0x0F,0x00,0x0A,0x02,0x4C,0x4E,0x4B,0x42,  /* 000007E8    "....LNKB" */
  64.699 +    0x00,0x12,0x0E,0x04,0x0C,0xFF,0xFF,0x0F,  /* 000007F0    "........" */
  64.700 +    0x00,0x0A,0x03,0x4C,0x4E,0x4B,0x43,0x00,  /* 000007F8    "...LNKC." */
  64.701 +    0x08,0x50,0x52,0x54,0x41,0x12,0x41,0x2F,  /* 00000800    ".PRTA.A/" */
  64.702 +    0x3C,0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x01,  /* 00000808    "<......." */
  64.703 +    0x00,0x00,0x00,0x0A,0x14,0x12,0x0B,0x04,  /* 00000810    "........" */
  64.704 +    0x0C,0xFF,0xFF,0x01,0x00,0x01,0x00,0x0A,  /* 00000818    "........" */
  64.705 +    0x15,0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x01,  /* 00000820    "........" */
  64.706 +    0x00,0x0A,0x02,0x00,0x0A,0x16,0x12,0x0C,  /* 00000828    "........" */
  64.707 +    0x04,0x0C,0xFF,0xFF,0x01,0x00,0x0A,0x03,  /* 00000830    "........" */
  64.708 +    0x00,0x0A,0x17,0x12,0x0B,0x04,0x0C,0xFF,  /* 00000838    "........" */
  64.709 +    0xFF,0x02,0x00,0x00,0x00,0x0A,0x18,0x12,  /* 00000840    "........" */
  64.710 +    0x0B,0x04,0x0C,0xFF,0xFF,0x02,0x00,0x01,  /* 00000848    "........" */
  64.711 +    0x00,0x0A,0x19,0x12,0x0C,0x04,0x0C,0xFF,  /* 00000850    "........" */
  64.712 +    0xFF,0x02,0x00,0x0A,0x02,0x00,0x0A,0x1A,  /* 00000858    "........" */
  64.713 +    0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x02,0x00,  /* 00000860    "........" */
  64.714 +    0x0A,0x03,0x00,0x0A,0x1B,0x12,0x0B,0x04,  /* 00000868    "........" */
  64.715 +    0x0C,0xFF,0xFF,0x03,0x00,0x00,0x00,0x0A,  /* 00000870    "........" */
  64.716 +    0x1C,0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x03,  /* 00000878    "........" */
  64.717 +    0x00,0x01,0x00,0x0A,0x1D,0x12,0x0C,0x04,  /* 00000880    "........" */
  64.718 +    0x0C,0xFF,0xFF,0x03,0x00,0x0A,0x02,0x00,  /* 00000888    "........" */
  64.719 +    0x0A,0x1E,0x12,0x0C,0x04,0x0C,0xFF,0xFF,  /* 00000890    "........" */
  64.720 +    0x03,0x00,0x0A,0x03,0x00,0x0A,0x1F,0x12,  /* 00000898    "........" */
  64.721 +    0x0B,0x04,0x0C,0xFF,0xFF,0x04,0x00,0x00,  /* 000008A0    "........" */
  64.722 +    0x00,0x0A,0x20,0x12,0x0B,0x04,0x0C,0xFF,  /* 000008A8    ".. ....." */
  64.723 +    0xFF,0x04,0x00,0x01,0x00,0x0A,0x21,0x12,  /* 000008B0    "......!." */
  64.724 +    0x0C,0x04,0x0C,0xFF,0xFF,0x04,0x00,0x0A,  /* 000008B8    "........" */
  64.725 +    0x02,0x00,0x0A,0x22,0x12,0x0C,0x04,0x0C,  /* 000008C0    "..."...." */
  64.726 +    0xFF,0xFF,0x04,0x00,0x0A,0x03,0x00,0x0A,  /* 000008C8    "........" */
  64.727 +    0x23,0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x05,  /* 000008D0    "#......." */
  64.728 +    0x00,0x00,0x00,0x0A,0x24,0x12,0x0B,0x04,  /* 000008D8    "....$..." */
  64.729 +    0x0C,0xFF,0xFF,0x05,0x00,0x01,0x00,0x0A,  /* 000008E0    "........" */
  64.730 +    0x25,0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x05,  /* 000008E8    "%......." */
  64.731 +    0x00,0x0A,0x02,0x00,0x0A,0x26,0x12,0x0C,  /* 000008F0    ".....&.." */
  64.732 +    0x04,0x0C,0xFF,0xFF,0x05,0x00,0x0A,0x03,  /* 000008F8    "........" */
  64.733 +    0x00,0x0A,0x27,0x12,0x0B,0x04,0x0C,0xFF,  /* 00000900    "..'....." */
  64.734 +    0xFF,0x06,0x00,0x00,0x00,0x0A,0x28,0x12,  /* 00000908    "......(." */
  64.735 +    0x0B,0x04,0x0C,0xFF,0xFF,0x06,0x00,0x01,  /* 00000910    "........" */
  64.736 +    0x00,0x0A,0x29,0x12,0x0C,0x04,0x0C,0xFF,  /* 00000918    "..)....." */
  64.737 +    0xFF,0x06,0x00,0x0A,0x02,0x00,0x0A,0x2A,  /* 00000920    ".......*" */
  64.738 +    0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x06,0x00,  /* 00000928    "........" */
  64.739 +    0x0A,0x03,0x00,0x0A,0x2B,0x12,0x0B,0x04,  /* 00000930    "....+..." */
  64.740 +    0x0C,0xFF,0xFF,0x07,0x00,0x00,0x00,0x0A,  /* 00000938    "........" */
  64.741 +    0x2C,0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x07,  /* 00000940    ",......." */
  64.742 +    0x00,0x01,0x00,0x0A,0x2D,0x12,0x0C,0x04,  /* 00000948    "....-..." */
  64.743 +    0x0C,0xFF,0xFF,0x07,0x00,0x0A,0x02,0x00,  /* 00000950    "........" */
  64.744 +    0x0A,0x2E,0x12,0x0C,0x04,0x0C,0xFF,0xFF,  /* 00000958    "........" */
  64.745 +    0x07,0x00,0x0A,0x03,0x00,0x0A,0x2F,0x12,  /* 00000960    "....../." */
  64.746 +    0x0B,0x04,0x0C,0xFF,0xFF,0x08,0x00,0x00,  /* 00000968    "........" */
  64.747 +    0x00,0x0A,0x11,0x12,0x0B,0x04,0x0C,0xFF,  /* 00000970    "........" */
  64.748 +    0xFF,0x08,0x00,0x01,0x00,0x0A,0x12,0x12,  /* 00000978    "........" */
  64.749 +    0x0C,0x04,0x0C,0xFF,0xFF,0x08,0x00,0x0A,  /* 00000980    "........" */
  64.750 +    0x02,0x00,0x0A,0x13,0x12,0x0C,0x04,0x0C,  /* 00000988    "........" */
  64.751 +    0xFF,0xFF,0x08,0x00,0x0A,0x03,0x00,0x0A,  /* 00000990    "........" */
  64.752 +    0x14,0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x09,  /* 00000998    "........" */
  64.753 +    0x00,0x00,0x00,0x0A,0x15,0x12,0x0B,0x04,  /* 000009A0    "........" */
  64.754 +    0x0C,0xFF,0xFF,0x09,0x00,0x01,0x00,0x0A,  /* 000009A8    "........" */
  64.755 +    0x16,0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x09,  /* 000009B0    "........" */
  64.756 +    0x00,0x0A,0x02,0x00,0x0A,0x17,0x12,0x0C,  /* 000009B8    "........" */
  64.757 +    0x04,0x0C,0xFF,0xFF,0x09,0x00,0x0A,0x03,  /* 000009C0    "........" */
  64.758 +    0x00,0x0A,0x18,0x12,0x0B,0x04,0x0C,0xFF,  /* 000009C8    "........" */
  64.759 +    0xFF,0x0A,0x00,0x00,0x00,0x0A,0x19,0x12,  /* 000009D0    "........" */
  64.760 +    0x0B,0x04,0x0C,0xFF,0xFF,0x0A,0x00,0x01,  /* 000009D8    "........" */
  64.761 +    0x00,0x0A,0x1A,0x12,0x0C,0x04,0x0C,0xFF,  /* 000009E0    "........" */
  64.762 +    0xFF,0x0A,0x00,0x0A,0x02,0x00,0x0A,0x1B,  /* 000009E8    "........" */
  64.763 +    0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x0A,0x00,  /* 000009F0    "........" */
  64.764 +    0x0A,0x03,0x00,0x0A,0x1C,0x12,0x0B,0x04,  /* 000009F8    "........" */
  64.765 +    0x0C,0xFF,0xFF,0x0B,0x00,0x00,0x00,0x0A,  /* 00000A00    "........" */
  64.766 +    0x1D,0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x0B,  /* 00000A08    "........" */
  64.767 +    0x00,0x01,0x00,0x0A,0x1E,0x12,0x0C,0x04,  /* 00000A10    "........" */
  64.768 +    0x0C,0xFF,0xFF,0x0B,0x00,0x0A,0x02,0x00,  /* 00000A18    "........" */
  64.769 +    0x0A,0x1F,0x12,0x0C,0x04,0x0C,0xFF,0xFF,  /* 00000A20    "........" */
  64.770 +    0x0B,0x00,0x0A,0x03,0x00,0x0A,0x20,0x12,  /* 00000A28    "...... ." */
  64.771 +    0x0B,0x04,0x0C,0xFF,0xFF,0x0C,0x00,0x00,  /* 00000A30    "........" */
  64.772 +    0x00,0x0A,0x21,0x12,0x0B,0x04,0x0C,0xFF,  /* 00000A38    "..!....." */
  64.773 +    0xFF,0x0C,0x00,0x01,0x00,0x0A,0x22,0x12,  /* 00000A40    "......"." */
  64.774 +    0x0C,0x04,0x0C,0xFF,0xFF,0x0C,0x00,0x0A,  /* 00000A48    "........" */
  64.775 +    0x02,0x00,0x0A,0x23,0x12,0x0C,0x04,0x0C,  /* 00000A50    "...#...." */
  64.776 +    0xFF,0xFF,0x0C,0x00,0x0A,0x03,0x00,0x0A,  /* 00000A58    "........" */
  64.777 +    0x24,0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x0D,  /* 00000A60    "$......." */
  64.778 +    0x00,0x00,0x00,0x0A,0x25,0x12,0x0B,0x04,  /* 00000A68    "....%..." */
  64.779 +    0x0C,0xFF,0xFF,0x0D,0x00,0x01,0x00,0x0A,  /* 00000A70    "........" */
  64.780 +    0x26,0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x0D,  /* 00000A78    "&......." */
  64.781 +    0x00,0x0A,0x02,0x00,0x0A,0x27,0x12,0x0C,  /* 00000A80    ".....'.." */
  64.782 +    0x04,0x0C,0xFF,0xFF,0x0D,0x00,0x0A,0x03,  /* 00000A88    "........" */
  64.783 +    0x00,0x0A,0x28,0x12,0x0B,0x04,0x0C,0xFF,  /* 00000A90    "..(....." */
  64.784 +    0xFF,0x0E,0x00,0x00,0x00,0x0A,0x29,0x12,  /* 00000A98    "......)." */
  64.785 +    0x0B,0x04,0x0C,0xFF,0xFF,0x0E,0x00,0x01,  /* 00000AA0    "........" */
  64.786 +    0x00,0x0A,0x2A,0x12,0x0C,0x04,0x0C,0xFF,  /* 00000AA8    "..*....." */
  64.787 +    0xFF,0x0E,0x00,0x0A,0x02,0x00,0x0A,0x2B,  /* 00000AB0    ".......+" */
  64.788 +    0x12,0x0C,0x04,0x0C,0xFF,0xFF,0x0E,0x00,  /* 00000AB8    "........" */
  64.789 +    0x0A,0x03,0x00,0x0A,0x2C,0x12,0x0B,0x04,  /* 00000AC0    "....,..." */
  64.790 +    0x0C,0xFF,0xFF,0x0F,0x00,0x00,0x00,0x0A,  /* 00000AC8    "........" */
  64.791 +    0x2D,0x12,0x0B,0x04,0x0C,0xFF,0xFF,0x0F,  /* 00000AD0    "-......." */
  64.792 +    0x00,0x01,0x00,0x0A,0x2E,0x12,0x0C,0x04,  /* 00000AD8    "........" */
  64.793 +    0x0C,0xFF,0xFF,0x0F,0x00,0x0A,0x02,0x00,  /* 00000AE0    "........" */
  64.794 +    0x0A,0x2F,0x12,0x0C,0x04,0x0C,0xFF,0xFF,  /* 00000AE8    "./......" */
  64.795 +    0x0F,0x00,0x0A,0x03,0x00,0x0A,0x10,0x5B,  /* 00000AF0    ".......[" */
  64.796 +    0x82,0x46,0x37,0x49,0x53,0x41,0x5F,0x08,  /* 00000AF8    ".F7ISA_." */
  64.797 +    0x5F,0x41,0x44,0x52,0x0C,0x00,0x00,0x01,  /* 00000B00    "_ADR...." */
  64.798 +    0x00,0x5B,0x80,0x50,0x49,0x52,0x51,0x02,  /* 00000B08    ".[.PIRQ." */
  64.799 +    0x0A,0x60,0x0A,0x04,0x10,0x2E,0x5C,0x00,  /* 00000B10    ".`....\." */
  64.800 +    0x5B,0x81,0x29,0x5C,0x2F,0x04,0x5F,0x53,  /* 00000B18    "[.)\/._S" */
  64.801 +    0x42,0x5F,0x50,0x43,0x49,0x30,0x49,0x53,  /* 00000B20    "B_PCI0IS" */
  64.802 +    0x41,0x5F,0x50,0x49,0x52,0x51,0x01,0x50,  /* 00000B28    "A_PIRQ.P" */
  64.803 +    0x49,0x52,0x41,0x08,0x50,0x49,0x52,0x42,  /* 00000B30    "IRA.PIRB" */
  64.804 +    0x08,0x50,0x49,0x52,0x43,0x08,0x50,0x49,  /* 00000B38    ".PIRC.PI" */
  64.805 +    0x52,0x44,0x08,0x5B,0x82,0x46,0x0B,0x53,  /* 00000B40    "RD.[.F.S" */
  64.806 +    0x59,0x53,0x52,0x08,0x5F,0x48,0x49,0x44,  /* 00000B48    "YSR._HID" */
  64.807 +    0x0C,0x41,0xD0,0x0C,0x02,0x08,0x5F,0x55,  /* 00000B50    ".A...._U" */
  64.808 +    0x49,0x44,0x01,0x08,0x43,0x52,0x53,0x5F,  /* 00000B58    "ID..CRS_" */
  64.809 +    0x11,0x4E,0x08,0x0A,0x8A,0x47,0x01,0x10,  /* 00000B60    ".N...G.." */
  64.810 +    0x00,0x10,0x00,0x00,0x10,0x47,0x01,0x22,  /* 00000B68    ".....G."" */
  64.811 +    0x00,0x22,0x00,0x00,0x0C,0x47,0x01,0x30,  /* 00000B70    "."...G.0" */
  64.812 +    0x00,0x30,0x00,0x00,0x10,0x47,0x01,0x44,  /* 00000B78    ".0...G.D" */
  64.813 +    0x00,0x44,0x00,0x00,0x1C,0x47,0x01,0x62,  /* 00000B80    ".D...G.b" */
  64.814 +    0x00,0x62,0x00,0x00,0x02,0x47,0x01,0x65,  /* 00000B88    ".b...G.e" */
  64.815 +    0x00,0x65,0x00,0x00,0x0B,0x47,0x01,0x72,  /* 00000B90    ".e...G.r" */
  64.816 +    0x00,0x72,0x00,0x00,0x0E,0x47,0x01,0x80,  /* 00000B98    ".r...G.." */
  64.817 +    0x00,0x80,0x00,0x00,0x01,0x47,0x01,0x84,  /* 00000BA0    ".....G.." */
  64.818 +    0x00,0x84,0x00,0x00,0x03,0x47,0x01,0x88,  /* 00000BA8    ".....G.." */
  64.819 +    0x00,0x88,0x00,0x00,0x01,0x47,0x01,0x8C,  /* 00000BB0    ".....G.." */
  64.820 +    0x00,0x8C,0x00,0x00,0x03,0x47,0x01,0x90,  /* 00000BB8    ".....G.." */
  64.821 +    0x00,0x90,0x00,0x00,0x10,0x47,0x01,0xA2,  /* 00000BC0    ".....G.." */
  64.822 +    0x00,0xA2,0x00,0x00,0x1C,0x47,0x01,0xE0,  /* 00000BC8    ".....G.." */
  64.823 +    0x00,0xE0,0x00,0x00,0x10,0x47,0x01,0xA0,  /* 00000BD0    ".....G.." */
  64.824 +    0x08,0xA0,0x08,0x00,0x04,0x47,0x01,0xC0,  /* 00000BD8    ".....G.." */
  64.825 +    0x0C,0xC0,0x0C,0x00,0x10,0x47,0x01,0xD0,  /* 00000BE0    ".....G.." */
  64.826 +    0x04,0xD0,0x04,0x00,0x02,0x79,0x00,0x14,  /* 00000BE8    ".....y.." */
  64.827 +    0x0B,0x5F,0x43,0x52,0x53,0x00,0xA4,0x43,  /* 00000BF0    "._CRS..C" */
  64.828 +    0x52,0x53,0x5F,0x5B,0x82,0x2B,0x50,0x49,  /* 00000BF8    "RS_[.+PI" */
  64.829 +    0x43,0x5F,0x08,0x5F,0x48,0x49,0x44,0x0B,  /* 00000C00    "C_._HID." */
  64.830 +    0x41,0xD0,0x08,0x5F,0x43,0x52,0x53,0x11,  /* 00000C08    "A.._CRS." */
  64.831 +    0x18,0x0A,0x15,0x47,0x01,0x20,0x00,0x20,  /* 00000C10    "...G. . " */
  64.832 +    0x00,0x01,0x02,0x47,0x01,0xA0,0x00,0xA0,  /* 00000C18    "...G...." */
  64.833 +    0x00,0x01,0x02,0x22,0x04,0x00,0x79,0x00,  /* 00000C20    "..."..y." */
  64.834 +    0x5B,0x82,0x47,0x05,0x44,0x4D,0x41,0x30,  /* 00000C28    "[.G.DMA0" */
  64.835 +    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 00000C30    "._HID.A." */
  64.836 +    0x02,0x00,0x08,0x5F,0x43,0x52,0x53,0x11,  /* 00000C38    "..._CRS." */
  64.837 +    0x41,0x04,0x0A,0x3D,0x2A,0x10,0x04,0x47,  /* 00000C40    "A..=*..G" */
  64.838 +    0x01,0x00,0x00,0x00,0x00,0x00,0x10,0x47,  /* 00000C48    ".......G" */
  64.839 +    0x01,0x81,0x00,0x81,0x00,0x00,0x03,0x47,  /* 00000C50    ".......G" */
  64.840 +    0x01,0x87,0x00,0x87,0x00,0x00,0x01,0x47,  /* 00000C58    ".......G" */
  64.841 +    0x01,0x89,0x00,0x89,0x00,0x00,0x03,0x47,  /* 00000C60    ".......G" */
  64.842 +    0x01,0x8F,0x00,0x8F,0x00,0x00,0x01,0x47,  /* 00000C68    ".......G" */
  64.843 +    0x01,0xC0,0x00,0xC0,0x00,0x00,0x20,0x47,  /* 00000C70    "...... G" */
  64.844 +    0x01,0x80,0x04,0x80,0x04,0x00,0x10,0x79,  /* 00000C78    ".......y" */
  64.845 +    0x00,0x5B,0x82,0x25,0x54,0x4D,0x52,0x5F,  /* 00000C80    ".[.%TMR_" */
  64.846 +    0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,  /* 00000C88    "._HID.A." */
  64.847 +    0x01,0x00,0x08,0x5F,0x43,0x52,0x53,0x11,  /* 00000C90    "..._CRS." */
  64.848 +    0x10,0x0A,0x0D,0x47,0x01,0x40,0x00,0x40,  /* 00000C98    "...G.@.@" */
  64.849 +    0x00,0x00,0x04,0x22,0x01,0x00,0x79,0x00,  /* 00000CA0    "..."..y." */
  64.850 +    0x5B,0x82,0x25,0x52,0x54,0x43,0x5F,0x08,  /* 00000CA8    "[.%RTC_." */
  64.851 +    0x5F,0x48,0x49,0x44,0x0C,0x41,0xD0,0x0B,  /* 00000CB0    "_HID.A.." */
  64.852 +    0x00,0x08,0x5F,0x43,0x52,0x53,0x11,0x10,  /* 00000CB8    ".._CRS.." */
  64.853 +    0x0A,0x0D,0x47,0x01,0x70,0x00,0x70,0x00,  /* 00000CC0    "..G.p.p." */
  64.854 +    0x00,0x02,0x22,0x00,0x01,0x79,0x00,0x5B,  /* 00000CC8    ".."..y.[" */
  64.855 +    0x82,0x22,0x53,0x50,0x4B,0x52,0x08,0x5F,  /* 00000CD0    "."SPKR._" */
  64.856 +    0x48,0x49,0x44,0x0C,0x41,0xD0,0x08,0x00,  /* 00000CD8    "HID.A..." */
  64.857 +    0x08,0x5F,0x43,0x52,0x53,0x11,0x0D,0x0A,  /* 00000CE0    "._CRS..." */
  64.858 +    0x0A,0x47,0x01,0x61,0x00,0x61,0x00,0x00,  /* 00000CE8    ".G.a.a.." */
  64.859 +    0x01,0x79,0x00,0x5B,0x82,0x31,0x50,0x53,  /* 00000CF0    ".y.[.1PS" */
  64.860 +    0x32,0x4D,0x08,0x5F,0x48,0x49,0x44,0x0C,  /* 00000CF8    "2M._HID." */
  64.861 +    0x41,0xD0,0x0F,0x13,0x08,0x5F,0x43,0x49,  /* 00000D00    "A...._CI" */
  64.862 +    0x44,0x0C,0x41,0xD0,0x0F,0x13,0x14,0x09,  /* 00000D08    "D.A....." */
  64.863 +    0x5F,0x53,0x54,0x41,0x00,0xA4,0x0A,0x0F,  /* 00000D10    "_STA...." */
  64.864 +    0x08,0x5F,0x43,0x52,0x53,0x11,0x08,0x0A,  /* 00000D18    "._CRS..." */
  64.865 +    0x05,0x22,0x00,0x10,0x79,0x00,0x5B,0x82,  /* 00000D20    "."..y.[." */
  64.866 +    0x42,0x04,0x50,0x53,0x32,0x4B,0x08,0x5F,  /* 00000D28    "B.PS2K._" */
  64.867 +    0x48,0x49,0x44,0x0C,0x41,0xD0,0x03,0x03,  /* 00000D30    "HID.A..." */
  64.868 +    0x08,0x5F,0x43,0x49,0x44,0x0C,0x41,0xD0,  /* 00000D38    "._CID.A." */
  64.869 +    0x03,0x0B,0x14,0x09,0x5F,0x53,0x54,0x41,  /* 00000D40    "...._STA" */
  64.870 +    0x00,0xA4,0x0A,0x0F,0x08,0x5F,0x43,0x52,  /* 00000D48    "....._CR" */
  64.871 +    0x53,0x11,0x18,0x0A,0x15,0x47,0x01,0x60,  /* 00000D50    "S....G.`" */
  64.872 +    0x00,0x60,0x00,0x00,0x01,0x47,0x01,0x64,  /* 00000D58    ".`...G.d" */
  64.873 +    0x00,0x64,0x00,0x00,0x01,0x22,0x02,0x00,  /* 00000D60    ".d...".." */
  64.874 +    0x79,0x00,0x5B,0x82,0x3A,0x46,0x44,0x43,  /* 00000D68    "y.[.:FDC" */
  64.875 +    0x30,0x08,0x5F,0x48,0x49,0x44,0x0C,0x41,  /* 00000D70    "0._HID.A" */
  64.876 +    0xD0,0x07,0x00,0x14,0x09,0x5F,0x53,0x54,  /* 00000D78    "....._ST" */
  64.877 +    0x41,0x00,0xA4,0x0A,0x0F,0x08,0x5F,0x43,  /* 00000D80    "A....._C" */
  64.878 +    0x52,0x53,0x11,0x1B,0x0A,0x18,0x47,0x01,  /* 00000D88    "RS....G." */
  64.879 +    0xF0,0x03,0xF0,0x03,0x01,0x06,0x47,0x01,  /* 00000D90    "......G." */
  64.880 +    0xF7,0x03,0xF7,0x03,0x01,0x01,0x22,0x40,  /* 00000D98    "......"@" */
  64.881 +    0x00,0x2A,0x04,0x00,0x79,0x00,0x5B,0x82,  /* 00000DA0    ".*..y.[." */
  64.882 +    0x46,0x04,0x55,0x41,0x52,0x31,0x08,0x5F,  /* 00000DA8    "F.UAR1._" */
  64.883 +    0x48,0x49,0x44,0x0C,0x41,0xD0,0x05,0x01,  /* 00000DB0    "HID.A..." */
  64.884 +    0x08,0x5F,0x55,0x49,0x44,0x01,0x14,0x19,  /* 00000DB8    "._UID..." */
  64.885 +    0x5F,0x53,0x54,0x41,0x00,0xA0,0x0D,0x93,  /* 00000DC0    "_STA...." */
  64.886 +    0x5E,0x5E,0x5E,0x5E,0x55,0x41,0x52,0x31,  /* 00000DC8    "^^^^UAR1" */
  64.887 +    0x00,0xA4,0x00,0xA1,0x04,0xA4,0x0A,0x0F,  /* 00000DD0    "........" */
  64.888 +    0x08,0x5F,0x43,0x52,0x53,0x11,0x10,0x0A,  /* 00000DD8    "._CRS..." */
  64.889 +    0x0D,0x47,0x01,0xF8,0x03,0xF8,0x03,0x08,  /* 00000DE0    ".G......" */
  64.890 +    0x08,0x22,0x10,0x00,0x79,0x00,0x5B,0x82,  /* 00000DE8    "."..y.[." */
  64.891 +    0x47,0x04,0x55,0x41,0x52,0x32,0x08,0x5F,  /* 00000DF0    "G.UAR2._" */
  64.892 +    0x48,0x49,0x44,0x0C,0x41,0xD0,0x05,0x01,  /* 00000DF8    "HID.A..." */
  64.893 +    0x08,0x5F,0x55,0x49,0x44,0x0A,0x02,0x14,  /* 00000E00    "._UID..." */
  64.894 +    0x19,0x5F,0x53,0x54,0x41,0x00,0xA0,0x0D,  /* 00000E08    "._STA..." */
  64.895 +    0x93,0x5E,0x5E,0x5E,0x5E,0x55,0x41,0x52,  /* 00000E10    ".^^^^UAR" */
  64.896 +    0x32,0x00,0xA4,0x00,0xA1,0x04,0xA4,0x0A,  /* 00000E18    "2......." */
  64.897 +    0x0F,0x08,0x5F,0x43,0x52,0x53,0x11,0x10,  /* 00000E20    ".._CRS.." */
  64.898 +    0x0A,0x0D,0x47,0x01,0xF8,0x02,0xF8,0x02,  /* 00000E28    "..G....." */
  64.899 +    0x08,0x08,0x22,0x08,0x00,0x79,0x00,0x5B,  /* 00000E30    ".."..y.[" */
  64.900 +    0x82,0x36,0x4C,0x54,0x50,0x31,0x08,0x5F,  /* 00000E38    ".6LTP1._" */
  64.901 +    0x48,0x49,0x44,0x0C,0x41,0xD0,0x04,0x00,  /* 00000E40    "HID.A..." */
  64.902 +    0x08,0x5F,0x55,0x49,0x44,0x0A,0x02,0x14,  /* 00000E48    "._UID..." */
  64.903 +    0x09,0x5F,0x53,0x54,0x41,0x00,0xA4,0x0A,  /* 00000E50    "._STA..." */
  64.904 +    0x0F,0x08,0x5F,0x43,0x52,0x53,0x11,0x10,  /* 00000E58    ".._CRS.." */
  64.905 +    0x0A,0x0D,0x47,0x01,0x78,0x03,0x78,0x03,  /* 00000E60    "..G.x.x." */
  64.906 +    0x08,0x08,0x22,0x80,0x00,0x79,0x00,
  64.907  };
  64.908  int DsdtLen=sizeof(AmlCode);
    65.1 --- a/tools/firmware/hvmloader/hvmloader.c	Tue Jan 22 08:27:29 2008 -0700
    65.2 +++ b/tools/firmware/hvmloader/hvmloader.c	Tue Jan 22 08:30:40 2008 -0700
    65.3 @@ -183,11 +183,23 @@ static void apic_setup(void)
    65.4  
    65.5  static void pci_setup(void)
    65.6  {
    65.7 -    uint32_t devfn, bar_reg, bar_data, bar_sz, cmd;
    65.8 -    uint32_t *base, io_base = 0xc000, mem_base = HVM_BELOW_4G_MMIO_START;
    65.9 +    uint32_t base, devfn, bar_reg, bar_data, bar_sz, cmd;
   65.10      uint16_t class, vendor_id, device_id;
   65.11      unsigned int bar, pin, link, isa_irq;
   65.12  
   65.13 +    /* Resources assignable to PCI devices via BARs. */
   65.14 +    struct resource {
   65.15 +        uint32_t base, max;
   65.16 +    } *resource;
   65.17 +    struct resource mem_resource = { 0xf0000000, 0xfc000000 };
   65.18 +    struct resource io_resource  = { 0xc000, 0x10000 };
   65.19 +
   65.20 +    /* Create a list of device BARs in descending order of size. */
   65.21 +    struct bars {
   65.22 +        uint32_t devfn, bar_reg, bar_sz;
   65.23 +    } *bars = (struct bars *)0xc0000;
   65.24 +    unsigned int i, nr_bars = 0;
   65.25 +
   65.26      /* Program PCI-ISA bridge with appropriate link routes. */
   65.27      isa_irq = 0;
   65.28      for ( link = 0; link < 4; link++ )
   65.29 @@ -242,44 +254,30 @@ static void pci_setup(void)
   65.30                      bar_reg = PCI_ROM_ADDRESS;
   65.31  
   65.32                  bar_data = pci_readl(devfn, bar_reg);
   65.33 -
   65.34                  pci_writel(devfn, bar_reg, ~0);
   65.35                  bar_sz = pci_readl(devfn, bar_reg);
   65.36 +                pci_writel(devfn, bar_reg, bar_data);
   65.37                  if ( bar_sz == 0 )
   65.38                      continue;
   65.39  
   65.40 -                if ( (bar_data & PCI_BASE_ADDRESS_SPACE) ==
   65.41 -                     PCI_BASE_ADDRESS_SPACE_MEMORY )
   65.42 -                {
   65.43 -                    base = &mem_base;
   65.44 -                    bar_sz &= PCI_BASE_ADDRESS_MEM_MASK;
   65.45 -                    bar_data &= ~PCI_BASE_ADDRESS_MEM_MASK;
   65.46 -                }
   65.47 -                else
   65.48 -                {
   65.49 -                    base = &io_base;
   65.50 -                    bar_sz &= PCI_BASE_ADDRESS_IO_MASK & 0xffff;
   65.51 -                    bar_data &= ~PCI_BASE_ADDRESS_IO_MASK;
   65.52 -                }
   65.53 +                bar_sz &= (((bar_data & PCI_BASE_ADDRESS_SPACE) ==
   65.54 +                           PCI_BASE_ADDRESS_SPACE_MEMORY) ?
   65.55 +                           PCI_BASE_ADDRESS_MEM_MASK :
   65.56 +                           (PCI_BASE_ADDRESS_IO_MASK & 0xffff));
   65.57                  bar_sz &= ~(bar_sz - 1);
   65.58  
   65.59 -                *base = (*base + bar_sz - 1) & ~(bar_sz - 1);
   65.60 -                bar_data |= *base;
   65.61 -                *base += bar_sz;
   65.62 -
   65.63 -                pci_writel(devfn, bar_reg, bar_data);
   65.64 -                printf("pci dev %02x:%x bar %02x size %08x: %08x\n",
   65.65 -                       devfn>>3, devfn&7, bar_reg, bar_sz, bar_data);
   65.66 +                for ( i = 0; i < nr_bars; i++ )
   65.67 +                    if ( bars[i].bar_sz < bar_sz )
   65.68 +                        break;
   65.69  
   65.70 -                /* Now enable the memory or I/O mapping. */
   65.71 -                cmd = pci_readw(devfn, PCI_COMMAND);
   65.72 -                if ( (bar_reg == PCI_ROM_ADDRESS) ||
   65.73 -                     ((bar_data & PCI_BASE_ADDRESS_SPACE) ==
   65.74 -                      PCI_BASE_ADDRESS_SPACE_MEMORY) )
   65.75 -                    cmd |= PCI_COMMAND_MEMORY;
   65.76 -                else
   65.77 -                    cmd |= PCI_COMMAND_IO;
   65.78 -                pci_writew(devfn, PCI_COMMAND, cmd);
   65.79 +                if ( i != nr_bars )
   65.80 +                    memmove(&bars[i+1], &bars[i], (nr_bars-i) * sizeof(*bars));
   65.81 +
   65.82 +                bars[i].devfn   = devfn;
   65.83 +                bars[i].bar_reg = bar_reg;
   65.84 +                bars[i].bar_sz  = bar_sz;
   65.85 +
   65.86 +                nr_bars++;
   65.87              }
   65.88              break;
   65.89          }
   65.90 @@ -296,6 +294,55 @@ static void pci_setup(void)
   65.91                     devfn>>3, devfn&7, 'A'+pin-1, isa_irq);
   65.92          }
   65.93      }
   65.94 +
   65.95 +    /* Assign iomem and ioport resources in descending order of size. */
   65.96 +    for ( i = 0; i < nr_bars; i++ )
   65.97 +    {
   65.98 +        devfn   = bars[i].devfn;
   65.99 +        bar_reg = bars[i].bar_reg;
  65.100 +        bar_sz  = bars[i].bar_sz;
  65.101 +
  65.102 +        bar_data = pci_readl(devfn, bar_reg);
  65.103 +
  65.104 +        if ( (bar_data & PCI_BASE_ADDRESS_SPACE) ==
  65.105 +             PCI_BASE_ADDRESS_SPACE_MEMORY )
  65.106 +        {
  65.107 +            resource = &mem_resource;
  65.108 +            bar_data &= ~PCI_BASE_ADDRESS_MEM_MASK;
  65.109 +        }
  65.110 +        else
  65.111 +        {
  65.112 +            resource = &io_resource;
  65.113 +            bar_data &= ~PCI_BASE_ADDRESS_IO_MASK;
  65.114 +        }
  65.115 +
  65.116 +        base = (resource->base + bar_sz - 1) & ~(bar_sz - 1);
  65.117 +        bar_data |= base;
  65.118 +        base += bar_sz;
  65.119 +
  65.120 +        if ( (base < resource->base) || (base > resource->max) )
  65.121 +        {
  65.122 +            printf("pci dev %02x:%x bar %02x size %08x: no space for "
  65.123 +                   "resource!\n", devfn>>3, devfn&7, bar_reg, bar_sz);
  65.124 +            continue;
  65.125 +        }
  65.126 +
  65.127 +        resource->base = base;
  65.128 +
  65.129 +        pci_writel(devfn, bar_reg, bar_data);
  65.130 +        printf("pci dev %02x:%x bar %02x size %08x: %08x\n",
  65.131 +               devfn>>3, devfn&7, bar_reg, bar_sz, bar_data);
  65.132 +
  65.133 +        /* Now enable the memory or I/O mapping. */
  65.134 +        cmd = pci_readw(devfn, PCI_COMMAND);
  65.135 +        if ( (bar_reg == PCI_ROM_ADDRESS) ||
  65.136 +             ((bar_data & PCI_BASE_ADDRESS_SPACE) ==
  65.137 +              PCI_BASE_ADDRESS_SPACE_MEMORY) )
  65.138 +            cmd |= PCI_COMMAND_MEMORY;
  65.139 +        else
  65.140 +            cmd |= PCI_COMMAND_IO;
  65.141 +        pci_writew(devfn, PCI_COMMAND, cmd);
  65.142 +    }
  65.143  }
  65.144  
  65.145  /*
    66.1 --- a/tools/flask/libflask/Makefile	Tue Jan 22 08:27:29 2008 -0700
    66.2 +++ b/tools/flask/libflask/Makefile	Tue Jan 22 08:30:40 2008 -0700
    66.3 @@ -33,13 +33,13 @@ build:
    66.4  
    66.5  .PHONY: install
    66.6  install: build
    66.7 -	[ -d $(DESTDIR)/usr/$(LIBDIR) ] || $(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
    66.8 -	[ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
    66.9 -	$(INSTALL_PROG) libflask.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
   66.10 -	$(INSTALL_DATA) libflask.a $(DESTDIR)/usr/$(LIBDIR)
   66.11 -	ln -sf libflask.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libflask.so.$(MAJOR)
   66.12 -	ln -sf libflask.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libflask.so
   66.13 -	$(INSTALL_DATA) include/flask.h $(DESTDIR)/usr/include
   66.14 +	$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
   66.15 +	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
   66.16 +	$(INSTALL_PROG) libflask.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
   66.17 +	$(INSTALL_DATA) libflask.a $(DESTDIR)$(LIBDIR)
   66.18 +	ln -sf libflask.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libflask.so.$(MAJOR)
   66.19 +	ln -sf libflask.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libflask.so
   66.20 +	$(INSTALL_DATA) include/flask.h $(DESTDIR)$(INCLUDEDIR)
   66.21  
   66.22  .PHONY: TAGS
   66.23  TAGS:
    67.1 --- a/tools/flask/loadpolicy/Makefile	Tue Jan 22 08:27:29 2008 -0700
    67.2 +++ b/tools/flask/loadpolicy/Makefile	Tue Jan 22 08:30:40 2008 -0700
    67.3 @@ -51,8 +51,8 @@ print-end:
    67.4  
    67.5  .PHONY: install
    67.6  install: all
    67.7 -	$(INSTALL_DIR) -p $(DESTDIR)/usr/sbin
    67.8 -	$(INSTALL_PROG) $(CLIENTS) $(DESTDIR)/usr/sbin
    67.9 +	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
   67.10 +	$(INSTALL_PROG) $(CLIENTS) $(DESTDIR)$(SBINDIR)
   67.11  
   67.12  -include $(PROG_DEP)
   67.13  
    68.1 --- a/tools/fs-back/Makefile	Tue Jan 22 08:27:29 2008 -0700
    68.2 +++ b/tools/fs-back/Makefile	Tue Jan 22 08:30:40 2008 -0700
    68.3 @@ -4,7 +4,6 @@ include $(XEN_ROOT)/tools/Rules.mk
    68.4  INCLUDES += -I.. -I../lib
    68.5  
    68.6  IBIN         = fs-backend 
    68.7 -INST_DIR     = /usr/sbin
    68.8  
    68.9  CFLAGS   += -Werror
   68.10  CFLAGS   += -Wno-unused
   68.11 @@ -30,7 +29,7 @@ fs-backend: $(OBJS) fs-backend.c
   68.12  	$(CC) $(CFLAGS) -o fs-backend $(OBJS) $(LIBS) fs-backend.c
   68.13  
   68.14  install: all
   68.15 -	$(INSTALL_PROG) $(IBIN) $(DESTDIR)$(INST_DIR)
   68.16 +	$(INSTALL_PROG) $(IBIN) $(DESTDIR)$(SBINDIR)
   68.17  
   68.18  clean:
   68.19  	rm -rf *.o *~ $(DEPS) xen $(IBIN) $(LIB)
    69.1 --- a/tools/guest-headers/Makefile	Tue Jan 22 08:27:29 2008 -0700
    69.2 +++ b/tools/guest-headers/Makefile	Tue Jan 22 08:30:40 2008 -0700
    69.3 @@ -10,8 +10,8 @@ check:
    69.4  .PHONY: install
    69.5  
    69.6  install:
    69.7 -	mkdir -p $(DESTDIR)/usr/include/xen/sys
    69.8 -	$(INSTALL_DATA) $(XEN_ROOT)/tools/include/$(XEN_OS)/*.h $(DESTDIR)/usr/include/xen/sys
    69.9 +	mkdir -p $(DESTDIR)$(INCLUDEDIR)/xen/sys
   69.10 +	$(INSTALL_DATA) $(XEN_ROOT)/tools/include/$(XEN_OS)/*.h $(DESTDIR)$(INCLUDEDIR)/xen/sys
   69.11  
   69.12  .PHONY: clean
   69.13  clean:
    70.1 --- a/tools/ioemu/configure	Tue Jan 22 08:27:29 2008 -0700
    70.2 +++ b/tools/ioemu/configure	Tue Jan 22 08:30:40 2008 -0700
    70.3 @@ -29,43 +29,15 @@ ar="ar"
    70.4  make="make"
    70.5  install="install"
    70.6  strip="strip"
    70.7 -cpu=`uname -m`
    70.8  target_list=""
    70.9 -case "$cpu" in
   70.10 -  i386|i486|i586|i686|i86pc|BePC)
   70.11 +case "$XEN_TARGET_ARCH" in
   70.12 +  x86_32)
   70.13      cpu="i386"
   70.14    ;;
   70.15 -  armv*b)
   70.16 -    cpu="armv4b"
   70.17 -  ;;
   70.18 -  armv*l)
   70.19 -    cpu="armv4l"
   70.20 -  ;;
   70.21 -  alpha)
   70.22 -    cpu="alpha"
   70.23 -  ;;
   70.24 -  "Power Macintosh"|ppc|ppc64)
   70.25 +  powerpc)
   70.26      cpu="powerpc"
   70.27    ;;
   70.28 -  mips)
   70.29 -    cpu="mips"
   70.30 -  ;;
   70.31 -  s390)
   70.32 -    cpu="s390"
   70.33 -  ;;
   70.34 -  sparc|sun4[muv])
   70.35 -    cpu="sparc"
   70.36 -  ;;
   70.37 -  sparc64)
   70.38 -    cpu="sparc64"
   70.39 -  ;;
   70.40 -  ia64)
   70.41 -    cpu="ia64"
   70.42 -  ;;
   70.43 -  m68k)
   70.44 -    cpu="m68k"
   70.45 -  ;;
   70.46 -  x86_64|amd64)
   70.47 +  x86_64)
   70.48      cpu="x86_64"
   70.49      libdir="lib64"
   70.50    ;;
    71.1 --- a/tools/ioemu/hw/ide.c	Tue Jan 22 08:27:29 2008 -0700
    71.2 +++ b/tools/ioemu/hw/ide.c	Tue Jan 22 08:30:40 2008 -0700
    71.3 @@ -756,7 +756,9 @@ static void ide_transfer_start(IDEState 
    71.4      s->end_transfer_func = end_transfer_func;
    71.5      s->data_ptr = buf;
    71.6      s->data_end = buf + size;
    71.7 -    s->status |= DRQ_STAT;
    71.8 +    /* don't violate the HSM */
    71.9 +    if (!(s->status & ERR_STAT))
   71.10 +        s->status |= DRQ_STAT;
   71.11      buffered_pio_reset(s);
   71.12  }
   71.13  
   71.14 @@ -2011,6 +2013,7 @@ static void ide_ioport_write(void *opaqu
   71.15              /* overlapping commands not supported */
   71.16              if (s->feature & 0x02)
   71.17                  goto abort_cmd;
   71.18 +            s->status = READY_STAT;
   71.19              s->atapi_dma = s->feature & 1;
   71.20              s->nsector = 1;
   71.21              ide_transfer_start(s, s->io_buffer, ATAPI_PACKET_SIZE, 
    72.1 --- a/tools/libfsimage/Rules.mk	Tue Jan 22 08:27:29 2008 -0700
    72.2 +++ b/tools/libfsimage/Rules.mk	Tue Jan 22 08:30:40 2008 -0700
    72.3 @@ -20,8 +20,8 @@ fs-all: $(FSLIB)
    72.4  
    72.5  .PHONY: fs-install
    72.6  fs-install: fs-all
    72.7 -	$(INSTALL_DIR) $(DESTDIR)/usr/$(FSDIR)
    72.8 -	$(INSTALL_PROG) $(FSLIB) $(DESTDIR)/usr/$(FSDIR)
    72.9 +	$(INSTALL_DIR) $(DESTDIR)$(FSDIR)
   72.10 +	$(INSTALL_PROG) $(FSLIB) $(DESTDIR)$(FSDIR)
   72.11  
   72.12  $(FSLIB): $(PIC_OBJS)
   72.13  	$(CC) $(CFLAGS) $(LDFLAGS) $(SHLIB_CFLAGS) -o $@ $^ -lfsimage $(FS_LIBDEPS)
    73.1 --- a/tools/libfsimage/common/Makefile	Tue Jan 22 08:27:29 2008 -0700
    73.2 +++ b/tools/libfsimage/common/Makefile	Tue Jan 22 08:30:40 2008 -0700
    73.3 @@ -22,14 +22,14 @@ all: $(LIB)
    73.4  
    73.5  .PHONY: install
    73.6  install: all
    73.7 -	[ -d $(DESTDIR)/usr/$(LIBDIR) ] || $(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
    73.8 -	[ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
    73.9 -	$(INSTALL_PROG) libfsimage.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
   73.10 -	ln -sf libfsimage.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libfsimage.so.$(MAJOR)
   73.11 -	ln -sf libfsimage.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libfsimage.so
   73.12 -	$(INSTALL_DATA) fsimage.h $(DESTDIR)/usr/include
   73.13 -	$(INSTALL_DATA) fsimage_plugin.h $(DESTDIR)/usr/include
   73.14 -	$(INSTALL_DATA) fsimage_grub.h $(DESTDIR)/usr/include
   73.15 +	$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
   73.16 +	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
   73.17 +	$(INSTALL_PROG) libfsimage.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
   73.18 +	ln -sf libfsimage.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libfsimage.so.$(MAJOR)
   73.19 +	ln -sf libfsimage.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libfsimage.so
   73.20 +	$(INSTALL_DATA) fsimage.h $(DESTDIR)$(INCLUDEDIR)
   73.21 +	$(INSTALL_DATA) fsimage_plugin.h $(DESTDIR)$(INCLUDEDIR)
   73.22 +	$(INSTALL_DATA) fsimage_grub.h $(DESTDIR)$(INCLUDEDIR)
   73.23  
   73.24  clean distclean:
   73.25  	rm -f $(PIC_OBJS) $(LIB) $(DEPS)
    74.1 --- a/tools/libxc/Makefile	Tue Jan 22 08:27:29 2008 -0700
    74.2 +++ b/tools/libxc/Makefile	Tue Jan 22 08:30:40 2008 -0700
    74.3 @@ -103,19 +103,19 @@ check-for-zlib:
    74.4  
    74.5  .PHONY: install
    74.6  install: build
    74.7 -	[ -d $(DESTDIR)/usr/$(LIBDIR) ] || $(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
    74.8 -	[ -d $(DESTDIR)/usr/include ] || $(INSTALL_DIR) $(DESTDIR)/usr/include
    74.9 -	$(INSTALL_PROG) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
   74.10 -	$(INSTALL_DATA) libxenctrl.a $(DESTDIR)/usr/$(LIBDIR)
   74.11 -	ln -sf libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenctrl.so.$(MAJOR)
   74.12 -	ln -sf libxenctrl.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenctrl.so
   74.13 -	$(INSTALL_DATA) xenctrl.h $(DESTDIR)/usr/include
   74.14 +	$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
   74.15 +	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
   74.16 +	$(INSTALL_PROG) libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
   74.17 +	$(INSTALL_DATA) libxenctrl.a $(DESTDIR)$(LIBDIR)
   74.18 +	ln -sf libxenctrl.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so.$(MAJOR)
   74.19 +	ln -sf libxenctrl.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenctrl.so
   74.20 +	$(INSTALL_DATA) xenctrl.h $(DESTDIR)$(INCLUDEDIR)
   74.21  
   74.22 -	$(INSTALL_PROG) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
   74.23 -	$(INSTALL_DATA) libxenguest.a $(DESTDIR)/usr/$(LIBDIR)
   74.24 -	ln -sf libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenguest.so.$(MAJOR)
   74.25 -	ln -sf libxenguest.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenguest.so
   74.26 -	$(INSTALL_DATA) xenguest.h $(DESTDIR)/usr/include
   74.27 +	$(INSTALL_PROG) libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
   74.28 +	$(INSTALL_DATA) libxenguest.a $(DESTDIR)$(LIBDIR)
   74.29 +	ln -sf libxenguest.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenguest.so.$(MAJOR)
   74.30 +	ln -sf libxenguest.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenguest.so
   74.31 +	$(INSTALL_DATA) xenguest.h $(DESTDIR)$(INCLUDEDIR)
   74.32  
   74.33  .PHONY: TAGS
   74.34  TAGS:
    75.1 --- a/tools/libxen/Makefile	Tue Jan 22 08:27:29 2008 -0700
    75.2 +++ b/tools/libxen/Makefile	Tue Jan 22 08:30:40 2008 -0700
    75.3 @@ -55,14 +55,14 @@ libxenapi.a: $(LIBXENAPI_OBJS)
    75.4  
    75.5  .PHONY: install
    75.6  install: all
    75.7 -	$(INSTALL_DIR) $(DESTDIR)/usr/include/xen/api
    75.8 -	$(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
    75.9 -	$(INSTALL_PROG) libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
   75.10 -	ln -sf libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenapi.so.$(MAJOR)
   75.11 -	ln -sf libxenapi.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenapi.so
   75.12 -	$(INSTALL_DATA) libxenapi.a $(DESTDIR)/usr/$(LIBDIR)
   75.13 +	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xen/api
   75.14 +	$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
   75.15 +	$(INSTALL_PROG) libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
   75.16 +	ln -sf libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenapi.so.$(MAJOR)
   75.17 +	ln -sf libxenapi.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenapi.so
   75.18 +	$(INSTALL_DATA) libxenapi.a $(DESTDIR)$(LIBDIR)
   75.19  	set -e; for i in $(LIBXENAPI_HDRS); do \
   75.20 -	    $(INSTALL_DATA) $$i $(DESTDIR)/usr/include/xen/api; \
   75.21 +	    $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEDIR)/xen/api; \
   75.22  	done
   75.23  
   75.24  
    76.1 --- a/tools/libxen/Makefile.dist	Tue Jan 22 08:27:29 2008 -0700
    76.2 +++ b/tools/libxen/Makefile.dist	Tue Jan 22 08:30:40 2008 -0700
    76.3 @@ -65,14 +65,14 @@ libxenapi.a: $(LIBXENAPI_OBJS)
    76.4  
    76.5  .PHONY: install
    76.6  install: all
    76.7 -	$(INSTALL_DIR) $(DESTDIR)/usr/include/xen/api
    76.8 -	$(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
    76.9 -	$(INSTALL_PROG) libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
   76.10 -	ln -sf libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenapi.so.$(MAJOR)
   76.11 -	ln -sf libxenapi.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenapi.so
   76.12 -	$(INSTALL_DATA) libxenapi.a $(DESTDIR)/usr/$(LIBDIR)
   76.13 +	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)/xen/api
   76.14 +	$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
   76.15 +	$(INSTALL_PROG) libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
   76.16 +	ln -sf libxenapi.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenapi.so.$(MAJOR)
   76.17 +	ln -sf libxenapi.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenapi.so
   76.18 +	$(INSTALL_DATA) libxenapi.a $(DESTDIR)$(LIBDIR)
   76.19  	set -e; for i in $(LIBXENAPI_HDRS); do \
   76.20 -	    $(INSTALL_DATA) $$i $(DESTDIR)/usr/include/xen/api; \
   76.21 +	    $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEDIR)/xen/api; \
   76.22  	done
   76.23  
   76.24  
    77.1 --- a/tools/misc/Makefile	Tue Jan 22 08:27:29 2008 -0700
    77.2 +++ b/tools/misc/Makefile	Tue Jan 22 08:30:40 2008 -0700
    77.3 @@ -29,10 +29,10 @@ build: $(TARGETS)
    77.4  
    77.5  .PHONY: install
    77.6  install: build
    77.7 -	[ -d $(DESTDIR)/usr/bin ] || $(INSTALL_DIR) $(DESTDIR)/usr/bin
    77.8 -	[ -d $(DESTDIR)/usr/sbin ] || $(INSTALL_DIR) $(DESTDIR)/usr/sbin
    77.9 -	$(INSTALL_PROG) $(INSTALL_BIN) $(DESTDIR)/usr/bin
   77.10 -	$(INSTALL_PROG) $(INSTALL_SBIN) $(DESTDIR)/usr/sbin
   77.11 +	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
   77.12 +	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
   77.13 +	$(INSTALL_PROG) $(INSTALL_BIN) $(DESTDIR)$(BINDIR)
   77.14 +	$(INSTALL_PROG) $(INSTALL_SBIN) $(DESTDIR)$(SBINDIR)
   77.15  	set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d install-recurse; done
   77.16  
   77.17  .PHONY: clean
    78.1 --- a/tools/misc/lomount/Makefile	Tue Jan 22 08:27:29 2008 -0700
    78.2 +++ b/tools/misc/lomount/Makefile	Tue Jan 22 08:30:40 2008 -0700
    78.3 @@ -16,7 +16,7 @@ build: $(BIN)
    78.4  
    78.5  .PHONY: install
    78.6  install install-recurse: build
    78.7 -	$(INSTALL_PROG) $(BIN) $(SCRIPTS) $(DESTDIR)/usr/bin
    78.8 +	$(INSTALL_PROG) $(BIN) $(SCRIPTS) $(DESTDIR)$(BINDIR)
    78.9  
   78.10  .PHONY: clean
   78.11  clean:
    79.1 --- a/tools/misc/miniterm/Makefile	Tue Jan 22 08:27:29 2008 -0700
    79.2 +++ b/tools/misc/miniterm/Makefile	Tue Jan 22 08:30:40 2008 -0700
    79.3 @@ -8,8 +8,8 @@ all: $(TARGET)
    79.4  
    79.5  .PHONY: install
    79.6  install: all
    79.7 -	[ -d $(DESTDIR)/usr/bin ] || $(INSTALL_DIR) $(DESTDIR)/usr/bin
    79.8 -	$(INSTALL_PROG) $(TARGET) $(DESTDIR)/usr/bin
    79.9 +	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
   79.10 +	$(INSTALL_PROG) $(TARGET) $(DESTDIR)$(BINDIR)
   79.11  
   79.12  .PHONY: install-recurse
   79.13  	: No sense in installing miniterm on the Xen box.
    80.1 --- a/tools/python/xen/xend/XendDomainInfo.py	Tue Jan 22 08:27:29 2008 -0700
    80.2 +++ b/tools/python/xen/xend/XendDomainInfo.py	Tue Jan 22 08:30:40 2008 -0700
    80.3 @@ -535,6 +535,11 @@ class XendDomainInfo:
    80.4                      self._createDevice(dev_type, dev_config_dict)
    80.5                  self._waitForDevice(dev_type, devid)
    80.6              except VmError, ex:
    80.7 +                del self.info['devices'][dev_uuid]
    80.8 +                if dev_type == 'tap':
    80.9 +                    self.info['vbd_refs'].remove(dev_uuid)
   80.10 +                else:
   80.11 +                    self.info['%s_refs' % dev_type].remove(dev_uuid)
   80.12                  raise ex
   80.13          else:
   80.14              devid = None
   80.15 @@ -1650,9 +1655,10 @@ class XendDomainInfo:
   80.16          self._recreateDom()
   80.17  
   80.18          # Set timer configration of domain
   80.19 -        if hvm:
   80.20 +        timer_mode = self.info["platform"].get("timer_mode")
   80.21 +        if hvm and timer_mode is not None:
   80.22              xc.hvm_set_param(self.domid, HVM_PARAM_TIMER_MODE,
   80.23 -                long(self.info["platform"].get("timer_mode")))
   80.24 +                             long(timer_mode))
   80.25  
   80.26          # Set maximum number of vcpus in domain
   80.27          xc.domain_max_vcpus(self.domid, int(self.info['VCPUs_max']))
    81.1 --- a/tools/security/Makefile	Tue Jan 22 08:27:29 2008 -0700
    81.2 +++ b/tools/security/Makefile	Tue Jan 22 08:30:40 2008 -0700
    81.3 @@ -44,9 +44,9 @@ ifndef XEN_PYTHON_NATIVE_INSTALL
    81.4  install: LIBPATH=$(shell PYTHONPATH=../python/xen/util python -c "import auxbin; print auxbin.libpath()")
    81.5  endif
    81.6  install: all $(ACM_CONFIG_FILE)
    81.7 -	$(INSTALL_DIR) $(DESTDIR)/usr/sbin
    81.8 -	$(INSTALL_PROG) $(ACM_INST_TOOLS) $(DESTDIR)/usr/sbin
    81.9 -	$(INSTALL_PROG) $(ACM_EZPOLICY) $(DESTDIR)/usr/sbin
   81.10 +	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
   81.11 +	$(INSTALL_PROG) $(ACM_INST_TOOLS) $(DESTDIR)$(SBINDIR)
   81.12 +	$(INSTALL_PROG) $(ACM_EZPOLICY) $(DESTDIR)$(SBINDIR)
   81.13  	$(INSTALL_DIR) $(DESTDIR)$(ACM_CONFIG_DIR)
   81.14  	$(INSTALL_DIR) $(DESTDIR)$(ACM_POLICY_DIR)
   81.15  	$(INSTALL_DATA) policies/$(ACM_SCHEMA) $(DESTDIR)$(ACM_POLICY_DIR)
    82.1 --- a/tools/vnet/doc/Makefile	Tue Jan 22 08:27:29 2008 -0700
    82.2 +++ b/tools/vnet/doc/Makefile	Tue Jan 22 08:30:40 2008 -0700
    82.3 @@ -13,8 +13,6 @@ LATEX2HTML	:= latex2html
    82.4  DOXYGEN		:= doxygen
    82.5  POD2MAN		:= pod2man
    82.6  
    82.7 -MAN_DIR		:= /usr/share/man
    82.8 -
    82.9  DOC_MAN5SRC	:= $(wildcard man/*.pod.5)
   82.10  DOC_MAN1SRC	:= $(wildcard man/*.pod.1)
   82.11  DOC_MAN1	:= $(patsubst man/%.pod.1,man1/%.1,$(DOC_MAN1SRC))
   82.12 @@ -47,7 +45,7 @@ clean:
   82.13  
   82.14  .PHONY:  install
   82.15   install: all
   82.16 -	$(INSTALL_DIR) $(DESTDIR)$(MAN_DIR)
   82.17 -	$(CP) -dR man1 $(DESTDIR)$(MAN_DIR)
   82.18 -	$(CP) -dR man5 $(DESTDIR)$(MAN_DIR)
   82.19 +	$(INSTALL_DIR) $(DESTDIR)$(MANDIR)
   82.20 +	$(CP) -dR man1 $(DESTDIR)$(MANDIR)
   82.21 +	$(CP) -dR man5 $(DESTDIR)$(MANDIR)
   82.22  
    83.1 --- a/tools/vnet/libxutil/Makefile	Tue Jan 22 08:27:29 2008 -0700
    83.2 +++ b/tools/vnet/libxutil/Makefile	Tue Jan 22 08:30:40 2008 -0700
    83.3 @@ -71,11 +71,11 @@ check-for-zlib:
    83.4  
    83.5  .PHONY: install
    83.6  install: build
    83.7 -	[ -d $(DESTDIR)/usr/$(LIBDIR) ] || $(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
    83.8 -	$(INSTALL_PROG) libxutil.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
    83.9 -	$(INSTALL_DATA) libxutil.a $(DESTDIR)/usr/$(LIBDIR)
   83.10 -	ln -sf libxutil.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxutil.so.$(MAJOR)
   83.11 -	ln -sf libxutil.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxutil.so
   83.12 +	$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
   83.13 +	$(INSTALL_PROG) libxutil.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
   83.14 +	$(INSTALL_DATA) libxutil.a $(DESTDIR)$(LIBDIR)
   83.15 +	ln -sf libxutil.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxutil.so.$(MAJOR)
   83.16 +	ln -sf libxutil.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxutil.so
   83.17  
   83.18  .PHONY: clean
   83.19  clean:
    84.1 --- a/tools/vnet/scripts/Makefile	Tue Jan 22 08:27:29 2008 -0700
    84.2 +++ b/tools/vnet/scripts/Makefile	Tue Jan 22 08:30:40 2008 -0700
    84.3 @@ -3,15 +3,13 @@
    84.4  XEN_ROOT        = ../../..
    84.5  include $(XEN_ROOT)/tools/Rules.mk
    84.6  
    84.7 -SBIN_DIR        = $(DESTDIR)/usr/sbin
    84.8 -
    84.9  .PHONY: all
   84.10  all:
   84.11  
   84.12  .PHONY: install
   84.13  install:
   84.14 -	$(INSTALL_DIR) $(SBIN_DIR)
   84.15 -	$(INSTALL_PROG) vn $(SBIN_DIR)
   84.16 +	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
   84.17 +	$(INSTALL_PROG) vn $(DESTDIR)$(SBINDIR)
   84.18  
   84.19  .PHONY: clean
   84.20  clean:
    85.1 --- a/tools/vnet/vnetd/Makefile	Tue Jan 22 08:27:29 2008 -0700
    85.2 +++ b/tools/vnet/vnetd/Makefile	Tue Jan 22 08:30:40 2008 -0700
    85.3 @@ -29,8 +29,6 @@ all: vnetd
    85.4  
    85.5  INSTALL_PROG ?= $(INSTALL) -m0755 -p
    85.6  
    85.7 -VNETD_INSTALL_DIR = /usr/sbin
    85.8 -
    85.9  INCLUDES += -I$(LIBXUTIL_DIR)
   85.10  INCLUDES += -I$(VNET_MODULE_DIR)
   85.11  INCLUDES += -I$(shell pwd)
   85.12 @@ -111,8 +109,8 @@ vnetd: $(VNETD_OBJ)
   85.13  
   85.14  .PHONY: install
   85.15  install: vnetd
   85.16 -	mkdir -p $(DESTDIR)$(VNETD_INSTALL_DIR)
   85.17 -	$(INSTALL_PROG) vnetd $(DESTDIR)$(VNETD_INSTALL_DIR)
   85.18 +	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
   85.19 +	$(INSTALL_PROG) vnetd $(DESTDIR)$(SBINDIR)
   85.20  
   85.21  .PHONY: clean
   85.22  clean:
    86.1 --- a/tools/xcutils/Makefile	Tue Jan 22 08:27:29 2008 -0700
    86.2 +++ b/tools/xcutils/Makefile	Tue Jan 22 08:30:40 2008 -0700
    86.3 @@ -11,7 +11,7 @@
    86.4  XEN_ROOT	= ../..
    86.5  include $(XEN_ROOT)/tools/Rules.mk
    86.6  
    86.7 -PROGRAMS_INSTALL_DIR = /usr/$(LIBDIR)/xen/bin
    86.8 +PROGRAMS_INSTALL_DIR = $(LIBDIR)/xen/bin
    86.9  
   86.10  INCLUDES += -I $(XEN_LIBXC) -I $(XEN_XENSTORE)
   86.11  
    87.1 --- a/tools/xenmon/Makefile	Tue Jan 22 08:27:29 2008 -0700
    87.2 +++ b/tools/xenmon/Makefile	Tue Jan 22 08:30:40 2008 -0700
    87.3 @@ -13,8 +13,6 @@
    87.4  XEN_ROOT=../..
    87.5  include $(XEN_ROOT)/tools/Rules.mk
    87.6  
    87.7 -sbindir=/usr/sbin
    87.8 -
    87.9  CFLAGS  += -Werror
   87.10  CFLAGS  += -I $(XEN_XC)
   87.11  CFLAGS  += -I $(XEN_LIBXC)
   87.12 @@ -31,10 +29,10 @@ build: $(BIN)
   87.13  
   87.14  .PHONY: install
   87.15  install: build
   87.16 -	[ -d $(DESTDIR)$(sbindir) ] || $(INSTALL_DIR) $(DESTDIR)$(sbindir)
   87.17 -	$(INSTALL_PROG) xenbaked $(DESTDIR)$(sbindir)/xenbaked
   87.18 -	$(INSTALL_PROG) xentrace_setmask  $(DESTDIR)$(sbindir)/xentrace_setmask
   87.19 -	$(INSTALL_PROG) xenmon.py  $(DESTDIR)$(sbindir)/xenmon.py
   87.20 +	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
   87.21 +	$(INSTALL_PROG) xenbaked $(DESTDIR)$(SBINDIR)/xenbaked
   87.22 +	$(INSTALL_PROG) xentrace_setmask  $(DESTDIR)$(SBINDIR)/xentrace_setmask
   87.23 +	$(INSTALL_PROG) xenmon.py  $(DESTDIR)$(SBINDIR)/xenmon.py
   87.24  
   87.25  .PHONY: clean
   87.26  clean:
    88.1 --- a/tools/xenstat/xentop/Makefile	Tue Jan 22 08:27:29 2008 -0700
    88.2 +++ b/tools/xenstat/xentop/Makefile	Tue Jan 22 08:30:40 2008 -0700
    88.3 @@ -18,11 +18,6 @@ ifneq ($(XENSTAT_XENTOP),y)
    88.4  all install xentop:
    88.5  else
    88.6  
    88.7 -prefix=/usr
    88.8 -mandir=$(prefix)/share/man
    88.9 -man1dir=$(mandir)/man1
   88.10 -sbindir=$(prefix)/sbin
   88.11 -
   88.12  CFLAGS += -DGCC_PRINTF -Wall -Werror -I$(XEN_LIBXENSTAT)
   88.13  LDFLAGS += -L$(XEN_LIBXENSTAT)
   88.14  LDLIBS += -lxenstat $(CURSES_LIBS) $(SOCKET_LIBS)
   88.15 @@ -33,9 +28,10 @@ all: xentop
   88.16  
   88.17  .PHONY: install
   88.18  install: xentop xentop.1
   88.19 -	$(INSTALL_PROG) xentop $(DESTDIR)$(sbindir)/xentop
   88.20 -	$(INSTALL_DIR) $(DESTDIR)$(man1dir)
   88.21 -	$(INSTALL_DATA) xentop.1 $(DESTDIR)$(man1dir)/xentop.1
   88.22 +	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
   88.23 +	$(INSTALL_PROG) xentop $(DESTDIR)$(SBINDIR)/xentop
   88.24 +	$(INSTALL_DIR) $(DESTDIR)$(MAN1DIR)
   88.25 +	$(INSTALL_DATA) xentop.1 $(DESTDIR)$(MAN1DIR)/xentop.1
   88.26  
   88.27  endif
   88.28  
    89.1 --- a/tools/xenstore/Makefile	Tue Jan 22 08:27:29 2008 -0700
    89.2 +++ b/tools/xenstore/Makefile	Tue Jan 22 08:30:40 2008 -0700
    89.3 @@ -81,20 +81,20 @@ tarball: clean
    89.4  install: all
    89.5  	$(INSTALL_DIR) $(DESTDIR)/var/run/xenstored
    89.6  	$(INSTALL_DIR) $(DESTDIR)/var/lib/xenstored
    89.7 -	$(INSTALL_DIR) $(DESTDIR)/usr/bin
    89.8 -	$(INSTALL_DIR) $(DESTDIR)/usr/sbin
    89.9 -	$(INSTALL_DIR) $(DESTDIR)/usr/include
   89.10 -	$(INSTALL_PROG) xenstored $(DESTDIR)/usr/sbin
   89.11 -	$(INSTALL_PROG) $(CLIENTS) $(DESTDIR)/usr/bin
   89.12 -	$(INSTALL_PROG) xenstore-control $(DESTDIR)/usr/bin
   89.13 -	$(INSTALL_PROG) xenstore-ls $(DESTDIR)/usr/bin
   89.14 -	$(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)
   89.15 -	$(INSTALL_PROG) libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)
   89.16 -	ln -sf libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)/usr/$(LIBDIR)/libxenstore.so.$(MAJOR)
   89.17 -	ln -sf libxenstore.so.$(MAJOR) $(DESTDIR)/usr/$(LIBDIR)/libxenstore.so
   89.18 -	$(INSTALL_DATA) libxenstore.a $(DESTDIR)/usr/$(LIBDIR)
   89.19 -	$(INSTALL_DATA) xs.h $(DESTDIR)/usr/include
   89.20 -	$(INSTALL_DATA) xs_lib.h $(DESTDIR)/usr/include
   89.21 +	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
   89.22 +	$(INSTALL_DIR) $(DESTDIR)$(SBINDIR)
   89.23 +	$(INSTALL_DIR) $(DESTDIR)$(INCLUDEDIR)
   89.24 +	$(INSTALL_PROG) xenstored $(DESTDIR)$(SBINDIR)
   89.25 +	$(INSTALL_PROG) $(CLIENTS) $(DESTDIR)$(BINDIR)
   89.26 +	$(INSTALL_PROG) xenstore-control $(DESTDIR)$(BINDIR)
   89.27 +	$(INSTALL_PROG) xenstore-ls $(DESTDIR)$(BINDIR)
   89.28 +	$(INSTALL_DIR) $(DESTDIR)$(LIBDIR)
   89.29 +	$(INSTALL_PROG) libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)
   89.30 +	ln -sf libxenstore.so.$(MAJOR).$(MINOR) $(DESTDIR)$(LIBDIR)/libxenstore.so.$(MAJOR)
   89.31 +	ln -sf libxenstore.so.$(MAJOR) $(DESTDIR)$(LIBDIR)/libxenstore.so
   89.32 +	$(INSTALL_DATA) libxenstore.a $(DESTDIR)$(LIBDIR)
   89.33 +	$(INSTALL_DATA) xs.h $(DESTDIR)$(INCLUDEDIR)
   89.34 +	$(INSTALL_DATA) xs_lib.h $(DESTDIR)$(INCLUDEDIR)
   89.35  
   89.36  -include $(PROG_DEP)
   89.37  
    90.1 --- a/tools/xentrace/Makefile	Tue Jan 22 08:27:29 2008 -0700
    90.2 +++ b/tools/xentrace/Makefile	Tue Jan 22 08:30:40 2008 -0700
    90.3 @@ -35,17 +35,14 @@ build: $(BIN) $(LIBBIN)
    90.4  
    90.5  .PHONY: install
    90.6  install: build
    90.7 -	[ -d $(DESTDIR)/usr/bin ] || $(INSTALL_DIR) $(DESTDIR)/usr/bin
    90.8 -	[ -z "$(LIBBIN)" ] || [ -d $(DESTDIR)/usr/$(LIBDIR)/xen/bin ] || \
    90.9 -		$(INSTALL_DIR) $(DESTDIR)/usr/$(LIBDIR)/xen/bin
   90.10 -	[ -d $(DESTDIR)/usr/share/man/man1 ] || \
   90.11 -		$(INSTALL_DIR) $(DESTDIR)/usr/share/man/man1
   90.12 -	[ -d $(DESTDIR)/usr/share/man/man8 ] || \
   90.13 -		$(INSTALL_DIR) $(DESTDIR)/usr/share/man/man8
   90.14 -	$(INSTALL_PROG) $(BIN) $(SCRIPTS) $(DESTDIR)/usr/bin
   90.15 -	[ -z "$(LIBBIN)" ] || $(INSTALL_PROG) $(LIBBIN) $(DESTDIR)/usr/$(LIBDIR)/xen/bin
   90.16 -	$(INSTALL_DATA) $(MAN1) $(DESTDIR)/usr/share/man/man1
   90.17 -	$(INSTALL_DATA) $(MAN8) $(DESTDIR)/usr/share/man/man8
   90.18 +	$(INSTALL_DIR) $(DESTDIR)$(BINDIR)
   90.19 +	[ -z "$(LIBBIN)" ] || $(INSTALL_DIR) $(DESTDIR)$(LIBDIR)/xen/bin
   90.20 +	$(INSTALL_DIR) $(DESTDIR)$(MAN1DIR)
   90.21 +	$(INSTALL_DIR) $(DESTDIR)$(MAN8DIR)
   90.22 +	$(INSTALL_PROG) $(BIN) $(SCRIPTS) $(DESTDIR)$(BINDIR)
   90.23 +	[ -z "$(LIBBIN)" ] || $(INSTALL_PROG) $(LIBBIN) $(DESTDIR)$(LIBDIR)/xen/bin
   90.24 +	$(INSTALL_DATA) $(MAN1) $(DESTDIR)$(MAN1DIR)
   90.25 +	$(INSTALL_DATA) $(MAN8) $(DESTDIR)$(MAN8DIR)
   90.26  
   90.27  .PHONY: clean
   90.28  clean:
    91.1 --- a/xen/arch/x86/cpu/intel_cacheinfo.c	Tue Jan 22 08:27:29 2008 -0700
    91.2 +++ b/xen/arch/x86/cpu/intel_cacheinfo.c	Tue Jan 22 08:30:40 2008 -0700
    91.3 @@ -1,6 +1,16 @@
    91.4 +/*
    91.5 + *      Routines to indentify caches on Intel CPU.
    91.6 + *
    91.7 + *      Changes:
    91.8 + *      Venkatesh Pallipadi	: Adding cache identification through cpuid(4)
    91.9 + *		Ashok Raj <ashok.raj@intel.com>: Work with CPU hotplug infrastructure.
   91.10 + *	Andi Kleen / Andreas Herrmann	: CPUID4 emulation on AMD.
   91.11 + */
   91.12 +
   91.13  #include <xen/config.h>
   91.14  #include <xen/init.h>
   91.15  #include <xen/lib.h>
   91.16 +#include <xen/errno.h>
   91.17  #include <asm/processor.h>
   91.18  
   91.19  #define LVL_1_INST	1
   91.20 @@ -17,7 +27,7 @@ struct _cache_table
   91.21  };
   91.22  
   91.23  /* all the cache descriptor types we care about (no TLB or trace cache entries) */
   91.24 -static struct _cache_table cache_table[] __devinitdata =
   91.25 +static struct _cache_table cache_table[] __cpuinitdata =
   91.26  {
   91.27  	{ 0x06, LVL_1_INST, 8 },	/* 4-way set assoc, 32 byte line size */
   91.28  	{ 0x08, LVL_1_INST, 16 },	/* 4-way set assoc, 32 byte line size */
   91.29 @@ -30,13 +40,23 @@ static struct _cache_table cache_table[]
   91.30  	{ 0x2c, LVL_1_DATA, 32 },	/* 8-way set assoc, 64 byte line size */
   91.31  	{ 0x30, LVL_1_INST, 32 },	/* 8-way set assoc, 64 byte line size */
   91.32  	{ 0x39, LVL_2,      128 },	/* 4-way set assoc, sectored cache, 64 byte line size */
   91.33 +	{ 0x3a, LVL_2,      192 },	/* 6-way set assoc, sectored cache, 64 byte line size */
   91.34  	{ 0x3b, LVL_2,      128 },	/* 2-way set assoc, sectored cache, 64 byte line size */
   91.35  	{ 0x3c, LVL_2,      256 },	/* 4-way set assoc, sectored cache, 64 byte line size */
   91.36 +	{ 0x3d, LVL_2,      384 },	/* 6-way set assoc, sectored cache, 64 byte line size */
   91.37 +	{ 0x3e, LVL_2,      512 },	/* 4-way set assoc, sectored cache, 64 byte line size */
   91.38  	{ 0x41, LVL_2,      128 },	/* 4-way set assoc, 32 byte line size */
   91.39  	{ 0x42, LVL_2,      256 },	/* 4-way set assoc, 32 byte line size */
   91.40  	{ 0x43, LVL_2,      512 },	/* 4-way set assoc, 32 byte line size */
   91.41  	{ 0x44, LVL_2,      1024 },	/* 4-way set assoc, 32 byte line size */
   91.42  	{ 0x45, LVL_2,      2048 },	/* 4-way set assoc, 32 byte line size */
   91.43 +	{ 0x46, LVL_3,      4096 },	/* 4-way set assoc, 64 byte line size */
   91.44 +	{ 0x47, LVL_3,      8192 },	/* 8-way set assoc, 64 byte line size */
   91.45 +	{ 0x49, LVL_3,      4096 },	/* 16-way set assoc, 64 byte line size */
   91.46 +	{ 0x4a, LVL_3,      6144 },	/* 12-way set assoc, 64 byte line size */
   91.47 +	{ 0x4b, LVL_3,      8192 },	/* 16-way set assoc, 64 byte line size */
   91.48 +	{ 0x4c, LVL_3,     12288 },	/* 12-way set assoc, 64 byte line size */
   91.49 +	{ 0x4d, LVL_3,     16384 },	/* 16-way set assoc, 64 byte line size */
   91.50  	{ 0x60, LVL_1_DATA, 16 },	/* 8-way set assoc, sectored cache, 64 byte line size */
   91.51  	{ 0x66, LVL_1_DATA, 8 },	/* 4-way set assoc, sectored cache, 64 byte line size */
   91.52  	{ 0x67, LVL_1_DATA, 16 },	/* 4-way set assoc, sectored cache, 64 byte line size */
   91.53 @@ -44,6 +64,7 @@ static struct _cache_table cache_table[]
   91.54  	{ 0x70, LVL_TRACE,  12 },	/* 8-way set assoc */
   91.55  	{ 0x71, LVL_TRACE,  16 },	/* 8-way set assoc */
   91.56  	{ 0x72, LVL_TRACE,  32 },	/* 8-way set assoc */
   91.57 +	{ 0x73, LVL_TRACE,  64 },	/* 8-way set assoc */
   91.58  	{ 0x78, LVL_2,    1024 },	/* 4-way set assoc, 64 byte line size */
   91.59  	{ 0x79, LVL_2,     128 },	/* 8-way set assoc, sectored cache, 64 byte line size */
   91.60  	{ 0x7a, LVL_2,     256 },	/* 8-way set assoc, sectored cache, 64 byte line size */
   91.61 @@ -60,15 +81,276 @@ static struct _cache_table cache_table[]
   91.62  	{ 0x00, 0, 0}
   91.63  };
   91.64  
   91.65 -unsigned int __devinit init_intel_cacheinfo(struct cpuinfo_x86 *c)
   91.66 +
   91.67 +enum _cache_type
   91.68 +{
   91.69 +	CACHE_TYPE_NULL	= 0,
   91.70 +	CACHE_TYPE_DATA = 1,
   91.71 +	CACHE_TYPE_INST = 2,
   91.72 +	CACHE_TYPE_UNIFIED = 3
   91.73 +};
   91.74 +
   91.75 +union _cpuid4_leaf_eax {
   91.76 +	struct {
   91.77 +		enum _cache_type	type:5;
   91.78 +		unsigned int		level:3;
   91.79 +		unsigned int		is_self_initializing:1;
   91.80 +		unsigned int		is_fully_associative:1;
   91.81 +		unsigned int		reserved:4;
   91.82 +		unsigned int		num_threads_sharing:12;
   91.83 +		unsigned int		num_cores_on_die:6;
   91.84 +	} split;
   91.85 +	u32 full;
   91.86 +};
   91.87 +
   91.88 +union _cpuid4_leaf_ebx {
   91.89 +	struct {
   91.90 +		unsigned int		coherency_line_size:12;
   91.91 +		unsigned int		physical_line_partition:10;
   91.92 +		unsigned int		ways_of_associativity:10;
   91.93 +	} split;
   91.94 +	u32 full;
   91.95 +};
   91.96 +
   91.97 +union _cpuid4_leaf_ecx {
   91.98 +	struct {
   91.99 +		unsigned int		number_of_sets:32;
  91.100 +	} split;
  91.101 +	u32 full;
  91.102 +};
  91.103 +
  91.104 +struct _cpuid4_info {
  91.105 +	union _cpuid4_leaf_eax eax;
  91.106 +	union _cpuid4_leaf_ebx ebx;
  91.107 +	union _cpuid4_leaf_ecx ecx;
  91.108 +	unsigned long size;
  91.109 +	cpumask_t shared_cpu_map;
  91.110 +};
  91.111 +
  91.112 +unsigned short			num_cache_leaves;
  91.113 +
  91.114 +/* AMD doesn't have CPUID4. Emulate it here to report the same
  91.115 +   information to the user.  This makes some assumptions about the machine:
  91.116 +   L2 not shared, no SMT etc. that is currently true on AMD CPUs.
  91.117 +
  91.118 +   In theory the TLBs could be reported as fake type (they are in "dummy").
  91.119 +   Maybe later */
  91.120 +union l1_cache {
  91.121 +	struct {
  91.122 +		unsigned line_size : 8;
  91.123 +		unsigned lines_per_tag : 8;
  91.124 +		unsigned assoc : 8;
  91.125 +		unsigned size_in_kb : 8;
  91.126 +	};
  91.127 +	unsigned val;
  91.128 +};
  91.129 +
  91.130 +union l2_cache {
  91.131 +	struct {
  91.132 +		unsigned line_size : 8;
  91.133 +		unsigned lines_per_tag : 4;
  91.134 +		unsigned assoc : 4;
  91.135 +		unsigned size_in_kb : 16;
  91.136 +	};
  91.137 +	unsigned val;
  91.138 +};
  91.139 +
  91.140 +union l3_cache {
  91.141 +	struct {
  91.142 +		unsigned line_size : 8;
  91.143 +		unsigned lines_per_tag : 4;
  91.144 +		unsigned assoc : 4;
  91.145 +		unsigned res : 2;
  91.146 +		unsigned size_encoded : 14;
  91.147 +	};
  91.148 +	unsigned val;
  91.149 +};
  91.150 +
  91.151 +static const unsigned short assocs[] = {
  91.152 +	[1] = 1, [2] = 2, [4] = 4, [6] = 8,
  91.153 +	[8] = 16, [0xa] = 32, [0xb] = 48,
  91.154 +	[0xc] = 64,
  91.155 +	[0xf] = 0xffff // ??
  91.156 +};
  91.157 +
  91.158 +static const unsigned char levels[] = { 1, 1, 2, 3 };
  91.159 +static const unsigned char types[] = { 1, 2, 3, 3 };
  91.160 +
  91.161 +static void __cpuinit amd_cpuid4(int leaf, union _cpuid4_leaf_eax *eax,
  91.162 +		       union _cpuid4_leaf_ebx *ebx,
  91.163 +		       union _cpuid4_leaf_ecx *ecx)
  91.164 +{
  91.165 +	unsigned dummy;
  91.166 +	unsigned line_size, lines_per_tag, assoc, size_in_kb;
  91.167 +	union l1_cache l1i, l1d;
  91.168 +	union l2_cache l2;
  91.169 +	union l3_cache l3;
  91.170 +	union l1_cache *l1 = &l1d;
  91.171 +
  91.172 +	eax->full = 0;
  91.173 +	ebx->full = 0;
  91.174 +	ecx->full = 0;
  91.175 +
  91.176 +	cpuid(0x80000005, &dummy, &dummy, &l1d.val, &l1i.val);
  91.177 +	cpuid(0x80000006, &dummy, &dummy, &l2.val, &l3.val);
  91.178 +
  91.179 +	switch (leaf) {
  91.180 +	case 1:
  91.181 +		l1 = &l1i;
  91.182 +	case 0:
  91.183 +		if (!l1->val)
  91.184 +			return;
  91.185 +		assoc = l1->assoc;
  91.186 +		line_size = l1->line_size;
  91.187 +		lines_per_tag = l1->lines_per_tag;
  91.188 +		size_in_kb = l1->size_in_kb;
  91.189 +		break;
  91.190 +	case 2:
  91.191 +		if (!l2.val)
  91.192 +			return;
  91.193 +		assoc = l2.assoc;
  91.194 +		line_size = l2.line_size;
  91.195 +		lines_per_tag = l2.lines_per_tag;
  91.196 +		/* cpu_data has errata corrections for K7 applied */
  91.197 +		size_in_kb = current_cpu_data.x86_cache_size;
  91.198 +		break;
  91.199 +	case 3:
  91.200 +		if (!l3.val)
  91.201 +			return;
  91.202 +		assoc = l3.assoc;
  91.203 +		line_size = l3.line_size;
  91.204 +		lines_per_tag = l3.lines_per_tag;
  91.205 +		size_in_kb = l3.size_encoded * 512;
  91.206 +		break;
  91.207 +	default:
  91.208 +		return;
  91.209 +	}
  91.210 +
  91.211 +	eax->split.is_self_initializing = 1;
  91.212 +	eax->split.type = types[leaf];
  91.213 +	eax->split.level = levels[leaf];
  91.214 +	if (leaf == 3)
  91.215 +		eax->split.num_threads_sharing = current_cpu_data.x86_max_cores - 1;
  91.216 +	else
  91.217 +		eax->split.num_threads_sharing = 0;
  91.218 +	eax->split.num_cores_on_die = current_cpu_data.x86_max_cores - 1;
  91.219 +
  91.220 +
  91.221 +	if (assoc == 0xf)
  91.222 +		eax->split.is_fully_associative = 1;
  91.223 +	ebx->split.coherency_line_size = line_size - 1;
  91.224 +	ebx->split.ways_of_associativity = assocs[assoc] - 1;
  91.225 +	ebx->split.physical_line_partition = lines_per_tag - 1;
  91.226 +	ecx->split.number_of_sets = (size_in_kb * 1024) / line_size /
  91.227 +		(ebx->split.ways_of_associativity + 1) - 1;
  91.228 +}
  91.229 +
  91.230 +static int __cpuinit cpuid4_cache_lookup(int index, struct _cpuid4_info *this_leaf)
  91.231 +{
  91.232 +	union _cpuid4_leaf_eax 	eax;
  91.233 +	union _cpuid4_leaf_ebx 	ebx;
  91.234 +	union _cpuid4_leaf_ecx 	ecx;
  91.235 +	unsigned		edx;
  91.236 +
  91.237 +	if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD)
  91.238 +		amd_cpuid4(index, &eax, &ebx, &ecx);
  91.239 +	else
  91.240 +		cpuid_count(4, index, &eax.full, &ebx.full, &ecx.full,  &edx);
  91.241 +	if (eax.split.type == CACHE_TYPE_NULL)
  91.242 +		return -EIO; /* better error ? */
  91.243 +
  91.244 +	this_leaf->eax = eax;
  91.245 +	this_leaf->ebx = ebx;
  91.246 +	this_leaf->ecx = ecx;
  91.247 +	this_leaf->size = (ecx.split.number_of_sets + 1) *
  91.248 +		(ebx.split.coherency_line_size + 1) *
  91.249 +		(ebx.split.physical_line_partition + 1) *
  91.250 +		(ebx.split.ways_of_associativity + 1);
  91.251 +	return 0;
  91.252 +}
  91.253 +
  91.254 +static int __cpuinit find_num_cache_leaves(void)
  91.255 +{
  91.256 +	unsigned int		eax, ebx, ecx, edx;
  91.257 +	union _cpuid4_leaf_eax	cache_eax;
  91.258 +	int 			i = -1;
  91.259 +
  91.260 +	do {
  91.261 +		++i;
  91.262 +		/* Do cpuid(4) loop to find out num_cache_leaves */
  91.263 +		cpuid_count(4, i, &eax, &ebx, &ecx, &edx);
  91.264 +		cache_eax.full = eax;
  91.265 +	} while (cache_eax.split.type != CACHE_TYPE_NULL);
  91.266 +	return i;
  91.267 +}
  91.268 +
  91.269 +unsigned int __cpuinit init_intel_cacheinfo(struct cpuinfo_x86 *c)
  91.270  {
  91.271  	unsigned int trace = 0, l1i = 0, l1d = 0, l2 = 0, l3 = 0; /* Cache sizes */
  91.272 +	unsigned int new_l1d = 0, new_l1i = 0; /* Cache sizes from cpuid(4) */
  91.273 +	unsigned int new_l2 = 0, new_l3 = 0, i; /* Cache sizes from cpuid(4) */
  91.274 +	unsigned int l2_id = 0, l3_id = 0, num_threads_sharing, index_msb;
  91.275  
  91.276 -	if (c->cpuid_level > 1) {
  91.277 +	if (c->cpuid_level > 3) {
  91.278 +		static int is_initialized;
  91.279 +
  91.280 +		if (is_initialized == 0) {
  91.281 +			/* Init num_cache_leaves from boot CPU */
  91.282 +			num_cache_leaves = find_num_cache_leaves();
  91.283 +			is_initialized++;
  91.284 +		}
  91.285 +
  91.286 +		/*
  91.287 +		 * Whenever possible use cpuid(4), deterministic cache
  91.288 +		 * parameters cpuid leaf to find the cache details
  91.289 +		 */
  91.290 +		for (i = 0; i < num_cache_leaves; i++) {
  91.291 +			struct _cpuid4_info this_leaf;
  91.292 +
  91.293 +			int retval;
  91.294 +
  91.295 +			retval = cpuid4_cache_lookup(i, &this_leaf);
  91.296 +			if (retval >= 0) {
  91.297 +				switch(this_leaf.eax.split.level) {
  91.298 +				    case 1:
  91.299 +					if (this_leaf.eax.split.type ==
  91.300 +							CACHE_TYPE_DATA)
  91.301 +						new_l1d = this_leaf.size/1024;
  91.302 +					else if (this_leaf.eax.split.type ==
  91.303 +							CACHE_TYPE_INST)
  91.304 +						new_l1i = this_leaf.size/1024;
  91.305 +					break;
  91.306 +				    case 2:
  91.307 +					new_l2 = this_leaf.size/1024;
  91.308 +					num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
  91.309 +					index_msb = get_count_order(num_threads_sharing);
  91.310 +					l2_id = c->apicid >> index_msb;
  91.311 +					break;
  91.312 +				    case 3:
  91.313 +					new_l3 = this_leaf.size/1024;
  91.314 +					num_threads_sharing = 1 + this_leaf.eax.split.num_threads_sharing;
  91.315 +					index_msb = get_count_order(num_threads_sharing);
  91.316 +					l3_id = c->apicid >> index_msb;
  91.317 +					break;
  91.318 +				    default:
  91.319 +					break;
  91.320 +				}
  91.321 +			}
  91.322 +		}
  91.323 +	}
  91.324 +	/*
  91.325 +	 * Don't use cpuid2 if cpuid4 is supported. For P4, we use cpuid2 for
  91.326 +	 * trace cache
  91.327 +	 */
  91.328 +	if ((num_cache_leaves == 0 || c->x86 == 15) && c->cpuid_level > 1) {
  91.329  		/* supports eax=2  call */
  91.330  		int i, j, n;
  91.331  		int regs[4];
  91.332  		unsigned char *dp = (unsigned char *)regs;
  91.333 +		int only_trace = 0;
  91.334 +
  91.335 +		if (num_cache_leaves != 0 && c->x86 == 15)
  91.336 +			only_trace = 1;
  91.337  
  91.338  		/* Number of times to iterate */
  91.339  		n = cpuid_eax(2) & 0xFF;
  91.340 @@ -90,6 +372,8 @@ unsigned int __devinit init_intel_cachei
  91.341  				while (cache_table[k].descriptor != 0)
  91.342  				{
  91.343  					if (cache_table[k].descriptor == des) {
  91.344 +						if (only_trace && cache_table[k].cache_type != LVL_TRACE)
  91.345 +							break;
  91.346  						switch (cache_table[k].cache_type) {
  91.347  						case LVL_1_INST:
  91.348  							l1i += cache_table[k].size;
  91.349 @@ -115,28 +399,39 @@ unsigned int __devinit init_intel_cachei
  91.350  				}
  91.351  			}
  91.352  		}
  91.353 +	}
  91.354  
  91.355 -		if ( trace )
  91.356 -			printk (KERN_INFO "CPU: Trace cache: %dK uops", trace);
  91.357 -		else if ( l1i )
  91.358 -			printk (KERN_INFO "CPU: L1 I cache: %dK", l1i);
  91.359 -		if ( l1d )
  91.360 -			printk(", L1 D cache: %dK\n", l1d);
  91.361 -		else
  91.362 -			printk("\n");
  91.363 -		if ( l2 )
  91.364 -			printk(KERN_INFO "CPU: L2 cache: %dK\n", l2);
  91.365 -		if ( l3 )
  91.366 -			printk(KERN_INFO "CPU: L3 cache: %dK\n", l3);
  91.367 +	if (new_l1d)
  91.368 +		l1d = new_l1d;
  91.369  
  91.370 -		/*
  91.371 -		 * This assumes the L3 cache is shared; it typically lives in
  91.372 -		 * the northbridge.  The L1 caches are included by the L2
  91.373 -		 * cache, and so should not be included for the purpose of
  91.374 -		 * SMP switching weights.
  91.375 -		 */
  91.376 -		c->x86_cache_size = l2 ? l2 : (l1i+l1d);
  91.377 +	if (new_l1i)
  91.378 +		l1i = new_l1i;
  91.379 +
  91.380 +	if (new_l2) {
  91.381 +		l2 = new_l2;
  91.382  	}
  91.383  
  91.384 +	if (new_l3) {
  91.385 +		l3 = new_l3;
  91.386 +	}
  91.387 +
  91.388 +	if (trace)
  91.389 +		printk (KERN_INFO "CPU: Trace cache: %dK uops", trace);
  91.390 +	else if ( l1i )
  91.391 +		printk (KERN_INFO "CPU: L1 I cache: %dK", l1i);
  91.392 +
  91.393 +	if (l1d)
  91.394 +		printk(", L1 D cache: %dK\n", l1d);
  91.395 +	else
  91.396 +		printk("\n");
  91.397 +
  91.398 +	if (l2)
  91.399 +		printk(KERN_INFO "CPU: L2 cache: %dK\n", l2);
  91.400 +
  91.401 +	if (l3)
  91.402 +		printk(KERN_INFO "CPU: L3 cache: %dK\n", l3);
  91.403 +
  91.404 +	c->x86_cache_size = l3 ? l3 : (l2 ? l2 : (l1i+l1d));
  91.405 +
  91.406  	return l2;
  91.407  }
    92.1 --- a/xen/arch/x86/hvm/vmx/vtd/Makefile	Tue Jan 22 08:27:29 2008 -0700
    92.2 +++ b/xen/arch/x86/hvm/vmx/vtd/Makefile	Tue Jan 22 08:30:40 2008 -0700
    92.3 @@ -2,3 +2,4 @@ obj-y += intel-iommu.o
    92.4  obj-y += dmar.o
    92.5  obj-y += utils.o
    92.6  obj-y += io.o
    92.7 +obj-y += qinval.o
    93.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    93.2 +++ b/xen/arch/x86/hvm/vmx/vtd/extern.h	Tue Jan 22 08:30:40 2008 -0700
    93.3 @@ -0,0 +1,55 @@
    93.4 +/*
    93.5 + * Copyright (c) 2006, Intel Corporation.
    93.6 + *
    93.7 + * This program is free software; you can redistribute it and/or modify it
    93.8 + * under the terms and conditions of the GNU General Public License,
    93.9 + * version 2, as published by the Free Software Foundation.
   93.10 + *
   93.11 + * This program is distributed in the hope it will be useful, but WITHOUT
   93.12 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   93.13 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   93.14 + * more details.
   93.15 + *
   93.16 + * You should have received a copy of the GNU General Public License along with
   93.17 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   93.18 + * Place - Suite 330, Boston, MA 02111-1307 USA.
   93.19 + *
   93.20 + * Copyright (C) Allen Kay <allen.m.kay@intel.com>
   93.21 + * Copyright (C) Weidong Han <weidong.han@intel.com>
   93.22 + */
   93.23 +
   93.24 +#ifndef _VTD_EXTERN_H_
   93.25 +#define _VTD_EXTERN_H_
   93.26 +
   93.27 +#include "dmar.h"
   93.28 +
   93.29 +extern int iommu_setup_done;
   93.30 +extern int vtd2_thurley_enabled;
   93.31 +extern int vtd2_qinval_enabled;
   93.32 +
   93.33 +extern spinlock_t ioapic_lock;
   93.34 +extern struct qi_ctrl *qi_ctrl;
   93.35 +extern struct ir_ctrl *ir_ctrl;
   93.36 +
   93.37 +void print_iommu_regs(struct acpi_drhd_unit *drhd);
   93.38 +void print_vtd_entries(struct domain *d, struct iommu *iommu,
   93.39 +                       int bus, int devfn, unsigned long gmfn);
   93.40 +
   93.41 +int qinval_setup(struct iommu *iommu);
   93.42 +int queue_invalidate_context(struct iommu *iommu,
   93.43 +    u16 did, u16 source_id, u8 function_mask, u8 granu);
   93.44 +int queue_invalidate_iotlb(struct iommu *iommu,
   93.45 +    u8 granu, u8 dr, u8 dw, u16 did, u8 am, u8 ih, u64 addr);
   93.46 +int queue_invalidate_iec(struct iommu *iommu,
   93.47 +    u8 granu, u8 im, u16 iidx);
   93.48 +int invalidate_sync(struct iommu *iommu);
   93.49 +int iommu_flush_iec_global(struct iommu *iommu);
   93.50 +int iommu_flush_iec_index(struct iommu *iommu, u8 im, u16 iidx);
   93.51 +void gsi_remapping(unsigned int gsi);
   93.52 +void print_iommu_regs(struct acpi_drhd_unit *drhd);
   93.53 +int vtd_hw_check(void);
   93.54 +struct iommu * ioapic_to_iommu(unsigned int apic_id);
   93.55 +struct acpi_drhd_unit * ioapic_to_drhd(unsigned int apic_id);
   93.56 +void clear_fault_bits(struct iommu *iommu);
   93.57 +
   93.58 +#endif // _VTD_EXTERN_H_
    94.1 --- a/xen/arch/x86/hvm/vmx/vtd/intel-iommu.c	Tue Jan 22 08:27:29 2008 -0700
    94.2 +++ b/xen/arch/x86/hvm/vmx/vtd/intel-iommu.c	Tue Jan 22 08:30:40 2008 -0700
    94.3 @@ -34,13 +34,10 @@
    94.4  #include "pci-direct.h"
    94.5  #include "pci_regs.h"
    94.6  #include "msi.h"
    94.7 +#include "extern.h"
    94.8  
    94.9  #define domain_iommu_domid(d) ((d)->arch.hvm_domain.hvm_iommu.iommu_domid)
   94.10  
   94.11 -extern void print_iommu_regs(struct acpi_drhd_unit *drhd);
   94.12 -extern void print_vtd_entries(struct domain *d, int bus, int devfn,
   94.13 -                              unsigned long gmfn);
   94.14 -
   94.15  static spinlock_t domid_bitmap_lock;    /* protect domain id bitmap */
   94.16  static int domid_bitmap_size;           /* domain id bitmap size in bit */
   94.17  static void *domid_bitmap;              /* iommu domain id bitmap */
   94.18 @@ -304,11 +301,12 @@ static void iommu_flush_write_buffer(str
   94.19  }
   94.20  
   94.21  /* return value determine if we need a write buffer flush */
   94.22 -static int __iommu_flush_context(
   94.23 -    struct iommu *iommu,
   94.24 +static int flush_context_reg(
   94.25 +    void *_iommu,
   94.26      u16 did, u16 source_id, u8 function_mask, u64 type,
   94.27      int non_present_entry_flush)
   94.28  {
   94.29 +    struct iommu *iommu = (struct iommu *) _iommu;
   94.30      u64 val = 0;
   94.31      unsigned long flag;
   94.32      unsigned long start_time;
   94.33 @@ -367,14 +365,16 @@ static int __iommu_flush_context(
   94.34  static int inline iommu_flush_context_global(
   94.35      struct iommu *iommu, int non_present_entry_flush)
   94.36  {
   94.37 -    return __iommu_flush_context(iommu, 0, 0, 0, DMA_CCMD_GLOBAL_INVL,
   94.38 +    struct iommu_flush *flush = iommu_get_flush(iommu);
   94.39 +    return flush->context(iommu, 0, 0, 0, DMA_CCMD_GLOBAL_INVL,
   94.40                                   non_present_entry_flush);
   94.41  }
   94.42  
   94.43  static int inline iommu_flush_context_domain(
   94.44      struct iommu *iommu, u16 did, int non_present_entry_flush)
   94.45  {
   94.46 -    return __iommu_flush_context(iommu, did, 0, 0, DMA_CCMD_DOMAIN_INVL,
   94.47 +    struct iommu_flush *flush = iommu_get_flush(iommu);
   94.48 +    return flush->context(iommu, did, 0, 0, DMA_CCMD_DOMAIN_INVL,
   94.49                                   non_present_entry_flush);
   94.50  }
   94.51  
   94.52 @@ -382,16 +382,18 @@ static int inline iommu_flush_context_de
   94.53      struct iommu *iommu, u16 did, u16 source_id,
   94.54      u8 function_mask, int non_present_entry_flush)
   94.55  {
   94.56 -    return __iommu_flush_context(iommu, did, source_id, function_mask,
   94.57 +    struct iommu_flush *flush = iommu_get_flush(iommu);
   94.58 +    return flush->context(iommu, did, source_id, function_mask,
   94.59                                   DMA_CCMD_DEVICE_INVL,
   94.60                                   non_present_entry_flush);
   94.61  }
   94.62  
   94.63  /* return value determine if we need a write buffer flush */
   94.64 -static int __iommu_flush_iotlb(struct iommu *iommu, u16 did,
   94.65 +static int flush_iotlb_reg(void *_iommu, u16 did,
   94.66                                 u64 addr, unsigned int size_order, u64 type,
   94.67                                 int non_present_entry_flush)
   94.68  {
   94.69 +    struct iommu *iommu = (struct iommu *) _iommu;
   94.70      int tlb_offset = ecap_iotlb_offset(iommu->ecap);
   94.71      u64 val = 0, val_iva = 0;
   94.72      unsigned long flag;
   94.73 @@ -467,14 +469,16 @@ static int __iommu_flush_iotlb(struct io
   94.74  static int inline iommu_flush_iotlb_global(struct iommu *iommu,
   94.75                                             int non_present_entry_flush)
   94.76  {
   94.77 -    return __iommu_flush_iotlb(iommu, 0, 0, 0, DMA_TLB_GLOBAL_FLUSH,
   94.78 +    struct iommu_flush *flush = iommu_get_flush(iommu);
   94.79 +    return flush->iotlb(iommu, 0, 0, 0, DMA_TLB_GLOBAL_FLUSH,
   94.80                                 non_present_entry_flush);
   94.81  }
   94.82  
   94.83  static int inline iommu_flush_iotlb_dsi(struct iommu *iommu, u16 did,
   94.84                                          int non_present_entry_flush)
   94.85  {
   94.86 -    return __iommu_flush_iotlb(iommu, did, 0, 0, DMA_TLB_DSI_FLUSH,
   94.87 +    struct iommu_flush *flush = iommu_get_flush(iommu);
   94.88 +    return flush->iotlb(iommu, did, 0, 0, DMA_TLB_DSI_FLUSH,
   94.89                                 non_present_entry_flush);
   94.90  }
   94.91  
   94.92 @@ -498,6 +502,7 @@ static int inline iommu_flush_iotlb_psi(
   94.93      u64 addr, unsigned int pages, int non_present_entry_flush)
   94.94  {
   94.95      unsigned int align;
   94.96 +    struct iommu_flush *flush = iommu_get_flush(iommu);
   94.97  
   94.98      BUG_ON(addr & (~PAGE_MASK_4K));
   94.99      BUG_ON(pages == 0);
  94.100 @@ -520,7 +525,7 @@ static int inline iommu_flush_iotlb_psi(
  94.101      addr >>= PAGE_SHIFT_4K + align;
  94.102      addr <<= PAGE_SHIFT_4K + align;
  94.103  
  94.104 -    return __iommu_flush_iotlb(iommu, did, addr, align,
  94.105 +    return flush->iotlb(iommu, did, addr, align,
  94.106                                 DMA_TLB_PSI_FLUSH, non_present_entry_flush);
  94.107  }
  94.108  
  94.109 @@ -701,7 +706,7 @@ static int iommu_enable_translation(stru
  94.110      unsigned long flags;
  94.111  
  94.112      dprintk(XENLOG_INFO VTDPREFIX,
  94.113 -            "iommu_enable_translation: enabling vt-d translation\n");
  94.114 +            "iommu_enable_translation: iommu->reg = %p\n", iommu->reg);
  94.115      spin_lock_irqsave(&iommu->register_lock, flags);
  94.116      iommu->gcmd |= DMA_GCMD_TE;
  94.117      dmar_writel(iommu->reg, DMAR_GCMD_REG, iommu->gcmd);
  94.118 @@ -746,16 +751,49 @@ static int iommu_page_fault_do_one(struc
  94.119                                     u8 fault_reason, u16 source_id, u32 addr)
  94.120  {
  94.121      dprintk(XENLOG_WARNING VTDPREFIX,
  94.122 -            "iommu_page_fault:%s: DEVICE %x:%x.%x addr %x REASON %x\n",
  94.123 -            (type ? "DMA Read" : "DMA Write"),
  94.124 -            (source_id >> 8), PCI_SLOT(source_id & 0xFF),
  94.125 -            PCI_FUNC(source_id & 0xFF), addr, fault_reason);
  94.126 +            "iommu_fault:%s: %x:%x.%x addr %x REASON %x iommu->reg = %p\n",
  94.127 +            (type ? "DMA Read" : "DMA Write"), (source_id >> 8),
  94.128 +            PCI_SLOT(source_id & 0xFF), PCI_FUNC(source_id & 0xFF), addr,
  94.129 +            fault_reason, iommu->reg);
  94.130  
  94.131 -    print_vtd_entries(current->domain, (source_id >> 8),(source_id & 0xff),
  94.132 -                      (addr >> PAGE_SHIFT)); 
  94.133 +    if (fault_reason < 0x20) 
  94.134 +        print_vtd_entries(current->domain, iommu, (source_id >> 8),
  94.135 +                          (source_id & 0xff), (addr >> PAGE_SHIFT)); 
  94.136 +
  94.137      return 0;
  94.138  }
  94.139  
  94.140 +static void iommu_fault_status(u32 fault_status)
  94.141 +{
  94.142 +    if (fault_status & DMA_FSTS_PFO)
  94.143 +        dprintk(XENLOG_ERR VTDPREFIX,
  94.144 +            "iommu_fault_status: Fault Overflow\n");
  94.145 +    else
  94.146 +    if (fault_status & DMA_FSTS_PPF)
  94.147 +        dprintk(XENLOG_ERR VTDPREFIX,
  94.148 +            "iommu_fault_status: Primary Pending Fault\n");
  94.149 +    else
  94.150 +    if (fault_status & DMA_FSTS_AFO)
  94.151 +        dprintk(XENLOG_ERR VTDPREFIX,
  94.152 +            "iommu_fault_status: Advanced Fault Overflow\n");
  94.153 +    else
  94.154 +    if (fault_status & DMA_FSTS_APF)
  94.155 +        dprintk(XENLOG_ERR VTDPREFIX,
  94.156 +            "iommu_fault_status: Advanced Pending Fault\n");
  94.157 +    else
  94.158 +    if (fault_status & DMA_FSTS_IQE)
  94.159 +        dprintk(XENLOG_ERR VTDPREFIX,
  94.160 +            "iommu_fault_status: Invalidation Queue Error\n");
  94.161 +    else
  94.162 +    if (fault_status & DMA_FSTS_ICE)
  94.163 +        dprintk(XENLOG_ERR VTDPREFIX,
  94.164 +            "iommu_fault_status: Invalidation Completion Error\n");
  94.165 +    else
  94.166 +    if (fault_status & DMA_FSTS_ITE)
  94.167 +        dprintk(XENLOG_ERR VTDPREFIX,
  94.168 +            "iommu_fault_status: Invalidation Time-out Error\n");
  94.169 +}
  94.170 +
  94.171  #define PRIMARY_FAULT_REG_LEN (16)
  94.172  static void iommu_page_fault(int vector, void *dev_id,
  94.173                               struct cpu_user_regs *regs)
  94.174 @@ -772,6 +810,8 @@ static void iommu_page_fault(int vector,
  94.175      fault_status = dmar_readl(iommu->reg, DMAR_FSTS_REG);
  94.176      spin_unlock_irqrestore(&iommu->register_lock, flags);
  94.177  
  94.178 +    iommu_fault_status(fault_status);
  94.179 +
  94.180      /* FIXME: ignore advanced fault log */
  94.181      if ( !(fault_status & DMA_FSTS_PPF) )
  94.182          return;
  94.183 @@ -936,6 +976,8 @@ struct iommu *iommu_alloc(void *hw_data)
  94.184  {
  94.185      struct acpi_drhd_unit *drhd = (struct acpi_drhd_unit *) hw_data;
  94.186      struct iommu *iommu;
  94.187 +    struct qi_ctrl *qi_ctrl;
  94.188 +    struct ir_ctrl *ir_ctrl;
  94.189  
  94.190      if ( nr_iommus > MAX_IOMMUS )
  94.191      {
  94.192 @@ -951,9 +993,10 @@ struct iommu *iommu_alloc(void *hw_data)
  94.193  
  94.194      set_fixmap_nocache(FIX_IOMMU_REGS_BASE_0 + nr_iommus, drhd->address);
  94.195      iommu->reg = (void *) fix_to_virt(FIX_IOMMU_REGS_BASE_0 + nr_iommus);
  94.196 -    dprintk(XENLOG_INFO VTDPREFIX,
  94.197 -            "iommu_alloc: iommu->reg = %p drhd->address = %lx\n",
  94.198 -            iommu->reg, drhd->address);
  94.199 +
  94.200 +    printk("iommu_alloc: iommu->reg = %p drhd->address = %lx\n",
  94.201 +           iommu->reg, drhd->address);
  94.202 +
  94.203      nr_iommus++;
  94.204  
  94.205      if ( !iommu->reg )
  94.206 @@ -965,9 +1008,19 @@ struct iommu *iommu_alloc(void *hw_data)
  94.207      iommu->cap = dmar_readq(iommu->reg, DMAR_CAP_REG);
  94.208      iommu->ecap = dmar_readq(iommu->reg, DMAR_ECAP_REG);
  94.209  
  94.210 +    printk("iommu_alloc: cap = %"PRIx64"\n",iommu->cap);
  94.211 +    printk("iommu_alloc: ecap = %"PRIx64"\n", iommu->ecap);
  94.212 +
  94.213      spin_lock_init(&iommu->lock);
  94.214      spin_lock_init(&iommu->register_lock);
  94.215  
  94.216 +    qi_ctrl = iommu_qi_ctrl(iommu);
  94.217 +    spin_lock_init(&qi_ctrl->qinval_lock);
  94.218 +    spin_lock_init(&qi_ctrl->qinval_poll_lock);
  94.219 +
  94.220 +    ir_ctrl = iommu_ir_ctrl(iommu);
  94.221 +    spin_lock_init(&ir_ctrl->iremap_lock);
  94.222 +
  94.223      drhd->iommu = iommu;
  94.224      return iommu;
  94.225   error:
  94.226 @@ -1071,8 +1124,10 @@ static int domain_context_mapping_one(
  94.227  
  94.228      if ( ecap_pass_thru(iommu->ecap) )
  94.229          context_set_translation_type(*context, CONTEXT_TT_PASS_THRU);
  94.230 +#ifdef CONTEXT_PASSTHRU
  94.231      else
  94.232      {
  94.233 +#endif
  94.234          if ( !hd->pgd )
  94.235          {
  94.236              struct dma_pte *pgd = (struct dma_pte *)alloc_xenheap_page();
  94.237 @@ -1087,7 +1142,9 @@ static int domain_context_mapping_one(
  94.238   
  94.239          context_set_address_root(*context, virt_to_maddr(hd->pgd));
  94.240          context_set_translation_type(*context, CONTEXT_TT_MULTI_LEVEL);
  94.241 +#ifdef CONTEXT_PASSTHRU
  94.242      }
  94.243 +#endif
  94.244  
  94.245      context_set_fault_enable(*context);
  94.246      context_set_present(*context);
  94.247 @@ -1462,7 +1519,6 @@ void iommu_domain_teardown(struct domain
  94.248                  if ( pgd[0].val != 0 )
  94.249                      free_xenheap_page((void*)maddr_to_virt(
  94.250                          dma_pte_addr(pgd[0])));
  94.251 -
  94.252                  free_xenheap_page((void *)hd->pgd);
  94.253              }
  94.254              break;
  94.255 @@ -1503,9 +1559,11 @@ int iommu_map_page(struct domain *d, pad
  94.256      drhd = list_entry(acpi_drhd_units.next, typeof(*drhd), list);
  94.257      iommu = drhd->iommu;
  94.258  
  94.259 +#ifdef CONTEXT_PASSTHRU
  94.260      /* do nothing if dom0 and iommu supports pass thru */
  94.261      if ( ecap_pass_thru(iommu->ecap) && (d->domain_id == 0) )
  94.262          return 0;
  94.263 +#endif
  94.264  
  94.265      pg = addr_to_dma_page(d, gfn << PAGE_SHIFT_4K);
  94.266      if ( !pg )
  94.267 @@ -1538,9 +1596,11 @@ int iommu_unmap_page(struct domain *d, d
  94.268      drhd = list_entry(acpi_drhd_units.next, typeof(*drhd), list);
  94.269      iommu = drhd->iommu;
  94.270  
  94.271 +#ifdef CONTEXT_PASSTHRU
  94.272      /* do nothing if dom0 and iommu supports pass thru */
  94.273      if ( ecap_pass_thru(iommu->ecap) && (d->domain_id == 0) )
  94.274          return 0;
  94.275 +#endif
  94.276  
  94.277      dma_pte_clear_one(d, gfn << PAGE_SHIFT_4K);
  94.278  
  94.279 @@ -1711,7 +1771,7 @@ void __init setup_dom0_devices(void)
  94.280                  pdev->bus, PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn));
  94.281  }
  94.282  
  94.283 -void clear_fault_bit(struct iommu *iommu)
  94.284 +void clear_fault_bits(struct iommu *iommu)
  94.285  {
  94.286      u64 val;
  94.287  
  94.288 @@ -1722,13 +1782,15 @@ void clear_fault_bit(struct iommu *iommu
  94.289          iommu->reg,
  94.290          cap_fault_reg_offset(dmar_readq(iommu->reg,DMAR_CAP_REG))+8,
  94.291          val);
  94.292 -    dmar_writel(iommu->reg, DMAR_FSTS_REG, DMA_FSTS_PFO);
  94.293 +    dmar_writel(iommu->reg, DMAR_FSTS_REG, DMA_FSTS_FAULTS);
  94.294  }
  94.295  
  94.296  static int init_vtd_hw(void)
  94.297  {
  94.298      struct acpi_drhd_unit *drhd;
  94.299      struct iommu *iommu;
  94.300 +    struct iommu_flush *flush = NULL;
  94.301 +    int vector;
  94.302      int ret;
  94.303  
  94.304      for_each_drhd_unit ( drhd )
  94.305 @@ -1740,8 +1802,23 @@ static int init_vtd_hw(void)
  94.306              gdprintk(XENLOG_ERR VTDPREFIX, "IOMMU: set root entry failed\n");
  94.307              return -EIO;
  94.308          }
  94.309 +
  94.310 +        vector = iommu_set_interrupt(iommu);
  94.311 +        dma_msi_data_init(iommu, vector);
  94.312 +        dma_msi_addr_init(iommu, cpu_physical_id(first_cpu(cpu_online_map)));
  94.313 +        iommu->vector = vector;
  94.314 +        clear_fault_bits(iommu);
  94.315 +        dmar_writel(iommu->reg, DMAR_FECTL_REG, 0);
  94.316 +
  94.317 +        /* initialize flush functions */
  94.318 +        flush = iommu_get_flush(iommu);
  94.319 +        flush->context = flush_context_reg;
  94.320 +        flush->iotlb = flush_iotlb_reg;
  94.321 +
  94.322 +        if ( qinval_setup(iommu) != 0);
  94.323 +            dprintk(XENLOG_ERR VTDPREFIX,
  94.324 +                    "Queued Invalidation hardware not found\n");
  94.325      }
  94.326 -
  94.327      return 0;
  94.328  }
  94.329  
  94.330 @@ -1749,20 +1826,13 @@ static int enable_vtd_translation(void)
  94.331  {
  94.332      struct acpi_drhd_unit *drhd;
  94.333      struct iommu *iommu;
  94.334 -    int vector = 0;
  94.335  
  94.336      for_each_drhd_unit ( drhd )
  94.337      {
  94.338          iommu = drhd->iommu;
  94.339 -        vector = iommu_set_interrupt(iommu);
  94.340 -        dma_msi_data_init(iommu, vector);
  94.341 -        dma_msi_addr_init(iommu, cpu_physical_id(first_cpu(cpu_online_map)));
  94.342 -        iommu->vector = vector;
  94.343 -        clear_fault_bit(iommu);
  94.344          if ( iommu_enable_translation(iommu) )
  94.345              return -EIO;
  94.346      }
  94.347 -
  94.348      return 0;
  94.349  }
  94.350  
  94.351 @@ -1793,9 +1863,6 @@ int iommu_setup(void)
  94.352      spin_lock_init(&domid_bitmap_lock);
  94.353      INIT_LIST_HEAD(&hd->pdev_list);
  94.354  
  94.355 -    /* start from scratch */
  94.356 -    iommu_flush_all();
  94.357 -
  94.358      /* setup clflush size */
  94.359      x86_clflush_size = ((cpuid_ebx(1) >> 8) & 0xff) * 8;
  94.360  
  94.361 @@ -1815,12 +1882,12 @@ int iommu_setup(void)
  94.362      for ( i = 0; i < max_page; i++ )
  94.363          iommu_map_page(dom0, i, i);
  94.364  
  94.365 +    enable_vtd_translation();
  94.366      if ( init_vtd_hw() )
  94.367          goto error;
  94.368      setup_dom0_devices();
  94.369      setup_dom0_rmrr();
  94.370 -    if ( enable_vtd_translation() )
  94.371 -        goto error;
  94.372 +    iommu_flush_all();
  94.373  
  94.374      return 0;
  94.375  
    95.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    95.2 +++ b/xen/arch/x86/hvm/vmx/vtd/qinval.c	Tue Jan 22 08:30:40 2008 -0700
    95.3 @@ -0,0 +1,456 @@
    95.4 +/*
    95.5 + * Copyright (c) 2006, Intel Corporation.
    95.6 + *
    95.7 + * This program is free software; you can redistribute it and/or modify it
    95.8 + * under the terms and conditions of the GNU General Public License,
    95.9 + * version 2, as published by the Free Software Foundation.
   95.10 + *
   95.11 + * This program is distributed in the hope it will be useful, but WITHOUT
   95.12 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   95.13 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   95.14 + * more details.
   95.15 + *
   95.16 + * You should have received a copy of the GNU General Public License along with
   95.17 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   95.18 + * Place - Suite 330, Boston, MA 02111-1307 USA.
   95.19 + *
   95.20 + * Copyright (C) Allen Kay <allen.m.kay@intel.com>
   95.21 + * Copyright (C) Xiaohui Xin <xiaohui.xin@intel.com>
   95.22 + */
   95.23 +
   95.24 +
   95.25 +#include <xen/init.h>
   95.26 +#include <xen/irq.h>
   95.27 +#include <xen/spinlock.h>
   95.28 +#include <xen/sched.h>
   95.29 +#include <xen/xmalloc.h>
   95.30 +#include <xen/domain_page.h>
   95.31 +#include <asm/delay.h>
   95.32 +#include <asm/string.h>
   95.33 +#include <asm/iommu.h>
   95.34 +#include <asm/hvm/vmx/intel-iommu.h>
   95.35 +#include "dmar.h"
   95.36 +#include "vtd.h"
   95.37 +#include "pci-direct.h"
   95.38 +#include "pci_regs.h"
   95.39 +#include "msi.h"
   95.40 +#include "extern.h"
   95.41 +
   95.42 +static void print_qi_regs(struct iommu *iommu)
   95.43 +{
   95.44 +    u64 val;
   95.45 +
   95.46 +    val = dmar_readq(iommu->reg, DMAR_IQA_REG);
   95.47 +    printk("DMAR_IAQ_REG = %"PRIx64"\n", val);
   95.48 +
   95.49 +    val = dmar_readq(iommu->reg, DMAR_IQH_REG);
   95.50 +    printk("DMAR_IAH_REG = %"PRIx64"\n", val);
   95.51 +
   95.52 +    val = dmar_readq(iommu->reg, DMAR_IQT_REG);
   95.53 +    printk("DMAR_IAT_REG = %"PRIx64"\n", val);
   95.54 +}
   95.55 +
   95.56 +static int qinval_next_index(struct iommu *iommu)
   95.57 +{
   95.58 +    u64 val;
   95.59 +    val = dmar_readq(iommu->reg, DMAR_IQT_REG);
   95.60 +    return (val >> 4);
   95.61 +}
   95.62 +
   95.63 +static int qinval_update_qtail(struct iommu *iommu, int index)
   95.64 +{
   95.65 +    u64 val;
   95.66 +
   95.67 +    /* Need an ASSERT to insure that we have got register lock */
   95.68 +    val = (index < (QINVAL_ENTRY_NR-1)) ? (index + 1) : 0;
   95.69 +    dmar_writeq(iommu->reg, DMAR_IQT_REG, (val << 4));
   95.70 +    return 0;
   95.71 +}
   95.72 +
   95.73 +static int gen_cc_inv_dsc(struct iommu *iommu, int index,
   95.74 +    u16 did, u16 source_id, u8 function_mask, u8 granu)
   95.75 +{
   95.76 +    u64 *ptr64;
   95.77 +    unsigned long flags;
   95.78 +    struct qinval_entry * qinval_entry = NULL;
   95.79 +    struct qi_ctrl *qi_ctrl = iommu_qi_ctrl(iommu);
   95.80 +
   95.81 +    spin_lock_irqsave(&qi_ctrl->qinval_lock, flags);
   95.82 +    qinval_entry = &qi_ctrl->qinval[index];
   95.83 +    qinval_entry->q.cc_inv_dsc.lo.type = TYPE_INVAL_CONTEXT;
   95.84 +    qinval_entry->q.cc_inv_dsc.lo.granu = granu;
   95.85 +    qinval_entry->q.cc_inv_dsc.lo.res_1 = 0;
   95.86 +    qinval_entry->q.cc_inv_dsc.lo.did = did;
   95.87 +    qinval_entry->q.cc_inv_dsc.lo.sid = source_id;
   95.88 +    qinval_entry->q.cc_inv_dsc.lo.fm = function_mask;
   95.89 +    qinval_entry->q.cc_inv_dsc.lo.res_2 = 0;
   95.90 +    qinval_entry->q.cc_inv_dsc.hi.res = 0;
   95.91 +    spin_unlock_irqrestore(&qi_ctrl->qinval_lock, flags);
   95.92 +
   95.93 +    ptr64 = (u64 *)qinval_entry;
   95.94 +    return 0;
   95.95 +}
   95.96 +
   95.97 +int queue_invalidate_context(struct iommu *iommu,
   95.98 +    u16 did, u16 source_id, u8 function_mask, u8 granu)
   95.99 +{
  95.100 +    int ret = -1;
  95.101 +    unsigned long flags;
  95.102 +    int index = -1;
  95.103 +
  95.104 +    spin_lock_irqsave(&iommu->register_lock, flags);
  95.105 +    index = qinval_next_index(iommu);
  95.106 +    if (index == -1)
  95.107 +        return -EBUSY;
  95.108 +    ret = gen_cc_inv_dsc(iommu, index, did, source_id,
  95.109 +                         function_mask, granu);
  95.110 +    ret |= qinval_update_qtail(iommu, index);
  95.111 +    spin_unlock_irqrestore(&iommu->register_lock, flags);
  95.112 +    return ret;
  95.113 +}
  95.114 +
  95.115 +static int gen_iotlb_inv_dsc(struct iommu *iommu, int index,
  95.116 +    u8 granu, u8 dr, u8 dw, u16 did, u8 am, u8 ih, u64 addr)
  95.117 +{
  95.118 +    unsigned long flags;
  95.119 +    struct qinval_entry * qinval_entry = NULL;
  95.120 +    struct qi_ctrl *qi_ctrl = iommu_qi_ctrl(iommu);
  95.121 +
  95.122 +    if ( index == -1 )
  95.123 +        return -1;
  95.124 +    spin_lock_irqsave(&qi_ctrl->qinval_lock, flags);
  95.125 +
  95.126 +    qinval_entry = &qi_ctrl->qinval[index];
  95.127 +    qinval_entry->q.iotlb_inv_dsc.lo.type = TYPE_INVAL_IOTLB;
  95.128 +    qinval_entry->q.iotlb_inv_dsc.lo.granu = granu;
  95.129 +    qinval_entry->q.iotlb_inv_dsc.lo.dr = 0;
  95.130 +    qinval_entry->q.iotlb_inv_dsc.lo.dw = 0;
  95.131 +    qinval_entry->q.iotlb_inv_dsc.lo.res_1 = 0;
  95.132 +    qinval_entry->q.iotlb_inv_dsc.lo.did = did;
  95.133 +    qinval_entry->q.iotlb_inv_dsc.lo.res_2 = 0;
  95.134 +
  95.135 +    qinval_entry->q.iotlb_inv_dsc.hi.am = am;
  95.136 +    qinval_entry->q.iotlb_inv_dsc.hi.ih = ih;
  95.137 +    qinval_entry->q.iotlb_inv_dsc.hi.res_1 = 0;
  95.138 +    qinval_entry->q.iotlb_inv_dsc.hi.addr = addr;
  95.139 +
  95.140 +    spin_unlock_irqrestore(&qi_ctrl->qinval_lock, flags);
  95.141 +    return 0;
  95.142 +}
  95.143 +
  95.144 +int queue_invalidate_iotlb(struct iommu *iommu,
  95.145 +    u8 granu, u8 dr, u8 dw, u16 did, u8 am, u8 ih, u64 addr)
  95.146 +{
  95.147 +    int ret = -1;
  95.148 +    unsigned long flags;
  95.149 +    int index = -1;
  95.150 +
  95.151 +    spin_lock_irqsave(&iommu->register_lock, flags);
  95.152 +
  95.153 +    index = qinval_next_index(iommu);
  95.154 +    ret = gen_iotlb_inv_dsc(iommu, index, granu, dr, dw, did,
  95.155 +                            am, ih, addr);
  95.156 +    ret |= qinval_update_qtail(iommu, index);
  95.157 +    spin_unlock_irqrestore(&iommu->register_lock, flags);
  95.158 +    return ret;
  95.159 +}
  95.160 +
  95.161 +static int gen_wait_dsc(struct iommu *iommu, int index,
  95.162 +    u8 iflag, u8 sw, u8 fn, u32 sdata, volatile u32 *saddr)
  95.163 +{
  95.164 +    u64 *ptr64;
  95.165 +    unsigned long flags;
  95.166 +    struct qinval_entry * qinval_entry = NULL;
  95.167 +    struct qi_ctrl *qi_ctrl = iommu_qi_ctrl(iommu);
  95.168 +
  95.169 +    if ( index == -1 )
  95.170 +        return -1;
  95.171 +    spin_lock_irqsave(&qi_ctrl->qinval_lock, flags);
  95.172 +    qinval_entry = &qi_ctrl->qinval[index];
  95.173 +    qinval_entry->q.inv_wait_dsc.lo.type = TYPE_INVAL_WAIT;
  95.174 +    qinval_entry->q.inv_wait_dsc.lo.iflag = iflag;
  95.175 +    qinval_entry->q.inv_wait_dsc.lo.sw = sw;
  95.176 +    qinval_entry->q.inv_wait_dsc.lo.fn = fn;
  95.177 +    qinval_entry->q.inv_wait_dsc.lo.res_1 = 0;
  95.178 +    qinval_entry->q.inv_wait_dsc.lo.sdata = sdata;
  95.179 +    qinval_entry->q.inv_wait_dsc.hi.res_1 = 0;
  95.180 +    qinval_entry->q.inv_wait_dsc.hi.saddr = virt_to_maddr(saddr) >> 2;
  95.181 +    spin_unlock_irqrestore(&qi_ctrl->qinval_lock, flags);
  95.182 +    ptr64 = (u64 *)qinval_entry;
  95.183 +    return 0;
  95.184 +}
  95.185 +
  95.186 +static int queue_invalidate_wait(struct iommu *iommu,
  95.187 +    u8 iflag, u8 sw, u8 fn, u32 sdata, volatile u32 *saddr)
  95.188 +{
  95.189 +    unsigned long flags;
  95.190 +    unsigned long start_time;
  95.191 +    int index = -1;
  95.192 +    int ret = -1;
  95.193 +    struct qi_ctrl *qi_ctrl = iommu_qi_ctrl(iommu);
  95.194 +
  95.195 +    spin_lock_irqsave(&qi_ctrl->qinval_poll_lock, flags);
  95.196 +    spin_lock_irqsave(&iommu->register_lock, flags);
  95.197 +    index = qinval_next_index(iommu);
  95.198 +    if (*saddr == 1)
  95.199 +        *saddr = 0;
  95.200 +    ret = gen_wait_dsc(iommu, index, iflag, sw, fn, sdata, saddr);
  95.201 +    ret |= qinval_update_qtail(iommu, index);
  95.202 +    spin_unlock_irqrestore(&iommu->register_lock, flags);
  95.203 +
  95.204 +    /* Now we don't support interrupt method */
  95.205 +    if ( sw )
  95.206 +    {
  95.207 +        /* In case all wait descriptor writes to same addr with same data */
  95.208 +        start_time = jiffies;
  95.209 +        while ( *saddr != 1 ) {
  95.210 +            if (time_after(jiffies, start_time + DMAR_OPERATION_TIMEOUT)) {
  95.211 +                print_qi_regs(iommu);
  95.212 +                panic("queue invalidate wait descriptor was not executed\n");
  95.213 +            }
  95.214 +            cpu_relax();
  95.215 +        }
  95.216 +    }
  95.217 +    spin_unlock_irqrestore(&qi_ctrl->qinval_poll_lock, flags);
  95.218 +    return ret;
  95.219 +}
  95.220 +
  95.221 +int invalidate_sync(struct iommu *iommu)
  95.222 +{
  95.223 +    int ret = -1;
  95.224 +    struct qi_ctrl *qi_ctrl = iommu_qi_ctrl(iommu);
  95.225 +
  95.226 +    if (qi_ctrl->qinval)
  95.227 +    {
  95.228 +        ret = queue_invalidate_wait(iommu,
  95.229 +            0, 1, 1, 1, &qi_ctrl->qinval_poll_status);
  95.230 +        return ret;
  95.231 +    }
  95.232 +    return 0;
  95.233 +}
  95.234 +
  95.235 +static int gen_dev_iotlb_inv_dsc(struct iommu *iommu, int index,
  95.236 +    u32 max_invs_pend, u16 sid, u16 size, u64 addr)
  95.237 +{
  95.238 +    unsigned long flags;
  95.239 +    struct qinval_entry * qinval_entry = NULL;
  95.240 +    struct qi_ctrl *qi_ctrl = iommu_qi_ctrl(iommu);
  95.241 +
  95.242 +    if ( index == -1 )
  95.243 +        return -1;
  95.244 +    spin_lock_irqsave(&qi_ctrl->qinval_lock, flags);
  95.245 +
  95.246 +    qinval_entry = &qi_ctrl->qinval[index];
  95.247 +    qinval_entry->q.dev_iotlb_inv_dsc.lo.type = TYPE_INVAL_DEVICE_IOTLB;
  95.248 +    qinval_entry->q.dev_iotlb_inv_dsc.lo.res_1 = 0;
  95.249 +    qinval_entry->q.dev_iotlb_inv_dsc.lo.max_invs_pend = max_invs_pend;
  95.250 +    qinval_entry->q.dev_iotlb_inv_dsc.lo.res_2 = 0;
  95.251 +    qinval_entry->q.dev_iotlb_inv_dsc.lo.sid = sid;
  95.252 +    qinval_entry->q.dev_iotlb_inv_dsc.lo.res_3 = 0;
  95.253 +
  95.254 +    qinval_entry->q.dev_iotlb_inv_dsc.hi.size = size;
  95.255 +    qinval_entry->q.dev_iotlb_inv_dsc.hi.addr = addr;
  95.256 +
  95.257 +    spin_unlock_irqrestore(&qi_ctrl->qinval_lock, flags);
  95.258 +    return 0;
  95.259 +}
  95.260 +
  95.261 +int queue_invalidate_device_iotlb(struct iommu *iommu,
  95.262 +    u32 max_invs_pend, u16 sid, u16 size, u64 addr)
  95.263 +{
  95.264 +    int ret = -1;
  95.265 +    unsigned long flags;
  95.266 +    int index = -1;
  95.267 +
  95.268 +    spin_lock_irqsave(&iommu->register_lock, flags);
  95.269 +    index = qinval_next_index(iommu);
  95.270 +    ret = gen_dev_iotlb_inv_dsc(iommu, index, max_invs_pend,
  95.271 +                                sid, size, addr);
  95.272 +    ret |= qinval_update_qtail(iommu, index);
  95.273 +    spin_unlock_irqrestore(&iommu->register_lock, flags);
  95.274 +    return ret;
  95.275 +}
  95.276 +
  95.277 +static int gen_iec_inv_dsc(struct iommu *iommu, int index,
  95.278 +    u8 granu, u8 im, u16 iidx)
  95.279 +{
  95.280 +    unsigned long flags;
  95.281 +    struct qinval_entry * qinval_entry = NULL;
  95.282 +    struct qi_ctrl *qi_ctrl = iommu_qi_ctrl(iommu);
  95.283 +
  95.284 +    if ( index == -1 )
  95.285 +        return -1;
  95.286 +    spin_lock_irqsave(&qi_ctrl->qinval_lock, flags);
  95.287 +
  95.288 +    qinval_entry = &qi_ctrl->qinval[index];
  95.289 +    qinval_entry->q.iec_inv_dsc.lo.type = TYPE_INVAL_IEC;
  95.290 +    qinval_entry->q.iec_inv_dsc.lo.granu = granu;
  95.291 +    qinval_entry->q.iec_inv_dsc.lo.res_1 = 0;
  95.292 +    qinval_entry->q.iec_inv_dsc.lo.im = im;
  95.293 +    qinval_entry->q.iec_inv_dsc.lo.iidx = iidx;
  95.294 +    qinval_entry->q.iec_inv_dsc.lo.res_2 = 0;
  95.295 +    qinval_entry->q.iec_inv_dsc.hi.res = 0;
  95.296 +
  95.297 +    spin_unlock_irqrestore(&qi_ctrl->qinval_lock, flags);
  95.298 +    return 0;
  95.299 +}
  95.300 +
  95.301 +int queue_invalidate_iec(struct iommu *iommu, u8 granu, u8 im, u16 iidx)
  95.302 +{
  95.303 +    int ret;
  95.304 +    unsigned long flags;
  95.305 +    int index = -1;
  95.306 +
  95.307 +    spin_lock_irqsave(&iommu->register_lock, flags);
  95.308 +    index = qinval_next_index(iommu);
  95.309 +    ret = gen_iec_inv_dsc(iommu, index, granu, im, iidx);
  95.310 +    ret |= qinval_update_qtail(iommu, index);
  95.311 +    spin_unlock_irqrestore(&iommu->register_lock, flags);
  95.312 +    return ret;
  95.313 +}
  95.314 +
  95.315 +u64 iec_cap;
  95.316 +int __iommu_flush_iec(struct iommu *iommu, u8 granu, u8 im, u16 iidx)
  95.317 +{
  95.318 +    int ret;
  95.319 +    ret = queue_invalidate_iec(iommu, granu, im, iidx);
  95.320 +    ret |= invalidate_sync(iommu);
  95.321 +
  95.322 +    /*
  95.323 +     * reading vt-d architecture register will ensure
  95.324 +     * draining happens in implementation independent way.
  95.325 +     */
  95.326 +    iec_cap = dmar_readq(iommu->reg, DMAR_CAP_REG);
  95.327 +    return ret;
  95.328 +}
  95.329 +
  95.330 +int iommu_flush_iec_global(struct iommu *iommu)
  95.331 +{
  95.332 +    return __iommu_flush_iec(iommu, IEC_GLOBAL_INVL, 0, 0);
  95.333 +}
  95.334 +
  95.335 +int iommu_flush_iec_index(struct iommu *iommu, u8 im, u16 iidx)
  95.336 +{
  95.337 +   return __iommu_flush_iec(iommu, IEC_INDEX_INVL, im, iidx);
  95.338 +}
  95.339 +
  95.340 +static int flush_context_qi(
  95.341 +    void *_iommu, u16 did, u16 sid, u8 fm, u64 type,
  95.342 +    int non_present_entry_flush)
  95.343 +{
  95.344 +    int ret = 0;
  95.345 +    struct iommu *iommu = (struct iommu *)_iommu;
  95.346 +    struct qi_ctrl *qi_ctrl = iommu_qi_ctrl(iommu);
  95.347 +
  95.348 +    /*
  95.349 +     * In the non-present entry flush case, if hardware doesn't cache
  95.350 +     * non-present entry we do nothing and if hardware cache non-present
  95.351 +     * entry, we flush entries of domain 0 (the domain id is used to cache
  95.352 +     * any non-present entries)
  95.353 +     */
  95.354 +    if ( non_present_entry_flush )
  95.355 +    {
  95.356 +        if ( !cap_caching_mode(iommu->cap) )
  95.357 +            return 1;
  95.358 +        else
  95.359 +            did = 0;
  95.360 +    }
  95.361 +
  95.362 +    if (qi_ctrl->qinval)
  95.363 +    {
  95.364 +        ret = queue_invalidate_context(iommu, did, sid, fm,
  95.365 +                                       type >> DMA_CCMD_INVL_GRANU_OFFSET);
  95.366 +        ret |= invalidate_sync(iommu);
  95.367 +    }
  95.368 +    return ret;
  95.369 +}
  95.370 +
  95.371 +static int flush_iotlb_qi(
  95.372 +    void *_iommu, u16 did,
  95.373 +    u64 addr, unsigned int size_order, u64 type,
  95.374 +    int non_present_entry_flush)
  95.375 +{
  95.376 +    u8 dr = 0, dw = 0;
  95.377 +    int ret = 0;
  95.378 +    struct iommu *iommu = (struct iommu *)_iommu;
  95.379 +    struct qi_ctrl *qi_ctrl = iommu_qi_ctrl(iommu);
  95.380 +
  95.381 +    /*
  95.382 +     * In the non-present entry flush case, if hardware doesn't cache
  95.383 +     * non-present entry we do nothing and if hardware cache non-present
  95.384 +     * entry, we flush entries of domain 0 (the domain id is used to cache
  95.385 +     * any non-present entries)
  95.386 +     */
  95.387 +    if ( non_present_entry_flush )
  95.388 +    {
  95.389 +        if ( !cap_caching_mode(iommu->cap) )
  95.390 +            return 1;
  95.391 +        else
  95.392 +            did = 0;
  95.393 +    }
  95.394 +
  95.395 +    if (qi_ctrl->qinval) {
  95.396 +        /* use queued invalidation */
  95.397 +        if (cap_write_drain(iommu->cap))
  95.398 +            dw = 1;
  95.399 +        if (cap_read_drain(iommu->cap))
  95.400 +            dr = 1;
  95.401 +        /* Need to conside the ih bit later */
  95.402 +        ret = queue_invalidate_iotlb(iommu,
  95.403 +                  (type >> DMA_TLB_FLUSH_GRANU_OFFSET), dr,
  95.404 +                  dw, did, (u8)size_order, 0, addr);
  95.405 +        ret |= invalidate_sync(iommu);
  95.406 +    }
  95.407 +    return ret;
  95.408 +}
  95.409 +
  95.410 +int qinval_setup(struct iommu *iommu)
  95.411 +{
  95.412 +    unsigned long start_time;
  95.413 +    u64 paddr;
  95.414 +    u32 status = 0;
  95.415 +    struct qi_ctrl *qi_ctrl;
  95.416 +    struct iommu_flush *flush;
  95.417 +
  95.418 +    qi_ctrl = iommu_qi_ctrl(iommu);
  95.419 +    flush = iommu_get_flush(iommu);
  95.420 +
  95.421 +    if ( !ecap_queued_inval(iommu->ecap) )
  95.422 +        return -ENODEV;
  95.423 +
  95.424 +    if (qi_ctrl->qinval == NULL) {
  95.425 +        qi_ctrl->qinval = alloc_xenheap_page();
  95.426 +        if (qi_ctrl->qinval == NULL)
  95.427 +            panic("Cannot allocate memory for qi_ctrl->qinval\n");
  95.428 +        memset((u8*)qi_ctrl->qinval, 0, PAGE_SIZE_4K);
  95.429 +        flush->context = flush_context_qi;
  95.430 +        flush->iotlb = flush_iotlb_qi;
  95.431 +    }
  95.432 +    paddr = virt_to_maddr(qi_ctrl->qinval);
  95.433 +
  95.434 +    /* Setup Invalidation Queue Address(IQA) register with the
  95.435 +     * address of the page we just allocated.  QS field at
  95.436 +     * bits[2:0] to indicate size of queue is one 4KB page.
  95.437 +     * That's 256 entries.  Queued Head (IQH) and Queue Tail (IQT)
  95.438 +     * registers are automatically reset to 0 with write
  95.439 +     * to IQA register.
  95.440 +     */
  95.441 +    dmar_writeq(iommu->reg, DMAR_IQA_REG, paddr);
  95.442 +
  95.443 +    /* enable queued invalidation hardware */
  95.444 +    iommu->gcmd |= DMA_GCMD_QIE;
  95.445 +    dmar_writel(iommu->reg, DMAR_GCMD_REG, iommu->gcmd);
  95.446 +
  95.447 +    /* Make sure hardware complete it */
  95.448 +    start_time = jiffies;
  95.449 +    while (1) {
  95.450 +        status = dmar_readl(iommu->reg, DMAR_GSTS_REG);
  95.451 +        if (status & DMA_GSTS_QIES)
  95.452 +            break;
  95.453 +        if (time_after(jiffies, start_time + DMAR_OPERATION_TIMEOUT))
  95.454 +            panic("Cannot set QIE field for queue invalidation\n");
  95.455 +        cpu_relax();
  95.456 +    }
  95.457 +    status = 0;
  95.458 +    return status;
  95.459 +}
    96.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    96.2 +++ b/xen/arch/x86/hvm/vmx/vtd/vtd.h	Tue Jan 22 08:30:40 2008 -0700
    96.3 @@ -0,0 +1,54 @@
    96.4 +/*
    96.5 + * Copyright (c) 2006, Intel Corporation.
    96.6 + *
    96.7 + * This program is free software; you can redistribute it and/or modify it
    96.8 + * under the terms and conditions of the GNU General Public License,
    96.9 + * version 2, as published by the Free Software Foundation.
   96.10 + *
   96.11 + * This program is distributed in the hope it will be useful, but WITHOUT
   96.12 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   96.13 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
   96.14 + * more details.
   96.15 + *
   96.16 + * You should have received a copy of the GNU General Public License along with
   96.17 + * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
   96.18 + * Place - Suite 330, Boston, MA 02111-1307 USA.
   96.19 + *
   96.20 + * Copyright (C) Allen Kay <allen.m.kay@intel.com>
   96.21 + * Copyright (C) Weidong Han <weidong.han@intel.com>
   96.22 + */
   96.23 +
   96.24 +#ifndef _VTD_H_
   96.25 +#define _VTD_H_
   96.26 +
   96.27 +#include <xen/list.h>
   96.28 +#include <asm/iommu.h>
   96.29 +
   96.30 +#define VTDPREFIX "[VT-D]" 
   96.31 +
   96.32 +#define DMAR_OPERATION_TIMEOUT (HZ*60) /* 1m */
   96.33 +#define time_after(a,b)         \
   96.34 +        (typecheck(unsigned long, a) && \
   96.35 +         typecheck(unsigned long, b) && \
   96.36 +         ((long)(b) - (long)(a) < 0))
   96.37 +
   96.38 +struct IO_APIC_route_remap_entry {
   96.39 +    union {
   96.40 +        u64 val;
   96.41 +        struct {
   96.42 +            u64 vector:8,
   96.43 +            delivery_mode:3,
   96.44 +            index_15:1,
   96.45 +            delivery_status:1,
   96.46 +            polarity:1,
   96.47 +            irr:1,
   96.48 +            trigger:1,
   96.49 +            mask:1,
   96.50 +            reserved:31,
   96.51 +            format:1,
   96.52 +            index_0_14:15;
   96.53 +        };
   96.54 +    };
   96.55 +};
   96.56 +
   96.57 +#endif // _VTD_H_
    97.1 --- a/xen/arch/x86/oprofile/nmi_int.c	Tue Jan 22 08:27:29 2008 -0700
    97.2 +++ b/xen/arch/x86/oprofile/nmi_int.c	Tue Jan 22 08:30:40 2008 -0700
    97.3 @@ -295,17 +295,16 @@ static int __init ppro_init(char ** cpu_
    97.4  {
    97.5  	__u8 cpu_model = current_cpu_data.x86_model;
    97.6  
    97.7 -	if (cpu_model > 15) {
    97.8 +	if (cpu_model == 15 || cpu_model == 23)
    97.9 +		*cpu_type = "i386/core_2";
   97.10 +	else if (cpu_model == 14)
   97.11 +		*cpu_type = "i386/core";
   97.12 +	else if (cpu_model > 13) {
   97.13  		printk("xenoprof: Initialization failed. "
   97.14  		       "Intel processor model %d for P6 class family is not "
   97.15  		       "supported\n", cpu_model);
   97.16  		return 0;
   97.17 -	}
   97.18 -	else if (cpu_model == 15)
   97.19 -		*cpu_type = "i386/core_2";
   97.20 -	else if (cpu_model == 14)
   97.21 -		*cpu_type = "i386/core";
   97.22 -	else if (cpu_model == 9)
   97.23 +	} else if (cpu_model == 9)
   97.24  		*cpu_type = "i386/p6_mobile";
   97.25  	else if (cpu_model > 5)
   97.26  		*cpu_type = "i386/piii";
    98.1 --- a/xen/include/asm-x86/iommu.h	Tue Jan 22 08:27:29 2008 -0700
    98.2 +++ b/xen/include/asm-x86/iommu.h	Tue Jan 22 08:30:40 2008 -0700
    98.3 @@ -31,6 +31,9 @@ extern int vtd_enabled;
    98.4  
    98.5  #define domain_hvm_iommu(d)     (&d->arch.hvm_domain.hvm_iommu)
    98.6  #define domain_vmx_iommu(d)     (&d->arch.hvm_domain.hvm_iommu.vmx_iommu)
    98.7 +#define iommu_qi_ctrl(iommu)    (&(iommu->intel.qi_ctrl));
    98.8 +#define iommu_ir_ctrl(iommu)    (&(iommu->intel.ir_ctrl));
    98.9 +#define iommu_get_flush(iommu)  (&(iommu->intel.flush));
   98.10  
   98.11  /*
   98.12   * The PCI interface treats multi-function devices as independent
   98.13 @@ -61,6 +64,7 @@ struct iommu {
   98.14      spinlock_t register_lock; /* protect iommu register handling */
   98.15      struct root_entry *root_entry; /* virtual address */
   98.16      unsigned int vector;
   98.17 +    struct intel_iommu intel;
   98.18  };
   98.19  
   98.20  int iommu_setup(void);
    99.1 --- a/xen/include/public/physdev.h	Tue Jan 22 08:27:29 2008 -0700
    99.2 +++ b/xen/include/public/physdev.h	Tue Jan 22 08:30:40 2008 -0700
    99.3 @@ -81,7 +81,11 @@ DEFINE_XEN_GUEST_HANDLE(physdev_set_iopl
    99.4  #define PHYSDEVOP_set_iobitmap           7
    99.5  struct physdev_set_iobitmap {
    99.6      /* IN */
    99.7 -    XEN_GUEST_HANDLE_00030205(uint8) bitmap;
    99.8 +#if __XEN_INTERFACE_VERSION__ >= 0x00030205
    99.9 +    XEN_GUEST_HANDLE(uint8) bitmap;
   99.10 +#else
   99.11 +    uint8_t *bitmap;
   99.12 +#endif
   99.13      uint32_t nr_ports;
   99.14  };
   99.15  typedef struct physdev_set_iobitmap physdev_set_iobitmap_t;
   100.1 --- a/xen/include/public/xen-compat.h	Tue Jan 22 08:27:29 2008 -0700
   100.2 +++ b/xen/include/public/xen-compat.h	Tue Jan 22 08:30:40 2008 -0700
   100.3 @@ -41,11 +41,4 @@
   100.4  #error "These header files do not support the requested interface version."
   100.5  #endif
   100.6  
   100.7 -/* Fields defined as a Xen guest handle since 0x00030205. */
   100.8 -#if __XEN_INTERFACE_VERSION__ >= 0x00030205
   100.9 -#define XEN_GUEST_HANDLE_00030205(type) XEN_GUEST_HANDLE(type)
  100.10 -#else
  100.11 -#define XEN_GUEST_HANDLE_00030205(type) type *
  100.12 -#endif
  100.13 -
  100.14  #endif /* __XEN_PUBLIC_XEN_COMPAT_H__ */
   101.1 --- a/xen/include/public/xen.h	Tue Jan 22 08:27:29 2008 -0700
   101.2 +++ b/xen/include/public/xen.h	Tue Jan 22 08:30:40 2008 -0700
   101.3 @@ -263,7 +263,11 @@ struct mmuext_op {
   101.4          /* SET_LDT */
   101.5          unsigned int nr_ents;
   101.6          /* TLB_FLUSH_MULTI, INVLPG_MULTI */
   101.7 -        XEN_GUEST_HANDLE_00030205(void) vcpumask;
   101.8 +#if __XEN_INTERFACE_VERSION__ >= 0x00030205
   101.9 +        XEN_GUEST_HANDLE(void) vcpumask;
  101.10 +#else
  101.11 +        void *vcpumask;
  101.12 +#endif
  101.13      } arg2;
  101.14  };
  101.15  typedef struct mmuext_op mmuext_op_t;