Changeset b66cc97 in mainline


Ignore:
Timestamp:
2016-04-24T08:00:09Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
38ad239
Parents:
0407636
Message:

ppc32: use asmtool.h macros for defining symbols

Files:
11 edited
4 moved

Legend:

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

    r0407636 rb66cc97  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/arch.h>
    3031#include <arch/regname.h>
     
    104105.endm
    105106
    106 .global start
    107 .global halt
    108 .global jump_to_kernel
    109 .global real_mode
    110 
    111107.section BOOTSTRAP, "ax"
    112108
    113 start:
     109SYMBOL(start)
    114110        lis r4, ofw_cif@ha
    115111        addi r4, r4, ofw_cif@l
     
    121117.text
    122118
    123 halt:
     119FUNCTION_BEGIN(halt)
    124120        b halt
    125 
    126 jump_to_kernel:
    127        
     121FUNCTION_END(halt)
     122
     123FUNCTION_BEGIN(jump_to_kernel)
    128124        # arguments:
    129125        # r3 = bootinfo (physical address)
     
    153149        isync
    154150        rfi
     151FUNCTION_END(jump_to_kernel)
    155152
    156153.section REALMODE, "ax"
    157154
    158155.align PAGE_WIDTH
    159 real_mode:
     156SYMBOL(real_mode)
    160157       
    161158        # arguments:
  • kernel/arch/ppc32/Makefile.inc

    r0407636 rb66cc97  
    4545        arch/$(KARCH)/src/boot/boot.S \
    4646        arch/$(KARCH)/src/ppc32.c \
    47         arch/$(KARCH)/src/dummy.s \
     47        arch/$(KARCH)/src/dummy.S \
    4848        arch/$(KARCH)/src/exception.S \
    4949        arch/$(KARCH)/src/interrupt.c \
  • kernel/arch/ppc32/src/asm.S

    r0407636 rb66cc97  
    2727 */
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/asm/regname.h>
    3031#include <arch/msr.h>
     
    3334.text
    3435
    35 .global userspace_asm
    36 .global iret
    37 .global iret_syscall
    38 .global memcpy_from_uspace
    39 .global memcpy_to_uspace
    40 .global memcpy_from_uspace_failover_address
    41 .global memcpy_to_uspace_failover_address
    42 .global early_putchar
    43 
    44 userspace_asm:
    45        
     36FUNCTION_BEGIN(userspace_asm)
    4637        /*
    4738         * r3 = uspace_uarg
     
    7869       
    7970        rfi
    80 
    81 iret:
    82        
     71FUNCTION_END(userspace_asm)
     72
     73SYMBOL(iret)
    8374        /* Disable interrupts */
    8475       
     
    142133        rfi
    143134
    144 iret_syscall:
    145        
     135SYMBOL(iret_syscall)
    146136        /* Disable interrupts */
    147137       
     
    204194        rfi
    205195
    206 memcpy_from_uspace:
    207 memcpy_to_uspace:
    208        
     196FUNCTION_BEGIN(memcpy_from_uspace)
     197FUNCTION_BEGIN(memcpy_to_uspace)
    209198        srwi. r7, r5, 3
    210199        addi r6, r3, -4
     
    267256                mtctr r7
    268257                b 1b
    269 
    270 memcpy_from_uspace_failover_address:
    271 memcpy_to_uspace_failover_address:
     258FUNCTION_END(memcpy_from_uspace)
     259FUNCTION_END(memcpy_to_uspace)
     260
     261SYMBOL(memcpy_from_uspace_failover_address)
     262SYMBOL(memcpy_to_uspace_failover_address)
    272263        /* Return zero, failure */
    273264        xor r3, r3, r3
    274265        blr
    275266
    276 early_putchar:
     267FUNCTION_BEGIN(early_putchar)
    277268        blr
     269FUNCTION_END(early_putchar)
  • kernel/arch/ppc32/src/boot/boot.S

    r0407636 rb66cc97  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/asm/regname.h>
    3031#include <config.h>
     
    3233.section K_TEXT_START, "ax"
    3334
    34 .global kernel_image_start
    35 kernel_image_start:
    36        
     35SYMBOL(kernel_image_start)
    3736        # load temporal kernel stack
    3837       
  • kernel/arch/ppc32/src/context.S

    r0407636 rb66cc97  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/context_struct.h>
    3031#include <arch/asm/regname.h>
     
    3233.text
    3334
    34 .global context_save_arch
    35 .global context_restore_arch
    36 
    37 context_save_arch:
     35FUNCTION_BEGIN(context_save_arch)
    3836        stw sp, CONTEXT_OFFSET_SP(r3)
    3937        stw r2, CONTEXT_OFFSET_R2(r3)
     
    6765        li r3, 1
    6866        blr
     67FUNCTION_END(context_save_arch)
    6968
    70 context_restore_arch:
     69FUNCTION_BEGIN(context_restore_arch)
    7170        lwz sp, CONTEXT_OFFSET_SP(r3)
    7271        lwz r2, CONTEXT_OFFSET_R2(r3)
     
    10099        li r3, 0
    101100        blr
     101FUNCTION_END(context_restore_arch)
  • kernel/arch/ppc32/src/debug/stacktrace_asm.S

    r0407636 rb66cc97  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/asm/regname.h>
    3031
    3132.text
    3233
    33 .global frame_pointer_get
    34 .global program_counter_get
    35 
    36 frame_pointer_get:
     34FUNCTION_BEGIN(frame_pointer_get)
    3735        mr r3, sp
    3836        blr
     37FUNCTION_END(frame_pointer_get)
    3938
    40 program_counter_get:
     39FUNCTION_BEGIN(program_counter_get)
    4140        mflr r3
    4241        blr
     42FUNCTION_END(program_counter_get)
  • kernel/arch/ppc32/src/dummy.S

    r0407636 rb66cc97  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032
    31 .global asm_delay_loop
    32 .global sys_tls_set
    33 .global cpu_halt
     33FUNCTION_BEGIN(sys_tls_set)
     34        b sys_tls_set
     35FUNCTION_END(sys_tls_set)
    3436
    35 sys_tls_set:
    36         b sys_tls_set
     37FUNCTION_BEGIN(asm_delay_loop)
     38        blr
     39FUNCTION_END(asm_delay_loop)
    3740
    38 asm_delay_loop:
    39         blr
    40 
    41 cpu_halt:
     41FUNCTION_BEGIN(cpu_halt)
    4242        b cpu_halt
     43FUNCTION_END(cpu_halt)
  • kernel/arch/ppc32/src/exception.S

    r0407636 rb66cc97  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/asm/regname.h>
    3031#include <arch/msr.h>
     
    126127
    127128.org 0x100
    128 .global exc_system_reset
    129 exc_system_reset:
     129SYMBOL(exc_system_reset)
    130130        CONTEXT_STORE
    131131       
     
    134134
    135135.org 0x200
    136 .global exc_machine_check
    137 exc_machine_check:
     136SYMBOL(exc_machine_check)
    138137        CONTEXT_STORE
    139138       
     
    142141
    143142.org 0x300
    144 .global exc_data_storage
    145 exc_data_storage:
     143SYMBOL(exc_data_storage)
    146144        CONTEXT_STORE
    147145       
     
    150148
    151149.org 0x400
    152 .global exc_instruction_storage
    153 exc_instruction_storage:
     150SYMBOL(exc_instruction_storage)
    154151        CONTEXT_STORE
    155152       
     
    158155
    159156.org 0x500
    160 .global exc_external
    161 exc_external:
     157SYMBOL(exc_external)
    162158        CONTEXT_STORE
    163159       
     
    166162
    167163.org 0x600
    168 .global exc_alignment
    169 exc_alignment:
     164SYMBOL(exc_alignment)
    170165        CONTEXT_STORE
    171166       
     
    174169
    175170.org 0x700
    176 .global exc_program
    177 exc_program:
     171SYMBOL(exc_program)
    178172        CONTEXT_STORE
    179173       
     
    182176
    183177.org 0x800
    184 .global exc_fp_unavailable
    185 exc_fp_unavailable:
     178SYMBOL(exc_fp_unavailable)
    186179        CONTEXT_STORE
    187180       
     
    190183
    191184.org 0x900
    192 .global exc_decrementer
    193 exc_decrementer:
     185SYMBOL(exc_decrementer)
    194186        CONTEXT_STORE
    195187       
     
    198190
    199191.org 0xa00
    200 .global exc_reserved0
    201 exc_reserved0:
     192SYMBOL(exc_reserved0)
    202193        CONTEXT_STORE
    203194       
     
    206197
    207198.org 0xb00
    208 .global exc_reserved1
    209 exc_reserved1:
     199SYMBOL(exc_reserved1)
    210200        CONTEXT_STORE
    211201       
     
    214204
    215205.org 0xc00
    216 .global exc_syscall
    217 exc_syscall:
     206SYMBOL(exc_syscall)
    218207        CONTEXT_STORE
    219208       
     
    221210
    222211.org 0xd00
    223 .global exc_trace
    224 exc_trace:
     212SYMBOL(exc_trace)
    225213        CONTEXT_STORE
    226214       
     
    229217
    230218.org 0x1000
    231 .global exc_itlb_miss
    232 exc_itlb_miss:
     219SYMBOL(exc_itlb_miss)
    233220        CONTEXT_STORE
    234221       
     
    237224
    238225.org 0x1100
    239 .global exc_dtlb_miss_load
    240 exc_dtlb_miss_load:
     226SYMBOL(exc_dtlb_miss_load)
    241227        CONTEXT_STORE
    242228       
     
    245231
    246232.org 0x1200
    247 .global exc_dtlb_miss_store
    248 exc_dtlb_miss_store:
     233SYMBOL(exc_dtlb_miss_store)
    249234        CONTEXT_STORE
    250235       
  • kernel/arch/ppc32/src/fpu_context.S

    r0407636 rb66cc97  
    2727#
    2828
     29#include <abi/asmtool.h>
    2930#include <arch/asm/regname.h>
    3031#include <arch/fpu_context_struct.h>
     
    3233
    3334.text
    34 
    35 .global fpu_context_save
    36 .global fpu_context_restore
    37 .global fpu_init
    38 .global fpu_enable
    39 .global fpu_disable
    4035
    4136.macro FPU_CONTEXT_STORE r
     
    109104.endm
    110105
    111 fpu_context_save:
     106FUNCTION_BEGIN(fpu_context_save)
    112107        FPU_CONTEXT_STORE r3
    113108       
     
    116111       
    117112        blr
     113FUNCTION_END(fpu_context_save)
    118114
    119 fpu_context_restore:
     115FUNCTION_BEGIN(fpu_context_restore)
    120116        lfd fr0, FPU_CONTEXT_OFFSET_FPSCR(r3)
    121117        mtfsf 0xff, fr0
     
    124120       
    125121        blr
     122FUNCTION_END(fpu_context_restore)
    126123
    127 fpu_init:
     124FUNCTION_BEGIN(fpu_init)
    128125        mfmsr r0
    129126        ori r0, r0, MSR_FP
     
    137134       
    138135        blr
     136FUNCTION_END(fpu_init)
    139137
    140 fpu_enable:
     138FUNCTION_BEGIN(fpu_enable)
    141139        mfmsr r0
    142140        ori r0, r0, MSR_FP
     
    144142        isync
    145143        blr
     144FUNCTION_END(fpu_enable)
    146145
    147 fpu_disable:
     146FUNCTION_BEGIN(fpu_disable)
    148147        mfmsr r0
    149148        li r3, MSR_FP
     
    152151        isync
    153152        blr
     153FUNCTION_END(fpu_disable)
  • uspace/lib/c/arch/ppc32/Makefile.inc

    r0407636 rb66cc97  
    2828
    2929ARCH_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 \
    3333        arch/$(UARCH)/src/syscall.c \
    3434        arch/$(UARCH)/src/fibril.S \
  • uspace/lib/c/arch/ppc32/src/entry.S

    r0407636 rb66cc97  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.section .init, "ax"
    3032
    3133.org 0
    32 
    33 .globl __entry
    3434
    3535## User-space task entry point
     
    3737# r6 contains the PCB pointer
    3838#
    39 __entry:
     39SYMBOL(__entry)
    4040        #
    4141        # Create the first stack frame.
  • uspace/lib/c/arch/ppc32/src/entryjmp.S

    r0407636 rb66cc97  
    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:
     37FUNCTION_BEGIN(entry_point_jmp)
    3838        mtctr %r3
    3939        mr %r6, %r4     # Pass pcb to the entry point in %r6
    4040        bctr
     41FUNCTION_END(entry_point_jmp)
  • uspace/lib/c/arch/ppc32/src/fibril.S

    r0407636 rb66cc97  
    2929.text
    3030
    31 .global context_save
    32 .global context_restore
    33 
     31#include <abi/asmtool.h>
    3432#include <libarch/regname.h>
    3533#include <libarch/fibril_context.h>
    3634
    37 context_save:
     35FUNCTION_BEGIN(context_save)
    3836        stw sp, CONTEXT_OFFSET_SP(r3)
    3937        stw r2, CONTEXT_OFFSET_TLS(r3)
     
    6765        li r3, 1
    6866        blr
     67FUNCTION_END(context_save)
    6968
    70 
    71 context_restore:
     69FUNCTION_BEGIN(context_restore)
    7270        lwz sp, CONTEXT_OFFSET_SP(r3)
    7371        lwz r2, CONTEXT_OFFSET_TLS(r3)
     
    10199        li r3, 0
    102100        blr
     101FUNCTION_END(context_restore)
  • uspace/lib/c/arch/ppc32/src/stacktrace_asm.S

    r0407636 rb66cc97  
    2929.text
    3030
     31#include <abi/asmtool.h>
    3132#include <libarch/regname.h>
    3233
    33 .global stacktrace_prepare
    34 .global stacktrace_fp_get
    35 .global stacktrace_pc_get
     34FUNCTION_BEGIN(stacktrace_prepare)
     35        blr
     36FUNCTION_END(stacktrace_prepare)
    3637
    37 stacktrace_prepare:
    38         blr
    39 
    40 stacktrace_fp_get:
     38FUNCTION_BEGIN(stacktrace_fp_get)
    4139        mr r3, sp
    4240        blr
     41FUNCTION_END(stacktrace_fp_get)
    4342
    44 stacktrace_pc_get:
     43FUNCTION_BEGIN(stacktrace_pc_get)
    4544        mflr r3
    4645        blr
     46FUNCTION_END(stacktrace_pc_get)
  • uspace/lib/c/arch/ppc32/src/thread_entry.S

    r0407636 rb66cc97  
    2727#
    2828
     29#include <abi/asmtool.h>
     30
    2931.text
    3032       
    31 .globl __thread_entry
    32 
    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.
     
    4444        b __thread_main
    4545
    46 .end __thread_entry
Note: See TracChangeset for help on using the changeset viewer.