aboutsummaryrefslogtreecommitdiff
path: root/lib9/lock-Unixware-386.s
diff options
context:
space:
mode:
authorbhgv <bhgv.empire@gmail.com>2018-03-01 16:54:45 +0200
committerbhgv <bhgv.empire@gmail.com>2018-03-01 16:54:45 +0200
commitb786f20bbab5a59046aa78a2c6c2a11536497202 (patch)
tree0851ecdec889eb9b7ba3751cc04d4f0b474e4a9e /lib9/lock-Unixware-386.s
inferno-os tree was separated from the inferno-os-android (separated from the Android driver)
Diffstat (limited to 'lib9/lock-Unixware-386.s')
-rw-r--r--lib9/lock-Unixware-386.s56
1 files changed, 56 insertions, 0 deletions
diff --git a/lib9/lock-Unixware-386.s b/lib9/lock-Unixware-386.s
new file mode 100644
index 0000000..efa33d0
--- /dev/null
+++ b/lib9/lock-Unixware-386.s
@@ -0,0 +1,56 @@
+ .section .bss
+ .align 4
+.L4_.bss:
+ .align 4
+Unixware_Asm_IntP: / Offset 0
+ .type Unixware_Asm_IntP,@object
+ .size Unixware_Asm_IntP,4
+ .set .,.+4
+Unixware_Asm_VoidP: / Offset 4
+ .type Unixware_Asm_VoidP,@object
+ .size Unixware_Asm_VoidP,4
+ .set .,.+4
+ .section .data
+ .align 4
+.L2_.data:
+ .align 4
+.L01: .string "canlock corrupted 0x%lux\n\000"
+ .set .,.+0x2
+ .section .text
+ .align 4
+.L1_.text:
+
+ .align 4
+ .align 4
+ .globl canlock
+canlock:
+ pushl %ebp
+ movl %esp,%ebp
+ pushl %esi
+ movl 8(%ebp),%eax
+ movl %eax,Unixware_Asm_IntP
+ movl $1, %ecx
+ xchg (%eax), %ecx
+ andl %ecx,%ecx
+ jne .L1
+ movl $1,%esi
+ jmp .L2
+ .align 4
+.L3:
+ subl %esi,%esi
+ jmp .L2
+ .align 4
+.L1:
+ cmpl $1,%ecx
+ je .L3
+ pushl %ecx
+ pushl $.L01
+ call print
+ addl $8,%esp
+.L2:
+ movl %esi,%eax
+ popl %esi
+ leave
+ ret
+ .type canlock,@function
+ .size canlock,.-canlock