Changeset f2ef7fd in mainline for uspace/lib/libc/arch/ia32/src/syscall.S
- Timestamp:
- 2008-10-05T21:20:13Z (17 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6198611
- Parents:
- 1d132ae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/arch/ia32/src/syscall.S
r1d132ae rf2ef7fd 29 29 .text 30 30 31 /** Syscall wrapper .31 /** Syscall wrapper - INT $0x30 version. 32 32 * 33 33 * Mind the order of arguments. First two arguments and the syscall number go to … … 35 35 * could benefit from this and not save unused registers on the stack. 36 36 */ 37 .global __syscall 38 __syscall :37 .global __syscall_int 38 __syscall_int: 39 39 pushl %ebx 40 40 pushl %esi … … 54 54 popl %ebx 55 55 ret 56 57 58 /** Syscall wrapper - SYSENTER version. 59 * 60 * This is an optimized version of syscall for four or less arguments. Note 61 * that EBP and EDI are used to remember user stack address and the return 62 * address. The kernel part doesn't save DS, ES and FS so the handler restores 63 * these to the selector immediately following CS (it must be the flat data 64 * segment, otherwise the SYSENTER wouldn't work in the first place). 65 */ 66 .global __syscall_sysenter 67 __syscall_sysenter: 68 pushl %ebx 69 pushl %esi 70 pushl %edi 71 pushl %ebp 72 mov %esp, %ebp 73 lea ra, %edi 74 movl 20(%esp), %edx # First argument. 75 movl 24(%esp), %ecx # Second argument. 76 movl 28(%esp), %ebx # Third argument. 77 movl 32(%esp), %esi # Fourth argument. 78 movl 44(%esp), %eax # Syscall number. 79 sysenter 80 ra: 81 movw %cs, %cx 82 addw $8, %cx 83 movw %cx, %ds 84 movw %cx, %es 85 movw %cx, %fs 86 popl %ebp 87 popl %edi 88 popl %esi 89 popl %ebx 90 ret
Note:
See TracChangeset
for help on using the changeset viewer.