You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "defs.h"
#include "gdbcmd.h"
if (port->baudrate != rate)
{
int x;
+ unsigned char cfcr;
x = dos_baudconv (rate);
if (x <= 0)
}
disable ();
+ cfcr = inb (port, com_cfcr);
+
outb(port, com_cfcr, CFCR_DLAB);
outb(port, com_dlbl, x & 0xff);
outb(port, com_dlbh, x >> 8);
- outb(port, com_cfcr, CFCR_8BITS);
+ outb(port, com_cfcr, cfcr);
port->baudrate = rate;
enable ();
}
return 0;
}
+static int
+dos_setstopbits (scb, num)
+ serial_t scb;
+ int num;
+{
+ struct dos_ttystate *port = &ports[scb->fd];
+ unsigned char cfcr;
+
+ disable ();
+ cfcr = inb (port, com_cfcr);
+
+ switch (num)
+ {
+ case SERIAL_1_STOPBITS:
+ outb (port, com_cfcr, cfcr & ~CFCR_STOPB);
+ break;
+ case SERIAL_1_AND_A_HALF_STOPBITS:
+ case SERIAL_2_STOPBITS:
+ outb (port, com_cfcr, cfcr | CFCR_STOPB);
+ break;
+ default:
+ enable ();
+ return 1;
+ }
+ enable ();
+
+ return 0;
+}
static int
dos_write (scb, str, len)
dos_print_tty_state,
dos_noflush_set_tty_state,
dos_setbaudrate,
+ dos_setstopbits,
+ dos_noop, /* wait for output to drain */
};