Mail Archives: djgpp/2002/11/28/08:00:13
Charles Sandmann <sandmann AT clio DOT rice DOT edu> wrote in message news:<3de5adb7 DOT sandmann AT clio DOT rice DOT edu>...
> > When I replaced the source code disable() and enable() by
> > ("sti") and ("cli") in my H/W interrupt handler, then system
> > never been hung, they work fine both with PS/2 mouse and
> > COM port mouse. So I think my problem has been solved! but I don't know why?
>
> Do *NOT* put an enable() call in your handler if you are using the
> DJGPP wrappers. Do *NOT* put a "sti" either. The wrappers are
> not re-entrant, and they restore interrupts on exit.
>
> > hardware_int_handler()
> > {
> > INTERRUPT_ENTER();
^^^^^^^^^^^^^ This is *wrong*, please Do *NOT* to use disable() or "sti"
>
> > //your handler code here.
>
> > INTERRUPT_LEAVE_BOTH();
^^^^^^^^^^^^^^ This is *wrong*, please Do *NOT* to use enable() or "cli"
> > }
>
> This is wrong; do not use the sti/cli
Thanks for Charles!!
Yes! I used DJGPP wrappers to insatll my handler. as this
...
_go32_dpmi_get_protected_mode_interrupt_vector(intr_vector, &oldirq);
newirq.pm_offset = (int)hardware_int_handler; //my H/W handler
newirq.pm_selector = _go32_my_cs();
_go32_dpmi_allocate_iret_wrapper(&newirq); //DJGPP wrapper.
...
In my handler, I remove INTERRUPT_ENTER() and INTERRUPT_LEAVE_BOTH() as
Charles said. And my program work fine(when mouse interrupt or my H/W
interrut occurred), my system never crashed! I try many times.
Thanks for Charles again!!
- Raw text -