Changeset 3b0f1b9a in mainline for kernel/arch/amd64/src


Ignore:
Timestamp:
2016-04-12T05:57:00Z (9 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0f792c28, d84398a7
Parents:
8844e70
Message:

amd64: use asmtool.h macros for defining symbols

Location:
kernel/arch/amd64/src
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/asm.S

    r8844e70 r3b0f1b9a  
    2727 */
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/pm.h>
    3031#include <arch/mm/page.h>
     
    3233
    3334.text
    34 .global interrupt_handlers
    35 .global syscall_entry
    36 .global cpuid
    37 .global has_cpuid
    38 .global read_efer_flag
    39 .global set_efer_flag
    40 .global memcpy_from_uspace
    41 .global memcpy_to_uspace
    42 .global memcpy_from_uspace_failover_address
    43 .global memcpy_to_uspace_failover_address
    44 .global early_putchar
    4535
    4636#define MEMCPY_DST   %rdi
     
    6454 *
    6555 */
    66 memcpy_from_uspace:
    67 memcpy_to_uspace:
     56FUNCTION_BEGIN(memcpy_from_uspace)
     57FUNCTION_BEGIN(memcpy_to_uspace)
    6858        movq MEMCPY_DST, %rax
    6959       
     
    8171        0:
    8272                ret                 /* return MEMCPY_SRC, success */
    83 
    84 memcpy_from_uspace_failover_address:
    85 memcpy_to_uspace_failover_address:
     73FUNCTION_END(memcpy_from_uspace)
     74FUNCTION_END(memcpy_to_uspace)
     75
     76SYMBOL(memcpy_from_uspace_failover_address)
     77SYMBOL(memcpy_to_uspace_failover_address)
    8678        xorl %eax, %eax         /* return 0, failure */
    8779        ret
     
    9284*
    9385*/
    94 has_cpuid:
     86FUNCTION_BEGIN(has_cpuid)
    9587        /* Load RFLAGS */
    9688        pushfq
     
    114106        xorl %edx, %eax
    115107        ret
    116 
    117 cpuid:
     108FUNCTION_END(has_cpuid)
     109
     110FUNCTION_BEGIN(cpuid)
    118111        /* Preserve %rbx across function calls */
    119112        movq %rbx, %r10
     
    130123        movq %r10, %rbx
    131124        ret
    132 
    133 set_efer_flag:
     125FUNCTION_END(cpuid)
     126
     127FUNCTION_BEGIN(set_efer_flag)
    134128        movl $0xc0000080, %ecx
    135129        rdmsr
     
    137131        wrmsr
    138132        ret
    139 
    140 read_efer_flag:
     133FUNCTION_END(set_efer_flag)
     134
     135FUNCTION_BEGIN(read_efer_flag)
    141136        movl $0xc0000080, %ecx
    142137        rdmsr
    143138        ret
     139FUNCTION_END(read_efer_flag)
    144140
    145141/*
     
    157153
    158154.macro handler i
    159 .global int_\i
    160 int_\i:
     155SYMBOL(int_\i)
    161156
    162157        /*
     
    249244        53,54,55,56,57,58,59,60,61,62,63
    250245
    251 interrupt_handlers:
     246SYMBOL(interrupt_handlers)
    252247.irp cnt, LIST_0_63
    253248        handler \cnt
     
    273268 *
    274269 */
    275 syscall_entry:
     270SYMBOL(syscall_entry)
    276271        /* Switch to hidden %gs */
    277272        swapgs
     
    396391 *
    397392 */
    398 early_putchar:
    399        
     393FUNCTION_BEGIN(early_putchar)
    400394#if ((defined(CONFIG_EGA)) && (!defined(CONFIG_FB)))
    401395       
     
    525519       
    526520        ret
    527 
     521FUNCTION_END(early_putchar)
     522
  • kernel/arch/amd64/src/boot/multiboot.S

    r8844e70 r3b0f1b9a  
    2929 */
    3030
     31#include <abi/asmtool.h>
    3132#include <arch/boot/boot.h>
    3233#include <arch/mm/page.h>
     
    6465
    6566.align 4
    66 .global multiboot_image_start
    6767multiboot_header:
    6868        .long MULTIBOOT_HEADER_MAGIC
     
    7575        .long multiboot_image_start
    7676
    77 multiboot_image_start:
     77SYMBOL(multiboot_image_start)
    7878        cli
    7979        cld
     
    640640
    641641.align 4096
    642 .global ptl_0
    643 ptl_0:
     642SYMBOL(ptl_0)
    644643        .quad ptl_1 + (PTL_WRITABLE | PTL_PRESENT)
    645644        .fill 510, 8, 0
     
    648647.section K_DATA_START, "aw", @progbits
    649648
    650 .global bootstrap_idtr
    651 bootstrap_idtr:
     649SYMBOL(bootstrap_idtr)
    652650        .word 0
    653651        .long 0
    654652
    655 .global bootstrap_gdtr
    656 bootstrap_gdtr:
     653SYMBOL(bootstrap_gdtr)
    657654        .word GDT_SELECTOR(GDT_ITEMS)
    658655        .long KA2PA(gdt)
    659656
    660 .global multiboot_eax
    661 multiboot_eax:
     657SYMBOL(multiboot_eax)
    662658        .long 0
    663659
    664 .global multiboot_ebx
    665 multiboot_ebx:
     660SYMBOL(multiboot_ebx)
    666661        .long 0
    667662
  • kernel/arch/amd64/src/boot/multiboot2.S

    r8844e70 r3b0f1b9a  
    2727 */
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/boot/boot.h>
    3031#include <arch/mm/page.h>
     
    4142
    4243.align 8
    43 .global multiboot2_image_start
    4444multiboot2_header_start:
    4545        .long MULTIBOOT2_HEADER_MAGIC
     
    122122multiboot2_header_end:
    123123
    124 multiboot2_image_start:
     124SYMBOL(multiboot2_image_start)
    125125        cli
    126126        cld
  • kernel/arch/amd64/src/context.S

    r8844e70 r3b0f1b9a  
    2727#
    2828
     29#include <abi/asmtool.h>
     30#include <arch/context_struct.h>
     31
    2932.text
    30 
    31 .global context_save_arch
    32 .global context_restore_arch
    33 
    34 #include <arch/context_struct.h>
    3533
    3634## Save current CPU context
     
    3937# pointed by the 1st argument. Returns 1 in EAX.
    4038#
    41 context_save_arch:
     39FUNCTION_BEGIN(context_save_arch)
    4240        movq (%rsp), %rdx     # the caller's return %eip
    4341       
     
    5654        incl %eax
    5755        ret
     56FUNCTION_END(context_save_arch)
    5857
    5958
     
    6362# pointed by the 1st argument. Returns 0 in EAX.
    6463#
    65 context_restore_arch:
     64FUNCTION_BEGIN(context_restore_arch)
    6665        movq CONTEXT_OFFSET_R15(%rdi), %r15
    6766        movq CONTEXT_OFFSET_R14(%rdi), %r14
     
    7978        xorl %eax, %eax       # context_restore returns 0
    8079        ret
     80FUNCTION_END(context_restore_arch)
    8181
  • kernel/arch/amd64/src/debug/stacktrace_asm.S

    r8844e70 r3b0f1b9a  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032
    31 .global frame_pointer_get
    32 .global program_counter_get
    33 
    34 frame_pointer_get:
     33FUNCTION_BEGIN(frame_pointer_get)
    3534        movq %rbp, %rax
    3635        ret
     36FUNCTION_END(frame_pointer_get)
    3737
    38 program_counter_get:
     38FUNCTION_BEGIN(program_counter_get)
    3939        movq (%rsp), %rax
    4040        ret
     41FUNCTION_END(program_counter_get)
  • kernel/arch/amd64/src/delay.S

    r8844e70 r3b0f1b9a  
    3131#
    3232
     33#include <abi/asmtool.h>
     34
    3335.text
    3436
    35 .global asm_delay_loop
    36 .global asm_fake_loop
    37 
    38 asm_delay_loop:
     37FUNCTION_BEGIN(asm_delay_loop)
    3938        0:
    4039                dec %rdi
     
    4241       
    4342        ret
     43FUNCTION_END(asm_delay_loop)
    4444
    45 asm_fake_loop:
     45FUNCTION_BEGIN(asm_fake_loop)
    4646        0:
    4747                dec %rdi
     
    4949       
    5050        ret
     51FUNCTION_END(asm_fake_loop)
     52
  • kernel/arch/amd64/src/smp/ap.S

    r8844e70 r3b0f1b9a  
    3232#
    3333
     34#include <abi/asmtool.h>
    3435#include <arch/boot/boot.h>
    3536#include <arch/boot/memmap.h>
     
    4344#ifdef CONFIG_SMP
    4445
    45 .global unmapped_ap_boot
    46 
    4746# This piece of code is real-mode and is meant to be alligned at 4K boundary.
    4847# The requirement for such an alignment comes from MP Specification's STARTUP
     
    5049
    5150.align 4096
    52 unmapped_ap_boot:
     51SYMBOL(unmapped_ap_boot)
    5352.code16
    5453        cli
     
    113112#ifdef CONFIG_SMP
    114113
    115 .global unmapped_ap_gdtr
    116 unmapped_ap_gdtr:
     114SYMBOL(unmapped_ap_gdtr)
    117115        .word 0
    118116        .long 0
Note: See TracChangeset for help on using the changeset viewer.