Qucs-S S-parameter Viewer & RF Synthesis Tools
Loading...
Searching...
No Matches
docs
help
help-venv
lib
python3.12
site-packages
greenlet
platform
switch_sparc_sun_gcc.h
1
/*
2
* this is the internal transfer function.
3
*
4
* HISTORY
5
* 16-May-15 Alexey Borzenkov <snaury@gmail.com>
6
* Move stack spilling code inside save/restore functions
7
* 30-Aug-13 Floris Bruynooghe <flub@devork.be>
8
Clean the register windows again before returning.
9
This does not clobber the PIC register as it leaves
10
the current window intact and is required for multi-
11
threaded code to work correctly.
12
* 08-Mar-11 Floris Bruynooghe <flub@devork.be>
13
* No need to set return value register explicitly
14
* before the stack and framepointer are adjusted
15
* as none of the other registers are influenced by
16
* this. Also don't needlessly clean the windows
17
* ('ta %0" :: "i" (ST_CLEAN_WINDOWS)') as that
18
* clobbers the gcc PIC register (%l7).
19
* 24-Nov-02 Christian Tismer <tismer@tismer.com>
20
* needed to add another magic constant to insure
21
* that f in slp_eval_frame(PyFrameObject *f)
22
* STACK_REFPLUS will probably be 1 in most cases.
23
* gets included into the saved stack area.
24
* 17-Sep-02 Christian Tismer <tismer@tismer.com>
25
* after virtualizing stack save/restore, the
26
* stack size shrunk a bit. Needed to introduce
27
* an adjustment STACK_MAGIC per platform.
28
* 15-Sep-02 Gerd Woetzel <gerd.woetzel@GMD.DE>
29
* added support for SunOS sparc with gcc
30
*/
31
32
#define STACK_REFPLUS 1
33
34
#ifdef SLP_EVAL
35
36
37
#define STACK_MAGIC 0
38
39
40
#if defined(__sparcv9)
41
#define SLP_FLUSHW __asm__ volatile ("flushw")
42
#else
43
#define SLP_FLUSHW __asm__ volatile ("ta 3")
/* ST_FLUSH_WINDOWS */
44
#endif
45
46
/* On sparc we need to spill register windows inside save/restore functions */
47
#define SLP_BEFORE_SAVE_STATE() SLP_FLUSHW
48
#define SLP_BEFORE_RESTORE_STATE() SLP_FLUSHW
49
50
51
static
int
52
slp_switch(
void
)
53
{
54
int
err;
55
int
*stackref, stsizediff;
56
57
/* Put current stack pointer into stackref.
58
* Register spilling is done in save/restore.
59
*/
60
__asm__
volatile
(
"mov %%sp, %0"
:
"=r"
(stackref));
61
62
{
63
/* Thou shalt put SLP_SAVE_STATE into a local block */
64
/* Copy the current stack onto the heap */
65
SLP_SAVE_STATE(stackref, stsizediff);
66
67
/* Increment stack and frame pointer by stsizediff */
68
__asm__
volatile
(
69
"add %0, %%sp, %%sp\n\t"
70
"add %0, %%fp, %%fp"
71
: :
"r"
(stsizediff));
72
73
/* Copy new stack from it's save store on the heap */
74
SLP_RESTORE_STATE();
75
76
__asm__
volatile
(
"mov %1, %0"
:
"=r"
(err) :
"i"
(0));
77
return
err;
78
}
79
}
80
81
#endif
82
83
/*
84
* further self-processing support
85
*/
86
87
/*
88
* if you want to add self-inspection tools, place them
89
* here. See the x86_msvc for the necessary defines.
90
* These features are highly experimental und not
91
* essential yet.
92
*/
Generated by
1.9.8