65oo2/vm/bus.h

25 lines
410 B
C
Raw Normal View History

2024-02-29 12:01:58 +00:00
#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);
2024-04-25 19:27:27 +00:00
typedef struct {
uint32_t start;
uint32_t end;
} Range;
typedef struct bus {
const char *name;
Range range;
BusRead read;
BusWrite write;
struct bus *sub[];
2024-02-29 12:01:58 +00:00
} Bus;
#endif /* !VM_BUS_H */