Skip to content

Commit

Permalink
xv6/x86.h: add stosb, fix bugs in insl/outsl (rep not repne)
Browse files Browse the repository at this point in the history
  • Loading branch information
rsc committed Mar 8, 2009
1 parent 4003e9b commit c396d06
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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)
{
Expand Down

0 comments on commit c396d06

Please sign in to comment.