Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
docs
help
help-venv
lib
python3.12
site-packages
greenlet
platform
switch_m68k_gcc.h
1
/*
2
* this is the internal transfer function.
3
*
4
* HISTORY
5
* 2014-01-06 Andreas Schwab <schwab@linux-m68k.org>
6
* File created.
7
*/
8
9
#ifdef SLP_EVAL
10
11
#define STACK_MAGIC 0
12
13
#define REGS_TO_SAVE "%d2", "%d3", "%d4", "%d5", "%d6", "%d7", \
14
"%a2", "%a3", "%a4"
15
16
static
int
17
slp_switch(
void
)
18
{
19
int
err;
20
int
*stackref, stsizediff;
21
void
*fp, *a5;
22
__asm__
volatile
(
""
: : : REGS_TO_SAVE);
23
__asm__
volatile
(
"move.l %%fp, %0"
:
"=m"
(fp));
24
__asm__
volatile
(
"move.l %%a5, %0"
:
"=m"
(a5));
25
__asm__ (
"move.l %%sp, %0"
:
"=r"
(stackref));
26
{
27
SLP_SAVE_STATE(stackref, stsizediff);
28
__asm__
volatile
(
"add.l %0, %%sp; add.l %0, %%fp"
: :
"r"
(stsizediff));
29
SLP_RESTORE_STATE();
30
__asm__
volatile
(
"clr.l %0"
:
"=g"
(err));
31
}
32
__asm__
volatile
(
"move.l %0, %%a5"
: :
"m"
(a5));
33
__asm__
volatile
(
"move.l %0, %%fp"
: :
"m"
(fp));
34
__asm__
volatile
(
""
: : : REGS_TO_SAVE);
35
return
err;
36
}
37
38
#endif
Generated by
1.9.8