Changeset 2b903ca in mainline
- Timestamp:
- 2013-05-30T22:26:46Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9ce0683
- Parents:
- 45b4300
- Location:
- uspace/lib/c/arch/ia32/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/ia32/src/entry.S
r45b4300 r2b903ca 47 47 # Do not set %gs, it contains descriptor that can see TLS 48 48 49 #ifndef PROCESSOR_i486 49 #ifndef PROCESSOR_i486 50 50 # Detect the mechanism used for making syscalls 51 51 movl $(INTEL_CPUID_STANDARD), %eax -
uspace/lib/c/arch/ia32/src/entryjmp.s
r45b4300 r2b903ca 36 36 push %ebp 37 37 movl %esp, %ebp 38 38 39 39 # %eax := entry_point 40 40 movl 0x8(%ebp), %eax 41 41 42 42 # %edi := pcb 43 43 # pcb is passed to the entry point in %edi 44 44 mov 0xc(%ebp), %edi 45 45 46 46 # Save a tiny bit of stack space 47 47 pop %ebp 48 48 49 49 jmp *%eax -
uspace/lib/c/arch/ia32/src/fibril.S
r45b4300 r2b903ca 34 34 .global context_restore 35 35 36 37 36 ## Save current CPU context 38 37 # … … 41 40 # 42 41 context_save: 43 movl 0(%esp), %eax# the caller's return %eip44 movl 4(%esp), %edx# address of the context variable to save context to45 46 42 movl 0(%esp), %eax # the caller's return %eip 43 movl 4(%esp), %edx # address of the context variable to save context to 44 45 # save registers to the context structure 47 46 CONTEXT_SAVE_ARCH_CORE %edx %eax 48 49 # Save TLS47 48 # save TLS 50 49 movl %gs:0, %eax 51 50 movl %eax, OFFSET_TLS(%edx) # tls -> ctx->tls 52 51 53 xorl %eax, %eax# context_save returns 152 xorl %eax, %eax # context_save returns 1 54 53 incl %eax 55 54 ret 56 57 55 58 56 ## Restore saved CPU context … … 62 60 # 63 61 context_restore: 64 movl 4(%esp), %eax# address of the context variable to restore context from65 66 62 movl 4(%esp), %eax # address of the context variable to restore context from 63 64 # restore registers from the context structure 67 65 CONTEXT_RESTORE_ARCH_CORE %eax %edx 68 69 movl %edx, 0(%esp)# ctx->pc -> saver's return %eip70 71 # Set thread local storage66 67 movl %edx, 0(%esp) # ctx->pc -> saver's return %eip 68 69 # set thread local storage 72 70 pushl %edx 73 movl OFFSET_TLS(%eax), %edx 74 movl $1, %eax # Syscall SYS_TLS_SET71 movl OFFSET_TLS(%eax), %edx # Set arg1 to TLS addr 72 movl $1, %eax # Syscall SYS_TLS_SET 75 73 int $0x30 76 74 popl %edx 77 75 78 xorl %eax, %eax# context_restore returns 076 xorl %eax, %eax # context_restore returns 0 79 77 ret -
uspace/lib/c/arch/ia32/src/setjmp.S
r45b4300 r2b903ca 35 35 .type setjmp,@function 36 36 setjmp: 37 movl 0(%esp), %eax # save pc value into eax38 movl 4(%esp), %edx # address of the jmp_buf structure to save context to37 movl 0(%esp), %eax # save pc value into eax 38 movl 4(%esp), %edx # address of the jmp_buf structure to save context to 39 39 40 40 # save registers to the jmp_buf structure 41 41 CONTEXT_SAVE_ARCH_CORE %edx %eax 42 42 43 xorl %eax, %eax# set_jmp returns 043 xorl %eax, %eax # set_jmp returns 0 44 44 ret 45 45 … … 52 52 CONTEXT_RESTORE_ARCH_CORE %ecx %edx 53 53 54 movl %edx, 0(%esp) # put saved pc on stack54 movl %edx, 0(%esp) # put saved pc on stack 55 55 ret -
uspace/lib/c/arch/ia32/src/thread_entry.s
r45b4300 r2b903ca 40 40 mov %dx, %fs 41 41 # Do not set %gs, it contains descriptor that can see TLS 42 42 43 43 # 44 44 # Create the first stack frame. … … 46 46 pushl $0 47 47 mov %esp, %ebp 48 48 49 49 # 50 50 # EAX contains address of uarg.
Note:
See TracChangeset
for help on using the changeset viewer.