plan9port/src/libthread/FreeBSD-386-asm.s

53 lines
884 B
ArmAsm
Raw Normal View History

2004-12-28 04:20:39 +00:00
.globl _tas
_tas:
movl $0xCAFEBABE, %eax
movl 4(%esp), %ecx
xchgl %eax, 0(%ecx)
ret
2005-11-04 16:34:19 +00:00
.globl getmcontext
getmcontext:
2005-11-03 01:00:56 +00:00
movl 4(%esp), %eax
2005-11-04 16:34:19 +00:00
2005-11-03 01:00:56 +00:00
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)
2004-12-28 04:20:39 +00:00
2005-11-03 01:00:56 +00:00
movl $1, 48(%eax) /* %eax */
movl (%esp), %ecx /* %eip */
movl %ecx, 60(%eax)
leal 4(%esp), %ecx /* %esp */
movl %ecx, 72(%eax)
2005-11-04 16:34:19 +00:00
2005-11-03 01:00:56 +00:00
movl 44(%eax), %ecx /* restore %ecx */
movl $0, %eax
2004-12-28 04:20:39 +00:00
ret
2005-11-04 16:34:19 +00:00
.globl setmcontext
setmcontext:
2005-11-03 01:00:56 +00:00
movl 4(%esp), %eax
2005-11-04 16:34:19 +00:00
2005-11-03 01:00:56 +00:00
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
2005-11-04 16:34:19 +00:00
movl 72(%eax), %esp
pushl 60(%eax) /* new %eip */
2005-11-03 01:00:56 +00:00
movl 48(%eax), %eax
ret
2005-11-04 16:34:19 +00:00