Add support for specific EOI PIC command.

This commit is contained in:
Jukka Heinonen 2003-09-01 23:55:53 +00:00 committed by Alexandre Julliard
parent dad477ce3f
commit 0a1fa89f33
1 changed files with 40 additions and 23 deletions

View File

@ -599,31 +599,48 @@ int WINAPI DOSVM_Enter( CONTEXT86 *context )
*/ */
void WINAPI DOSVM_PIC_ioport_out( WORD port, BYTE val) void WINAPI DOSVM_PIC_ioport_out( WORD port, BYTE val)
{ {
LPDOSEVENT event; if (port != 0x20)
{
FIXME( "Unsupported PIC port %04x\n", port );
}
else if (val == 0x20 || (val >= 0x60 && val <= 0x67))
{
EnterCriticalSection(&qcrit);
if ((port==0x20) && (val==0x20)) { if (!current_event)
EnterCriticalSection(&qcrit); {
if (current_event) { WARN( "%s without active IRQ\n",
/* EOI (End Of Interrupt) */ val == 0x20 ? "EOI" : "Specific EOI" );
TRACE("received EOI for current IRQ, clearing\n"); }
event = current_event; else if (val != 0x20 && val - 0x60 != current_event->irq)
current_event = event->next; {
if (event->relay) WARN( "Specific EOI but current IRQ %d is not %d\n",
(*event->relay)(NULL,event->data); current_event->irq, val - 0x60 );
free(event); }
else
{
LPDOSEVENT event = current_event;
if (DOSVM_HasPendingEvents()) { TRACE( "Received %s for current IRQ %d, clearing event\n",
/* another event is pending, which we should probably val == 0x20 ? "EOI" : "Specific EOI", event->irq );
* be able to process now */
TRACE("another event pending, setting flag\n"); current_event = event->next;
NtCurrentTeb()->vm86_pending |= VIP_MASK; if (event->relay)
} (*event->relay)(NULL,event->data);
} else { free(event);
WARN("EOI without active IRQ\n");
} if (DOSVM_HasPendingEvents())
LeaveCriticalSection(&qcrit); {
} else { TRACE( "Another event pending, setting pending flag\n" );
FIXME("unrecognized PIC command %02x\n",val); NtCurrentTeb()->vm86_pending |= VIP_MASK;
}
}
LeaveCriticalSection(&qcrit);
}
else
{
FIXME( "Unrecognized PIC command %02x\n", val );
} }
} }