Changeset 3b0f1b9a in mainline
- Timestamp:
- 2016-04-12T05:57:00Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0f792c28, d84398a7
- Parents:
- 8844e70
- Files:
-
- 14 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/src/asm.S
r8844e70 r3b0f1b9a 27 27 */ 28 28 29 #include <abi/asmtool.h> 29 30 #include <arch/pm.h> 30 31 #include <arch/mm/page.h> … … 32 33 33 34 .text 34 .global interrupt_handlers35 .global syscall_entry36 .global cpuid37 .global has_cpuid38 .global read_efer_flag39 .global set_efer_flag40 .global memcpy_from_uspace41 .global memcpy_to_uspace42 .global memcpy_from_uspace_failover_address43 .global memcpy_to_uspace_failover_address44 .global early_putchar45 35 46 36 #define MEMCPY_DST %rdi … … 64 54 * 65 55 */ 66 memcpy_from_uspace: 67 memcpy_to_uspace: 56 FUNCTION_BEGIN(memcpy_from_uspace) 57 FUNCTION_BEGIN(memcpy_to_uspace) 68 58 movq MEMCPY_DST, %rax 69 59 … … 81 71 0: 82 72 ret /* return MEMCPY_SRC, success */ 83 84 memcpy_from_uspace_failover_address: 85 memcpy_to_uspace_failover_address: 73 FUNCTION_END(memcpy_from_uspace) 74 FUNCTION_END(memcpy_to_uspace) 75 76 SYMBOL(memcpy_from_uspace_failover_address) 77 SYMBOL(memcpy_to_uspace_failover_address) 86 78 xorl %eax, %eax /* return 0, failure */ 87 79 ret … … 92 84 * 93 85 */ 94 has_cpuid: 86 FUNCTION_BEGIN(has_cpuid) 95 87 /* Load RFLAGS */ 96 88 pushfq … … 114 106 xorl %edx, %eax 115 107 ret 116 117 cpuid: 108 FUNCTION_END(has_cpuid) 109 110 FUNCTION_BEGIN(cpuid) 118 111 /* Preserve %rbx across function calls */ 119 112 movq %rbx, %r10 … … 130 123 movq %r10, %rbx 131 124 ret 132 133 set_efer_flag: 125 FUNCTION_END(cpuid) 126 127 FUNCTION_BEGIN(set_efer_flag) 134 128 movl $0xc0000080, %ecx 135 129 rdmsr … … 137 131 wrmsr 138 132 ret 139 140 read_efer_flag: 133 FUNCTION_END(set_efer_flag) 134 135 FUNCTION_BEGIN(read_efer_flag) 141 136 movl $0xc0000080, %ecx 142 137 rdmsr 143 138 ret 139 FUNCTION_END(read_efer_flag) 144 140 145 141 /* … … 157 153 158 154 .macro handler i 159 .global int_\i 160 int_\i: 155 SYMBOL(int_\i) 161 156 162 157 /* … … 249 244 53,54,55,56,57,58,59,60,61,62,63 250 245 251 interrupt_handlers: 246 SYMBOL(interrupt_handlers) 252 247 .irp cnt, LIST_0_63 253 248 handler \cnt … … 273 268 * 274 269 */ 275 syscall_entry: 270 SYMBOL(syscall_entry) 276 271 /* Switch to hidden %gs */ 277 272 swapgs … … 396 391 * 397 392 */ 398 early_putchar: 399 393 FUNCTION_BEGIN(early_putchar) 400 394 #if ((defined(CONFIG_EGA)) && (!defined(CONFIG_FB))) 401 395 … … 525 519 526 520 ret 527 521 FUNCTION_END(early_putchar) 522 -
kernel/arch/amd64/src/boot/multiboot.S
r8844e70 r3b0f1b9a 29 29 */ 30 30 31 #include <abi/asmtool.h> 31 32 #include <arch/boot/boot.h> 32 33 #include <arch/mm/page.h> … … 64 65 65 66 .align 4 66 .global multiboot_image_start67 67 multiboot_header: 68 68 .long MULTIBOOT_HEADER_MAGIC … … 75 75 .long multiboot_image_start 76 76 77 multiboot_image_start: 77 SYMBOL(multiboot_image_start) 78 78 cli 79 79 cld … … 640 640 641 641 .align 4096 642 .global ptl_0 643 ptl_0: 642 SYMBOL(ptl_0) 644 643 .quad ptl_1 + (PTL_WRITABLE | PTL_PRESENT) 645 644 .fill 510, 8, 0 … … 648 647 .section K_DATA_START, "aw", @progbits 649 648 650 .global bootstrap_idtr 651 bootstrap_idtr: 649 SYMBOL(bootstrap_idtr) 652 650 .word 0 653 651 .long 0 654 652 655 .global bootstrap_gdtr 656 bootstrap_gdtr: 653 SYMBOL(bootstrap_gdtr) 657 654 .word GDT_SELECTOR(GDT_ITEMS) 658 655 .long KA2PA(gdt) 659 656 660 .global multiboot_eax 661 multiboot_eax: 657 SYMBOL(multiboot_eax) 662 658 .long 0 663 659 664 .global multiboot_ebx 665 multiboot_ebx: 660 SYMBOL(multiboot_ebx) 666 661 .long 0 667 662 -
kernel/arch/amd64/src/boot/multiboot2.S
r8844e70 r3b0f1b9a 27 27 */ 28 28 29 #include <abi/asmtool.h> 29 30 #include <arch/boot/boot.h> 30 31 #include <arch/mm/page.h> … … 41 42 42 43 .align 8 43 .global multiboot2_image_start44 44 multiboot2_header_start: 45 45 .long MULTIBOOT2_HEADER_MAGIC … … 122 122 multiboot2_header_end: 123 123 124 multiboot2_image_start: 124 SYMBOL(multiboot2_image_start) 125 125 cli 126 126 cld -
kernel/arch/amd64/src/context.S
r8844e70 r3b0f1b9a 27 27 # 28 28 29 #include <abi/asmtool.h> 30 #include <arch/context_struct.h> 31 29 32 .text 30 31 .global context_save_arch32 .global context_restore_arch33 34 #include <arch/context_struct.h>35 33 36 34 ## Save current CPU context … … 39 37 # pointed by the 1st argument. Returns 1 in EAX. 40 38 # 41 context_save_arch: 39 FUNCTION_BEGIN(context_save_arch) 42 40 movq (%rsp), %rdx # the caller's return %eip 43 41 … … 56 54 incl %eax 57 55 ret 56 FUNCTION_END(context_save_arch) 58 57 59 58 … … 63 62 # pointed by the 1st argument. Returns 0 in EAX. 64 63 # 65 context_restore_arch: 64 FUNCTION_BEGIN(context_restore_arch) 66 65 movq CONTEXT_OFFSET_R15(%rdi), %r15 67 66 movq CONTEXT_OFFSET_R14(%rdi), %r14 … … 79 78 xorl %eax, %eax # context_restore returns 0 80 79 ret 80 FUNCTION_END(context_restore_arch) 81 81 -
kernel/arch/amd64/src/debug/stacktrace_asm.S
r8844e70 r3b0f1b9a 27 27 # 28 28 29 #include <abi/asmtool.h> 30 29 31 .text 30 32 31 .global frame_pointer_get 32 .global program_counter_get 33 34 frame_pointer_get: 33 FUNCTION_BEGIN(frame_pointer_get) 35 34 movq %rbp, %rax 36 35 ret 36 FUNCTION_END(frame_pointer_get) 37 37 38 program_counter_get: 38 FUNCTION_BEGIN(program_counter_get) 39 39 movq (%rsp), %rax 40 40 ret 41 FUNCTION_END(program_counter_get) -
kernel/arch/amd64/src/delay.S
r8844e70 r3b0f1b9a 31 31 # 32 32 33 #include <abi/asmtool.h> 34 33 35 .text 34 36 35 .global asm_delay_loop 36 .global asm_fake_loop 37 38 asm_delay_loop: 37 FUNCTION_BEGIN(asm_delay_loop) 39 38 0: 40 39 dec %rdi … … 42 41 43 42 ret 43 FUNCTION_END(asm_delay_loop) 44 44 45 asm_fake_loop: 45 FUNCTION_BEGIN(asm_fake_loop) 46 46 0: 47 47 dec %rdi … … 49 49 50 50 ret 51 FUNCTION_END(asm_fake_loop) 52 -
kernel/arch/amd64/src/smp/ap.S
r8844e70 r3b0f1b9a 32 32 # 33 33 34 #include <abi/asmtool.h> 34 35 #include <arch/boot/boot.h> 35 36 #include <arch/boot/memmap.h> … … 43 44 #ifdef CONFIG_SMP 44 45 45 .global unmapped_ap_boot46 47 46 # This piece of code is real-mode and is meant to be alligned at 4K boundary. 48 47 # The requirement for such an alignment comes from MP Specification's STARTUP … … 50 49 51 50 .align 4096 52 unmapped_ap_boot: 51 SYMBOL(unmapped_ap_boot) 53 52 .code16 54 53 cli … … 113 112 #ifdef CONFIG_SMP 114 113 115 .global unmapped_ap_gdtr 116 unmapped_ap_gdtr: 114 SYMBOL(unmapped_ap_gdtr) 117 115 .word 0 118 116 .long 0 -
uspace/lib/c/arch/amd64/Makefile.inc
r8844e70 r3b0f1b9a 28 28 29 29 ARCH_SOURCES = \ 30 arch/$(UARCH)/src/entry. s\31 arch/$(UARCH)/src/entryjmp. s\32 arch/$(UARCH)/src/thread_entry. s\30 arch/$(UARCH)/src/entry.S \ 31 arch/$(UARCH)/src/entryjmp.S \ 32 arch/$(UARCH)/src/thread_entry.S \ 33 33 arch/$(UARCH)/src/syscall.S \ 34 34 arch/$(UARCH)/src/fibril.S \ -
uspace/lib/c/arch/amd64/src/entry.S
r8844e70 r3b0f1b9a 27 27 # 28 28 29 #include <abi/asmtool.h> 30 29 31 .section .init, "ax" 30 32 31 33 .org 0 32 33 .globl __entry34 34 35 35 ## User-space task entry point … … 37 37 # %rdi contains the PCB pointer 38 38 # 39 __entry: 39 SYMBOL(__entry) 40 40 # 41 41 # Create the first stack frame. -
uspace/lib/c/arch/amd64/src/entryjmp.S
r8844e70 r3b0f1b9a 27 27 # 28 28 29 .globl entry_point_jmp 29 #include <abi/asmtool.h> 30 30 31 31 ## void entry_point_jmp(void *entry_point, void *pcb); … … 35 35 # 36 36 # Jump to program entry point 37 entry_point_jmp: 37 SYMBOL(entry_point_jmp) 38 38 # use standard amd32 prologue not to confuse anybody 39 39 push %rbp -
uspace/lib/c/arch/amd64/src/fibril.S
r8844e70 r3b0f1b9a 27 27 # 28 28 29 #include <abi/asmtool.h> 30 #include <libarch/fibril_context.h> 31 29 32 .text 30 31 .global context_save32 .global context_restore33 34 #include <libarch/fibril_context.h>35 33 36 34 ## Save current CPU context … … 39 37 # pointed by the 1st argument. Returns 1 in EAX. 40 38 # 41 context_save: 39 FUNCTION_BEGIN(context_save) 42 40 movq (%rsp), %rdx # the caller's return %eip 43 41 … … 60 58 incl %eax 61 59 ret 60 FUNCTION_END(context_save) 62 61 63 62 ## Restore current CPU context … … 66 65 # pointed by the 1st argument. Returns 0 in EAX. 67 66 # 68 context_restore: 69 67 FUNCTION_BEGIN(context_restore) 70 68 movq CONTEXT_OFFSET_R15(%rdi), %r15 71 69 movq CONTEXT_OFFSET_R14(%rdi), %r14 … … 88 86 xorl %eax, %eax # context_restore returns 0 89 87 ret 88 FUNCTION_END(context_restore) 90 89 -
uspace/lib/c/arch/amd64/src/stacktrace_asm.S
r8844e70 r3b0f1b9a 27 27 # 28 28 29 #include <abi/asmtool.h> 30 29 31 .text 30 32 31 .global stacktrace_prepare 32 .global stacktrace_fp_get33 .global stacktrace_pc_get 33 FUNCTION_BEGIN(stacktrace_prepare) 34 ret 35 FUNCTION_END(stacktrace_prepare) 34 36 35 stacktrace_prepare: 36 ret 37 38 stacktrace_fp_get: 37 FUNCTION_BEGIN(stacktrace_fp_get) 39 38 movq %rbp, %rax 40 39 ret 40 FUNCTION_END(stacktrace_fp_get) 41 41 42 stacktrace_pc_get: 42 FUNCTION_BEGIN(stacktrace_pc_get) 43 43 movq (%rsp), %rax 44 44 ret 45 FUNCTION_END(stacktrace_pc_get) 46 -
uspace/lib/c/arch/amd64/src/syscall.S
r8844e70 r3b0f1b9a 27 27 # 28 28 29 #include <abi/asmtool.h> 30 29 31 .text 30 31 .global __syscall32 32 33 33 ## Make a system call. … … 43 43 # @return The return value will be stored in RAX. 44 44 # 45 __syscall: 45 FUNCTION_BEGIN(__syscall) 46 46 # 47 47 # Move the syscall number into RAX. … … 55 55 syscall 56 56 ret 57 FUNCTION_END(__syscall) 57 58 -
uspace/lib/c/arch/amd64/src/thread_entry.S
r8844e70 r3b0f1b9a 27 27 # 28 28 29 #include <abi/asmtool.h> 30 29 31 .text 30 31 .globl __thread_entry32 32 33 33 ## User-space thread entry point for all but the first threads. 34 34 # 35 35 # 36 __thread_entry: 36 SYMBOL_BEGIN(__thread_entry) 37 37 # 38 38 # Create the first stack frame. … … 47 47 movq %rax, %rdi 48 48 call __thread_main 49 50 .end __thread_entry 49 SYMBOL_END(__thread_entry) -
uspace/lib/math/arch/amd64/src/cos.S
r8844e70 r3b0f1b9a 27 27 # 28 28 29 #include <abi/asmtool.h> 29 30 #include <libarch/x87.h> 30 31 31 32 .text 32 33 33 .global cos_f64 34 35 cos_f64: 34 FUNCTION_BEGIN(cos_f64) 36 35 pushq %rbp 37 36 movq %rsp, %rbp … … 77 76 leave 78 77 retq 78 FUNCTION_END(cos_f64) -
uspace/lib/math/arch/amd64/src/sin.S
r8844e70 r3b0f1b9a 27 27 # 28 28 29 #include <abi/asmtool.h> 29 30 #include <libarch/x87.h> 30 31 31 32 .text 32 33 33 .global sin_f64 34 35 sin_f64: 34 FUNCTION_BEGIN(sin_f64) 36 35 pushq %rbp 37 36 movq %rsp, %rbp … … 77 76 leave 78 77 retq 78 FUNCTION_END(sin_f64) 79 -
uspace/lib/math/arch/amd64/src/trunc.S
r8844e70 r3b0f1b9a 27 27 # 28 28 29 #include <abi/asmtool.h> 29 30 #include <libarch/x87.h> 30 31 31 32 .text 32 33 33 .global trunc_f64 34 35 trunc_f64: 34 FUNCTION_BEGIN(trunc_f64) 36 35 pushq %rbp 37 36 movq %rsp, %rbp … … 63 62 leave 64 63 retq 64 FUNCTION_END(trunc_f64)
Note:
See TracChangeset
for help on using the changeset viewer.