Patchwork two minor Coreinfo patches

login
register
about
Submitter Myles Watson
Date 2009-08-21 19:09:20
Message ID <2831fecf0908211209q179f6015pa8c9738d349f5f52@mail.gmail.com>
Download mbox | patch
Permalink /patch/168/
State Accepted
Headers show

Comments

Myles Watson - 2009-08-21 19:09:20
Update Coreinfo to use TAG_FORWARD in tables.
Update the ramdump function cursor functions and make the address hex
instead of decimal

Signed-off-by: Myles Watson <mylesgw@gmail.com>

Thanks,
Myles
Stefan Reinauer - 2009-08-22 14:16:13
On 8/21/09 9:09 PM, Myles Watson wrote:
> Update Coreinfo to use TAG_FORWARD in tables.
> Update the ramdump function cursor functions and make the address hex
> instead of decimal
>
> Signed-off-by: Myles Watson <mylesgw@gmail.com>
>   

Both are Acked-by: Stefan Reinauer <stepan@coresystems.de>
ron minnich - 2009-08-22 15:21:44
On Fri, Aug 21, 2009 at 12:09 PM, Myles Watson<mylesgw@gmail.com> wrote:
> Update Coreinfo to use TAG_FORWARD in tables.
> Update the ramdump function cursor functions and make the address hex
> instead of decimal
>
> Signed-off-by: Myles Watson <mylesgw@gmail.com>

I notice you removed the checks for < 0 and > something.

I assume these are checked elsewhere?
Acked-by: Ronald G. Minnich <rminnich@gmail.com>
Uwe Hermann - 2009-08-22 16:18:23
On Fri, Aug 21, 2009 at 01:09:20PM -0600, Myles Watson wrote:
> Update Coreinfo to use TAG_FORWARD in tables.
> Update the ramdump function cursor functions and make the address hex
> instead of decimal
> 
> Signed-off-by: Myles Watson <mylesgw@gmail.com>

Great stuff, thanks! Tested on QEMU, looks good.

Both patches are:

Acked-by: Uwe Hermann <uwe@hermann-uwe.de>

 
Uwe.
Myles Watson - 2009-08-24 15:27:58
> I notice you removed the checks for < 0 and > something.
>
> I assume these are checked elsewhere?
Yes.  At the end of the file they're checked and forced into bounds.

> Acked-by: Ronald G. Minnich <rminnich@gmail.com>
Rev 4563.

Thanks,
Myles

Patch

Index: svn/ramdump_module.c
===================================================================
--- svn.orig/ramdump_module.c
+++ svn/ramdump_module.c
@@ -34,7 +34,7 @@  static void dump_ram(WINDOW *win, uint32
 	int i, x = 0, y = 0, count = 0;
 	volatile uint8_t *ptr = (void *)(addr);
 
-	mvwprintw(win, 0, col + 54, "RAM address: %10d", addr);
+	mvwprintw(win, 0, col + 54, "RAM address: %10x", addr);
 
 	/* Dump 256 bytes of RAM. */
 	for (i = 1; i < 257; i++) {
@@ -68,23 +68,21 @@  static int ramdump_module_handle(int key
 {
 	switch (key) {
 	case KEY_DOWN:
-		if (cursor == cursor_max)
-			return 0;
 		cursor++;
 		break;
 	case KEY_UP:
-		if (cursor == 0)
-			return 0;
 		cursor--;
 		break;
-	case KEY_NPAGE:
-		if (cursor == cursor_max)
-			return 0;
-		cursor += 4096; /* Jump in 1MB steps. */
+	case KEY_RIGHT:
+		cursor += 256;
+		break;
+	case KEY_LEFT:
+		cursor -= 256;
 		break;
 	case KEY_PPAGE:
-		if (cursor == 0)
-			return 0;
+		cursor += 4096; /* Jump in 1MB steps. */
+		break;
+	case KEY_NPAGE:
 		cursor -= 4096; /* Jump in 1MB steps. */
 		break;
 	}