Changeset 29b2bbf in mainline for kernel/arch/sparc64/include
- Timestamp:
- 2006-09-18T22:10:20Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 19dba2b
- Parents:
- 57da95c
- Location:
- kernel/arch/sparc64/include
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/include/arch.h
r57da95c r29b2bbf 38 38 #define KERN_sparc64_ARCH_H_ 39 39 40 #define ASI_AIUP 0x10 /** Access to primary context with user privileges. */41 #define ASI_AIUS 0x11 /** Access to secondary context with user privileges. */40 #define ASI_AIUP 0x10 /** Access to primary context with user privileges. */ 41 #define ASI_AIUS 0x11 /** Access to secondary context with user privileges. */ 42 42 43 #define NWINDOW 8 /** Number of register window sets. */ 43 #define ASI_NUCLEUS_QUAD_LDD 0x24 /** ASI for 16-byte atomic loads. */ 44 45 #define NWINDOW 8 /** Number of register window sets. */ 44 46 45 47 #endif -
kernel/arch/sparc64/include/barrier.h
r57da95c r29b2bbf 42 42 #define CS_LEAVE_BARRIER() __asm__ volatile ("" ::: "memory") 43 43 44 #define memory_barrier() 45 #define read_barrier() 46 #define write_barrier() 44 #define memory_barrier() __asm__ volatile ("membar #LoadLoad | #StoreStore\n" ::: "memory") 45 #define read_barrier() __asm__ volatile ("membar #LoadLoad\n" ::: "memory") 46 #define write_barrier() __asm__ volatile ("membar #StoreStore\n" ::: "memory") 47 47 48 48 /** Flush Instruction Memory instruction. */ -
kernel/arch/sparc64/include/mm/mmu.h
r57da95c r29b2bbf 49 49 50 50 /* Virtual Addresses within ASI_IMMU. */ 51 #define VA_IMMU_T AG_TARGET 0x0 /**< IMMUtag target register. */51 #define VA_IMMU_TSB_TAG_TARGET 0x0 /**< IMMU TSB tag target register. */ 52 52 #define VA_IMMU_SFSR 0x18 /**< IMMU sync fault status register. */ 53 53 #define VA_IMMU_TSB_BASE 0x28 /**< IMMU TSB base register. */ … … 65 65 66 66 /* Virtual Addresses within ASI_DMMU. */ 67 #define VA_DMMU_T AG_TARGET 0x0 /**< DMMUtag target register. */67 #define VA_DMMU_TSB_TAG_TARGET 0x0 /**< DMMU TSB tag target register. */ 68 68 #define VA_PRIMARY_CONTEXT_REG 0x8 /**< DMMU primary context register. */ 69 69 #define VA_SECONDARY_CONTEXT_REG 0x10 /**< DMMU secondary context register. */ -
kernel/arch/sparc64/include/mm/tsb.h
r57da95c r29b2bbf 36 36 #define KERN_sparc64_TSB_H_ 37 37 38 #include <arch/mm/tte.h>39 #include <arch/mm/mmu.h>40 #include <arch/types.h>41 #include <typedefs.h>42 43 38 /* 44 39 * ITSB abd DTSB will claim 64K of memory, which … … 52 47 #define DTSB_ENTRY_COUNT (512*(1<<TSB_SIZE)) 53 48 49 #define TSB_TAG_TARGET_CONTEXT_SHIFT 48 50 51 #ifndef __ASM__ 52 53 #include <arch/mm/tte.h> 54 #include <arch/mm/mmu.h> 55 #include <arch/types.h> 56 #include <typedefs.h> 57 58 /** TSB Tag Target register. */ 59 union tsb_tag_target { 60 uint64_t value; 61 struct { 62 unsigned invalid : 1; /**< Invalidated by software. */ 63 unsigned : 2; 64 unsigned context : 13; /**< Software ASID. */ 65 unsigned : 6; 66 uint64_t va_tag : 42; /**< Virtual address bits <63:22>. */ 67 } __attribute__ ((packed)); 68 }; 69 typedef union tsb_tag_target tsb_tag_target_t; 70 71 /** TSB entry. */ 54 72 struct tsb_entry { 55 t te_tag_t tag;73 tsb_tag_target_t tag; 56 74 tte_data_t data; 57 75 } __attribute__ ((packed)); … … 110 128 111 129 extern void tsb_invalidate(as_t *as, uintptr_t page, count_t pages); 130 extern void itsb_pte_copy(pte_t *t); 131 extern void dtsb_pte_copy(pte_t *t, bool ro); 132 133 #endif /* !def __ASM__ */ 112 134 113 135 #endif -
kernel/arch/sparc64/include/mm/tte.h
r57da95c r29b2bbf 51 51 #include <arch/types.h> 52 52 53 #define VA_TAG_PAGE_SHIFT 22 54 53 55 /** Translation Table Entry - Tag. */ 54 56 union tte_tag { -
kernel/arch/sparc64/include/trap/mmu.h
r57da95c r29b2bbf 45 45 #include <arch/trap/regwin.h> 46 46 47 #ifdef CONFIG_TSB 48 #include <arch/mm/tsb.h> 49 #endif 50 47 51 #define TT_FAST_INSTRUCTION_ACCESS_MMU_MISS 0x64 48 52 #define TT_FAST_DATA_ACCESS_MMU_MISS 0x68 … … 57 61 * First, try to refill TLB from TSB. 58 62 */ 59 ! TODO60 63 64 #ifdef CONFIG_TSB 65 ldxa [%g0] ASI_IMMU, %g1 ! read TSB Tag Target Register 66 ldxa [%g0] ASI_IMMU_TSB_8KB_PTR_REG, %g2 ! read TSB 8K Pointer 67 ldda [%g2] ASI_NUCLEUS_QUAD_LDD, %g4 ! 16-byte atomic load into %g4 and %g5 68 cmp %g1, %g4 ! is this the entry we are looking for? 69 bne,pn %xcc, 0f 70 nop 71 stxa %g5, [%g0] ASI_ITLB_DATA_IN_REG ! copy mapping from ITSB to ITLB 72 retry 73 #endif 74 75 0: 61 76 wrpr %g0, PSTATE_PRIV_BIT | PSTATE_AG_BIT, %pstate 62 77 PREEMPTIBLE_HANDLER fast_instruction_access_mmu_miss … … 67 82 * First, try to refill TLB from TSB. 68 83 */ 69 ! TODO 84 85 #ifdef CONFIG_TSB 86 ldxa [%g0] ASI_DMMU, %g1 ! read TSB Tag Target Register 87 srlx %g1, TSB_TAG_TARGET_CONTEXT_SHIFT, %g2 ! is this kernel miss? 88 brz,pn %g2, 0f 89 ldxa [%g0] ASI_DMMU_TSB_8KB_PTR_REG, %g3 ! read TSB 8K Pointer 90 ldda [%g3] ASI_NUCLEUS_QUAD_LDD, %g4 ! 16-byte atomic load into %g4 and %g5 91 cmp %g1, %g4 ! is this the entry we are looking for? 92 bne,pn %xcc, 0f 93 nop 94 stxa %g5, [%g0] ASI_DTLB_DATA_IN_REG ! copy mapping from DTSB to DTLB 95 retry 96 #endif 70 97 71 98 /* … … 77 104 * Note that branch-delay slots are used in order to save space. 78 105 */ 79 106 0: 80 107 mov VA_DMMU_TAG_ACCESS, %g1 81 108 ldxa [%g1] ASI_DMMU, %g1 ! read the faulting Context and VPN … … 111 138 .macro FAST_DATA_ACCESS_PROTECTION_HANDLER tl 112 139 /* 113 * First, try to refill TLB from TSB.114 */115 ! TODO116 117 /*118 140 * The same special case as in FAST_DATA_ACCESS_MMU_MISS_HANDLER. 119 141 */ 142 120 143 .if (\tl > 0) 121 144 wrpr %g0, 1, %tl
Note:
See TracChangeset
for help on using the changeset viewer.