-static int pic_free(struct vm_device * dev) {
+static int pic_free(struct pic_internal * state) {
+
+ // unregister intr_controller
+ // unregister intr router
+
+ V3_Free(state);
return 0;
}
static struct v3_device_ops dev_ops = {
- .free = pic_free,
+ .free = (int (*)(void *))pic_free,
};
// PIC is only usable in non-multicore environments
// just hardcode the core context
struct guest_info * core = &(vm->cores[0]);
+
+ state = (struct pic_internal *)V3_Malloc(sizeof(struct pic_internal));
V3_ASSERT(state != NULL);
-
- state = (struct pic_internal *)V3_Malloc(sizeof(struct pic_internal));
-
struct vm_device * dev = v3_add_device(vm, dev_id, &dev_ops, state);