changeset: 10279:33ab720b27d99d7a943a5cc87fdd0e4dee8fcef6
user: jimix@xxxxxxxxxxxxxxxxxxxxx
date: Mon May 15 17:37:48 2006 -0400
files: tools/domctrl/console.c tools/domctrl/domctrl.c
description:
[ppc] fix domctrl console functionlity
diff -r cdd80419bcfe2a4d3c53876e0f45eea3f19e929a -r
33ab720b27d99d7a943a5cc87fdd0e4dee8fcef6 tools/domctrl/console.c
--- a/tools/domctrl/console.c Mon May 15 17:36:44 2006 -0400
+++ b/tools/domctrl/console.c Mon May 15 17:37:48 2006 -0400
@@ -12,24 +12,33 @@
int console(char *argv[], int argc)
{
- struct xencons_interface *intf;
+ struct xencons_interface volatile *intf;
unsigned long *page_array;
unsigned long domid;
+ unsigned long console_pfn;
+ unsigned long console_mfn;
int rc = 0;
if (argc < 2)
return -1;
domid = strtoul(argv[1], NULL, 0);
+ if (argc == 3) {
+ console_pfn = strtoul(argv[2], NULL, 0);
+ } else {
+ console_pfn = 0x3ffd;
+ }
DEBUG(printf("get_page_array(0x%lx)\n", domid));
if (get_page_array(domid, &page_array))
return -1;
+ console_mfn = page_array[console_pfn];
+
DEBUG(printf("xc_map_foreign_range(0x%lx, 0x%x, 0x%x, 0x%lx)\n",
- domid, getpagesize(), PROT_READ|PROT_WRITE, CONSOLE_MFN));
+ domid, getpagesize(), PROT_READ|PROT_WRITE, console_mfn));
intf = xc_map_foreign_range(xc_handle, domid, getpagesize(),
- PROT_READ|PROT_WRITE, CONSOLE_MFN);
+ PROT_READ|PROT_WRITE, console_mfn);
if (intf == NULL) {
perror("xc_map_foreign_range");
return -1;
@@ -48,16 +57,16 @@ int console(char *argv[], int argc)
prod = intf->out_prod;
size = prod - cons;
- if ((size == 0) || (size > sizeof(intf->out)))
- continue;
- printf("got %d bytes\n", size);
+ if (!((size == 0) || (size > sizeof(intf->out)))) {
+ while (cons != prod) {
+ char buf[1];
- while (cons != prod) {
- char buf[1];
-
- buf[0] = intf->out[MASK_XENCONS_IDX(cons++, intf->out)];
- write(STDOUT_FILENO, buf, 1);
+ buf[0] = intf->out[MASK_XENCONS_IDX(cons++, intf->out)];
+ write(STDOUT_FILENO, buf, 1);
+ }
+ intf->out_cons = cons;
}
+ /* input here */
}
munmap(console, getpagesize());
diff -r cdd80419bcfe2a4d3c53876e0f45eea3f19e929a -r
33ab720b27d99d7a943a5cc87fdd0e4dee8fcef6 tools/domctrl/domctrl.c
--- a/tools/domctrl/domctrl.c Mon May 15 17:36:44 2006 -0400
+++ b/tools/domctrl/domctrl.c Mon May 15 17:37:48 2006 -0400
@@ -31,7 +31,7 @@ void usage(void)
" list\n"
" create <kernel>\n"
" destroy <domid>\n"
- " console <domid>\n"
+ " console <domid> <pfn>\n"
" mem <domid> <paddr> [len [filename]]\n"
" regs <domid.vcpu>\n");
}
_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel
|