.update_screen = screen_update,
.update_cursor = cursor_update,
.scroll = scroll,
+ .set_text_resolution = NULL,
};
-static int cons_free(struct vm_device * dev) {
- return -1;
+static int cons_free(struct cons_state * state) {
+
+ // kill thread... ?
+
+ V3_Free(state);
+ return 0;
}
static struct v3_device_ops dev_ops = {
- .free = cons_free,
+ .free = (int (*)(void *))cons_free,
};
v3_lock_init(&(state->cons_lock));
- struct vm_device * dev = v3_allocate_device(dev_id, &dev_ops, state);
+ struct vm_device * dev = v3_add_device(vm, dev_id, &dev_ops, state);
- if (v3_attach_device(vm, dev) == -1) {
+ if (dev == NULL) {
PrintError("Could not attach device %s\n", dev_id);
+ V3_Free(state);
return -1;
}