Changeset 8844e70 in mainline for kernel/arch/ia32


Ignore:
Timestamp:
2016-04-11T17:03:47Z (9 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3b0f1b9a
Parents:
3a34852
Message:

ia32: use asmtool.h macros for defining symbols

Location:
kernel/arch/ia32
Files:
8 edited
1 moved

Legend:

Unmodified
Added
Removed
  • kernel/arch/ia32/Makefile.inc

    r3a34852 r8844e70  
    7575        arch/$(KARCH)/src/debug/stacktrace.c \
    7676        arch/$(KARCH)/src/debug/stacktrace_asm.S \
    77         arch/$(KARCH)/src/delay.s \
     77        arch/$(KARCH)/src/delay.S \
    7878        arch/$(KARCH)/src/asm.S \
    7979        arch/$(KARCH)/src/proc/scheduler.c \
  • kernel/arch/ia32/src/asm.S

    r3a34852 r8844e70  
    3131 */
    3232
     33#include <abi/asmtool.h>
    3334#include <arch/pm.h>
    3435#include <arch/cpu.h>
     
    3738
    3839.text
    39 .global paging_on
    40 .global enable_l_apic_in_msr
    41 .global memcpy_from_uspace
    42 .global memcpy_from_uspace_failover_address
    43 .global memcpy_to_uspace
    44 .global memcpy_to_uspace_failover_address
    45 .global early_putchar
    4640
    4741#define MEMCPY_DST   4
     
    6458 *
    6559 */
    66 memcpy_from_uspace:
    67 memcpy_to_uspace:
     60FUNCTION_BEGIN(memcpy_from_uspace)
     61FUNCTION_BEGIN(memcpy_to_uspace)
    6862        movl %edi, %edx  /* save %edi */
    6963        movl %esi, %eax  /* save %esi */
     
    9387                movl MEMCPY_DST(%esp), %eax
    9488                ret
     89FUNCTION_END(memcpy_from_uspace)
     90FUNCTION_END(memcpy_to_uspace)
    9591
    9692/*
     
    9894 * above had caused a page fault.
    9995 */
    100 memcpy_from_uspace_failover_address:
    101 memcpy_to_uspace_failover_address:
     96SYMBOL(memcpy_from_uspace_failover_address)
     97SYMBOL(memcpy_to_uspace_failover_address)
    10298        movl %edx, %edi
    10399        movl %eax, %esi
     
    112108 *
    113109 */
    114 paging_on:
     110FUNCTION_BEGIN(paging_on)
    115111        movl %cr0, %edx
    116112        orl $(1 << 31), %edx  /* paging on */
     
    123119        0:
    124120                ret
     121FUNCTION_END(paging_on)
    125122
    126123/** Enable local APIC
     
    129126 *
    130127 */
    131 enable_l_apic_in_msr:
     128FUNCTION_BEGIN(enable_l_apic_in_msr)
    132129        movl $0x1b, %ecx
    133130        rdmsr
     
    136133        wrmsr
    137134        ret
     135FUNCTION_END(enable_l_apic_in_msr)
    138136
    139137/*
     
    152150 * entirely in registers.
    153151 */
    154 .global sysenter_handler
    155 sysenter_handler:
     152SYMBOL(sysenter_handler)
    156153
    157154        /*
     
    232229 * This is the legacy syscall handler using the interrupt mechanism.
    233230 */
    234 .global int_syscall
    235 int_syscall:
     231SYMBOL(int_syscall)
    236232        subl $(ISTATE_SOFT_SIZE + 4), %esp
    237233
     
    319315
    320316.macro handler i
    321 .global int_\i
    322 int_\i:
     317SYMBOL(int_\i)
    323318        /*
    324319         * This macro distinguishes between two versions of ia32
     
    462457 *
    463458 */
    464 early_putchar:
     459FUNCTION_BEGIN(early_putchar)
    465460       
    466461#if ((defined(CONFIG_EGA)) && (!defined(CONFIG_FB)))
     
    594589       
    595590        ret
    596 
     591FUNCTION_END(early_putchar)
     592
  • kernel/arch/ia32/src/atomic.S

    r3a34852 r8844e70  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032
    3133#ifdef CONFIG_SMP
    3234
    33 .global spinlock_arch
    34 
    3535#
    3636# This is a bus-and-hyperthreading-friendly implementation of spinlock
    3737#
    38 spinlock_arch:
     38FUNCTION_BEGIN(spinlock_arch)
    3939        pushl %eax
    4040        pushl %ebx
     
    5555        popl %eax
    5656        ret
     57FUNCTION_END(spinlock_arch)
    5758       
    5859#endif
  • kernel/arch/ia32/src/boot/multiboot.S

    r3a34852 r8844e70  
    2929 */
    3030
     31#include <abi/asmtool.h>
    3132#include <arch/boot/boot.h>
    3233#include <arch/mm/page.h>
     
    6162
    6263.align 4
    63 .global multiboot_image_start
    6464multiboot_header:
    6565        .long MULTIBOOT_HEADER_MAGIC
     
    7272        .long multiboot_image_start
    7373
    74 multiboot_image_start:
     74SYMBOL(multiboot_image_start)
    7575        cli
    7676        cld
     
    162162 *
    163163 */
    164 .global map_kernel_pse
     164FUNCTION_BEGIN(map_kernel_pse)
    165165map_kernel_pse:
    166166        /* Paging features */
     
    194194        movl %ebx, %cr0
    195195        ret
     196FUNCTION_END(map_kernel_pse)
    196197
    197198/** Setup mapping for the kernel (non-PSE variant).
     
    201202 *
    202203 */
    203 .global map_kernel_non_pse
    204 map_kernel_non_pse:
     204FUNCTION_BEGIN(map_kernel_non_pse)
    205205        /* Paging features */
    206206        movl %cr4, %ecx
     
    281281               
    282282                ret
     283FUNCTION_END(map_kernel_non_pse)
    283284
    284285/** Calculate unmapped address of the end of the kernel. */
     
    707708        .space 4096, 0
    708709
    709 .global bootstrap_idtr
    710 bootstrap_idtr:
     710SYMBOL(bootstrap_idtr)
    711711        .word 0
    712712        .long 0
    713713
    714 .global bootstrap_gdtr
    715 bootstrap_gdtr:
     714SYMBOL(bootstrap_gdtr)
    716715        .word GDT_SELECTOR(GDT_ITEMS)
    717716        .long KA2PA(gdt)
    718717
    719 .global multiboot_eax
    720 multiboot_eax:
     718SYMBOL(multiboot_eax)
    721719        .long 0
    722720
    723 .global multiboot_ebx
    724 multiboot_ebx:
     721SYMBOL(multiboot_ebx)
    725722        .long 0
    726723
  • kernel/arch/ia32/src/boot/multiboot2.S

    r3a34852 r8844e70  
    2727 */
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/boot/boot.h>
    3031#include <arch/pm.h>
     
    3940
    4041.align 8
    41 .global multiboot2_image_start
    4242multiboot2_header_start:
    4343        .long MULTIBOOT2_HEADER_MAGIC
     
    120120multiboot2_header_end:
    121121
    122 multiboot2_image_start:
     122SYMBOL(multiboot2_image_start)
    123123        cli
    124124        cld
  • kernel/arch/ia32/src/context.S

    r3a34852 r8844e70  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/context_struct.h>
    3031
    3132.text
    32 
    33 .global context_save_arch
    34 .global context_restore_arch
    35 
    3633
    3734## Save current CPU context
     
    4037# pointed by the 1st argument. Returns 1 in EAX.
    4138#
    42 context_save_arch:
     39FUNCTION_BEGIN(context_save_arch)
    4340        movl 0(%esp), %eax      # save pc value into eax       
    4441        movl 4(%esp), %edx      # address of the context variable to save context to
     
    5552        incl %eax
    5653        ret
     54FUNCTION_END(context_save_arch)
    5755
    5856
     
    6260# pointed by the 1st argument. Returns 0 in EAX.
    6361#
    64 context_restore_arch:
     62FUNCTION_BEGIN(context_restore_arch)
    6563        movl 4(%esp), %eax      # address of the context variable to restore context from
    6664
     
    7674        xorl %eax, %eax         # context_restore returns 0
    7775        ret
    78 
     76FUNCTION_END(context_restore_arch)
  • kernel/arch/ia32/src/debug/stacktrace_asm.S

    r3a34852 r8844e70  
    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        movl %ebp, %eax
    3635        ret
     36FUNCTION_END(frame_pointer_get)
    3737
    38 program_counter_get:
     38FUNCTION_BEGIN(program_counter_get)
    3939        movl (%esp), %eax
    4040        ret
     41FUNCTION_END(program_counter_get)
  • kernel/arch/ia32/src/delay.S

    r3a34852 r8844e70  
    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        movl 4(%esp),%ecx       # move argument to %ecx
    40390:      lahf
     
    4241        jnz 0b
    4342        ret
     43FUNCTION_END(asm_delay_loop)
    4444
    45 asm_fake_loop:
     45FUNCTION_BEGIN(asm_fake_loop)
    4646        movl 4(%esp),%ecx       # move argument to %ecx
    47470:      lahf
     
    4949        jz 0b
    5050        ret
     51FUNCTION_END(asm_fake_loop)
     52
  • kernel/arch/ia32/src/smp/ap.S

    r3a34852 r8844e70  
    3232 */
    3333
     34#include <abi/asmtool.h>
    3435#include <arch/boot/boot.h>
    3536#include <arch/boot/memmap.h>
     
    4041
    4142#ifdef CONFIG_SMP
    42 
    43 .global unmapped_ap_boot
    4443
    4544KTEXT=8
     
    5352
    5453.align 4096
    55 unmapped_ap_boot:
     54SYMBOL(unmapped_ap_boot)
    5655.code16
    5756        cli
     
    9998#ifdef CONFIG_SMP
    10099
    101 .global unmapped_ap_gdtr
    102 
    103 unmapped_ap_gdtr:
     100SYMBOL(unmapped_ap_gdtr)
    104101        .word 0
    105102        .long 0
Note: See TracChangeset for help on using the changeset viewer.