@@ -775,7 +775,7 @@ int arch_domain_create(struct domain *d,
* Only use it for the hardware domain because the linux kernel may not
* support multi-platform.
*/
- if ( is_hardware_domain(d) && (rc = domain_vuart_init(d)) )
+ if ( is_hardware_domain(d) && (rc = hwdom_vuart_init(d)) )
goto fail;
if ( (rc = domain_vpci_init(d)) != 0 )
@@ -844,7 +844,7 @@ void arch_domain_destroy(struct domain *d)
iommu_domain_destroy(d);
p2m_final_teardown(d);
domain_vgic_free(d);
- domain_vuart_free(d);
+ hwdom_vuart_free(d);
free_xenheap_page(d->shared_info);
#ifdef CONFIG_ACPI
free_xenheap_pages(d->arch.efi_acpi_table,
@@ -31,19 +31,17 @@
#include "vuart.h"
-#define domain_has_vuart(d) ((d)->arch.vuart.info != NULL)
+static int hwdom_vuart_mmio_read(struct vcpu *v, mmio_info_t *info,
+ register_t *r, void *priv);
+static int hwdom_vuart_mmio_write(struct vcpu *v, mmio_info_t *info,
+ register_t r, void *priv);
-static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info,
- register_t *r, void *priv);
-static int vuart_mmio_write(struct vcpu *v, mmio_info_t *info,
- register_t r, void *priv);
-
-static const struct mmio_handler_ops vuart_mmio_handler = {
- .read = vuart_mmio_read,
- .write = vuart_mmio_write,
+static const struct mmio_handler_ops hwdom_vuart_mmio_handler = {
+ .read = hwdom_vuart_mmio_read,
+ .write = hwdom_vuart_mmio_write,
};
-int domain_vuart_init(struct domain *d)
+int hwdom_vuart_init(struct domain *d)
{
ASSERT( is_hardware_domain(d) );
@@ -58,7 +56,7 @@ int domain_vuart_init(struct domain *d)
if ( !d->arch.vuart.buf )
return -ENOMEM;
- register_mmio_handler(d, &vuart_mmio_handler,
+ register_mmio_handler(d, &hwdom_vuart_mmio_handler,
d->arch.vuart.info->base_addr,
d->arch.vuart.info->size,
NULL);
@@ -66,15 +64,12 @@ int domain_vuart_init(struct domain *d)
return 0;
}
-void domain_vuart_free(struct domain *d)
+void hwdom_vuart_free(struct domain *d)
{
- if ( !domain_has_vuart(d) )
- return;
-
- xfree(d->arch.vuart.buf);
+ XFREE(d->arch.vuart.buf);
}
-static void vuart_print_char(struct vcpu *v, char c)
+static void hwdom_vuart_print_char(struct vcpu *v, char c)
{
struct domain *d = v->domain;
struct vuart *uart = &d->arch.vuart;
@@ -95,7 +90,7 @@ static void vuart_print_char(struct vcpu *v, char c)
spin_unlock(&uart->lock);
}
-static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info,
+static int hwdom_vuart_mmio_read(struct vcpu *v, mmio_info_t *info,
register_t *r, void *priv)
{
struct domain *d = v->domain;
@@ -113,7 +108,7 @@ static int vuart_mmio_read(struct vcpu *v, mmio_info_t *info,
return 1;
}
-static int vuart_mmio_write(struct vcpu *v, mmio_info_t *info,
+static int hwdom_vuart_mmio_write(struct vcpu *v, mmio_info_t *info,
register_t r, void *priv)
{
struct domain *d = v->domain;
@@ -123,7 +118,7 @@ static int vuart_mmio_write(struct vcpu *v, mmio_info_t *info,
if ( offset == d->arch.vuart.info->data_off )
/* ignore any status bits */
- vuart_print_char(v, r & 0xFF);
+ hwdom_vuart_print_char(v, r & 0xFF);
return 1;
}
@@ -24,12 +24,12 @@ struct domain;
#ifdef CONFIG_HWDOM_VUART
-int domain_vuart_init(struct domain *d);
-void domain_vuart_free(struct domain *d);
+int hwdom_vuart_init(struct domain *d);
+void hwdom_vuart_free(struct domain *d);
#else
-static inline int domain_vuart_init(struct domain *d)
+static inline int hwdom_vuart_init(struct domain *d)
{
/*
* The vUART is unconditionally inialized for the hw domain. So we
@@ -38,7 +38,7 @@ static inline int domain_vuart_init(struct domain *d)
return 0;
}
-static inline void domain_vuart_free(struct domain *d) {};
+static inline void hwdom_vuart_free(struct domain *d) {};
#endif /* CONFIG_HWDOM_VUART */