Changeset c52ed6b in mainline


Ignore:
Timestamp:
2005-12-12T23:55:08Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5bb8e45
Parents:
0bd4f56d
Message:

sparc64 work.
More ITLB and DTLB controlling functions.

Location:
arch/sparc64
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • arch/sparc64/include/asm.h

    r0bd4f56d rc52ed6b  
    132132static inline void asi_u64_write(asi_t asi, __address va, __u64 v)
    133133{
    134         __asm__ volatile ("stxa %0, [%1] %2\n" : :  "r" (v), "r" (va), "i" (asi));
     134        __asm__ volatile ("stxa %0, [%1] %2\n" : :  "r" (v), "r" (va), "i" (asi) : "memory");
    135135}
    136 
    137136
    138137void cpu_halt(void);
  • arch/sparc64/include/barrier.h

    r0bd4f56d rc52ed6b  
    4040#define write_barrier()
    4141
    42 #define flush()                 __asm__ volatile ("flush\n" ::: "memory")
     42/** Flush Instruction Memory. */
     43static inline void flush(void)
     44{
     45        /*
     46         * The FLUSH instruction takes address parameter,
     47         * but JPS1 implementations are free to ignore it.
     48         * The only requirement is that it is a valid address
     49         * as it is passed to D-MMU.
     50         */
     51        __asm__ volatile ("flush %sp\n");       /* %sp is guaranteed to reference mapped memory */
     52}
    4353
    4454#endif
  • arch/sparc64/include/mm/tlb.h

    r0bd4f56d rc52ed6b  
    3232#include <arch/mm/tte.h>
    3333#include <arch/asm.h>
     34#include <arch/barrier.h>
    3435#include <arch/types.h>
    3536#include <typedefs.h>
     
    9899};
    99100typedef union tlb_tag_read_reg tlb_tag_read_reg_t;
     101typedef union tlb_tag_read_reg tlb_tag_access_reg_t;
    100102
    101103/** Read IMMU TLB Data Access Register.
     
    135137 * @return Current value of specified IMMU TLB Tag Read Register.
    136138 */
    137 static inline __u64 itlb_tag_read(index_t entry)
     139static inline __u64 itlb_tag_read_read(index_t entry)
    138140{
    139141        tlb_tag_read_addr_t tag;
     
    150152 * @return Current value of specified DMMU TLB Tag Read Register.
    151153 */
    152 static inline __u64 dtlb_tag_read(index_t entry)
     154static inline __u64 dtlb_tag_read_read(index_t entry)
    153155{
    154156        tlb_tag_read_addr_t tag;
     
    159161}
    160162
     163/** Write IMMU TLB Tag Access Register.
     164 *
     165 * @param v Value to be written.
     166 */
     167static inline void itlb_tag_access_write(__u64 v)
     168{
     169        asi_u64_write(ASI_IMMU, VA_IMMU_TAG_ACCESS, v);
     170        flush();
     171}
     172
     173/** Write DMMU TLB Tag Access Register.
     174 *
     175 * @param v Value to be written.
     176 */
     177static inline void dtlb_tag_access_write(__u64 v)
     178{
     179        asi_u64_write(ASI_DMMU, VA_DMMU_TAG_ACCESS, v);
     180        flush();
     181}
     182
     183/** Write IMMU TLB Data in Register.
     184 *
     185 * @param v Value to be written.
     186 */
     187static inline void itlb_data_in_write(__u64 v)
     188{
     189        asi_u64_write(ASI_ITLB_DATA_IN_REG, 0, v);
     190        flush();
     191}
     192
     193/** Write DMMU TLB Data in Register.
     194 *
     195 * @param v Value to be written.
     196 */
     197static inline void dtlb_data_in_write(__u64 v)
     198{
     199        asi_u64_write(ASI_DTLB_DATA_IN_REG, 0, v);
     200        flush();
     201}
     202
    161203#endif
  • arch/sparc64/src/mm/tlb.c

    r0bd4f56d rc52ed6b  
    4545        for (i = 0; i < ITLB_ENTRY_COUNT; i++) {
    4646                d.value = itlb_data_access_read(i);
    47                 t.value = itlb_tag_read(i);
     47                t.value = itlb_tag_read_read(i);
    4848               
    49                 printf("%d: va=%X, context=%d, v=%d, size=%X, nfo=%d, ie=%d, soft2=%X, diag=%X, pa=%X, soft=%X, l=%d, cp=%d, cv=%d, e=%d, p=%d, w=%d, g=%d\n",
     49                printf("%d: va=%Q, context=%d, v=%d, size=%d, nfo=%d, ie=%d, soft2=%X, diag=%X, pa=%X, soft=%X, l=%d, cp=%d, cv=%d, e=%d, p=%d, w=%d, g=%d\n",
    5050                        i, t.va, t.context, d.v, d.size, d.nfo, d.ie, d.soft2, d.diag, d.pa, d.soft, d.l, d.cp, d.cv, d.e, d.p, d.w, d.g);
    5151        }
     
    5454        for (i = 0; i < DTLB_ENTRY_COUNT; i++) {
    5555                d.value = dtlb_data_access_read(i);
    56                 t.value = dtlb_tag_read(i);
     56                t.value = dtlb_tag_read_read(i);
    5757               
    58                 printf("%d: va=%X, context=%d, v=%d, size=%X, nfo=%d, ie=%d, soft2=%X, diag=%X, pa=%X, soft=%X, l=%d, cp=%d, cv=%d, e=%d, p=%d, w=%d, g=%d\n",
     58                printf("%d: va=%Q, context=%d, v=%d, size=%d, nfo=%d, ie=%d, soft2=%X, diag=%X, pa=%X, soft=%X, l=%d, cp=%d, cv=%d, e=%d, p=%d, w=%d, g=%d\n",
    5959                        i, t.va, t.context, d.v, d.size, d.nfo, d.ie, d.soft2, d.diag, d.pa, d.soft, d.l, d.cp, d.cv, d.e, d.p, d.w, d.g);
    6060        }
Note: See TracChangeset for help on using the changeset viewer.