Changeset 1787e527 in mainline for boot/arch/sparc64/loader/asm.S


Ignore:
Timestamp:
2009-11-16T21:22:54Z (14 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5ebdf94
Parents:
fcbd1be (diff), 9c70ed6 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

merged with head (unstable)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • boot/arch/sparc64/loader/asm.S

    rfcbd1be r1787e527  
    3131#include <register.h>
    3232
    33 .register       %g2, #scratch
    34 .register       %g3, #scratch
     33.register %g2, #scratch
     34.register %g3, #scratch
    3535
    3636.text
     
    4343        ba %xcc, halt
    4444        nop
     45
     46memcpy:
     47        mov %o0, %o3      ! save dst
     48        add %o1, 7, %g1
     49        and %g1, -8, %g1
     50        cmp %o1, %g1
     51        be,pn %xcc, 3f
     52        add %o0, 7, %g1
     53        mov 0, %g3
    4554       
    46 memcpy:
    47         mov     %o0, %o3                ! save dst
    48         add     %o1, 7, %g1
    49         and     %g1, -8, %g1
    50         cmp     %o1, %g1
    51         be,pn   %xcc, 3f
    52         add     %o0, 7, %g1
    53         mov     0, %g3
    54 0:
    55         brz,pn  %o2, 2f
    56         mov     0, %g2
    57 1:
    58         ldub    [%g3 + %o1], %g1
    59         add     %g2, 1, %g2
    60         cmp     %o2, %g2
    61         stb     %g1, [%g3 + %o0]
    62         bne,pt  %xcc, 1b
    63         mov     %g2, %g3
    64 2:
    65         jmp     %o7 + 8                 ! exit point
    66         mov     %o3, %o0
    67 3:
    68         and     %g1, -8, %g1
    69         cmp     %o0, %g1
    70         bne,pt  %xcc, 0b
    71         mov     0, %g3
    72         srlx    %o2, 3, %g4
    73         brz,pn  %g4, 5f
    74         mov     0, %g5
    75 4:
    76         sllx    %g3, 3, %g2
    77         add     %g5, 1, %g3
    78         ldx     [%o1 + %g2], %g1
    79         mov     %g3, %g5
    80         cmp     %g4, %g3
    81         bne,pt  %xcc, 4b
    82         stx     %g1, [%o0 + %g2]
    83 5:
    84         and     %o2, 7, %o2
    85         brz,pn  %o2, 2b
    86         sllx    %g4, 3, %g1
    87         mov     0, %g2
    88         add     %g1, %o0, %o0
    89         add     %g1, %o1, %g4
    90         mov     0, %g3
    91 6:
    92         ldub    [%g2 + %g4], %g1
    93         stb     %g1, [%g2 + %o0]
    94         add     %g3, 1, %g2
    95         cmp     %o2, %g2
    96         bne,pt  %xcc, 6b
    97         mov     %g2, %g3
    98 
    99         jmp     %o7 + 8                 ! exit point
    100         mov     %o3, %o0
     55        0:
     56                brz,pn %o2, 2f
     57                mov 0, %g2
     58       
     59        1:
     60                ldub [%g3 + %o1], %g1
     61                add %g2, 1, %g2
     62                cmp %o2, %g2
     63                stb %g1, [%g3 + %o0]
     64                bne,pt %xcc, 1b
     65                mov %g2, %g3
     66       
     67        2:
     68                jmp %o7 + 8   ! exit point
     69                mov %o3, %o0
     70       
     71        3:
     72                and %g1, -8, %g1
     73                cmp %o0, %g1
     74                bne,pt %xcc, 0b
     75                mov 0, %g3
     76                srlx %o2, 3, %g4
     77                brz,pn %g4, 5f
     78                mov 0, %g5
     79       
     80        4:
     81                sllx %g3, 3, %g2
     82                add %g5, 1, %g3
     83                ldx [%o1 + %g2], %g1
     84                mov %g3, %g5
     85                cmp %g4, %g3
     86                bne,pt %xcc, 4b
     87                stx %g1, [%o0 + %g2]
     88       
     89        5:
     90                and %o2, 7, %o2
     91                brz,pn %o2, 2b
     92                sllx %g4, 3, %g1
     93                mov 0, %g2
     94                add %g1, %o0, %o0
     95                add %g1, %o1, %g4
     96                mov 0, %g3
     97       
     98        6:
     99                ldub [%g2 + %g4], %g1
     100                stb %g1, [%g2 + %o0]
     101                add %g3, 1, %g2
     102                cmp %o2, %g2
     103                bne,pt %xcc, 6b
     104                mov %g2, %g3
     105       
     106        jmp %o7 + 8   ! exit point
     107        mov %o3, %o0
    101108
    102109jump_to_kernel:
     
    107114         * 3. Flush instruction pipeline.
    108115         */
    109 
     116       
    110117        /*
    111118         * US3 processors have a write-invalidate cache, so explicitly
    112119         * invalidating it is not required. Whether to invalidate I-cache
    113          * or not is decided according to the value of the global
    114          * "subarchitecture" variable (set in the bootstrap).
     120         * or not is decided according to the value of the 5th argument
     121         * (subarchitecture).
    115122         */
    116         set subarchitecture, %g2
    117         ldub [%g2], %g2
    118         cmp %g2, 3
     123        cmp %i4, 3
    119124        be %xcc, 1f
    120125        nop
    121 0:
    122         call icache_flush
    123         nop
    124 1:
    125         membar #StoreStore
     126       
     127        0:
     128                call icache_flush
     129                nop
     130       
     131        1:
     132                membar #StoreStore
    126133       
    127134        /*
    128135         * Flush the instruction pipeline.
    129136         */
    130         flush   %i7
    131 
     137        flush %i7
     138       
    132139        mov %o0, %l1
    133140        mov %o1, %o0
    134141        mov %o2, %o1
    135142        mov %o3, %o2
    136         jmp %l1                         ! jump to kernel
     143        jmp %l1       ! jump to kernel
    137144        nop
    138145
    139 #define ICACHE_SIZE             8192
    140 #define ICACHE_LINE_SIZE        32
    141 #define ICACHE_SET_BIT          (1 << 13)
    142 #define ASI_ICACHE_TAG          0x67
     146#define ICACHE_SIZE       8192
     147#define ICACHE_LINE_SIZE  32
     148#define ICACHE_SET_BIT    (1 << 13)
     149#define ASI_ICACHE_TAG    0x67
    143150
    144151# Flush I-cache
    145152icache_flush:
    146         set     ((ICACHE_SIZE - ICACHE_LINE_SIZE) | ICACHE_SET_BIT), %g1
    147         stxa    %g0, [%g1] ASI_ICACHE_TAG
    148 0:      membar  #Sync
    149         subcc   %g1, ICACHE_LINE_SIZE, %g1
    150         bnz,pt  %xcc, 0b
    151         stxa    %g0, [%g1] ASI_ICACHE_TAG
    152         membar  #Sync
     153        set ((ICACHE_SIZE - ICACHE_LINE_SIZE) | ICACHE_SET_BIT), %g1
     154        stxa %g0, [%g1] ASI_ICACHE_TAG
     155       
     156        0:
     157                membar #Sync
     158                subcc %g1, ICACHE_LINE_SIZE, %g1
     159                bnz,pt %xcc, 0b
     160       
     161        stxa %g0, [%g1] ASI_ICACHE_TAG
     162        membar #Sync
    153163        retl
    154164        ! SF Erratum #51
    155165        nop
     166
    156167.global ofw
    157168ofw:
     
    159170        set ofw_cif, %l0
    160171        ldx [%l0], %l0
    161 
     172       
    162173        rdpr  %pstate, %l1
    163174        and  %l1, ~PSTATE_AM_BIT, %l2
    164175        wrpr  %l2, 0, %pstate
    165    
     176       
    166177        jmpl %l0, %o7
    167178        mov %i0, %o0
    168 
     179       
    169180        wrpr %l1, 0, %pstate
    170 
     181       
    171182        ret
    172183        restore %o0, 0, %o0
Note: See TracChangeset for help on using the changeset viewer.