From 09d3f81dcff1fce41b048229a874a1ea21680a0c Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Sat, 12 Dec 2020 06:08:33 +0000 Subject: [PATCH] sh: use new common trampoline --- arch/sh/defs.h | 3 +++ arch/sh/trampoline.c | 28 +--------------------------- 2 files changed, 4 insertions(+), 27 deletions(-) diff --git a/arch/sh/defs.h b/arch/sh/defs.h index 2090e87..dd13d47 100644 --- a/arch/sh/defs.h +++ b/arch/sh/defs.h @@ -12,6 +12,9 @@ #define REG_MACH (20) #define REG_MACL (21) +#define FETCH_LINKPTR(dest) \ + asm("mov r8, %0" : "=rm" (dest)); + #include "common-defs.h" #endif diff --git a/arch/sh/trampoline.c b/arch/sh/trampoline.c index cd1b863..83eb453 100644 --- a/arch/sh/trampoline.c +++ b/arch/sh/trampoline.c @@ -1,28 +1,2 @@ -/* - * Copyright (c) 2020 Ariadne Conill - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * This software is provided 'as is' and without any warranty, express or - * implied. In no event shall the authors be liable for any damages arising - * from the use of this software. - */ - -#include -#include #include "defs.h" - -void -libucontext_trampoline(void) -{ - libucontext_ucontext_t *uc_link; - - asm("mov r8, %0" : "=r" (uc_link)); - - if (uc_link == NULL) - exit(0); - - libucontext_setcontext(uc_link); -} +#include "common-trampoline.c"