Title: [8173] trunk/kernel/kgdb.c: Fix bug[#5831] Don't write memory byte one by one.
Revision
8173
Author
sonicz
Date
2010-01-15 04:45:56 -0500 (Fri, 15 Jan 2010)

Log Message

Fix bug[#5831] Don't write memory byte one by one.

Write the expected memory data size at once, because some arch has
memory mapped registers that can only be access as 32 bit or 16 bit
only.

Modified Paths

Diff

Modified: trunk/kernel/kgdb.c (8172 => 8173)


--- trunk/kernel/kgdb.c	2010-01-15 09:25:11 UTC (rev 8172)
+++ trunk/kernel/kgdb.c	2010-01-15 09:45:56 UTC (rev 8173)
@@ -395,22 +395,17 @@
  */
 int __weak kgdb_ebin2mem(char *buf, char *mem, int count)
 {
-	int err = 0;
-	char c;
+	int size = 0;
+	char *c = buf;
 
 	while (count-- > 0) {
-		c = *buf++;
-		if (c == 0x7d)
-			c = *buf++ ^ 0x20;
-
-		err = probe_kernel_write(mem, &c, 1);
-		if (err)
-			break;
-
-		mem++;
+		if (c[size] == 0x7d)
+			c[size] = *buf++ ^ 0x20;
+		buf++;
+		size++;
 	}
 
-	return err;
+	return	probe_kernel_write(mem, c, size);
 }
 
 /*
_______________________________________________
Linux-kernel-commits mailing list
[email protected]
https://blackfin.uclinux.org/mailman/listinfo/linux-kernel-commits

Reply via email to