-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathiotable.h
40 lines (34 loc) · 913 Bytes
/
iotable.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* Kernel-based Virtual Machine test driver
*
* This test driver provides a simple way of testing kvm, without a full
* device model.
*
* Copyright (C) 2006 Qumranet
*
* Authors:
*
* Avi Kivity <[email protected]>
* Yaniv Kamay <[email protected]>
*
* This work is licensed under the GNU LGPL license, version 2.
*/
#include <stdint.h>
#define MAX_IO_TABLE 50
typedef int (io_table_handler_t)(void *, int, int, uint64_t, uint64_t *);
struct io_table_entry
{
uint64_t start;
uint64_t end;
io_table_handler_t *handler;
void *opaque;
};
struct io_table
{
int nr_entries;
struct io_table_entry entries[MAX_IO_TABLE];
};
struct io_table_entry *io_table_lookup(struct io_table *io_table,
uint64_t addr);
int io_table_register(struct io_table *io_table, uint64_t start, uint64_t size,
io_table_handler_t *handler, void *opaque);