Changeset 8844e70 in mainline
- Timestamp:
- 2016-04-11T17:03:47Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3b0f1b9a
- Parents:
- 3a34852
- Files:
-
- 13 edited
- 3 moved
Legend:
- Unmodified
- Added
- Removed
-
abi/include/abi/asmtool.h
r3a34852 r8844e70 36 36 #define ABI_ASMTOOL_H_ 37 37 38 #define SYMBOL(sym) \ 39 .global sym; \ 40 sym: 41 #define SYMBOL_BEGIN(sym) \ 42 SYMBOL(sym) 43 #define SYMBOL_END(sym) \ 44 .size sym, . - sym 45 46 #define OBJECT_BEGIN(obj) \ 47 .type obj, @object; \ 48 SYMBOL_BEGIN(obj) 49 #define OBJECT_END(obj) \ 50 SYMBOL_END(obj) 51 38 52 #define FUNCTION_BEGIN(func) \ 39 .global func; \40 53 .type func, @function; \ 41 func: 42 54 SYMBOL_BEGIN(func) 43 55 #define FUNCTION_END(func) \ 44 .size func, . - func56 SYMBOL_END(func) 45 57 46 58 #endif -
kernel/arch/ia32/Makefile.inc
r3a34852 r8844e70 75 75 arch/$(KARCH)/src/debug/stacktrace.c \ 76 76 arch/$(KARCH)/src/debug/stacktrace_asm.S \ 77 arch/$(KARCH)/src/delay. s\77 arch/$(KARCH)/src/delay.S \ 78 78 arch/$(KARCH)/src/asm.S \ 79 79 arch/$(KARCH)/src/proc/scheduler.c \ -
kernel/arch/ia32/src/asm.S
r3a34852 r8844e70 31 31 */ 32 32 33 #include <abi/asmtool.h> 33 34 #include <arch/pm.h> 34 35 #include <arch/cpu.h> … … 37 38 38 39 .text 39 .global paging_on40 .global enable_l_apic_in_msr41 .global memcpy_from_uspace42 .global memcpy_from_uspace_failover_address43 .global memcpy_to_uspace44 .global memcpy_to_uspace_failover_address45 .global early_putchar46 40 47 41 #define MEMCPY_DST 4 … … 64 58 * 65 59 */ 66 memcpy_from_uspace: 67 memcpy_to_uspace: 60 FUNCTION_BEGIN(memcpy_from_uspace) 61 FUNCTION_BEGIN(memcpy_to_uspace) 68 62 movl %edi, %edx /* save %edi */ 69 63 movl %esi, %eax /* save %esi */ … … 93 87 movl MEMCPY_DST(%esp), %eax 94 88 ret 89 FUNCTION_END(memcpy_from_uspace) 90 FUNCTION_END(memcpy_to_uspace) 95 91 96 92 /* … … 98 94 * above had caused a page fault. 99 95 */ 100 memcpy_from_uspace_failover_address: 101 memcpy_to_uspace_failover_address: 96 SYMBOL(memcpy_from_uspace_failover_address) 97 SYMBOL(memcpy_to_uspace_failover_address) 102 98 movl %edx, %edi 103 99 movl %eax, %esi … … 112 108 * 113 109 */ 114 paging_on: 110 FUNCTION_BEGIN(paging_on) 115 111 movl %cr0, %edx 116 112 orl $(1 << 31), %edx /* paging on */ … … 123 119 0: 124 120 ret 121 FUNCTION_END(paging_on) 125 122 126 123 /** Enable local APIC … … 129 126 * 130 127 */ 131 enable_l_apic_in_msr: 128 FUNCTION_BEGIN(enable_l_apic_in_msr) 132 129 movl $0x1b, %ecx 133 130 rdmsr … … 136 133 wrmsr 137 134 ret 135 FUNCTION_END(enable_l_apic_in_msr) 138 136 139 137 /* … … 152 150 * entirely in registers. 153 151 */ 154 .global sysenter_handler 155 sysenter_handler: 152 SYMBOL(sysenter_handler) 156 153 157 154 /* … … 232 229 * This is the legacy syscall handler using the interrupt mechanism. 233 230 */ 234 .global int_syscall 235 int_syscall: 231 SYMBOL(int_syscall) 236 232 subl $(ISTATE_SOFT_SIZE + 4), %esp 237 233 … … 319 315 320 316 .macro handler i 321 .global int_\i 322 int_\i: 317 SYMBOL(int_\i) 323 318 /* 324 319 * This macro distinguishes between two versions of ia32 … … 462 457 * 463 458 */ 464 early_putchar: 459 FUNCTION_BEGIN(early_putchar) 465 460 466 461 #if ((defined(CONFIG_EGA)) && (!defined(CONFIG_FB))) … … 594 589 595 590 ret 596 591 FUNCTION_END(early_putchar) 592 -
kernel/arch/ia32/src/atomic.S
r3a34852 r8844e70 27 27 # 28 28 29 #include <abi/asmtool.h> 30 29 31 .text 30 32 31 33 #ifdef CONFIG_SMP 32 34 33 .global spinlock_arch34 35 35 # 36 36 # This is a bus-and-hyperthreading-friendly implementation of spinlock 37 37 # 38 spinlock_arch: 38 FUNCTION_BEGIN(spinlock_arch) 39 39 pushl %eax 40 40 pushl %ebx … … 55 55 popl %eax 56 56 ret 57 FUNCTION_END(spinlock_arch) 57 58 58 59 #endif -
kernel/arch/ia32/src/boot/multiboot.S
r3a34852 r8844e70 29 29 */ 30 30 31 #include <abi/asmtool.h> 31 32 #include <arch/boot/boot.h> 32 33 #include <arch/mm/page.h> … … 61 62 62 63 .align 4 63 .global multiboot_image_start64 64 multiboot_header: 65 65 .long MULTIBOOT_HEADER_MAGIC … … 72 72 .long multiboot_image_start 73 73 74 multiboot_image_start: 74 SYMBOL(multiboot_image_start) 75 75 cli 76 76 cld … … 162 162 * 163 163 */ 164 .global map_kernel_pse 164 FUNCTION_BEGIN(map_kernel_pse) 165 165 map_kernel_pse: 166 166 /* Paging features */ … … 194 194 movl %ebx, %cr0 195 195 ret 196 FUNCTION_END(map_kernel_pse) 196 197 197 198 /** Setup mapping for the kernel (non-PSE variant). … … 201 202 * 202 203 */ 203 .global map_kernel_non_pse 204 map_kernel_non_pse: 204 FUNCTION_BEGIN(map_kernel_non_pse) 205 205 /* Paging features */ 206 206 movl %cr4, %ecx … … 281 281 282 282 ret 283 FUNCTION_END(map_kernel_non_pse) 283 284 284 285 /** Calculate unmapped address of the end of the kernel. */ … … 707 708 .space 4096, 0 708 709 709 .global bootstrap_idtr 710 bootstrap_idtr: 710 SYMBOL(bootstrap_idtr) 711 711 .word 0 712 712 .long 0 713 713 714 .global bootstrap_gdtr 715 bootstrap_gdtr: 714 SYMBOL(bootstrap_gdtr) 716 715 .word GDT_SELECTOR(GDT_ITEMS) 717 716 .long KA2PA(gdt) 718 717 719 .global multiboot_eax 720 multiboot_eax: 718 SYMBOL(multiboot_eax) 721 719 .long 0 722 720 723 .global multiboot_ebx 724 multiboot_ebx: 721 SYMBOL(multiboot_ebx) 725 722 .long 0 726 723 -
kernel/arch/ia32/src/boot/multiboot2.S
r3a34852 r8844e70 27 27 */ 28 28 29 #include <abi/asmtool.h> 29 30 #include <arch/boot/boot.h> 30 31 #include <arch/pm.h> … … 39 40 40 41 .align 8 41 .global multiboot2_image_start42 42 multiboot2_header_start: 43 43 .long MULTIBOOT2_HEADER_MAGIC … … 120 120 multiboot2_header_end: 121 121 122 multiboot2_image_start: 122 SYMBOL(multiboot2_image_start) 123 123 cli 124 124 cld -
kernel/arch/ia32/src/context.S
r3a34852 r8844e70 27 27 # 28 28 29 #include <abi/asmtool.h> 29 30 #include <arch/context_struct.h> 30 31 31 32 .text 32 33 .global context_save_arch34 .global context_restore_arch35 36 33 37 34 ## Save current CPU context … … 40 37 # pointed by the 1st argument. Returns 1 in EAX. 41 38 # 42 context_save_arch: 39 FUNCTION_BEGIN(context_save_arch) 43 40 movl 0(%esp), %eax # save pc value into eax 44 41 movl 4(%esp), %edx # address of the context variable to save context to … … 55 52 incl %eax 56 53 ret 54 FUNCTION_END(context_save_arch) 57 55 58 56 … … 62 60 # pointed by the 1st argument. Returns 0 in EAX. 63 61 # 64 context_restore_arch: 62 FUNCTION_BEGIN(context_restore_arch) 65 63 movl 4(%esp), %eax # address of the context variable to restore context from 66 64 … … 76 74 xorl %eax, %eax # context_restore returns 0 77 75 ret 78 76 FUNCTION_END(context_restore_arch) -
kernel/arch/ia32/src/debug/stacktrace_asm.S
r3a34852 r8844e70 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 movl %ebp, %eax 36 35 ret 36 FUNCTION_END(frame_pointer_get) 37 37 38 program_counter_get: 38 FUNCTION_BEGIN(program_counter_get) 39 39 movl (%esp), %eax 40 40 ret 41 FUNCTION_END(program_counter_get) -
kernel/arch/ia32/src/delay.S
r3a34852 r8844e70 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 movl 4(%esp),%ecx # move argument to %ecx 40 39 0: lahf … … 42 41 jnz 0b 43 42 ret 43 FUNCTION_END(asm_delay_loop) 44 44 45 asm_fake_loop: 45 FUNCTION_BEGIN(asm_fake_loop) 46 46 movl 4(%esp),%ecx # move argument to %ecx 47 47 0: lahf … … 49 49 jz 0b 50 50 ret 51 FUNCTION_END(asm_fake_loop) 52 -
kernel/arch/ia32/src/smp/ap.S
r3a34852 r8844e70 32 32 */ 33 33 34 #include <abi/asmtool.h> 34 35 #include <arch/boot/boot.h> 35 36 #include <arch/boot/memmap.h> … … 40 41 41 42 #ifdef CONFIG_SMP 42 43 .global unmapped_ap_boot44 43 45 44 KTEXT=8 … … 53 52 54 53 .align 4096 55 unmapped_ap_boot: 54 SYMBOL(unmapped_ap_boot) 56 55 .code16 57 56 cli … … 99 98 #ifdef CONFIG_SMP 100 99 101 .global unmapped_ap_gdtr 102 103 unmapped_ap_gdtr: 100 SYMBOL(unmapped_ap_gdtr) 104 101 .word 0 105 102 .long 0 -
uspace/lib/c/arch/ia32/Makefile.inc
r3a34852 r8844e70 29 29 ARCH_SOURCES = \ 30 30 arch/$(UARCH)/src/entry.S \ 31 arch/$(UARCH)/src/entryjmp. s\32 arch/$(UARCH)/src/thread_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/ia32/src/entry.S
r3a34852 r8844e70 27 27 # 28 28 29 #include <abi/asmtool.h> 30 29 31 INTEL_CPUID_STANDARD = 1 30 32 INTEL_SEP = 11 … … 34 36 .org 0 35 37 36 .globl __entry37 38 38 ## User-space task entry point 39 39 # 40 40 # %edi contains the PCB pointer 41 41 # 42 __entry: 42 SYMBOL(__entry) 43 43 mov %ss, %ax 44 44 mov %ax, %ds -
uspace/lib/c/arch/ia32/src/entryjmp.S
r3a34852 r8844e70 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); 32 32 # 33 33 # Jump to program entry point 34 entry_point_jmp: 34 SYMBOL(entry_point_jmp) 35 35 # Use standard ia32 prologue not to confuse anybody 36 36 push %ebp -
uspace/lib/c/arch/ia32/src/stacktrace_asm.S
r3a34852 r8844e70 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 movl %ebp, %eax 40 39 ret 40 FUNCTION_END(stacktrace_fp_get) 41 41 42 stacktrace_pc_get: 42 FUNCTION_BEGIN(stacktrace_pc_get) 43 43 movl (%esp), %eax 44 44 ret 45 FUNCTION_END(stacktrace_pc_get) -
uspace/lib/c/arch/ia32/src/syscall.S
r3a34852 r8844e70 27 27 # 28 28 29 #include <abi/asmtool.h> 30 29 31 .data 30 32 31 .global __syscall_fast_func 32 __syscall_fast_func: 33 OBJECT_BEGIN(__syscall_fast_func) 33 34 .long __syscall_slow 34 .size __syscall_fast_func, . - __syscall_fast_func 35 OBJECT_END(__syscall_fast_func) 35 36 36 37 .text … … 42 43 * could benefit from this and not save unused registers on the stack. 43 44 */ 44 .global __syscall_slow 45 __syscall_slow: 45 FUNCTION_BEGIN(__syscall_slow) 46 46 pushl %ebx 47 47 pushl %esi … … 61 61 popl %ebx 62 62 ret 63 FUNCTION_END(__syscall_slow) 63 64 64 65 … … 71 72 * segment, otherwise the SYSENTER wouldn't work in the first place). 72 73 */ 73 .global __syscall_fast 74 .type __syscall_fast, @function 75 76 __syscall_fast: 74 FUNCTION_BEGIN(__syscall_fast) 77 75 pushl %ebx 78 76 pushl %esi … … 98 96 popl %ebx 99 97 ret 100 101 .size __syscall_fast, . - __syscall_fast 98 FUNCTION_END(__syscall_fast) -
uspace/lib/c/arch/ia32/src/thread_entry.S
r3a34852 r8844e70 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 mov %ss, %dx 38 38 mov %dx, %ds … … 57 57 # Not reached. 58 58 # 59 60 .end __thread_entry 59 SYMBOL_END(__thread_entry)
Note:
See TracChangeset
for help on using the changeset viewer.