Add memory to clobber list for read syscalls
This commit is contained in:
parent
6a51f8851b
commit
c8875d39f2
@ -48,7 +48,7 @@ intptr_t read(int32_t fd, const void* buf, intptr_t size){
|
||||
// Input operands
|
||||
: "r"((int64_t)fd), "r" (buf), "r"(size)
|
||||
// Clobbered registers
|
||||
: "x0", "x1", "x2", "x8"
|
||||
: "x0", "x1", "x2", "x8", "memory"
|
||||
);
|
||||
return n_read;
|
||||
}
|
||||
|
||||
@ -39,7 +39,7 @@ intptr_t read(int32_t fd, const void* buf, intptr_t size){
|
||||
"move %0, $v0\n"
|
||||
: "=r"(n_read)
|
||||
: "r"(fd), "r"(buf), "r"(size)
|
||||
: "a0", "a1", "a2", "v0" //TODO: temp registers clobbered by syscall should probably also be listed but this fn returns right away so it should be fine?
|
||||
: "a0", "a1", "a2", "v0", "memory" //TODO: temp registers clobbered by syscall should probably also be listed but this fn returns right away so it should be fine?
|
||||
);
|
||||
return n_read;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user