uint_t cons_offset;
};
-static int handle_info_write(ushort_t port, void * src, uint_t length, struct vm_device * dev) {
+static int handle_info_write(struct guest_info * core, ushort_t port, void * src, uint_t length, struct vm_device * dev) {
struct debug_state * state = (struct debug_state *)dev->private_data;
state->info_buf[state->info_offset++] = *(char*)src;
}
-static int handle_debug_write(ushort_t port, void * src, uint_t length, struct vm_device * dev) {
+static int handle_debug_write(struct guest_info * core, ushort_t port, void * src, uint_t length, struct vm_device * dev) {
struct debug_state * state = (struct debug_state *)dev->private_data;
state->debug_buf[state->debug_offset++] = *(char*)src;
}
-static int handle_console_write(ushort_t port, void * src, uint_t length, struct vm_device * dev) {
+static int handle_console_write(struct guest_info * core, ushort_t port, void * src, uint_t length, struct vm_device * dev) {
struct debug_state * state = (struct debug_state *)dev->private_data;
state->cons_buf[state->cons_offset++] = *(char*)src;
}
-static int handle_gen_write(ushort_t port, void * src, uint_t length, struct vm_device * dev) {
+static int handle_gen_write(struct guest_info * core, ushort_t port, void * src, uint_t length, struct vm_device * dev) {
switch (length) {
case 1:
-static int debug_init(struct guest_info * vm, void * cfg_data) {
- struct debug_state * state = NULL;
+static int debug_init(struct v3_vm_info * vm, v3_cfg_tree_t * cfg) {
+ struct debug_state * state = NULL;
+ char * dev_id = v3_cfg_val(cfg, "ID");
state = (struct debug_state *)V3_Malloc(sizeof(struct debug_state));
V3_ASSERT(state != NULL);
PrintDebug("Creating Bochs Debug Device\n");
- struct vm_device * dev = v3_allocate_device("BOCHS_DEBUG", &dev_ops, state);
+ struct vm_device * dev = v3_allocate_device(dev_id, &dev_ops, state);
if (v3_attach_device(vm, dev) == -1) {
- PrintError("Could not attach device %s\n", "BOCHS_DEBUG");
+ PrintError("Could not attach device %s\n", dev_id);
return -1;
}