|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH v2 7/7] xen/console: introduce console_get_focus()
From: Denis Mukhin <dmukhin@xxxxxxxx>
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@xxxxxxxx>
---
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(-)
diff --git a/xen/arch/arm/vpl011.c b/xen/arch/arm/vpl011.c
index 147958eee8..9ce6151c2a 100644
--- a/xen/arch/arm/vpl011.c
+++ b/xen/arch/arm/vpl011.c
@@ -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);
}
/*
diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 9905ffd6b9..888dabe8af 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -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);
@@ -526,6 +526,11 @@ static bool cf_check console_set_focus(domid_t domid)
return true;
}
+domid_t console_get_focus(void)
+{
+ return console_focus;
+}
+
/*
* Switch console focus.
* Rotates input focus among Xen and domains with console input permission.
diff --git a/xen/include/xen/console.h b/xen/include/xen/console.h
index 83cbc9fbda..19da2b755c 100644
--- a/xen/include/xen/console.h
+++ b/xen/include/xen/console.h
@@ -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.
--
2.34.1
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |