Merge commit 'fe270d044d512a308fb1fdf02cb11db46df29cdb' into upstream-merge
[qemu/qemu-dev-zwu.git] / rwhandler.h
blobbc11849572e65a5ebd2ce879a8785fcba2076859
1 #ifndef READ_WRITE_HANDLER_H
2 #define READ_WRITE_HANDLER_H
4 #include "qemu-common.h"
5 #include "ioport.h"
7 typedef struct ReadWriteHandler ReadWriteHandler;
9 /* len is guaranteed to be one of 1, 2 or 4, addr is guaranteed to fit in an
10 * appropriate type (io/memory/etc). They do not need to be range checked. */
11 typedef void WriteHandlerFunc(ReadWriteHandler *, pcibus_t addr,
12 uint32_t value, int len);
13 typedef uint32_t ReadHandlerFunc(ReadWriteHandler *, pcibus_t addr, int len);
15 struct ReadWriteHandler {
16 WriteHandlerFunc *write;
17 ReadHandlerFunc *read;
20 /* Helpers for when we want to use a single routine with length. */
21 /* CPU memory handler: both read and write must be present. */
22 int cpu_register_io_memory_simple(ReadWriteHandler *);
23 /* io port handler: can supply only read or write handlers. */
24 int register_ioport_simple(ReadWriteHandler *,
25 pio_addr_t start, int length, int size);
27 #endif