Skip to content

Commit

Permalink
Changed memory constraints for assembly macro for PPC Linux platforms.
Browse files Browse the repository at this point in the history
  • Loading branch information
Trevor Bowen committed Jul 31, 2012
1 parent bad771c commit f61a3b0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions platform/switch_ppc64_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
* This seems to be now fully functional!
* 04-Mar-02 Hye-Shik Chang <perky@fallin.lv>
* Ported from i386.
* 31-Jul-12 Trevor Bowen <trevorbowen@gmail.com>
* Changed memory constraints to register only.
*/

#define STACK_REFPLUS 1
Expand All @@ -51,14 +53,14 @@ slp_switch(void)
{
register long *stackref, stsizediff;
__asm__ volatile ("" : : : REGS_TO_SAVE);
__asm__ ("mr %0, 1" : "=g" (stackref) : );
__asm__ ("mr %0, 1" : "=r" (stackref) : );
{
SLP_SAVE_STATE(stackref, stsizediff);
__asm__ volatile (
"mr 11, %0\n"
"add 1, 1, 11\n"
: /* no outputs */
: "g" (stsizediff)
: "r" (stsizediff)
: "11"
);
SLP_RESTORE_STATE();
Expand Down
6 changes: 4 additions & 2 deletions platform/switch_ppc_linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
* This seems to be now fully functional!
* 04-Mar-02 Hye-Shik Chang <perky@fallin.lv>
* Ported from i386.
* 31-Jul-12 Trevor Bowen <trevorbowen@gmail.com>
* Changed memory constraints to register only.
*/

#define STACK_REFPLUS 1
Expand All @@ -49,15 +51,15 @@ slp_switch(void)
{
register int *stackref, stsizediff;
__asm__ volatile ("" : : : REGS_TO_SAVE);
__asm__ ("mr %0, 1" : "=g" (stackref) : );
__asm__ ("mr %0, 1" : "=r" (stackref) : );
{
SLP_SAVE_STATE(stackref, stsizediff);
__asm__ volatile (
"mr 11, %0\n"
"add 1, 1, 11\n"
"add 30, 30, 11\n"
: /* no outputs */
: "g" (stsizediff)
: "r" (stsizediff)
: "11"
);
SLP_RESTORE_STATE();
Expand Down

0 comments on commit f61a3b0

Please sign in to comment.