summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrsc <rsc>2009-03-08 21:27:57 +0000
committerrsc <rsc>2009-03-08 21:27:57 +0000
commitc396d065d3f5e5a0f966857d710a434a2f2db066 (patch)
tree39c743a3a8eb6c386b6daf30abe2e770f727a284
parent4003e9bed8a306048c7dfe7143949778f96f7273 (diff)
downloadxv6-labs-c396d065d3f5e5a0f966857d710a434a2f2db066.tar.gz
xv6-labs-c396d065d3f5e5a0f966857d710a434a2f2db066.tar.bz2
xv6-labs-c396d065d3f5e5a0f966857d710a434a2f2db066.zip
xv6/x86.h: add stosb, fix bugs in insl/outsl (rep not repne)
-rw-r--r--x86.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/x86.h b/x86.h
index 5961d67..08e1798 100644
--- a/x86.h
+++ b/x86.h
@@ -12,7 +12,7 @@ inb(ushort port)
static inline void
insl(int port, void *addr, int cnt)
{
- asm volatile("cld; repne insl" :
+ asm volatile("cld; rep insl" :
"=D" (addr), "=c" (cnt) :
"d" (port), "0" (addr), "1" (cnt) :
"memory", "cc");
@@ -33,12 +33,21 @@ outw(ushort port, ushort data)
static inline void
outsl(int port, const void *addr, int cnt)
{
- asm volatile("cld; repne outsl" :
+ asm volatile("cld; rep outsl" :
"=S" (addr), "=c" (cnt) :
"d" (port), "0" (addr), "1" (cnt) :
"cc");
}
+static inline void
+stosb(void *addr, int data, int cnt)
+{
+ asm volatile("cld; rep stosb" :
+ "=D" (addr), "=c" (cnt) :
+ "0" (addr), "1" (cnt), "a" (data) :
+ "memory", "cc");
+}
+
static inline uint
read_ebp(void)
{