libthread: rm Darwin pre-11.0.0 support
Darwin 11.0.0 was Mac OS X 10.7.0 aka Lion. The previous version was Snow Leopard, which has been unsupported by Apple since February 2014.
This commit is contained in:
parent
8dcb18f71b
commit
52397aaf2b
5 changed files with 0 additions and 192 deletions
|
|
@ -1,52 +0,0 @@
|
||||||
.globl _tas
|
|
||||||
_tas:
|
|
||||||
movl $0xCAFEBABE, %eax
|
|
||||||
movl 4(%esp), %ecx
|
|
||||||
xchgl %eax, 0(%ecx)
|
|
||||||
ret
|
|
||||||
|
|
||||||
.globl _getmcontext
|
|
||||||
_getmcontext:
|
|
||||||
movl 4(%esp), %eax
|
|
||||||
|
|
||||||
movl %fs, 8(%eax)
|
|
||||||
movl %es, 12(%eax)
|
|
||||||
movl %ds, 16(%eax)
|
|
||||||
movl %ss, 76(%eax)
|
|
||||||
movl %edi, 20(%eax)
|
|
||||||
movl %esi, 24(%eax)
|
|
||||||
movl %ebp, 28(%eax)
|
|
||||||
movl %ebx, 36(%eax)
|
|
||||||
movl %edx, 40(%eax)
|
|
||||||
movl %ecx, 44(%eax)
|
|
||||||
|
|
||||||
movl $1, 48(%eax) /* %eax */
|
|
||||||
movl (%esp), %ecx /* %eip */
|
|
||||||
movl %ecx, 60(%eax)
|
|
||||||
leal 4(%esp), %ecx /* %esp */
|
|
||||||
movl %ecx, 72(%eax)
|
|
||||||
|
|
||||||
movl 44(%eax), %ecx /* restore %ecx */
|
|
||||||
movl $0, %eax
|
|
||||||
ret
|
|
||||||
|
|
||||||
.globl _setmcontext
|
|
||||||
_setmcontext:
|
|
||||||
movl 4(%esp), %eax
|
|
||||||
|
|
||||||
movl 8(%eax), %fs
|
|
||||||
movl 12(%eax), %es
|
|
||||||
movl 16(%eax), %ds
|
|
||||||
movl 76(%eax), %ss
|
|
||||||
movl 20(%eax), %edi
|
|
||||||
movl 24(%eax), %esi
|
|
||||||
movl 28(%eax), %ebp
|
|
||||||
movl 36(%eax), %ebx
|
|
||||||
movl 40(%eax), %edx
|
|
||||||
movl 44(%eax), %ecx
|
|
||||||
|
|
||||||
movl 72(%eax), %esp
|
|
||||||
pushl 60(%eax) /* new %eip */
|
|
||||||
movl 48(%eax), %eax
|
|
||||||
ret
|
|
||||||
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
#include "threadimpl.h"
|
|
||||||
|
|
||||||
void
|
|
||||||
makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...)
|
|
||||||
{
|
|
||||||
int *sp;
|
|
||||||
|
|
||||||
sp = (int*)ucp->uc_stack.ss_sp+ucp->uc_stack.ss_size/4;
|
|
||||||
sp -= argc;
|
|
||||||
/*
|
|
||||||
* Stack pointer at call instruction (before return address
|
|
||||||
* gets pushed) must be 16-byte aligned.
|
|
||||||
*/
|
|
||||||
if((uintptr)sp%4)
|
|
||||||
abort();
|
|
||||||
while((uintptr)sp%16)
|
|
||||||
sp--;
|
|
||||||
memmove(sp, &argc+1, argc*sizeof(int));
|
|
||||||
*--sp = 0; /* return address */
|
|
||||||
ucp->uc_mcontext.mc_eip = (long)func;
|
|
||||||
ucp->uc_mcontext.mc_esp = (int)sp;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
swapcontext(ucontext_t *oucp, ucontext_t *ucp)
|
|
||||||
{
|
|
||||||
if(getcontext(oucp) == 0)
|
|
||||||
setcontext(ucp);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -1,83 +0,0 @@
|
||||||
/* get FPR and VR use flags with sc 0x7FF3 */
|
|
||||||
/* get vsave with mfspr reg, 256 */
|
|
||||||
|
|
||||||
.text
|
|
||||||
.align 2
|
|
||||||
|
|
||||||
.globl __getmcontext
|
|
||||||
|
|
||||||
__getmcontext: /* xxx: instruction scheduling */
|
|
||||||
mflr r0
|
|
||||||
mfcr r5
|
|
||||||
mfctr r6
|
|
||||||
mfxer r7
|
|
||||||
stw r0, 0*4(r3)
|
|
||||||
stw r5, 1*4(r3)
|
|
||||||
stw r6, 2*4(r3)
|
|
||||||
stw r7, 3*4(r3)
|
|
||||||
|
|
||||||
stw r1, 4*4(r3)
|
|
||||||
stw r2, 5*4(r3)
|
|
||||||
li r5, 1 /* return value for setmcontext */
|
|
||||||
stw r5, 6*4(r3)
|
|
||||||
|
|
||||||
stw r13, (0+7)*4(r3) /* callee-save GPRs */
|
|
||||||
stw r14, (1+7)*4(r3) /* xxx: block move */
|
|
||||||
stw r15, (2+7)*4(r3)
|
|
||||||
stw r16, (3+7)*4(r3)
|
|
||||||
stw r17, (4+7)*4(r3)
|
|
||||||
stw r18, (5+7)*4(r3)
|
|
||||||
stw r19, (6+7)*4(r3)
|
|
||||||
stw r20, (7+7)*4(r3)
|
|
||||||
stw r21, (8+7)*4(r3)
|
|
||||||
stw r22, (9+7)*4(r3)
|
|
||||||
stw r23, (10+7)*4(r3)
|
|
||||||
stw r24, (11+7)*4(r3)
|
|
||||||
stw r25, (12+7)*4(r3)
|
|
||||||
stw r26, (13+7)*4(r3)
|
|
||||||
stw r27, (14+7)*4(r3)
|
|
||||||
stw r28, (15+7)*4(r3)
|
|
||||||
stw r29, (16+7)*4(r3)
|
|
||||||
stw r30, (17+7)*4(r3)
|
|
||||||
stw r31, (18+7)*4(r3)
|
|
||||||
|
|
||||||
li r3, 0 /* return */
|
|
||||||
blr
|
|
||||||
|
|
||||||
.globl __setmcontext
|
|
||||||
|
|
||||||
__setmcontext:
|
|
||||||
lwz r13, (0+7)*4(r3) /* callee-save GPRs */
|
|
||||||
lwz r14, (1+7)*4(r3) /* xxx: block move */
|
|
||||||
lwz r15, (2+7)*4(r3)
|
|
||||||
lwz r16, (3+7)*4(r3)
|
|
||||||
lwz r17, (4+7)*4(r3)
|
|
||||||
lwz r18, (5+7)*4(r3)
|
|
||||||
lwz r19, (6+7)*4(r3)
|
|
||||||
lwz r20, (7+7)*4(r3)
|
|
||||||
lwz r21, (8+7)*4(r3)
|
|
||||||
lwz r22, (9+7)*4(r3)
|
|
||||||
lwz r23, (10+7)*4(r3)
|
|
||||||
lwz r24, (11+7)*4(r3)
|
|
||||||
lwz r25, (12+7)*4(r3)
|
|
||||||
lwz r26, (13+7)*4(r3)
|
|
||||||
lwz r27, (14+7)*4(r3)
|
|
||||||
lwz r28, (15+7)*4(r3)
|
|
||||||
lwz r29, (16+7)*4(r3)
|
|
||||||
lwz r30, (17+7)*4(r3)
|
|
||||||
lwz r31, (18+7)*4(r3)
|
|
||||||
|
|
||||||
lwz r1, 4*4(r3)
|
|
||||||
lwz r2, 5*4(r3)
|
|
||||||
|
|
||||||
lwz r0, 0*4(r3)
|
|
||||||
mtlr r0
|
|
||||||
lwz r0, 1*4(r3)
|
|
||||||
mtcr r0 /* mtcrf 0xFF, r0 */
|
|
||||||
lwz r0, 2*4(r3)
|
|
||||||
mtctr r0
|
|
||||||
lwz r0, 3*4(r3)
|
|
||||||
mtxer r0
|
|
||||||
|
|
||||||
lwz r3, 6*4(r3)
|
|
||||||
blr
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
#include "threadimpl.h"
|
|
||||||
|
|
||||||
void
|
|
||||||
makecontext(ucontext_t *ucp, void (*func)(void), int argc, ...)
|
|
||||||
{
|
|
||||||
ulong *sp, *tos;
|
|
||||||
va_list arg;
|
|
||||||
|
|
||||||
tos = (ulong*)ucp->uc_stack.ss_sp+ucp->uc_stack.ss_size/sizeof(ulong);
|
|
||||||
sp = tos - 16;
|
|
||||||
ucp->mc.pc = (long)func;
|
|
||||||
ucp->mc.sp = (long)sp;
|
|
||||||
va_start(arg, argc);
|
|
||||||
ucp->mc.r3 = va_arg(arg, long);
|
|
||||||
va_end(arg);
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
|
||||||
swapcontext(ucontext_t *oucp, ucontext_t *ucp)
|
|
||||||
{
|
|
||||||
if(getcontext(oucp) == 0)
|
|
||||||
setcontext(ucp);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
@ -7,9 +7,6 @@ case "$tag" in
|
||||||
*-NetBSD-*)
|
*-NetBSD-*)
|
||||||
echo ${SYSNAME}-${OBJTYPE}-asm.o $SYSNAME.o pthread.o stkmalloc.o
|
echo ${SYSNAME}-${OBJTYPE}-asm.o $SYSNAME.o pthread.o stkmalloc.o
|
||||||
;;
|
;;
|
||||||
*-Darwin-10.[5-6].* | *-Darwin-[89].*)
|
|
||||||
echo ${SYSNAME}-${OBJTYPE}-asm.o $SYSNAME-${OBJTYPE}.o pthread.o stkmalloc.o
|
|
||||||
;;
|
|
||||||
*-OpenBSD-*)
|
*-OpenBSD-*)
|
||||||
echo ${SYSNAME}-${OBJTYPE}-asm.o ${SYSNAME}-${OBJTYPE}.o pthread.o stkmmap.o
|
echo ${SYSNAME}-${OBJTYPE}-asm.o ${SYSNAME}-${OBJTYPE}.o pthread.o stkmmap.o
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue