defs: use register output only for FETCH_LINKPTR

pull/25/head
osy 2021-01-02 18:17:28 -08:00 committed by Ariadne Conill
parent 638770cfd0
commit e1e6508af2
8 changed files with 8 additions and 7 deletions

View File

@ -19,7 +19,7 @@
#endif #endif
#define FETCH_LINKPTR(dest) \ #define FETCH_LINKPTR(dest) \
asm("mov x0, %0" : "=rm" ((dest))) asm("mov x0, %0" : "=r" ((dest)))
#include "common-defs.h" #include "common-defs.h"

View File

@ -6,7 +6,7 @@
#define TYPE(__proc) #define TYPE(__proc)
#define FETCH_LINKPTR(dest) \ #define FETCH_LINKPTR(dest) \
asm("movs r0, %0" : "=rm" ((dest))) asm("movs r0, %0" : "=r" ((dest)))
#include "common-defs.h" #include "common-defs.h"

View File

@ -19,6 +19,7 @@ libucontext_trampoline(void)
{ {
libucontext_ucontext_t *uc_link; libucontext_ucontext_t *uc_link;
// FIXME: there's no guarantee that input is not clobbered!
FETCH_LINKPTR(uc_link); FETCH_LINKPTR(uc_link);
if (uc_link == NULL) if (uc_link == NULL)

View File

@ -27,7 +27,7 @@
#define PC_OFFSET REG_OFFSET(REG_PC) #define PC_OFFSET REG_OFFSET(REG_PC)
#define FETCH_LINKPTR(dest) \ #define FETCH_LINKPTR(dest) \
asm("mov.l (%%sp, %%d7.l * 4), %0" : "=rm" ((dest))) asm("mov.l (%%sp, %%d7.l * 4), %0" :: "r" ((dest)))
#include "common-defs.h" #include "common-defs.h"

View File

@ -48,7 +48,7 @@
#define PC_OFFSET REG_OFFSET(REG_PC) #define PC_OFFSET REG_OFFSET(REG_PC)
#define FETCH_LINKPTR(dest) \ #define FETCH_LINKPTR(dest) \
asm("mv %0, s1" : "=rm" ((dest))) asm("mv %0, s1" : "=r" ((dest)))
#include "common-defs.h" #include "common-defs.h"

View File

@ -13,7 +13,7 @@
#define REG_MACL (21) #define REG_MACL (21)
#define FETCH_LINKPTR(dest) \ #define FETCH_LINKPTR(dest) \
asm("mov r8, %0" : "=rm" (dest)); asm("mov r8, %0" : "=r" (dest));
#include "common-defs.h" #include "common-defs.h"

View File

@ -60,7 +60,7 @@
#define MCONTEXT_GREGS (20) #define MCONTEXT_GREGS (20)
#define FETCH_LINKPTR(dest) \ #define FETCH_LINKPTR(dest) \
asm("movl (%%esp, %%ebx, 4), %0" : "=rm" ((dest))); asm("movl (%%esp, %%ebx, 4), %0" : "=r" ((dest)));
#include "common-defs.h" #include "common-defs.h"

View File

@ -32,7 +32,7 @@
#define REG_SZ (8) #define REG_SZ (8)
#define FETCH_LINKPTR(dest) \ #define FETCH_LINKPTR(dest) \
asm("movq (%%rbx), %0" : "=rm" ((dest))); asm("movq (%%rbx), %0" : "=r" ((dest)));
#include "common-defs.h" #include "common-defs.h"