WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

[XenPPC] [pushed] [ppc] fix domctrl console functionlity

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [pushed] [ppc] fix domctrl console functionlity
From: jimix@xxxxxxxxxxxxxx
Date: Mon, 15 May 2006 17:50:17 -0400
Delivery-date: Mon, 15 May 2006 14:48:34 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>
  • [XenPPC] [pushed] [ppc] fix domctrl console functionlity, jimix <=