summaryrefslogtreecommitdiff
path: root/sys/src/9/xen
diff options
context:
space:
mode:
authormischief <mischief@offblast.org>2014-06-24 19:37:03 -0700
committermischief <mischief@offblast.org>2014-06-24 19:37:03 -0700
commit2060daf3b0f7ad91c73cec00516659f248841983 (patch)
treed1db64e0151202383eb97de330db9dd62e75a7fa /sys/src/9/xen
parent5ba95fdb07ddc2c32111a1b2f57f17aa27fcbbf5 (diff)
xen: fix early console
Diffstat (limited to 'sys/src/9/xen')
-rw-r--r--sys/src/9/xen/fns.h1
-rw-r--r--sys/src/9/xen/main.c3
-rw-r--r--sys/src/9/xen/uartxen.c26
3 files changed, 10 insertions, 20 deletions
diff --git a/sys/src/9/xen/fns.h b/sys/src/9/xen/fns.h
index b6d0fc7a1..8072cb7bd 100644
--- a/sys/src/9/xen/fns.h
+++ b/sys/src/9/xen/fns.h
@@ -59,6 +59,7 @@ void insl(int, void*, int);
int intrdisable(int, void (*)(Ureg *, void *), void*, int, char*);
void intrenable(int, void (*)(Ureg*, void*), void*, int, char*);
int ioalloc(int, int, int, char*);
+void ioinit(void);
int isaconfig(char*, int, ISAConf*);
void kbdenable(void);
#define kmapinval()
diff --git a/sys/src/9/xen/main.c b/sys/src/9/xen/main.c
index 966b39997..03f22d18b 100644
--- a/sys/src/9/xen/main.c
+++ b/sys/src/9/xen/main.c
@@ -73,8 +73,9 @@ main(void)
{
mach0init();
options();
- quotefmtinstall();
+ ioinit();
xenconsinit();
+ quotefmtinstall();
//consdebug = rdb;
print("\nPlan 9 (%s)\n", xenstart->magic);
diff --git a/sys/src/9/xen/uartxen.c b/sys/src/9/xen/uartxen.c
index 31e9b8ef3..8a6a7d7de 100644
--- a/sys/src/9/xen/uartxen.c
+++ b/sys/src/9/xen/uartxen.c
@@ -90,7 +90,7 @@ interrupt(Ureg*, void *arg)
coherence();
while (cons != con->in_prod) {
c = con->in[MASK_XENCONS_IDX(cons++, con->in)];
- uartrecv(uart, c & 0xFF);
+ uartrecv(uart, c);
}
coherence();
con->in_cons = cons;
@@ -232,22 +232,13 @@ xenputc(Uart*, int c)
struct xencons_interface *con = xencons.intf;
unsigned long prod;
- c &= 0xFF;
-
ilock(&xencons.txlock);
- /*
- while(con->out_cons == con->out_prod)
- HYPERVISOR_yield();
- */
- if(con->out_cons == con->out_prod){
- iunlock(&xencons.txlock);
- return;
- }
-
prod = con->out_prod;
-
- if((con->out[MASK_XENCONS_IDX(prod++, con->out)] = c) == '\n')
- con->out[MASK_XENCONS_IDX(prod++, con->out)] = '\r';
+ if((prod - con->out_cons) < sizeof(con->out)){
+ if (c == '\n')
+ con->out[MASK_XENCONS_IDX(prod++, con->out)] = '\r';
+ con->out[MASK_XENCONS_IDX(prod++, con->out)] = c;
+ }
coherence();
con->out_prod = prod;
@@ -303,6 +294,7 @@ xenconsinit(void)
xencons.evtchn = xenstart->console_evtchn;
consuart = &xenuart;
+ consuart->console = 1;
}
void
@@ -326,9 +318,5 @@ kbdenable(void)
consuart = uart;
uart->console = 1;
-
- uartputs("CONSOLE1\n", 9);
-
- //*(char*)0 = 0;
}