Changeset 1eb154f in mainline for boot/arch/sparc64/loader/asm.S


Ignore:
Timestamp:
2008-06-15T11:07:37Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3527a93
Parents:
c711efe
Message:

Don't make any assumptions about the contents of the I-cache in sparc64
loader and before passing control to the kernel, invalidate the I-cache.

File:
1 edited

Legend:

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

    rc711efe r1eb154f  
    100100jump_to_kernel:
    101101        /*
    102          * Make sure that the code we have moved has drained to main memory.
    103          * We have a reason to assume that the I-cache does not include the
    104          * code to which we are going to pass control. Hence no I-cache
    105          * invalidation.
     102         * We have copied code and now we need to guarantee cache coherence.
     103         * 1. Make sure that the code we have moved has drained to main memory.
     104         * 2. Invalidate I-cache.
     105         * 3. Flush instruction pipeline.
    106106         */
    107         membar #StoreStore
     107        call    icache_flush
     108        membar  #StoreStore
     109        flush   %i7
    108110
    109111        mov %o0, %l1
     
    112114        mov %o3, %o2
    113115        jmp %l1                         ! jump to kernel
     116        nop
     117
     118#define ICACHE_SIZE             8192
     119#define ICACHE_LINE_SIZE        32
     120#define ICACHE_SET_BIT          (1 << 13)
     121#define ASI_ICACHE_TAG          0x67
     122
     123# Flush I-cache
     124icache_flush:
     125        set     ((ICACHE_SIZE - ICACHE_LINE_SIZE) | ICACHE_SET_BIT), %g1
     126        stxa    %g0, [%g1] ASI_ICACHE_TAG
     1270:      membar  #Sync
     128        subcc   %g1, ICACHE_LINE_SIZE, %g1
     129        bnz,pt  %xcc, 0b
     130        stxa    %g0, [%g1] ASI_ICACHE_TAG
     131        membar  #Sync
     132        retl
     133        ! SF Erratum #51
    114134        nop
    115135
Note: See TracChangeset for help on using the changeset viewer.