Changeset a35b458 in mainline for uspace/lib/c/arch/ia32/src
- Timestamp:
- 2018-03-02T20:10:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- Location:
- uspace/lib/c/arch/ia32/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/arch/ia32/src/entry.S
r3061bc1 ra35b458 46 46 mov %ax, %fs 47 47 # Do not set %gs, it contains descriptor that can see TLS 48 48 49 49 #ifndef PROCESSOR_i486 50 50 # Detect the mechanism used for making syscalls … … 57 57 0: 58 58 #endif 59 59 60 60 # 61 61 # Create the first stack frame. … … 64 64 pushl $0 65 65 movl %esp, %ebp 66 66 67 67 # Pass the PCB pointer to __main as the first argument 68 68 pushl %edi -
uspace/lib/c/arch/ia32/src/entryjmp.S
r3061bc1 ra35b458 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
r3061bc1 ra35b458 40 40 movl 0(%esp), %eax # the caller's return %eip 41 41 movl 4(%esp), %edx # address of the context variable to save context to 42 42 43 43 # save registers to the context structure 44 44 movl %esp, CONTEXT_OFFSET_SP(%edx) # %esp -> ctx->sp … … 48 48 movl %edi, CONTEXT_OFFSET_EDI(%edx) # %edi -> ctx->edi 49 49 movl %ebp, CONTEXT_OFFSET_EBP(%edx) # %ebp -> ctx->ebp 50 50 51 51 # save TLS 52 52 movl %gs:0, %eax 53 53 movl %eax, CONTEXT_OFFSET_TLS(%edx) # tls -> ctx->tls 54 54 55 55 xorl %eax, %eax # context_save returns 1 56 56 incl %eax … … 65 65 FUNCTION_BEGIN(context_restore) 66 66 movl 4(%esp), %eax # address of the context variable to restore context from 67 67 68 68 # restore registers from the context structure 69 69 movl CONTEXT_OFFSET_SP(%eax),%esp # ctx->sp -> %esp … … 73 73 movl CONTEXT_OFFSET_EDI(%eax),%edi # ctx->edi -> %edi 74 74 movl CONTEXT_OFFSET_EBP(%eax),%ebp # ctx->ebp -> %ebp 75 75 76 76 movl %edx, 0(%esp) # ctx->pc -> saver's return %eip 77 77 78 78 # set thread local storage 79 79 movl CONTEXT_OFFSET_TLS(%eax), %edx # Set arg1 to TLS addr 80 80 movl %edx, %gs:0 81 81 82 82 xorl %eax, %eax # context_restore returns 0 83 83 ret -
uspace/lib/c/arch/ia32/src/rtld/reloc.c
r3061bc1 ra35b458 65 65 elf_word sym_idx; 66 66 uint32_t sym_addr; 67 67 68 68 elf_symbol_t *sym_table; 69 69 elf_symbol_t *sym; … … 71 71 uint32_t sym_size; 72 72 char *str_tab; 73 73 74 74 elf_symbol_t *sym_def; 75 75 module_t *dest; … … 82 82 83 83 DPRINTF("address: 0x%" PRIxPTR ", entries: %zd\n", (uintptr_t)rt, rt_entries); 84 84 85 85 for (i = 0; i < rt_entries; ++i) { 86 86 // DPRINTF("symbol %d: ", i); … … 173 173 memcpy(r_ptr, (const void *)sym_addr, sym_size); 174 174 break; 175 175 176 176 case R_386_RELATIVE: 177 177 DPRINTF("fixup R_386_RELATIVE (b+a)\n"); -
uspace/lib/c/arch/ia32/src/thread_entry.S
r3061bc1 ra35b458 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. … … 47 47 pushl $0 48 48 mov %esp, %ebp 49 49 50 50 # 51 51 # EAX contains address of uarg. … … 53 53 pushl %eax 54 54 call __thread_main 55 55 56 56 # 57 57 # Not reached.
Note:
See TracChangeset
for help on using the changeset viewer.