Changeset ed166f7 in mainline for kernel/arch/sparc64/include
- Timestamp:
- 2006-08-31T18:53:14Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6767c1d
- Parents:
- e0b241f
- Location:
- kernel/arch/sparc64/include
- Files:
-
- 31 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/include/arch.h
re0b241f red166f7 35 35 */ 36 36 37 #ifndef __sparc64_ARCH_H__38 #define __sparc64_ARCH_H__37 #ifndef KERN_sparc64_ARCH_H_ 38 #define KERN_sparc64_ARCH_H_ 39 39 40 40 #define ASI_AIUP 0x10 /** Access to primary context with user privileges. */ -
kernel/arch/sparc64/include/arg.h
re0b241f red166f7 27 27 */ 28 28 29 29 /** @addtogroup sparc64 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef __sparc64_ARG_H__36 #define __sparc64_ARG_H__35 #ifndef KERN_sparc64_ARG_H_ 36 #define KERN_sparc64_ARG_H_ 37 37 38 38 #include <stdarg.h> … … 40 40 #endif 41 41 42 42 /** @} 43 43 */ 44 -
kernel/arch/sparc64/include/asm.h
re0b241f red166f7 331 331 extern void write_to_ig_g6(uint64_t val); 332 332 333 extern void switch_to_userspace(uint64_t pc, uint64_t sp); 334 333 335 #endif 334 336 -
kernel/arch/sparc64/include/atomic.h
re0b241f red166f7 33 33 */ 34 34 35 #ifndef __sparc64_ATOMIC_H__36 #define __sparc64_ATOMIC_H__35 #ifndef KERN_sparc64_ATOMIC_H_ 36 #define KERN_sparc64_ATOMIC_H_ 37 37 38 38 #include <arch/types.h> -
kernel/arch/sparc64/include/barrier.h
re0b241f red166f7 33 33 */ 34 34 35 #ifndef __sparc64_BARRIER_H__36 #define __sparc64_BARRIER_H__35 #ifndef KERN_sparc64_BARRIER_H_ 36 #define KERN_sparc64_BARRIER_H_ 37 37 38 38 /* -
kernel/arch/sparc64/include/byteorder.h
re0b241f red166f7 27 27 */ 28 28 29 29 /** @addtogroup sparc64 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef __sparc64_BYTEORDER_H__36 #define __sparc64_BYTEORDER_H__35 #ifndef KERN_sparc64_BYTEORDER_H_ 36 #define KERN_sparc64_BYTEORDER_H_ 37 37 38 38 #include <arch/types.h> … … 51 51 #endif 52 52 53 53 /** @} 54 54 */ 55 -
kernel/arch/sparc64/include/console.h
re0b241f red166f7 37 37 38 38 extern void kkbdpoll(void *arg); 39 extern void ofw_sparc64_console_init(void);40 39 extern void standalone_sparc64_console_init(void); 41 40 -
kernel/arch/sparc64/include/context.h
re0b241f red166f7 33 33 */ 34 34 35 #ifndef __sparc64_CONTEXT_H__36 #define __sparc64_CONTEXT_H__35 #ifndef KERN_sparc64_CONTEXT_H_ 36 #define KERN_sparc64_CONTEXT_H_ 37 37 38 #ifndef __sparc64_STACK_H__38 #ifndef KERN_sparc64_STACK_H_ 39 39 # include <arch/stack.h> 40 40 #endif 41 41 42 #ifndef __sparc64_TYPES_H__42 #ifndef KERN_sparc64_TYPES_H_ 43 43 # include <arch/types.h> 44 44 #endif 45 45 46 #ifndef __ALIGN_H__46 #ifndef KERN_ALIGN_H_ 47 47 # include <align.h> 48 48 #endif -
kernel/arch/sparc64/include/cpu.h
re0b241f red166f7 33 33 */ 34 34 35 #ifndef __sparc64_CPU_H__36 #define __sparc64_CPU_H__35 #ifndef KERN_sparc64_CPU_H_ 36 #define KERN_sparc64_CPU_H_ 37 37 38 38 #include <arch/register.h> -
kernel/arch/sparc64/include/debug.h
re0b241f red166f7 27 27 */ 28 28 29 29 /** @addtogroup sparc64debug 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef __sparc64_DEBUG_H__36 #define __sparc64_DEBUG_H__35 #ifndef KERN_sparc64_DEBUG_H_ 36 #define KERN_sparc64_DEBUG_H_ 37 37 38 38 #endif 39 39 40 40 /** @} 41 41 */ 42 -
kernel/arch/sparc64/include/drivers/tick.h
re0b241f red166f7 33 33 */ 34 34 35 #ifndef __sparc64_TICK_H__36 #define __sparc64_TICK_H__35 #ifndef KERN_sparc64_TICK_H_ 36 #define KERN_sparc64_TICK_H_ 37 37 38 38 #include <typedefs.h> -
kernel/arch/sparc64/include/elf.h
re0b241f red166f7 33 33 */ 34 34 35 #ifndef __sparc64_ELF_H__36 #define __sparc64_ELF_H__35 #ifndef KERN_sparc64_ELF_H_ 36 #define KERN_sparc64_ELF_H_ 37 37 38 38 #define ELF_MACHINE EM_SPARCV9 -
kernel/arch/sparc64/include/faddr.h
re0b241f red166f7 27 27 */ 28 28 29 29 /** @addtogroup sparc64 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef __sparc64_FADDR_H__36 #define __sparc64_FADDR_H__35 #ifndef KERN_sparc64_FADDR_H_ 36 #define KERN_sparc64_FADDR_H_ 37 37 38 38 #include <arch/types.h> … … 42 42 #endif 43 43 44 44 /** @} 45 45 */ 46 -
kernel/arch/sparc64/include/fpu_context.h
re0b241f red166f7 27 27 */ 28 28 29 29 /** @addtogroup sparc64 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef __sparc64_FPU_CONTEXT_H__36 #define __sparc64_FPU_CONTEXT_H__35 #ifndef KERN_sparc64_FPU_CONTEXT_H_ 36 #define KERN_sparc64_FPU_CONTEXT_H_ 37 37 38 38 #include <arch/types.h> … … 43 43 #endif 44 44 45 45 /** @} 46 46 */ 47 -
kernel/arch/sparc64/include/interrupt.h
re0b241f red166f7 34 34 */ 35 35 36 #ifndef __sparc64_INTERRUPT_H__37 #define __sparc64_INTERRUPT_H__36 #ifndef KERN_sparc64_INTERRUPT_H_ 37 #define KERN_sparc64_INTERRUPT_H_ 38 38 39 39 #include <typedefs.h> 40 40 #include <arch/types.h> 41 #include <arch/regdef.h> 41 42 42 43 #define IRQ_COUNT 1 /* TODO */ … … 53 54 static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr) 54 55 { 55 /* TODO */56 istate->tpc = retaddr; 56 57 } 58 57 59 static inline int istate_from_uspace(istate_t *istate) 58 60 { 59 /* TODO */ 60 return 0; 61 return !(istate->tstate & TSTATE_PRIV_BIT); 61 62 } 63 62 64 static inline unative_t istate_get_pc(istate_t *istate) 63 65 { 64 /* TODO */ 65 return 0; 66 return istate->tpc; 66 67 } 67 68 -
kernel/arch/sparc64/include/memstr.h
re0b241f red166f7 27 27 */ 28 28 29 29 /** @addtogroup sparc64 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef __sparc64_MEMSTR_H__36 #define __sparc64_MEMSTR_H__35 #ifndef KERN_sparc64_MEMSTR_H_ 36 #define KERN_sparc64_MEMSTR_H_ 37 37 38 38 #define memcpy(dst, src, cnt) __builtin_memcpy((dst), (src), (cnt)) … … 45 45 #endif 46 46 47 47 /** @} 48 48 */ 49 -
kernel/arch/sparc64/include/mm/as.h
re0b241f red166f7 27 27 */ 28 28 29 29 /** @addtogroup sparc64mm 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef __sparc64_AS_H__36 #define __sparc64_AS_H__35 #ifndef KERN_sparc64_AS_H_ 36 #define KERN_sparc64_AS_H_ 37 37 38 38 #define KERNEL_ADDRESS_SPACE_SHADOWED_ARCH 1 … … 45 45 #define USTACK_ADDRESS_ARCH (0x7fffffffffffffff-(PAGE_SIZE-1)) 46 46 47 #define as_install_arch(as)48 49 47 extern void as_arch_init(void); 50 48 51 49 #endif 52 50 53 51 /** @} 54 52 */ 55 53 -
kernel/arch/sparc64/include/mm/frame.h
re0b241f red166f7 48 48 struct { 49 49 unsigned : 23; 50 uint64_t pfn : 28; /**< Physical Frame Number. */51 unsigned offset : 13; /**< Offset. */50 uint64_t pfn : 28; /**< Physical Frame Number. */ 51 unsigned offset : 13; /**< Offset. */ 52 52 } __attribute__ ((packed)); 53 53 }; -
kernel/arch/sparc64/include/mm/memory_init.h
re0b241f red166f7 27 27 */ 28 28 29 29 /** @addtogroup sparc64mm 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef __sparc64_MEMORY_INIT_H__36 #define __sparc64_MEMORY_INIT_H__35 #ifndef KERN_sparc64_MEMORY_INIT_H_ 36 #define KERN_sparc64_MEMORY_INIT_H_ 37 37 38 38 #include <typedefs.h> … … 42 42 #endif 43 43 44 44 /** @} 45 45 */ 46 -
kernel/arch/sparc64/include/mm/mmu.h
re0b241f red166f7 33 33 */ 34 34 35 #ifndef __sparc64_MMU_H__36 #define __sparc64_MMU_H__35 #ifndef KERN_sparc64_MMU_H_ 36 #define KERN_sparc64_MMU_H_ 37 37 38 38 /* LSU Control Register ASI. */ -
kernel/arch/sparc64/include/mm/tlb.h
re0b241f red166f7 33 33 */ 34 34 35 #ifndef __sparc64_TLB_H__ 36 #define __sparc64_TLB_H__ 37 35 #ifndef KERN_sparc64_TLB_H_ 36 #define KERN_sparc64_TLB_H_ 38 37 39 38 #define ITLB_ENTRY_COUNT 64 -
kernel/arch/sparc64/include/mm/tte.h
re0b241f red166f7 33 33 */ 34 34 35 #ifndef __sparc64_TTE_H__36 #define __sparc64_TTE_H__35 #ifndef KERN_sparc64_TTE_H_ 36 #define KERN_sparc64_TTE_H_ 37 37 38 38 #define TTE_G (1<<0) -
kernel/arch/sparc64/include/proc/task.h
re0b241f red166f7 27 27 */ 28 28 29 29 /** @addtogroup sparc64proc 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef __sparc64_TASK_H__36 #define __sparc64_TASK_H__35 #ifndef KERN_sparc64_TASK_H_ 36 #define KERN_sparc64_TASK_H_ 37 37 38 38 typedef struct { … … 44 44 #endif 45 45 46 46 /** @} 47 47 */ 48 -
kernel/arch/sparc64/include/regdef.h
re0b241f red166f7 47 47 #define TSTATE_PSTATE_SHIFT 8 48 48 #define TSTATE_PRIV_BIT (PSTATE_PRIV_BIT<<TSTATE_PSTATE_SHIFT) 49 #define TSTATE_IE_BIT (PSTATE_IE_BIT<<TSTATE_PSTATE_SHIFT) 49 50 50 51 #define TSTATE_CWP_MASK 0x1f -
kernel/arch/sparc64/include/trap/exception.h
re0b241f red166f7 34 34 */ 35 35 36 #ifndef __sparc64_EXCEPTION_H__37 #define __sparc64_EXCEPTION_H__36 #ifndef KERN_sparc64_EXCEPTION_H_ 37 #define KERN_sparc64_EXCEPTION_H_ 38 38 39 39 #define TT_INSTRUCTION_ACCESS_EXCEPTION 0x08 -
kernel/arch/sparc64/include/trap/interrupt.h
re0b241f red166f7 35 35 */ 36 36 37 #ifndef __sparc64_TRAP_INTERRUPT_H__38 #define __sparc64_TRAP_INTERRUPT_H__37 #ifndef KERN_sparc64_TRAP_INTERRUPT_H_ 38 #define KERN_sparc64_TRAP_INTERRUPT_H_ 39 39 40 40 #include <arch/trap/trap_table.h> -
kernel/arch/sparc64/include/trap/mmu.h
re0b241f red166f7 43 43 #include <arch/mm/mmu.h> 44 44 #include <arch/mm/tte.h> 45 #include <arch/trap/regwin.h> 45 46 46 47 #define TT_FAST_INSTRUCTION_ACCESS_MMU_MISS 0x64 … … 51 52 52 53 #ifdef __ASM__ 54 53 55 .macro FAST_INSTRUCTION_ACCESS_MMU_MISS_HANDLER 54 /*55 *First, try to refill TLB from TSB.56 */56 ! 57 ! First, try to refill TLB from TSB. 58 ! 57 59 ! TODO 58 60 … … 75 77 * Note that branch-delay slots are used in order to save space. 76 78 */ 77 0: 79 78 80 mov VA_DMMU_TAG_ACCESS, %g1 79 81 ldxa [%g1] ASI_DMMU, %g1 ! read the faulting Context and VPN … … 85 87 86 88 or %g3, (TTE_CP|TTE_P|TTE_W), %g2 ! 8K pages are the default (encoded as 0) 87 set1, %g388 89 89 mov 1, %g3 90 sllx %g3, TTE_V_SHIFT, %g3 91 or %g2, %g3, %g2 90 92 stxa %g2, [%g0] ASI_DTLB_DATA_IN_REG ! identity map the kernel page 91 93 retry … … 93 95 /* 94 96 * Third, catch and handle special cases when the trap is caused by 95 * some register window trap handler. 97 * the userspace register window spill or fill handler. In case 98 * one of these two traps caused this trap, we just lower the trap 99 * level and service the DTLB miss. In the end, we restart 100 * the offending SAVE or RESTORE. 96 101 */ 97 102 0: 98 ! TODO103 HANDLE_MMU_TRAPS_FROM_SPILL_OR_FILL 99 104 100 0:101 105 wrpr %g0, PSTATE_PRIV_BIT | PSTATE_AG_BIT, %pstate 102 106 PREEMPTIBLE_HANDLER fast_data_access_mmu_miss … … 104 108 105 109 .macro FAST_DATA_ACCESS_PROTECTION_HANDLER 110 /* 111 * First, try to refill TLB from TSB. 112 */ 113 ! TODO 114 115 /* 116 * The same special case as in FAST_DATA_ACCESS_MMU_MISS_HANDLER. 117 */ 118 HANDLE_MMU_TRAPS_FROM_SPILL_OR_FILL 119 106 120 wrpr %g0, PSTATE_PRIV_BIT | PSTATE_AG_BIT, %pstate 107 121 PREEMPTIBLE_HANDLER fast_data_access_protection 108 122 .endm 123 124 /* 125 * Macro used to lower TL when a MMU trap is caused by 126 * the userspace register window spill or fill handler. 127 */ 128 .macro HANDLE_MMU_TRAPS_FROM_SPILL_OR_FILL 129 rdpr %tl, %g1 130 dec %g1 131 brz %g1, 0f ! if TL was 1, skip 132 nop 133 wrpr %g1, 0, %tl ! TL-- 134 rdpr %tt, %g2 135 cmp %g2, TT_SPILL_1_NORMAL 136 be 0f ! trap from spill_1_normal 137 cmp %g2, TT_FILL_1_NORMAL 138 be 0f ! trap from fill_1_normal 139 inc %g1 140 wrpr %g1, 0, %tl ! another trap, TL++ 141 0: 142 .endm 143 109 144 #endif /* __ASM__ */ 110 145 -
kernel/arch/sparc64/include/trap/regwin.h
re0b241f red166f7 35 35 */ 36 36 37 #ifndef __sparc64_REGWIN_H__38 #define __sparc64_REGWIN_H__37 #ifndef KERN_sparc64_REGWIN_H_ 38 #define KERN_sparc64_REGWIN_H_ 39 39 40 40 #include <arch/stack.h> -
kernel/arch/sparc64/include/trap/trap.h
re0b241f red166f7 33 33 */ 34 34 35 #ifndef __sparc64_TRAP_H__36 #define __sparc64_TRAP_H__35 #ifndef KERN_sparc64_TRAP_H_ 36 #define KERN_sparc64_TRAP_H_ 37 37 38 38 extern void trap_init(void); -
kernel/arch/sparc64/include/trap/trap_table.h
re0b241f red166f7 33 33 */ 34 34 35 #ifndef __sparc64_TRAP_TABLE_H__ 36 #define __sparc64_TRAP_TABLE_H__ 37 38 #ifndef __ASM__ 39 #include <arch/types.h> 40 #endif /* __ASM__ */ 35 #ifndef KERN_sparc64_TRAP_TABLE_H_ 36 #define KERN_sparc64_TRAP_TABLE_H_ 41 37 42 38 #include <arch/stack.h> … … 47 43 48 44 #ifndef __ASM__ 45 46 #include <arch/types.h> 47 49 48 struct trap_table_entry { 50 49 uint8_t octets[TRAP_TABLE_ENTRY_SIZE]; -
kernel/arch/sparc64/include/types.h
re0b241f red166f7 27 27 */ 28 28 29 29 /** @addtogroup sparc64 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef __sparc64_TYPES_H__36 #define __sparc64_TYPES_H__35 #ifndef KERN_sparc64_TYPES_H_ 36 #define KERN_sparc64_TYPES_H_ 37 37 38 38 #define NULL 0 … … 62 62 #endif 63 63 64 64 /** @} 65 65 */ 66
Note:
See TracChangeset
for help on using the changeset viewer.