summaryrefslogtreecommitdiffstats
path: root/src/libthread/FreeBSDasm.s
diff options
context:
space:
mode:
authorrsc <devnull@localhost>2005-07-19 17:40:15 +0000
committerrsc <devnull@localhost>2005-07-19 17:40:15 +0000
commit42a57eff1ce95e0e33bd6d0ce1f06ced9f210151 (patch)
tree4195e5b9d3657fd64fad334e76c7226838200dfe /src/libthread/FreeBSDasm.s
parentd67cd5c33c62679df29dce6b452d32882cd2eca5 (diff)
downloadplan9port-42a57eff1ce95e0e33bd6d0ce1f06ced9f210151.tar.gz
plan9port-42a57eff1ce95e0e33bd6d0ce1f06ced9f210151.zip
better architecture splitting
Diffstat (limited to 'src/libthread/FreeBSDasm.s')
-rw-r--r--src/libthread/FreeBSDasm.s54
1 files changed, 0 insertions, 54 deletions
diff --git a/src/libthread/FreeBSDasm.s b/src/libthread/FreeBSDasm.s
deleted file mode 100644
index f9a80255..00000000
--- a/src/libthread/FreeBSDasm.s
+++ /dev/null
@@ -1,54 +0,0 @@
-.globl _tas
-_tas:
- movl $0xCAFEBABE, %eax
- movl 4(%esp), %ecx
- xchgl %eax, 0(%ecx)
- ret
-
-.globl setmcontext
-setmcontext:
- movl 4(%esp), %edx
- movl 8(%edx), %fs
- movl 12(%edx), %es
- movl 16(%edx), %ds
- movl 76(%edx), %ss
- movl 20(%edx), %edi
- movl 24(%edx), %esi
- movl 28(%edx), %ebp
- movl %esp, %ecx
- movl 72(%edx), %esp
- pushl 60(%edx) /* eip */
- pushl 44(%edx) /* ecx */
- pushl 48(%edx) /* eax */
- movl 36(%edx), %ebx
- movl 40(%edx), %edx
- movl 12(%ecx), %eax
- popl %eax
- popl %ecx
- ret
-
-.globl getmcontext
-getmcontext:
- pushl %edx
- movl 8(%esp), %edx
- movl %fs, 8(%edx)
- movl %es, 12(%edx)
- movl %ds, 16(%edx)
- movl %ss, 76(%edx)
- movl %edi, 20(%edx)
- movl %esi, 24(%edx)
- movl %ebp, 28(%edx)
- movl %ebx, 36(%edx)
- movl $1, 48(%edx)
- popl %eax
- movl %eax, 40(%edx)
- movl %ecx, 44(%edx)
- movl (%esp), %eax /* eip */
- movl %eax, 60(%edx)
- movl %esp, %eax
- addl $4, %eax /* setmcontext will re-push the eip */
- movl %eax, 72(%edx)
- movl 40(%edx), %edx
- xorl %eax, %eax
- ret
-