repo.or.cz
/
minix.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
minor fixes for safecopy & safemap tests
[minix.git]
/
lib
/
libhgfs
/
backdoor.S
blob
e7e51e6468c9584ae1c9f34f07040a9f52b306e9
1
/* Part of libhgfs - (c) 2009, D.C. van Moolenbroek */
2
#include <machine/asm.h>
3
4
.text
5
6
MAGIC = 0x564D5868
7
BD_PORT = 0x5658
8
IO_PORT = 0x5659
9
10
ENTRY(__libhgfs_backdoor)
11
pushl %ebx
12
pushl %esi
13
pushl %edi
14
pushl %ebp
15
movl 4+16(%esp), %ebp
16
movl $MAGIC, %eax
17
movl 4(%ebp), %ebx
18
movl 8(%ebp), %ecx
19
movl 12(%ebp), %edx
20
movw $BD_PORT, %dx
21
movl 16(%ebp), %esi
22
movl 20(%ebp), %edi
23
inl %dx
24
movl %eax, (%ebp)
25
movl %ebx, 4(%ebp)
26
movl %ecx, 8(%ebp)
27
movl %edx, 12(%ebp)
28
movl %esi, 16(%ebp)
29
movl %edi, 20(%ebp)
30
popl %ebp
31
popl %edi
32
popl %esi
33
popl %ebx
34
ret
35
36
ENTRY(__libhgfs_backdoor_in)
37
pushl %ebx
38
pushl %esi
39
pushl %edi
40
pushl %ebp
41
movl 4+16(%esp), %eax
42
movl 4(%eax), %ebx
43
movl 8(%eax), %ecx
44
movl 12(%eax), %edx
45
movw $IO_PORT, %dx
46
movl 16(%eax), %esi
47
movl 20(%eax), %edi
48
movl 24(%eax), %ebp
49
movl $MAGIC, %eax
50
cld
51
repe; insb
52
pushl %eax
53
movl 4+20(%esp), %eax
54
movl %ebx, 4(%eax)
55
movl %ecx, 8(%eax)
56
movl %edx, 12(%eax)
57
movl %esi, 16(%eax)
58
movl %edi, 20(%eax)
59
movl %ebp, 24(%eax)
60
popl %ebx
61
movl %ebx, (%eax)
62
movl (%eax), %eax
63
popl %ebp
64
popl %edi
65
popl %esi
66
popl %ebx
67
ret
68
69
ENTRY(__libhgfs_backdoor_out)
70
pushl %ebx
71
pushl %esi
72
pushl %edi
73
pushl %ebp
74
movl 4+16(%esp), %eax
75
movl 4(%eax), %ebx
76
movl 8(%eax), %ecx
77
movl 12(%eax), %edx
78
movw $IO_PORT, %dx
79
movl 16(%eax), %esi
80
movl 20(%eax), %edi
81
movl 24(%eax), %ebp
82
movl $MAGIC, %eax
83
cld
84
repe; outsb
85
pushl %eax
86
movl 4+20(%esp), %eax
87
movl %ebx, 4(%eax)
88
movl %ecx, 8(%eax)
89
movl %edx, 12(%eax)
90
movl %esi, 16(%eax)
91
movl %edi, 20(%eax)
92
movl %ebp, 24(%eax)
93
popl %ebx
94
movl %ebx, (%eax)
95
movl (%eax), %eax
96
popl %ebp
97
popl %edi
98
popl %esi
99
popl %ebx
100
ret