Changeset 81aec18 in rtems


Ignore:
Timestamp:
Jan 24, 2019, 1:29:03 PM (5 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
b1381ae
Parents:
afd50b3
git-author:
Sebastian Huber <sebastian.huber@…> (01/24/19 13:29:03)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/25/19 14:40:11)
Message:

bsps/powerpc: Fix 64-bit issues in assembler files

We have to be careful with instructions which operate explicitly on
words or doublewords.

Update #3082.

Location:
bsps/powerpc
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • bsps/powerpc/include/libcpu/powerpc-utility.h

    rafd50b3 r81aec18  
    975975.endm
    976976
     977.macro SHIFT_RIGHT_IMMEDIATE rd, rs, imm
     978#if defined(__powerpc64__)
     979        srdi    \rd, \rs, \imm
     980#else
     981        srwi    \rd, \rs, \imm
     982#endif
     983.endm
     984
     985.macro COMPARE_LOGICAL cr, ra, rb
     986#if defined(__powerpc64__)
     987        cmpld   \cr, \ra, \rb
     988#else
     989        cmplw   \cr, \ra, \rb
     990#endif
     991.endm
     992
     993.macro CLEAR_RIGHT_IMMEDIATE rd, rs, imm
     994#if defined(__powerpc64__)
     995        clrrdi  \rd, \rs, \imm
     996#else
     997        clrrwi  \rd, \rs, \imm
     998#endif
     999.endm
     1000
    9771001#define LINKER_SYMBOL(sym) .extern sym
    9781002
  • bsps/powerpc/qoriq/start/start.S

    rafd50b3 r81aec18  
    107107        bne     .Lnull_area_setup_done
    108108        LA      r3, bsp_section_start_begin
    109         srawi   r3, r3, 2
     109        SHIFT_RIGHT_IMMEDIATE   r3, r3, 2
    110110        mtctr   r3
    111111        li      r3, -4
     
    320320        PPC_REG_LOAD    r3, PER_CPU_INTERRUPT_STACK_HIGH(CPU_SELF)
    321321        subi    r1, r3, PPC_MINIMUM_STACK_FRAME_SIZE
    322         clrrwi  r1, r1, PPC_STACK_ALIGN_POWER
     322        CLEAR_RIGHT_IMMEDIATE   r1, r1, PPC_STACK_ALIGN_POWER
    323323        li      r0, 0
    324324        PPC_REG_STORE   r0, 0(r1)
  • bsps/powerpc/shared/cpu_asm.S

    rafd50b3 r81aec18  
    267267
    268268        /* Align to a cache line */
    269         clrrwi  r3, r3, PPC_DEFAULT_CACHE_LINE_POWER
    270         clrrwi  r5, r4, PPC_DEFAULT_CACHE_LINE_POWER
     269        CLEAR_RIGHT_IMMEDIATE   r3, r3, PPC_DEFAULT_CACHE_LINE_POWER
     270        CLEAR_RIGHT_IMMEDIATE   r5, r4, PPC_DEFAULT_CACHE_LINE_POWER
    271271
    272272        DATA_CACHE_ZERO_AND_TOUCH(r10, PPC_CONTEXT_CACHE_LINE_0)
     
    558558PROC (_CPU_Context_restore):
    559559        /* Align to a cache line */
    560         clrrwi  r5, r3, PPC_DEFAULT_CACHE_LINE_POWER
     560        CLEAR_RIGHT_IMMEDIATE   r5, r3, PPC_DEFAULT_CACHE_LINE_POWER
    561561
    562562        GET_SELF_CPU_CONTROL    r12
     
    587587        sub     r7, r4, r7
    588588        add     r4, r8, r7
    589         clrrwi  r5, r4, PPC_DEFAULT_CACHE_LINE_POWER
     589        CLEAR_RIGHT_IMMEDIATE   r5, r4, PPC_DEFAULT_CACHE_LINE_POWER
    590590
    591591        /* Update the executing */
  • bsps/powerpc/shared/start/bsp-start-zero.S

    rafd50b3 r81aec18  
    2222
    2323#include <rtems/asm.h>
    24 #include <rtems/powerpc/powerpc.h>
     24#include <libcpu/powerpc-utility.h>
    2525#include <bspopts.h>
    2626
     
    3636        li      r0, 0
    3737        subi    r11, r3, 1
    38         clrrwi  r11, r11, PPC_CACHE_ALIGN_POWER
     38        CLEAR_RIGHT_IMMEDIATE   r11, r11, PPC_CACHE_ALIGN_POWER
    3939        addi    r10, r11, PPC_CACHE_ALIGNMENT
    4040        subf    r11, r3, r10
    41         cmplw   cr7, r11, r4
     41        COMPARE_LOGICAL cr7, r11, r4
    4242        add     r9, r3, r4
    4343        ble-    cr7, head_end_done
     
    5757
    5858        subf    r11, r3, r9
    59         srwi    r11, r11, PPC_CACHE_ALIGN_POWER
     59        SHIFT_RIGHT_IMMEDIATE   r11, r11, PPC_CACHE_ALIGN_POWER
    6060        addi    r11, r11, 1
    6161        mtctr   r11
Note: See TracChangeset for help on using the changeset viewer.