Create a C wrapper around the Forth key word to be used in the debugger instead of calling availchar()/getchar(). Using this

wrapper means that the debugger now works correctly under PPC.

Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk>


git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@822 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
Mark Cave-Ayland
2010-07-25 17:34:13 +00:00
committed by Mark Cave-Ayland
parent 3330f2e126
commit fc58e30c96

View File

@@ -446,6 +446,27 @@ int printf_console( const char *fmt, ... )
return i;
}
static
int getchar_console( void )
{
cell tmp;
/* Push to the Forth interpreter for console output */
tmp = rstackcnt;
trampoline[1] = findword("key");
PUSHR(PC);
PC = pointer2cell(trampoline);
while (rstackcnt > tmp) {
dbg_interp_printk("getchar_console: NEXT\n");
next();
}
return POP();
}
static void
display_dbg_dstack ( void )
{
@@ -567,8 +588,7 @@ do_source_dbg( struct debug_xt *debug_xt_item )
return;
/* Otherwise in step mode, prompt for a keypress */
while (!availchar());
k = getchar();
k = getchar_console();
/* Only proceed if done is true */
while (!done)
@@ -601,8 +621,7 @@ do_source_dbg( struct debug_xt *debug_xt_item )
/* Down - mark current word for debug and step into it */
done = add_debug_xt(read_ucell(cell2pointer(PC)));
if (!done) {
while (!availchar());
k = getchar();
k = getchar_console();
}
break;
@@ -618,8 +637,7 @@ do_source_dbg( struct debug_xt *debug_xt_item )
/* Display rstack */
display_dbg_rstack();
done = 0;
while (!availchar());
k = getchar();
k = getchar_console();
break;
case 'f':
@@ -636,8 +654,7 @@ do_source_dbg( struct debug_xt *debug_xt_item )
default:
/* Display debug banner */
printf_console(DEBUG_BANNER);
while (!availchar());
k = getchar();
k = getchar_console();
}
}
}