#include <palacios/vmm_dev_mgr.h>
#include <palacios/vm_guest_mem.h>
-#ifdef CONFIG_HOST_DEVICE
+#ifdef V3_CONFIG_HOST_DEVICE
#include <interfaces/vmm_host_dev.h>
#endif
-#ifndef CONFIG_DEBUG_GENERIC
+#ifndef V3_CONFIG_DEBUG_GENERIC
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
struct generic_internal {
enum {GENERIC_PHYSICAL, GENERIC_HOST} forward_type;
-#ifdef CONFIG_HOST_DEVICE
+#ifdef V3_CONFIG_HOST_DEVICE
v3_host_dev_t host_dev;
#endif
struct vm_device *dev; // me
}
return length;
break;
-#ifdef CONFIG_HOST_DEVICE
+#ifdef V3_CONFIG_HOST_DEVICE
case GENERIC_HOST:
if (state->host_dev) {
return v3_host_dev_write_io(state->host_dev,port,src,length);
uint_t i;
int rc;
-#ifdef CONFIG_DEBUG_GENERIC
+#ifdef V3_CONFIG_DEBUG_GENERIC
struct generic_internal *state = (struct generic_internal *) priv_data;
#endif
}
return length;
break;
-#ifdef CONFIG_HOST_DEVICE
+#ifdef V3_CONFIG_HOST_DEVICE
case GENERIC_HOST:
if (state->host_dev) {
return v3_host_dev_read_io(state->host_dev,port,dst,length);
uint_t i;
int rc;
-#ifdef CONFIG_DEBUG_GENERIC
+#ifdef V3_CONFIG_DEBUG_GENERIC
struct generic_internal *state = (struct generic_internal *) priv_data;
#endif
static int generic_read_port_print_and_ignore(struct guest_info * core, uint16_t port, void * src,
uint_t length, void * priv_data) {
-#ifdef CONFIG_DEBUG_GENERIC
+#ifdef V3_CONFIG_DEBUG_GENERIC
struct generic_internal *state = (struct generic_internal *) priv_data;
#endif
uint_t length, void * priv_data) {
int i;
-#ifdef CONFIG_DEBUG_GENERIC
+#ifdef V3_CONFIG_DEBUG_GENERIC
struct generic_internal *state = (struct generic_internal *) priv_data;
#endif
memcpy(V3_VAddr((void*)gpa),src,len);
return len;
break;
-#ifdef CONFIG_HOST_DEVICE
+#ifdef V3_CONFIG_HOST_DEVICE
case GENERIC_HOST:
if (state->host_dev) {
return v3_host_dev_write_mem(state->host_dev,gpa,src,len);
uint_t len,
void * priv)
{
-#ifdef CONFIG_DEBUG_GENERIC
+#ifdef V3_CONFIG_DEBUG_GENERIC
struct vm_device *dev = (struct vm_device *) priv;
struct generic_internal *state = (struct generic_internal *) dev->private_data;
#endif
uint_t len,
void * priv)
{
-#ifdef CONFIG_DEBUG_GENERIC
+#ifdef V3_CONFIG_DEBUG_GENERIC
struct vm_device *dev = (struct vm_device *) priv;
struct generic_internal *state = (struct generic_internal *) dev->private_data;
#endif
memcpy(dst,V3_VAddr((void*)gpa),len);
return len;
break;
-#ifdef CONFIG_HOST_DEVICE
+#ifdef V3_CONFIG_HOST_DEVICE
case GENERIC_HOST:
if (state->host_dev) {
return v3_host_dev_read_mem(state->host_dev,gpa,dst,len);
uint_t len,
void * priv)
{
-#ifdef CONFIG_DEBUG_GENERIC
+#ifdef V3_CONFIG_DEBUG_GENERIC
struct vm_device *dev = (struct vm_device *) priv;
struct generic_internal *state = (struct generic_internal *) dev->private_data;
#endif
uint_t len,
void * priv)
{
-#ifdef CONFIG_DEBUG_GENERIC
+#ifdef V3_CONFIG_DEBUG_GENERIC
struct vm_device *dev = (struct vm_device *) priv;
struct generic_internal *state = (struct generic_internal *) dev->private_data;
#endif
PrintDebug("generic (%s): deinit_device\n", state->name);
-#ifdef CONFIG_HOST_DEVICE
+#ifdef V3_CONFIG_HOST_DEVICE
if (state->host_dev) {
v3_host_dev_close(state->host_dev);
state->host_dev=0;
struct generic_internal * state = NULL;
char * dev_id = v3_cfg_val(cfg, "ID");
char * forward = v3_cfg_val(cfg, "forward");
-#ifdef CONFIG_HOST_DEVICE
+#ifdef V3_CONFIG_HOST_DEVICE
char * host_dev = v3_cfg_val(cfg, "hostdev");
#endif
v3_cfg_tree_t * port_cfg = v3_cfg_subtree(cfg, "ports");
if (!strcasecmp(forward,"physical_device")) {
state->forward_type=GENERIC_PHYSICAL;
} else if (!strcasecmp(forward,"host_device")) {
-#ifdef CONFIG_HOST_DEVICE
+#ifdef V3_CONFIG_HOST_DEVICE
state->forward_type=GENERIC_HOST;
#else
PrintError("generic (%s): cannot configure host device since host device support is not built in\n", state->name);
state->dev=dev;
-#ifdef CONFIG_HOST_DEVICE
+#ifdef V3_CONFIG_HOST_DEVICE
if (state->forward_type==GENERIC_HOST) {
if (!host_dev) {
PrintError("generic (%s): host forwarding requested, but no host device given\n", state->name);