win-pvdrivers

view xencache/xencache.h @ 1055:a127b9bea695

Add xencache - tmem client implementation that does writethrough caching of pagefile writes in ephemeral tmem. Testing only.
author James Harper <james.harper@bendigoit.com.au>
date Sun Jun 02 16:38:50 2013 +1000 (2013-06-02)
parents
children 2d5fbe07e866
line source
1 /*
2 PV Drivers for Windows Xen HVM Domains
3 Copyright (C) 2013 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 #pragma warning(disable: 4127)
22 #pragma warning(disable : 4200) // zero-sized array
24 #if !defined(_XENCACHE_H_)
25 #define _XENCACHE_H_
27 #define __DRIVER_NAME "XenCache"
29 #define XENCACHE_POOL_TAG (ULONG)'XenC'
31 #include <fltkernel.h>
32 #define NTSTRSAFE_LIB
33 #include <ntstrsafe.h>
34 #include <xen_windows.h>
36 typedef struct _pagefile_context_t pagefile_context_t;
37 typedef struct _global_context_t global_context_t;
39 struct _global_context_t {
40 KSPIN_LOCK lock;
41 pagefile_context_t *pagefile_head;
42 };
44 struct _pagefile_context_t {
45 pagefile_context_t *next;
46 global_context_t *global;
47 PFILE_OBJECT file_object;
48 ULONG pool_id;
50 ULONGLONG put_success_count;
51 ULONGLONG put_fail_count;
52 ULONGLONG get_success_count;
53 ULONGLONG get_fail_count;
54 };
56 #endif