[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] mini-os: support event channel 0 for console



The console event channel might be 0 for the console, so use the value
of ~0 as invalid instead.

Signed-off-by: Juergen Gross <jgross@xxxxxxxx>
---
 console/xencons_ring.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/console/xencons_ring.c b/console/xencons_ring.c
index b6db74e..5c2573e 100644
--- a/console/xencons_ring.c
+++ b/console/xencons_ring.c
@@ -17,7 +17,7 @@
 DECLARE_WAIT_QUEUE_HEAD(console_queue);
 
 static struct xencons_interface *console_ring;
-uint32_t console_evtchn;
+uint32_t console_evtchn = ~0;
 
 static struct consfront_dev* resume_xen_console(struct consfront_dev* dev);
 
@@ -55,7 +55,7 @@ static inline void notify_daemon(struct consfront_dev *dev)
 
 static inline struct xencons_interface *xencons_interface(void)
 {
-    return console_evtchn ? console_ring : NULL;
+    return (console_evtchn != ~0) ? console_ring : NULL;
 } 
  
 int xencons_ring_send_no_notify(struct consfront_dev *dev, const char *data, 
unsigned len)
@@ -181,7 +181,7 @@ struct consfront_dev *xencons_ring_init(void)
 {
     struct consfront_dev *dev;
 
-    if (!console_evtchn)
+    if (console_evtchn != ~0)
         return 0;
 
     dev = malloc(sizeof(struct consfront_dev));
-- 
2.26.2




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.