blob: 5a5483b60fb449d9864ca91f771774de973a9d64 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
/** @file usermem_asm.S
*
* @brief userspace r/w functions.
*
* @author Hanjie Wu (hanjiew)
* @bug No functional bugs
*/
.text
.global try_read
.type try_read, %function
try_read:
mov 0x4(%esp), %eax
mov 0x8(%esp), %esi
mov %gs:(%eax), %al
mov %al, (%esi)
xor %eax, %eax
ret
.global try_write
.type try_write, %function
try_write:
mov 0x4(%esp), %eax
mov 0x8(%esp), %edx
mov %dl, %gs:(%eax)
xor %eax, %eax
ret
/* unsuccessful r/w will jump to this function and we return 1 */
.global usermem_fail
.type usermem_fail, %function
usermem_fail:
mov $0xffffffff, %eax
ret
|