From 15ba7b039c1c6416b2c430ceae271d3be9adefa9 Mon Sep 17 00:00:00 2001 From: Ariadne Conill Date: Sun, 6 Dec 2020 02:24:49 -0600 Subject: [PATCH] m68k: add startcontext trampoline --- arch/m68k/startcontext.S | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 arch/m68k/startcontext.S diff --git a/arch/m68k/startcontext.S b/arch/m68k/startcontext.S new file mode 100644 index 0000000..321e467 --- /dev/null +++ b/arch/m68k/startcontext.S @@ -0,0 +1,26 @@ +/* + * 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 "defs.h" + +FUNC(__start_context) + lea (%sp, %d7.l * REG_SZ), %sp /* place uc_link in $sp */ + + tst.l (%sp) /* test next content for NULL */ + jeq no_linked_context + + jbsr __setcontext /* call setcontext */ + move.l %d0, (%sp) + +no_linked_context: + jbsr exit +END(__start_context)