interrupts, timer, keyboard, segments, lots of kernel code
[bootcensus] / src / asmops.h
index 2578467..3ce2f17 100644 (file)
@@ -7,6 +7,11 @@
 #define disable_intr() asm volatile("cli")
 #define halt_cpu() asm volatile("hlt")
 
+#define CALLER_EIP(eip) \
+       asm volatile( \
+               "mov (%%esp), %0\n\t" \
+               : "=a" ((uint32_t)eip))
+
 static inline uint8_t inb(uint16_t port)
 {
        uint8_t res;