to prevent reordering.
for (p = s; *p != '\0'; p++)
outb (0x8900, *p);
- asm ("cli; hlt");
+ asm volatile ("cli; hlt" : : : "memory");
printf ("still running...\n");
for (;;);
}
/* Disable interrupts by clearing the interrupt flag.
See [IA32-v2b] "CLI" and [IA32-v3a] 5.8.1 "Masking Maskable
Hardware Interrupts". */
- asm volatile ("cli");
+ asm volatile ("cli" : : : "memory");
return old_level;
}
See [IA32-v2a] "HLT", [IA32-v2b] "STI", and [IA32-v3a]
7.11.1 "HLT Instruction". */
- asm ("sti; hlt");
+ asm volatile ("sti; hlt" : : : "memory");
}
}
new page tables immediately. See [IA32-v2a] "MOV--Move
to/from Control Registers" and [IA32-v3a] 3.7.5 "Base
Address of the Page Directory". */
- asm volatile ("movl %0, %%cr3" :: "r" (vtop (pd)));
+ asm volatile ("movl %0, %%cr3" : : "r" (vtop (pd)) : "memory");
}
/* Returns the currently active page directory. */
arguments on the stack in the form of a `struct intr_frame',
we just point the stack pointer (%esp) to our stack frame
and jump to it. */
- asm ("movl %0, %%esp; jmp intr_exit" :: "g" (&if_));
+ asm volatile ("movl %0, %%esp; jmp intr_exit" : : "g" (&if_) : "memory");
NOT_REACHED ();
}