@@ -78,12 +78,11 @@ static void vpl011_write_data_xen(struct domain *d, uint8_t data)
unsigned long flags;
struct vpl011 *vpl011 = &d->arch.vpl011;
struct vpl011_xen_backend *intf = vpl011->backend.xen;
- struct domain *input = console_get_domain();
VPL011_LOCK(d, flags);
intf->out[intf->out_prod++] = data;
- if ( d == input )
+ if ( d->domain_id == console_get_focus() )
{
if ( intf->out_prod == 1 )
{
@@ -123,8 +122,6 @@ static void vpl011_write_data_xen(struct domain *d, uint8_t data)
vpl011_update_interrupt_status(d);
VPL011_UNLOCK(d, flags);
-
- console_put_domain(input);
}
/*
@@ -484,12 +484,12 @@ static struct domain *console_get_domain_by_id(domid_t domid)
return NULL;
}
-struct domain *console_get_domain(void)
+static struct domain *console_get_domain(void)
{
return console_get_domain_by_id(console_focus);
}
-void console_put_domain(struct domain *d)
+static void console_put_domain(struct domain *d)
{
if ( d )
rcu_unlock_domain(d);
@@ -523,6 +523,11 @@ static int console_set_focus(domid_t domid)
return 0;
}
+domid_t console_get_focus(void)
+{
+ return console_focus;
+}
+
/*
* Switch console focus.
* Rotates input focus among Xen, dom0 and boot-time created domUs while
@@ -32,8 +32,7 @@ void console_end_sync(void);
void console_start_log_everything(void);
void console_end_log_everything(void);
-struct domain *console_get_domain(void);
-void console_put_domain(struct domain *d);
+domid_t console_get_focus(void);
/*
* Steal output from the console. Returns +ve identifier, else -ve error.
Add console_get_focus() as a console public API to the retrieve current console owner domain ID. Make console_{get,put}_domain() private and simplify vpl011 code a bit. Signed-off-by: Denis Mukhin <dmukhin@ford.com> --- xen/arch/arm/vpl011.c | 5 +---- xen/drivers/char/console.c | 9 +++++++-- xen/include/xen/console.h | 3 +-- 3 files changed, 9 insertions(+), 8 deletions(-)