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] fixed bug in \r processing

changeset:   9952:1b2574f1c62f5a5c03802d8769b472b7ffdee155
tag:         tip
user:        jimix@xxxxxxxxxxxxxxxxxxxxx
date:        Thu Apr 27 11:23:42 2006 -0400
files:       xen/arch/ppc/boot_of.c
description:
[ppc] fixed bug in \r processing
bad math caused early truncate.
guess we were all too busy lookin at return statements :-P


diff -r 292112ed118ba522bad8ceba75fffb8c8cdc1acc -r 
1b2574f1c62f5a5c03802d8769b472b7ffdee155 xen/arch/ppc/boot_of.c
--- a/xen/arch/ppc/boot_of.c    Tue Apr 25 14:15:52 2006 -0400
+++ b/xen/arch/ppc/boot_of.c    Thu Apr 27 11:23:42 2006 -0400
@@ -112,14 +112,15 @@ static int __init of_write(int ih, const
 
     while (i < len) {
         if (addr[i] == '\n') {
-            int l = len - i - 1;
-            if (l > 0) {
-                rc = _of_write(ih, addr, len - i - 1);
-                if (rc == OF_FAILURE) return rc;
+            if (i > 0) {
+                rc = _of_write(ih, addr, i);
+                if (rc == OF_FAILURE)
+                    return rc;
                 sum += rc;
             }
             rc = _of_write(ih, "\r\n", 2);
-            if (rc == OF_FAILURE) return rc;
+            if (rc == OF_FAILURE)
+                return rc;
             sum += rc;
             i++;
             addr += i;
@@ -131,7 +132,8 @@ static int __init of_write(int ih, const
     }
     if (len > 0) {
         rc = _of_write(ih, addr, len);
-        if (rc == OF_FAILURE) return rc;
+        if (rc == OF_FAILURE)
+            return rc;
         sum += rc;
     }
             
@@ -626,6 +628,13 @@ static int boot_of_fixup_refs(void *mem)
                 of_panic("no prop: name %s, path %s, device 0x%x\n",
                          name, path, rp);
 
+            {
+                int f;
+                for (f = 0; f < sizeof (ofpath) - 8; f += 8)
+                    memcpy(&ofpath[f], "deadbeef", 8);
+                ofpath[sizeof (ofpath) -1] = '\0';
+            }
+
             rc = of_package_to_path(ref, ofpath, sizeof (ofpath));
             if (rc == OF_FAILURE)
                 of_panic("no package: name %s, path %s, device 0x%x,\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] fixed bug in \r processing, jimix <=