Ticket #5344: arch_int.patch

File arch_int.patch, 700 bytes (added by Grey, 14 years ago)
  • headers/private/kernel/arch/x86/arch_int.h

     
    2525    asm volatile("pushfl;\n"
    2626        "popl %0;\n"
    2727        "cli" : "=g" (flags));
    28     return (flags & 0x200) != 0;
     28    return flags ;
    2929}
    3030
    3131
    3232static inline void
    3333arch_int_restore_interrupts_inline(int oldState)
    3434{
    35     int flags = oldState ? 0x200 : 0;
    36 
    37     asm volatile("pushfl;\n"
    38         "popl   %0;\n"
    39         "andl   $0xfffffdff,%0;\n"
    40         "orl    %1,%0;\n"
    41         "pushl  %0;\n"
    42         "popfl\n"
    43         : "=&r"(flags) : "r"(flags));
     35    if( oldState & 0x200 )
     36            asm("sti");
    4437}
    4538
    4639