Mail Archives: djgpp/2002/11/24/18:15:19
Hello,
None of the documentation I have seen suggests wrapping cli/sti around
the setting of an interrupt handler using
_go32_dpmi_*_protected_mode_vector. Is this required, for example in
the following code:
outportb(com_port + SERIAL_LCR, 0x03);
outportb(com_port + SERIAL_IER, 0x00);
while (inportb(com_port + SERIAL_IIR) & 0x01 == 0) {
// clean out registers
}
_go32_dpmi_seginfo old_isr, new_isr;
_go32_dpmi_get_protected_mode_interrupt_vector(interruptno,
&old_isr);
new_isr.pm_offset = (int)isr;
new_isr.pm_selector = _go32_my_cs();
_go32_dpmi_allocate_iret_wrapper(&new_isr);
_go32_dpmi_set_protected_mode_interrupt_vector(interruptno,
&new_isr);
It seems to me that interrupts should be disabled for all of this,
both disabling interrupt generation from the hardware device (UART) as
well as setting the interrupt handler. But I never see cli/sti calls
wrapped around the handler installation code; what is correct?
Thanks,
Eric Farmer
- Raw text -