diff options
author | Stan Shebs <shebs@codesourcery.com> | 1995-04-15 21:22:14 +0000 |
---|---|---|
committer | Stan Shebs <shebs@codesourcery.com> | 1995-04-15 21:22:14 +0000 |
commit | 8befb594699839bf0d4af2f399b71ceb84a3bb2c (patch) | |
tree | 68b725cd9e816422de7164b2ac3bc5d6a59f9795 /gdb/ser-mac.c | |
parent | b3636ee55ec939d470bd1af69f047d1bf1613066 (diff) | |
download | gdb-8befb594699839bf0d4af2f399b71ceb84a3bb2c.zip gdb-8befb594699839bf0d4af2f399b71ceb84a3bb2c.tar.gz gdb-8befb594699839bf0d4af2f399b71ceb84a3bb2c.tar.bz2 |
* mpw-make.in (init.c): Don't try to do symbolic {o} in sed
command, not allowed by some version of MPW Make.
* ser-mac.c (mac-setbaudrate): Make it actually set baud rates.
Diffstat (limited to 'gdb/ser-mac.c')
-rw-r--r-- | gdb/ser-mac.c | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/gdb/ser-mac.c b/gdb/ser-mac.c index 98a503c..250375a 100644 --- a/gdb/ser-mac.c +++ b/gdb/ser-mac.c @@ -239,12 +239,46 @@ mac_print_tty_state (scb, ttystate) return; } +/* If there is a tricky formula to relate real baud rates + to what the serial driver wants, we should use it. Until + we get one, this table will have to do. */ + +static struct { + int real_rate; + int bits; +} mac_baud_rate_table[] = { + { 57600, baud57600 }, + { 38400, 2 /* ??? */ }, + { 19200, baud19200 }, + { 9600, baud9600 }, + { 7200, baud7200 }, + { 4800, baud4800 }, + { 3600, baud3600 }, + { 2400, baud2400 }, + { 1800, baud1800 }, + { 1200, baud1200 }, + { 600, baud600 }, + { 300, baud300 }, + { 0, 0 } +}; + static int mac_set_baud_rate (scb, rate) serial_t scb; int rate; { - return 0; + int i, bits; + + for (i = 0; mac_baud_rate_table[i].real_rate != 0; ++i) + { + if (mac_baud_rate_table[i].real_rate == rate) + { + bits = mac_baud_rate_table[i].bits; + break; + } + } + SerReset (input_refnum, stop10|noParity|data8|bits); + SerReset (output_refnum, stop10|noParity|data8|bits); } static int |