-Audit all sti/cli calls.
+Audit all sti/cli calls. Audit all call16 calls to make sure flags is
+setup properly with respect to irqs.
Audit statements where a 32bit intermediary changes meaning of a 16bit
comparison.
static void
try_boot(u16 seq_nr)
{
+ irq_enable();
+
SET_IPL(sequence, seq_nr);
+
u16 bootseg;
u8 bootdrv = 0;
u16 bootdev, bootip;
{
if (CONFIG_ATA)
ata_detect();
- irq_enable();
struct bregs br;
memset(&br, 0, sizeof(br));
call16_int(0x19, &br);
u32 func = GET_EBDA(far_call_pointer);
asm volatile(
- "pushl %%ebp\n"
- "pushfl\n"
"pushl %0\n"
"pushw %w1\n" // status
"pushw %w2\n" // X
"pushw $0\n" // Z
"lcallw *8(%%esp)\n"
"addl $12, %%esp\n"
- "popfl\n"
- "popl %%ebp\n"
+ "cld\n"
: "+a" (func), "+b" (status), "+c" (X), "+d" (Y)
:
- : "esi", "edi"
+ : "esi", "edi", "ebp", "cc"
);
}
// XXX - move this to a c file and use PANIC PORT.
#define BX_PANIC(fmt, args...) do { \
bprintf(0, fmt , ##args); \
+ irq_disable(); \
for (;;) \
hlt(); \
} while (0)
eoi_master_pic();
}
+// Call a function with a specified register state. Note that on
+// return, the interrupt enable/disable flag may be altered.
static inline
void call16(struct bregs *callregs)
{
asm volatile(
- "pushl %%ebp\n" // Save state
- "pushfl\n"
#ifdef MODE16
"calll __call16\n"
#else
"calll __call16_from32\n"
#endif
- "popfl\n" // Restore state
- "popl %%ebp\n"
: "+a" (callregs), "+m" (*callregs)
:
- : "ebx", "ecx", "edx", "esi", "edi");
+ : "ebx", "ecx", "edx", "esi", "edi", "ebp", "cc");
}
static inline