Changeset 73b3ecd in mainline


Ignore:
Timestamp:
2016-04-21T20:00:18Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
054476d
Parents:
96521f2f
Message:

arm32: use asmtool.h macros for defining symbols

Files:
14 edited
4 moved

Legend:

Unmodified
Added
Removed
  • boot/arch/arm32/src/asm.S

    r96521f2f r73b3ecd  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/arch.h>
    3031
    3132.section BOOTSTRAP
    3233
    33 .global start
    34 .global boot_pt
    35 .global boot_stack
    36 .global halt
    37 .global jump_to_kernel
    38 
    39 start:
     34SYMBOL(start)
    4035        ldr sp, =boot_stack
    4136        b bootstrap
    4237
    4338.section BOOTPT
    44 boot_pt:
     39SYMBOL(boot_pt)
    4540        .space PTL0_ENTRIES * PTL0_ENTRY_SIZE
    4641
    4742.section BOOTSTACK
    4843        .space 4096
    49 boot_stack:
     44SYMBOL(boot_stack)
    5045
    5146.text
    5247
    53 halt:
     48FUNCTION_BEGIN(halt)
    5449        b halt
     50FUNCTION_END(halt)
    5551
    56 jump_to_kernel:
     52FUNCTION_BEGIN(jump_to_kernel)
    5753        #
    5854        # Make sure that the I-cache, D-cache and memory are mutually coherent
     
    108104#endif
    109105        mov pc, r0
     106FUNCTION_END(jump_to_kernel)
     107
  • boot/arch/arm32/src/eabi.S

    r96521f2f r73b3ecd  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032
    31 .global __aeabi_idiv
    32 .global __aeabi_uidiv
    33 
    34 .global __aeabi_idivmod
    35 .global __aeabi_uidivmod
    36 
    37 .global __aeabi_ldivmod
    38 .global __aeabi_uldivmod
    39 
    40 __aeabi_idiv:
     33FUNCTION_BEGIN(__aeabi_idiv)
    4134        push {lr}
    4235        bl __divsi3
    4336        pop {lr}
    4437        mov pc, lr
     38FUNCTION_END(__aeabi_idiv)
    4539
    46 __aeabi_uidiv:
     40FUNCTION_BEGIN(__aeabi_uidiv)
    4741        push {lr}
    4842        bl __udivsi3
    4943        pop {lr}
    5044        mov pc, lr
     45FUNCTION_END(__aeabi_uidiv)
    5146
    52 __aeabi_idivmod:
     47FUNCTION_BEGIN(__aeabi_idivmod)
    5348        push {lr}
    5449        sub sp, sp, #12
     
    5954        pop {lr}
    6055        mov pc, lr
     56FUNCTION_END(__aeabi_idivmod)
    6157
    62 __aeabi_uidivmod:
     58FUNCTION_BEGIN(__aeabi_uidivmod)
    6359        push {lr}
    6460        sub sp, sp, #12
     
    6965        pop {lr}
    7066        mov pc, lr
     67FUNCTION_END(__aeabi_uidivmod)
    7168
    72 __aeabi_ldivmod:
     69FUNCTION_BEGIN(__aeabi_ldivmod)
    7370        push {lr}
    7471        sub sp, sp, #24
     
    8077        pop {lr}
    8178        mov pc, lr
     79FUNCTION_END(__aeabi_ldivmod)
    8280
    83 __aeabi_uldivmod:
     81FUNCTION_BEGIN(__aeabi_uldivmod)
    8482        push {lr}
    8583        sub sp, sp, #24
     
    9189        pop {lr}
    9290        mov pc, lr
     91FUNCTION_END(__aeabi_uldivmod)
     92
  • kernel/arch/arm32/Makefile.inc

    r96521f2f r73b3ecd  
    3333ATSIGN = %
    3434
    35 GCC_CFLAGS += -fno-omit-frame-pointer -mapcs-frame -march=$(subst _,-,$(PROCESSOR_ARCH)) -mno-unaligned-access
     35GCC_CFLAGS += -fno-omit-frame-pointer -mapcs-frame -march=$(subst _,-,$(PROCESSOR_ARCH)) -mno-unaligned-access -mfpu=vfpv3
    3636
    3737ifeq ($(CONFIG_FPU),y)
     
    7070ifeq ($(CONFIG_FPU),y)
    7171        ARCH_SOURCES += arch/$(KARCH)/src/fpu_context.c
    72         ARCH_SOURCES += arch/$(KARCH)/src/fpu.s
     72        ARCH_SOURCES += arch/$(KARCH)/src/fpu.S
    7373endif
    7474
  • kernel/arch/arm32/src/asm.S

    r96521f2f r73b3ecd  
    2727 */
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032
    31 .global memcpy_from_uspace
    32 .global memcpy_to_uspace
    33 .global memcpy_from_uspace_failover_address
    34 .global memcpy_to_uspace_failover_address
    35 .global early_putchar
    36 
    37 memcpy_from_uspace:
    38 memcpy_to_uspace:
     33FUNCTION_BEGIN(memcpy_from_uspace)
     34FUNCTION_BEGIN(memcpy_to_uspace)
    3935        add r3, r1, #3
    4036        bic r3, r3, #3
     
    9490                bne 7b
    9591                b 3b
     92FUNCTION_END(memcpy_from_uspace)
     93FUNCTION_END(memcpy_to_uspace)
    9694
    97 memcpy_from_uspace_failover_address:
    98 memcpy_to_uspace_failover_address:
     95SYMBOL(memcpy_from_uspace_failover_address)
     96SYMBOL(memcpy_to_uspace_failover_address)
    9997        mov r0, #0
    10098        ldmia sp!, {r4, r5, pc}
    10199
    102 early_putchar:
     100FUNCTION_BEGIN(early_putchar)
    103101        mov pc, lr
     102FUNCTION_END(early_putchar)
     103
  • kernel/arch/arm32/src/context.S

    r96521f2f r73b3ecd  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text   
    3032
    31 .global context_save_arch
    32 .global context_restore_arch
    33 
    34 context_save_arch:
     33FUNCTION_BEGIN(context_save_arch)
    3534        stmfd sp!, {r1}
    3635        mrs r1, cpsr
     
    4443        mov r0, #1
    4544        mov pc, lr
     45FUNCTION_END(context_save_arch)
    4646
    47 
    48 context_restore_arch:
     47FUNCTION_BEGIN(context_restore_arch)
    4948        ldmia r0!, {r4}
    5049        mrs r5, cpsr
     
    5857        mov r0, #0
    5958        mov pc, lr
     59FUNCTION_END(context_restore_arch)
     60
  • kernel/arch/arm32/src/debug/stacktrace_asm.S

    r96521f2f r73b3ecd  
    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        mov r0, fp
    3635        mov pc, lr
     36FUNCTION_END(frame_pointer_get)
    3737
    38 program_counter_get:
     38FUNCTION_BEGIN(program_counter_get)
    3939        mov r0, lr
    4040        mov pc, lr
     41FUNCTION_END(program_counter_get)
     42
  • kernel/arch/arm32/src/dummy.S

    r96521f2f r73b3ecd  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032
    31 .global calibrate_delay_loop
    32 .global asm_delay_loop
     33FUNCTION_BEGIN(calibrate_delay_loop)
     34        mov     pc, lr
     35FUNCTION_END(calibrate_delay_loop)
    3336
    34 .global sys_tls_set
    35 .global dummy
    36 
    37 calibrate_delay_loop:
     37FUNCTION_BEGIN(asm_delay_loop)
    3838        mov     pc, lr
    39 
    40 asm_delay_loop:
    41         mov     pc, lr
     39FUNCTION_END(asm_delay_loop)
    4240
    4341# not used on ARM
    44 sys_tls_set:
     42FUNCTION_BEGIN(sys_tls_set)
     43FUNCTION_BEGIN(dummy)
     44        mov pc, lr
     45FUNCTION_END(dummy)
     46FUNCTION_END(sys_tls_set)
    4547
    46 dummy:
    47         mov pc, lr
  • kernel/arch/arm32/src/eabi.S

    r96521f2f r73b3ecd  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032
    31 .global __aeabi_idiv
    32 .global __aeabi_uidiv
    33 
    34 .global __aeabi_idivmod
    35 .global __aeabi_uidivmod
    36 
    37 .global __aeabi_ldivmod
    38 .global __aeabi_uldivmod
    39 
    40 __aeabi_idiv:
     33FUNCTION_BEGIN(__aeabi_idiv)
    4134        push {lr}
    4235        bl __divsi3
    4336        pop {lr}
    4437        mov pc, lr
     38FUNCTION_END(__aeabi_idiv)
    4539
    46 __aeabi_uidiv:
     40FUNCTION_BEGIN(__aeabi_uidiv)
    4741        push {lr}
    4842        bl __udivsi3
    4943        pop {lr}
    5044        mov pc, lr
     45FUNCTION_END(__aeabi_uidiv)
    5146
    52 __aeabi_idivmod:
     47FUNCTION_BEGIN(__aeabi_idivmod)
    5348        push {lr}
    5449        sub sp, sp, #12
     
    5954        pop {lr}
    6055        mov pc, lr
     56FUNCTION_END(__aeabi_idivmod)
    6157
    62 __aeabi_uidivmod:
     58FUNCTION_BEGIN(__aeabi_uidivmod)
    6359        push {lr}
    6460        sub sp, sp, #12
     
    6965        pop {lr}
    7066        mov pc, lr
     67FUNCTION_END(__aeabi_uidivmod)
    7168
    72 __aeabi_ldivmod:
     69FUNCTION_BEGIN(__aeabi_ldivmod)
    7370        push {lr}
    7471        sub sp, sp, #24
     
    8077        pop {lr}
    8178        mov pc, lr
     79FUNCTION_END(__aeabi_ldivmod)
    8280
    83 __aeabi_uldivmod:
     81FUNCTION_BEGIN(__aeabi_uldivmod)
    8482        push {lr}
    8583        sub sp, sp, #24
     
    9189        pop {lr}
    9290        mov pc, lr
     91FUNCTION_END(__aeabi_uldivmod)
     92
  • kernel/arch/arm32/src/exc_handler.S

    r96521f2f r73b3ecd  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text   
    30 
    31 .global irq_exception_entry
    32 .global fiq_exception_entry
    33 .global data_abort_exception_entry
    34 .global prefetch_abort_exception_entry
    35 .global undef_instr_exception_entry
    36 .global swi_exception_entry
    37 .global reset_exception_entry
    38 
    3932
    4033# Switches to kernel stack and saves all registers there.
     
    156149.endm
    157150
    158 reset_exception_entry:
     151SYMBOL(reset_exception_entry)
    159152        SAVE_REGS_TO_STACK
    160153        mov r0, #0
     
    163156        LOAD_REGS_FROM_STACK
    164157
    165 irq_exception_entry:
     158SYMBOL(irq_exception_entry)
    166159        sub lr, lr, #4
    167160        SAVE_REGS_TO_STACK
     
    171164        LOAD_REGS_FROM_STACK
    172165
    173 fiq_exception_entry:
     166SYMBOL(fiq_exception_entry)
    174167        sub lr, lr, #4
    175168        SAVE_REGS_TO_STACK
     
    179172        LOAD_REGS_FROM_STACK
    180173
    181 undef_instr_exception_entry:
     174SYMBOL(undef_instr_exception_entry)
    182175        SAVE_REGS_TO_STACK
    183176        mov r0, #1
     
    186179        LOAD_REGS_FROM_STACK
    187180
    188 prefetch_abort_exception_entry:
     181SYMBOL(prefetch_abort_exception_entry)
    189182        sub lr, lr, #4
    190183        SAVE_REGS_TO_STACK
     
    194187        LOAD_REGS_FROM_STACK
    195188
    196 data_abort_exception_entry:
     189SYMBOL(data_abort_exception_entry)
    197190        sub lr, lr, #8
    198191        SAVE_REGS_TO_STACK
     
    202195        LOAD_REGS_FROM_STACK
    203196
    204 swi_exception_entry:
     197SYMBOL(swi_exception_entry)
    205198        ldr r13, =exc_stack
    206199        SAVE_REGS_TO_STACK
  • kernel/arch/arm32/src/fpu.S

    r96521f2f r73b3ecd  
    2727 */
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032
    31 .global fpsid_read
    32 .global mvfr0_read
    33 .global fpscr_read
    34 .global fpscr_write
    35 .global fpexc_read
    36 .global fpexc_write
    37 
    38 .global fpu_context_save_s32
    39 .global fpu_context_restore_s32
    40 .global fpu_context_save_d16
    41 .global fpu_context_restore_d16
    42 .global fpu_context_save_d32
    43 .global fpu_context_restore_d32
    44 
    45 fpsid_read:
     33FUNCTION_BEGIN(fpsid_read)
    4634        vmrs r0, fpsid
    4735        mov pc, lr
     36FUNCTION_END(fpsid_read)
    4837
    49 mvfr0_read:
     38FUNCTION_BEGIN(mvfr0_read)
    5039        vmrs r0, mvfr0
    5140        mov pc, lr
     41FUNCTION_END(mvfr0_read)
    5242
    53 fpscr_read:
     43FUNCTION_BEGIN(fpscr_read)
    5444        vmrs r0, fpscr
    5545        mov pc, lr
     46FUNCTION_END(fpscr_read)
    5647
    57 fpscr_write:
     48FUNCTION_BEGIN(fpscr_write)
    5849        vmsr fpscr, r0
    5950        mov pc, lr
     51FUNCTION_END(fpscr_write)
    6052
    61 fpexc_read:
     53FUNCTION_BEGIN(fpexc_read)
    6254        vmrs r0, fpexc
    6355        mov pc, lr
     56FUNCTION_END(fpexc_read)
    6457
    65 fpexc_write:
     58FUNCTION_BEGIN(fpexc_write)
    6659        vmsr fpexc, r0
    6760        mov pc, lr
     61FUNCTION_END(fpexc_write)
    6862
    69 fpu_context_save_s32:
     63FUNCTION_BEGIN(fpu_context_save_s32)
    7064        vmrs r1, fpexc
    7165        vmrs r2, fpscr
     
    7367        vstmia r0!, {s0-s31}
    7468        mov pc, lr
     69FUNCTION_END(fpu_context_save_s32)
    7570
    76 fpu_context_restore_s32:
     71FUNCTION_BEGIN(fpu_context_restore_s32)
    7772        ldmia r0!, {r1, r2}
    7873        vmsr fpexc, r1
     
    8075        vldmia r0!, {s0-s31}
    8176        mov pc, lr
     77FUNCTION_END(fpu_context_restore_s32)
    8278
    83 fpu_context_save_d16:
     79FUNCTION_BEGIN(fpu_context_save_d16)
    8480        vmrs r1, fpexc
    8581        vmrs r2, fpscr
     
    8783        vstmia r0!, {d0-d15}
    8884        mov pc, lr
     85FUNCTION_END(fpu_context_save_d16)
    8986
    90 fpu_context_restore_d16:
     87FUNCTION_BEGIN(fpu_context_restore_d16)
    9188        ldmia r0!, {r1, r2}
    9289        vmsr fpexc, r1
     
    9491        vldmia r0!, {d0-d15}
    9592        mov pc, lr
     93FUNCTION_END(fpu_context_restore_d16)
    9694
    97 fpu_context_save_d32:
     95FUNCTION_BEGIN(fpu_context_save_d32)
    9896        vmrs r1, fpexc
    9997        stmia r0!, {r1}
     
    103101        vstmia r0!, {d16-d31}
    104102        mov pc, lr
     103FUNCTION_END(fpu_context_save_d32)
    105104
    106 fpu_context_restore_d32:
     105FUNCTION_BEGIN(fpu_context_restore_d32)
    107106        ldmia r0!, {r1, r2}
    108107        vmsr fpexc, r1
     
    111110        vldmia r0!, {d16-d31}
    112111        mov pc, lr
     112FUNCTION_END(fpu_context_restore_d32)
    113113
    114 
    115 
  • kernel/arch/arm32/src/start.S

    r96521f2f r73b3ecd  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/asm/boot.h>
    3031
    3132.text
    3233
    33 .global kernel_image_start
    34 .global exc_stack
    35 .global supervisor_sp
    36 
    37 kernel_image_start:
    38 
     34SYMBOL(kernel_image_start)
    3935        # initialize Stack pointer for exception modes
    4036        mrs r4, cpsr
     
    8379
    8480        .space 1024
    85 exc_stack:
     81SYMBOL(exc_stack)
    8682
    87 supervisor_sp:
     83SYMBOL(supervisor_sp)
    8884        .space 4
  • uspace/lib/c/arch/arm32/Makefile.inc

    r96521f2f r73b3ecd  
    2929
    3030ARCH_SOURCES = \
    31         arch/$(UARCH)/src/entry.s \
    32         arch/$(UARCH)/src/entryjmp.s \
    33         arch/$(UARCH)/src/thread_entry.s \
     31        arch/$(UARCH)/src/entry.S \
     32        arch/$(UARCH)/src/entryjmp.S \
     33        arch/$(UARCH)/src/thread_entry.S \
    3434        arch/$(UARCH)/src/syscall.c \
    3535        arch/$(UARCH)/src/fibril.S \
  • uspace/lib/c/arch/arm32/src/eabi.S

    r96521f2f r73b3ecd  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032
    31 .global __aeabi_read_tp
    32 
    33 .global __aeabi_idiv
    34 .global __aeabi_uidiv
    35 
    36 .global __aeabi_idivmod
    37 .global __aeabi_uidivmod
    38 
    39 .global __aeabi_ldivmod
    40 .global __aeabi_uldivmod
    41 
    42 __aeabi_read_tp:
     33FUNCTION_BEGIN(__aeabi_read_tp)
    4334        mov r0, r9
    4435        mov pc, lr
     36FUNCTION_END(__aeabi_read_tp)
    4537
    46 __aeabi_idiv:
     38FUNCTION_BEGIN(__aeabi_idiv)
    4739        push {lr}
    4840        bl __divsi3
    4941        pop {lr}
    5042        mov pc, lr
     43FUNCTION_END(__aeabi_idiv)
    5144
    52 __aeabi_uidiv:
     45FUNCTION_BEGIN(__aeabi_uidiv)
    5346        push {lr}
    5447        bl __udivsi3
    5548        pop {lr}
    5649        mov pc, lr
     50FUNCTION_END(__aeabi_uidiv)
    5751
    58 __aeabi_idivmod:
     52FUNCTION_BEGIN(__aeabi_idivmod)
    5953        push {lr}
    6054        sub sp, sp, #12
     
    6559        pop {lr}
    6660        mov pc, lr
     61FUNCTION_END(__aeabi_idivmod)
    6762
    68 __aeabi_uidivmod:
     63FUNCTION_BEGIN(__aeabi_uidivmod)
    6964        push {lr}
    7065        sub sp, sp, #12
     
    7570        pop {lr}
    7671        mov pc, lr
     72FUNCTION_END(__aeabi_uidivmod)
    7773
    78 __aeabi_ldivmod:
     74FUNCTION_BEGIN(__aeabi_ldivmod)
    7975        push {lr}
    8076        sub sp, sp, #24
     
    8682        pop {lr}
    8783        mov pc, lr
     84FUNCTION_END(__aeabi_ldivmod)
    8885
    89 __aeabi_uldivmod:
     86FUNCTION_BEGIN(__aeabi_uldivmod)
    9087        push {lr}
    9188        sub sp, sp, #24
     
    9794        pop {lr}
    9895        mov pc, lr
     96FUNCTION_END(__aeabi_uldivmod)
     97
  • uspace/lib/c/arch/arm32/src/entry.S

    r96521f2f r73b3ecd  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.section .init, "ax"
    3032
    3133.org 0
    32 
    33 .global __entry
    3434
    3535## User-space task entry point
     
    3838# r2 contains the RAS page address
    3939#
    40 __entry:
     40SYMBOL(__entry)
    4141        # Store the RAS page address into the ras_page variable
    4242        ldr r0, =ras_page
     
    5757.data
    5858
    59 .global ras_page
    60 ras_page:
     59SYMBOL(ras_page)
    6160        .long 0
  • uspace/lib/c/arch/arm32/src/entryjmp.S

    r96521f2f r73b3ecd  
    2727#
    2828
    29 .globl entry_point_jmp
     29#include <abi/asmtool.h>
    3030
    3131## void entry_point_jmp(void *entry_point, void *pcb);
     
    3535#
    3636# Jump to program entry point
    37 entry_point_jmp:
     37SYMBOL(entry_point_jmp)
    3838        # load ras_page address to r2
    3939        ldr r2, =ras_page
  • uspace/lib/c/arch/arm32/src/fibril.S

    r96521f2f r73b3ecd  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032
    31 .global context_save
    32 .global context_restore
    33 
    34 context_save:
     33FUNCTION_BEGIN(context_save)
    3534        stmia r0!, {sp, lr}
    3635        stmia r0!, {r4-r11}
     
    3938        mov r0, #1
    4039        mov pc, lr
     40FUNCTION_END(context_save)
    4141
    42 context_restore:
     42FUNCTION_BEGIN(context_restore)
    4343        ldmia r0!, {sp, lr}
    4444        ldmia r0!, {r4-r11}
     
    4747        mov r0, #0
    4848        mov pc, lr
     49FUNCTION_END(context_restore)
    4950
  • uspace/lib/c/arch/arm32/src/stacktrace_asm.S

    r96521f2f r73b3ecd  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032
    31 .global stacktrace_prepare
    32 .global stacktrace_fp_get
    33 .global stacktrace_pc_get
     33FUNCTION_BEGIN(stacktrace_prepare)
     34        mov pc, lr
     35FUNCTION_END(stacktrace_prepare)
    3436
    35 stacktrace_prepare:
    36         mov pc, lr
    37 
    38 stacktrace_fp_get:
     37FUNCTION_BEGIN(stacktrace_fp_get)
    3938        mov r0, fp
    4039        mov pc, lr
     40FUNCTION_END(stacktrace_fp_get)
    4141
    42 stacktrace_pc_get:
     42FUNCTION_BEGIN(stacktrace_pc_get)
    4343        mov r0, lr
    4444        mov pc, lr
     45FUNCTION_END(stacktrace_pc_get)
     46
  • uspace/lib/c/arch/arm32/src/thread_entry.S

    r96521f2f r73b3ecd  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    30 
    31 .global __thread_entry
    3232
    3333## User-space thread entry point for all but the first threads.
    3434#
    3535#
    36 __thread_entry:
     36SYMBOL(__thread_entry)
    3737        #
    3838        # Create the first stack frame.
Note: See TracChangeset for help on using the changeset viewer.