mirror of
https://github.com/emptyynes/LIVM.git
synced 2025-01-08 01:22:25 +03:00
d02a5d3dfd
+ started doing clock devices + console device is now located at devices[1], devices[0] is clock
36 lines
695 B
C
36 lines
695 B
C
#define CLOCK vm->devices[0]
|
|
|
|
void clock_write(struct VMinst* vm, void* data, uint64_t length) {
|
|
|
|
}
|
|
|
|
void clock_out(struct VMinst* vm) {
|
|
|
|
}
|
|
|
|
void clock_read(struct VMinst* vm, void* buffer, uint64_t length, uint64_t where) {
|
|
|
|
}
|
|
|
|
void clock_wait(struct VMinst* vm, uint64_t data) {
|
|
|
|
}
|
|
|
|
void clock_poweroff(struct VMinst* vm) {
|
|
#ifdef LLLIVMDEBUG
|
|
puts("clock_poweroff<");
|
|
#endif
|
|
free(CLOCK.buffer);
|
|
#ifdef LLLIVMDEBUG
|
|
puts("clock_poweroff>");
|
|
#endif
|
|
}
|
|
|
|
void setup_clock(struct VMinst* vm) {
|
|
CLOCK.buffer = malloc(10240);
|
|
CLOCK.write = &clock_write;
|
|
CLOCK.out = &clock_out;
|
|
CLOCK.read = &clock_read;
|
|
CLOCK.wait = &clock_wait;
|
|
CLOCK.poweroff = &clock_poweroff;
|
|
}
|