Skip to content
This repository was archived by the owner on Feb 13, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
2260bcd
implement switching using the Stackman submodule
kristjanvalur Jan 3, 2020
5537847
update stackman for correct ARM code
kristjanvalur Jan 6, 2020
e4e9cc8
change submodule to https
kristjanvalur Jan 12, 2020
7e82df2
Merge branch 'stackman' of ssh://github.com/kristjanvalur/stackless i…
kristjanvalur Jan 12, 2020
e312dc8
Merge branch 'main-slp' into stackman
akruis Jun 22, 2021
8f36251
Use stackman from https://github.com/stackless-dev/stackman.git
akruis Jun 23, 2021
8bac0cd
Update submodule stackman to the latest version
akruis Jun 23, 2021
d7704ee
Fix #include statements
akruis Jun 23, 2021
af23038
prepare for a merge with main-slp
akruis Jul 9, 2021
504edea
Merge branch 'main-slp' into stackman
akruis Jul 9, 2021
7d85c37
Readd the stackman submodule
akruis Jul 9, 2021
e981179
Adapt the patch to upstream changes.
akruis Jul 9, 2021
7e1bb4a
Change "make clean" to not remove static library files from stackman.
akruis Jul 9, 2021
20657c4
Merge branch 'main-slp' into stackman
akruis Jul 11, 2021
55e8946
Add configure options --with-stackman=dir and --without-stackman
akruis Jul 11, 2021
7772ab7
Update create_source_archive.sh to include Stackman.
akruis Jul 11, 2021
2f8a7e2
Merge branch 'main-slp' into stackman
akruis Jul 11, 2021
8f6a3df
Detect Stackman abiname and link the appropriate libstackman.a
akruis Jul 11, 2021
a20298b
remove superfluous tabs
akruis Jul 11, 2021
553ab3d
Merge remote-tracking branch 'origin/main-slp' into stackman
akruis Jul 13, 2021
c5bea11
Fix the usage of SLP_SAVE_STATE.
akruis Jul 14, 2021
ab0c29a
Integrate Stackman into the windows build infrastructure.
akruis Jul 14, 2021
bb897f8
Add documentation and build instructions.
akruis Jul 14, 2021
0022882
merge main-slp into branch stackman
akruis Jul 15, 2021
ac479bd
Add support for ARM and ARM64
akruis Jul 15, 2021
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
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "Include/internal/stackman"]
path = Include/internal/stackman
url = ssh://git@github.com/kristjanvalur/stackman
11 changes: 11 additions & 0 deletions Include/internal/slp_platformselect.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@
* Platform Selection for Stackless
*/

/* First, see if stackman an implementation without external
* assembler, use that if possible
*/
#define STACKMAN_OPTIONAL
#include "stackman/src/stackman.h"
#if defined(STACKMAN_PLATFORM) && !defined(STACKMAN_EXTERNAL_ASM)
#include "internal/slp_switch_stackman.h"

#else /* use traditional stackless switching */

#if defined(MS_WIN32) && !defined(MS_WIN64) && defined(_M_IX86)
#include "internal/slp_switch_x86_msvc.h" /* MS Visual Studio on X86 */
#elif defined(MS_WIN64) && defined(_M_X64)
Expand Down Expand Up @@ -32,6 +42,7 @@
#elif defined(SN_TARGET_PS3)
#include "internal/slp_switch_ps3_SNTools.h" /* Sony PS3 */
#endif
#endif

/* default definitions if not defined in above files */

Expand Down
66 changes: 66 additions & 0 deletions Include/internal/slp_switch_stackman.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
/*
* this is the internal transfer function, using
* the stackman platform library.
* We create a wrapper callback that employs the existing
* stack macros.
* At some later point in time, the callback could be
* written directly.
*
*/

#define SLP_STACK_REFPLUS 1

#ifdef SLP_EVAL
#define SLP_STACK_MAGIC 0


/* need a special function arount SLP_SAVE_STATE() because
* the macro has a built-in return of 0 or -1. Must catch
* that.
*/
static int slp_stackman_cb_save(void *sp, intptr_t *pdiff)
{
intptr_t diff;
SLP_SAVE_STATE(sp, diff);
*pdiff = diff;
return 1;
}

static void *slp_stackman_cb(void *_ctxt, int opcode, void *sp)
{
int *error = (int*)_ctxt;
intptr_t stsizediff;
if (opcode == STACKMAN_OP_SAVE)
{
int ret = slp_stackman_cb_save(sp, &stsizediff);
if (ret == 1) {
/* regular switch */
return (void*)((char*)sp + stsizediff);
}
if (ret == -1)
{
*error = -1;
}
/* error or save only, no change in sp */
return sp;
}
else
{
if (*error != -1)
SLP_RESTORE_STATE();
return sp;
}
}

static int
slp_switch(void)
{
/* this can be on the stack, because if there isn't a switch
* then it is intact. (error or save only) */
int error = 0;
stackman_switch(&slp_stackman_cb, &error);
return error;
}

#include "stackman/src/stackman_impl.h"
#endif
1 change: 1 addition & 0 deletions Include/internal/stackman
Submodule stackman added at 261a57