win-pvdrivers

view common/include/xen_public.h @ 77:b9b4b731f890

Tidyups and work on getting xennet at least as functional as it was before I started messing with it :)
author James Harper <james.harper@bendigoit.com.au>
date Fri Dec 28 23:21:49 2007 +1100 (2007-12-28)
parents dfa772949c6e
children 3a9c28d5a006
line source
1 /*
2 PV Drivers for Windows Xen HVM Domains
3 Copyright (C) 2007 James Harper
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
20 #if !defined(_XEN_PUBLIC_H_)
21 #define _XEN_PUBLIC_H_
23 //#include <evtchn_public.h>
24 //#include <xenbus_public.h>
25 //#include <gnttbl_public.h>
27 DEFINE_GUID( GUID_XEN_IFACE, 0x5C568AC5, 0x9DDF, 0x4FA5, 0xA9, 0x4A, 0x39, 0xD6, 0x70, 0x77, 0x81, 0x9C);
28 //{5C568AC5-9DDF-4FA5-A94A-39D67077819C}
30 typedef PHYSICAL_ADDRESS
31 (*PXEN_ALLOCMMIO)(ULONG Length);
33 typedef PHYSICAL_ADDRESS
34 (*PXEN_FREEMEM)(PVOID Ptr);
36 typedef NTSTATUS
37 (*PXEN_EVTCHN_BIND)(PVOID Context, evtchn_port_t Port, PKSERVICE_ROUTINE ServiceRoutine, PVOID ServiceContext);
39 typedef NTSTATUS
40 (*PXEN_EVTCHN_UNBIND)(PVOID Context, evtchn_port_t Port);
42 typedef NTSTATUS
43 (*PXEN_EVTCHN_MASK)(PVOID Context, evtchn_port_t Port);
45 typedef NTSTATUS
46 (*PXEN_EVTCHN_UNMASK)(PVOID Context, evtchn_port_t Port);
48 typedef NTSTATUS
49 (*PXEN_EVTCHN_NOTIFY)(PVOID Context, evtchn_port_t Port);
51 typedef evtchn_port_t
52 (*PXEN_EVTCHN_ALLOCUNBOUND)(PVOID Context, domid_t Domain);
54 typedef grant_ref_t
55 (*PXEN_GNTTBL_GRANTACCESS)(WDFDEVICE Device, domid_t domid, unsigned long frame, int readonly);
56 typedef BOOLEAN
57 (*PXEN_GNTTBL_ENDACCESS)(WDFDEVICE Device, grant_ref_t ref);
59 typedef VOID
60 (*PXENBUS_WATCH_CALLBACK)(char *Path, PVOID ServiceContext);
62 typedef char *
63 (*PXEN_XENBUS_READ)(PVOID Context, xenbus_transaction_t xbt, const char *path, char **value);
65 typedef char *
66 (*PXEN_XENBUS_WRITE)(PVOID Context, xenbus_transaction_t xbt, const char *path, const char *value);
68 typedef char *
69 (*PXEN_XENBUS_PRINTF)(PVOID Context, xenbus_transaction_t xbt, const char *path, const char *fmt, ...);
71 typedef char *
72 (*PXEN_XENBUS_STARTTRANSACTION)(PVOID Context, xenbus_transaction_t *xbt);
74 typedef char *
75 (*PXEN_XENBUS_ENDTRANSACTION)(PVOID Context, xenbus_transaction_t t, int abort, int *retry);
77 typedef char *
78 (*PXEN_XENBUS_LIST)(PVOID Context, xenbus_transaction_t xbt, const char *prefix, char ***contents);
80 typedef char *
81 (*PXEN_XENBUS_ADDWATCH)(PVOID Context, xenbus_transaction_t xbt, const char *Path, PXENBUS_WATCH_CALLBACK ServiceRoutine, PVOID ServiceContext);
83 typedef char *
84 (*PXEN_XENBUS_REMWATCH)(PVOID Context, xenbus_transaction_t xbt, const char *Path, PXENBUS_WATCH_CALLBACK ServiceRoutine, PVOID ServiceContext);
86 typedef struct _XEN_IFACE {
87 INTERFACE InterfaceHeader;
89 PXEN_ALLOCMMIO AllocMMIO;
90 PXEN_FREEMEM FreeMem;
92 PXEN_EVTCHN_BIND EvtChn_Bind;
93 PXEN_EVTCHN_UNBIND EvtChn_Unbind;
94 PXEN_EVTCHN_MASK EvtChn_Mask;
95 PXEN_EVTCHN_UNMASK EvtChn_Unmask;
96 PXEN_EVTCHN_NOTIFY EvtChn_Notify;
97 PXEN_EVTCHN_ALLOCUNBOUND EvtChn_AllocUnbound;
98 PXEN_EVTCHN_BIND EvtChn_BindDpc;
100 PXEN_GNTTBL_GRANTACCESS GntTbl_GrantAccess;
101 PXEN_GNTTBL_ENDACCESS GntTbl_EndAccess;
103 PXEN_XENBUS_READ XenBus_Read;
104 PXEN_XENBUS_WRITE XenBus_Write;
105 PXEN_XENBUS_PRINTF XenBus_Printf;
106 PXEN_XENBUS_STARTTRANSACTION XenBus_StartTransaction;
107 PXEN_XENBUS_ENDTRANSACTION XenBus_EndTransaction;
108 PXEN_XENBUS_LIST XenBus_List;
109 PXEN_XENBUS_ADDWATCH XenBus_AddWatch;
110 PXEN_XENBUS_REMWATCH XenBus_RemWatch;
112 } XEN_IFACE, *PXEN_IFACE;
114 #define XEN_DATA_MAGIC 0x12345678
116 typedef struct _XENPCI_IDENTIFICATION_DESCRIPTION
117 {
118 WDF_CHILD_IDENTIFICATION_DESCRIPTION_HEADER Header;
119 UNICODE_STRING DeviceType;
120 char Path[128];
121 ULONG DeviceIndex;
122 } XENPCI_IDENTIFICATION_DESCRIPTION, *PXENPCI_IDENTIFICATION_DESCRIPTION;
124 typedef struct {
125 ULONG Magic;
126 char Path[128];
127 ULONG DeviceIndex;
128 PXENBUS_WATCH_CALLBACK WatchHandler;
129 PVOID WatchContext;
130 XEN_IFACE XenInterface;
131 BOOLEAN AutoEnumerate;
132 CM_PARTIAL_RESOURCE_DESCRIPTOR InterruptRaw;
133 CM_PARTIAL_RESOURCE_DESCRIPTOR InterruptTranslated;
134 } XENPCI_XEN_DEVICE_DATA, *PXENPCI_XEN_DEVICE_DATA;
136 WDF_DECLARE_CONTEXT_TYPE_WITH_NAME(XENPCI_XEN_DEVICE_DATA, GetXenDeviceData);
138 #endif