Article View: comp.os.msdos.programmer
Article #4280U8250 - Enabling THRE
From: Viraf Bankwalla
Date: Wed, 16 Jan 1991 18:04
Date: Wed, 16 Jan 1991 18:04
73 lines
1931 bytes
1931 bytes
Hi,
The Waite Group's, MS-DOS Developer's Guide,
Chapter 8, Programming the Serial Port, pg 471, has the
following isr:
/*---------------- C O D E --------------------*
void interrupt far s_inthndlr(void)
{
int c;
register int int_id, intmask;
_enable(); /* Enable interrupts immediately */
while(TRUE)
{
ini_id = inp(IIR);
if (bit0(int_id) == 1)
{
/* If bit 0 is 1, then no interrupts pending.
** Send an end of interrupt signal to the
** 8259A Programmable Interrupt Controller
** and return.
*/
outp(P8259_0, END_OF_INT);
return;
}
/* If it is receive data ready interrupt
** enable interrupts for "transmit holding
** register empty"
*/
if (int_id >= RXDATARDY)
turnon_int(THREINT, intmask);
/* Process interrupt according to ID. The
** following list is in increasing order of
** priority.
*/
switch(int_id)
{
case MDMSTAT: /* Read modem status */
s_modemstatus = inp(MSR);
break;
case TXREGEMPTY:
s_trmty();
break;
case RXDATAREADY:
s_rda();
break;
case RLINESTATUS: /* Read line status */
s_linestatus = inp(LSR);
break;
}
}
}
/*---------------- E N D C O D E --------------------*
My question is, why are THRE interrupts enabled, if (int_id > RXDATAREADY).
Is it to do with the interrupt priority ?.
Any help would be greatly appreciated.
Thanks in advance.
viraf bankwalla
viraf@seas.gwu.edu
...!uunet!gwusun!viraf
Technical Details
Message-ID:
<2550@sparko.gwu.edu>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!seas.gwu.edu!virafShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!seas.gwu.edu!viraf From: viraf@seas.gwu.edu (Viraf Bankwalla) Newsgroups: comp.os.msdos.programmer Subject: U8250 - Enabling THRE Message-ID: <2550@sparko.gwu.edu> Date: 16 Jan 91 18:04:30 GMT Reply-To: viraf@seas.gwu.edu () Organization: The George Washington University, Washington D.C. Lines: 73