win-pvdrivers

annotate common/include/xen_windows.h @ 62:edd4a2ad5b44

Removed old inf files
author James Harper <james.harper@bendigoit.com.au>
date Wed Dec 19 10:22:50 2007 +1100 (2007-12-19)
parents a54ad4e0e083
children 06b4321b7068
rev   line source
james@0 1 #if !defined(_XEN_WINDOWS_H_)
james@0 2 #define _XEN_WINDOWS_H_
james@0 3
james@0 4 #pragma warning( disable : 4201 ) // nonstandard extension used : nameless struct/union
james@0 5 #pragma warning( disable : 4214 ) // nonstandard extension used : bit field types other than int
james@0 6
james@0 7 #define __XEN_INTERFACE_VERSION__ 0x00030205
james@0 8 #define __i386__
andy@18 9 typedef INT8 int8_t;
andy@18 10 typedef UINT8 uint8_t;
andy@18 11 typedef INT16 int16_t;
andy@18 12 typedef UINT16 uint16_t;
andy@18 13 typedef INT32 int32_t;
andy@18 14 typedef UINT32 uint32_t;
andy@18 15 typedef UINT64 uint64_t;
james@0 16 typedef unsigned long pgentry_t;
james@0 17
james@0 18 #include <xen.h>
james@0 19
james@0 20 #define _PAGE_PRESENT 0x001UL
james@0 21 #define _PAGE_RW 0x002UL
james@0 22 #define _PAGE_USER 0x004UL
james@0 23 #define _PAGE_PWT 0x008UL
james@0 24 #define _PAGE_PCD 0x010UL
james@0 25 #define _PAGE_ACCESSED 0x020UL
james@0 26 #define _PAGE_DIRTY 0x040UL
james@0 27 #define _PAGE_PAT 0x080UL
james@0 28 #define _PAGE_PSE 0x080UL
james@0 29 #define _PAGE_GLOBAL 0x100UL
james@0 30
james@0 31 #define L1_PROT (_PAGE_PRESENT|_PAGE_RW|_PAGE_ACCESSED)
james@0 32
james@0 33 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
james@0 34
james@0 35 typedef unsigned long xenbus_transaction_t;
james@0 36 typedef uint32_t XENSTORE_RING_IDX;
james@0 37
james@0 38 #define XBT_NIL ((xenbus_transaction_t)0)
james@0 39
james@0 40 #define SPLITSTRING_POOL_TAG (ULONG) 'SSPT'
james@0 41
james@0 42 static char **
james@0 43 SplitString(char *String, char Split, int MaxParts, int *Count)
james@0 44 {
james@0 45 char **RetVal;
james@0 46 char *first;
james@0 47 char *last;
james@0 48
james@0 49 //KdPrint((__DRIVER_NAME " a\n"));
james@0 50
james@0 51 *Count = 0;
james@0 52
james@0 53 RetVal = ExAllocatePoolWithTag(NonPagedPool, (MaxParts + 1) * sizeof(char *), SPLITSTRING_POOL_TAG);
james@0 54 last = String;
james@0 55 do
james@0 56 {
james@0 57 if (*Count == MaxParts)
james@0 58 break;
james@0 59 //KdPrint((__DRIVER_NAME " b - count = %d\n", *Count));
james@0 60 first = last;
james@0 61 for (last = first; *last != '\0' && *last != Split; last++);
james@0 62 RetVal[*Count] = ExAllocatePoolWithTag(NonPagedPool, last - first + 1, SPLITSTRING_POOL_TAG);
james@0 63 //KdPrint((__DRIVER_NAME " c - count = %d\n", *Count));
james@0 64 strncpy(RetVal[*Count], first, last - first);
james@0 65 RetVal[*Count][last - first] = 0;
james@0 66 //KdPrint((__DRIVER_NAME " d - count = %d\n", *Count));
james@0 67 (*Count)++;
james@0 68 //KdPrint((__DRIVER_NAME " e - count = %d\n", *Count));
james@0 69 if (*last == Split)
james@0 70 last++;
james@0 71 } while (*last != 0);
james@0 72 //KdPrint((__DRIVER_NAME " f - count = %d\n", *Count));
james@0 73 RetVal[*Count] = NULL;
james@0 74 return RetVal;
james@0 75 }
james@0 76
james@0 77 static VOID
james@0 78 FreeSplitString(char **Bits, int Count)
james@0 79 {
james@0 80 int i;
james@0 81
james@0 82 for (i = 0; i < Count; i++)
james@0 83 ExFreePoolWithTag(Bits[i], SPLITSTRING_POOL_TAG);
james@0 84 ExFreePoolWithTag(Bits, SPLITSTRING_POOL_TAG);
james@0 85 }
james@0 86
james@0 87 #endif