Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for m68k #38

Merged
merged 1 commit into from
Jan 6, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions platform/switch_m68k_gcc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* this is the internal transfer function.
*
* HISTORY
* 2014-01-06 Andreas Schwab <schwab@linux-m68k.org>
* File created.
*/

#ifdef SLP_EVAL

#define STACK_MAGIC 0

#define REGS_TO_SAVE "%d2", "%d3", "%d4", "%d5", "%d6", "%d7", \
"%a2", "%a3", "%a4"

static int
slp_switch(void)
{
int *stackref, stsizediff;
void *fp, *a5;
__asm__ volatile ("" : : : REGS_TO_SAVE);
__asm__ volatile ("move.l %%fp, %0" : "=m"(fp));
__asm__ volatile ("move.l %%a5, %0" : "=m"(a5));
__asm__ ("move.l %%sp, %0" : "=r"(stackref));
{
SLP_SAVE_STATE(stackref, stsizediff);
__asm__ volatile ("add.l %0, %%sp; add.l %0, %%fp" : : "r"(stsizediff));
SLP_RESTORE_STATE();
}
__asm__ volatile ("move.l %0, %%a5" : : "m"(a5));
__asm__ volatile ("move.l %0, %%fp" : : "m"(fp));
__asm__ volatile ("" : : : REGS_TO_SAVE);
return 0;
}

#endif
2 changes: 2 additions & 0 deletions slp_platformselect.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,6 @@
#include "platform/switch_mips_unix.h" /* Linux/MIPS */
#elif defined(__GNUC__) && defined(__aarch64__)
#include "platform/switch_aarch64_gcc.h" /* Aarch64 ABI */
#elif defined(__GNUC__) && defined(__mc68000__)
#include "platform/switch_m68k_gcc.h" /* gcc on m68k */
#endif