25 lines
410 B
C
25 lines
410 B
C
#ifndef VM_BUS_H
|
|
# define VM_BUS_H 1
|
|
|
|
# include <stddef.h>
|
|
# include <stdint.h>
|
|
|
|
typedef int (*BusRead)(uint32_t addr, void *data, size_t sz);
|
|
typedef int (*BusWrite)(uint32_t addr, const void *data, size_t sz);
|
|
|
|
typedef struct {
|
|
uint32_t start;
|
|
uint32_t end;
|
|
} Range;
|
|
|
|
typedef struct bus {
|
|
const char *name;
|
|
Range range;
|
|
|
|
BusRead read;
|
|
BusWrite write;
|
|
|
|
struct bus *sub[];
|
|
} Bus;
|
|
|
|
#endif /* !VM_BUS_H */ |