Skip to content
Snippets Groups Projects
Commit c396d065 authored by rsc's avatar rsc
Browse files

xv6/x86.h: add stosb, fix bugs in insl/outsl (rep not repne)

parent 4003e9be
No related branches found
No related tags found
No related merge requests found
...@@ -12,7 +12,7 @@ inb(ushort port) ...@@ -12,7 +12,7 @@ inb(ushort port)
static inline void static inline void
insl(int port, void *addr, int cnt) insl(int port, void *addr, int cnt)
{ {
asm volatile("cld; repne insl" : asm volatile("cld; rep insl" :
"=D" (addr), "=c" (cnt) : "=D" (addr), "=c" (cnt) :
"d" (port), "0" (addr), "1" (cnt) : "d" (port), "0" (addr), "1" (cnt) :
"memory", "cc"); "memory", "cc");
...@@ -33,12 +33,21 @@ outw(ushort port, ushort data) ...@@ -33,12 +33,21 @@ outw(ushort port, ushort data)
static inline void static inline void
outsl(int port, const void *addr, int cnt) outsl(int port, const void *addr, int cnt)
{ {
asm volatile("cld; repne outsl" : asm volatile("cld; rep outsl" :
"=S" (addr), "=c" (cnt) : "=S" (addr), "=c" (cnt) :
"d" (port), "0" (addr), "1" (cnt) : "d" (port), "0" (addr), "1" (cnt) :
"cc"); "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 static inline uint
read_ebp(void) read_ebp(void)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment