From: erfarmer201 AT comcast DOT net (Eric Farmer) Newsgroups: comp.os.msdos.djgpp Subject: Disable interrupts around _go32_dpmi calls? Date: 24 Nov 2002 15:13:34 -0800 Organization: http://groups.google.com/ Lines: 28 Message-ID: NNTP-Posting-Host: 68.55.233.20 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1038179615 5314 127.0.0.1 (24 Nov 2002 23:13:35 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: 24 Nov 2002 23:13:35 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com 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