aboutsummaryrefslogtreecommitdiff
path: root/sim/m32c/mem.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2008-06-17 00:34:37 +0000
committerDJ Delorie <dj@redhat.com>2008-06-17 00:34:37 +0000
commite7ddc197153de3bcee60451d867d95a13d5f146f (patch)
treed6ba28ee533b366885344fb2c18635bae33be308 /sim/m32c/mem.c
parent2bcebd805259eee3878a47ba21068278d6d8495f (diff)
downloadfsf-binutils-gdb-e7ddc197153de3bcee60451d867d95a13d5f146f.zip
fsf-binutils-gdb-e7ddc197153de3bcee60451d867d95a13d5f146f.tar.gz
fsf-binutils-gdb-e7ddc197153de3bcee60451d867d95a13d5f146f.tar.bz2
* m32c.opc (BRK, GDBBRK): Remove debug logic.
* main.c (main): Add option to set raw console. * mem.h (m32c_use_raw_console): Declare. * mem.c (m32c_sim_restore_console): Only restore console if it's been previously set. (m32c_use_raw_console): Define. (mem_get_byte): Set raw console if m32c_use_raw_console is set.
Diffstat (limited to 'sim/m32c/mem.c')
-rw-r--r--sim/m32c/mem.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/sim/m32c/mem.c b/sim/m32c/mem.c
index 474fc5e..20d2350 100644
--- a/sim/m32c/mem.c
+++ b/sim/m32c/mem.c
@@ -50,6 +50,7 @@ static unsigned char **pt[L1_LEN];
int m32c_console_ifd = 0;
int m32c_console_ofd = 1;
+int m32c_use_raw_console = 0;
#ifdef TIMER_A
Timer_A timer_a;
@@ -394,7 +395,8 @@ stdin_ready ()
void
m32c_sim_restore_console ()
{
- tcsetattr (m32c_console_ifd, TCSANOW, &oattr);
+ if (console_raw)
+ tcsetattr (m32c_console_ifd, TCSANOW, &oattr);
console_raw = 0;
}
@@ -409,9 +411,9 @@ mem_get_byte (int address)
case 0x2ed: /* m32c uart1c1 */
case 0x3ad: /* m16c uart1c1 */
-#if 0
- if (!console_raw)
+ if (!console_raw && m32c_use_raw_console)
{
+ struct termios attr;
tcgetattr (m32c_console_ifd, &attr);
tcgetattr (m32c_console_ifd, &oattr);
/* We want each key to be sent as the user presses them. */
@@ -420,7 +422,6 @@ mem_get_byte (int address)
console_raw = 1;
atexit (m32c_sim_restore_console);
}
-#endif
if (stdin_ready ())
return 0x02; /* tx empty and rx full */