Fix apic build with kvm disabled
[qemu/qemu-dev-zwu.git] / kvm / test / lib / x86 / io.c
blob894f398b1c23766de27e923c7d27a191ac3a6b83
1 #include "libcflat.h"
2 #include "smp.h"
4 static struct spinlock lock;
6 static void print_serial(const char *buf)
8 unsigned long len = strlen(buf);
10 asm volatile ("rep/outsb" : "+S"(buf), "+c"(len) : "d"(0xf1));
13 void puts(const char *s)
15 spin_lock(&lock);
16 print_serial(s);
17 spin_unlock(&lock);
20 void exit(int code)
22 asm volatile("out %0, %1" : : "a"(code), "d"((short)0xf4));