libthc: adding back removed _thc_schedulecont assembly function
@@ -1319,6 +1319,27 @@ __asm__ (" .text \n\t"
" subq $8, %rsp \n\t"
" jmp *0(%rdi) \n\t");
+/*
+ int _thc_schedulecont(awe_t *awe) // rdi
+*/
+
+__asm__ (" .text \n\t"
+ " .align 16 \n\t"
+ " .globl _thc_schedulecont \n\t"
+ " .type _thc_schedulecont, @function \n\t"
+ "_thc_schedulecont: \n\t"
+ " mov 0(%rsp), %rsi \n\t"
+ " mov %rsi, 0(%rdi) \n\t" // EIP (our return address)
+ " mov %rbp, 8(%rdi) \n\t" // EBP
+ " mov %rsp, 16(%rdi) \n\t" // ESP+8 (after return)
+ " addq $8, 16(%rdi) \n\t"
+ // AWE now initialized. Call C function for scheduling.
+ // It will return normally to us. The AWE will resume
+ // directly in our caller.
+ " call _thc_schedulecont_c \n\t" // AWE still in rdi
+ " movq $0, %rax \n\t"
+ " ret \n\t");
+
/*
void _thc_callcont(awe_t *awe, // rdi
THCContFn_t fn, // rsi
