Changeset ed166f7 in mainline
- Timestamp:
- 2006-08-31T18:53:14Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 6767c1d
- Parents:
- e0b241f
- Location:
- kernel
- Files:
-
- 41 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 -
kernel/arch/sparc64/src/asm.S
re0b241f red166f7 29 29 #include <arch/stack.h> 30 30 #include <arch/regdef.h> 31 #include <arch/mm/mmu.h> 31 32 32 33 .text … … 144 145 read_from_ag_g7: 145 146 READ_ALTERNATE_REGISTER %g7, PSTATE_AG_BIT 147 148 149 /** Switch to userspace. 150 * 151 * %o0 Userspace entry address. 152 * %o1 Userspace stack pointer address. 153 */ 154 .global switch_to_userspace 155 switch_to_userspace: 156 flushw 157 wrpr %g0, 0, %cleanwin ! avoid information leak 158 save %o1, -STACK_WINDOW_SAVE_AREA_SIZE, %sp 159 160 clr %i2 161 clr %i3 162 clr %i4 163 clr %i5 164 clr %i6 165 166 wrpr %g0, 1, %tl ! enforce mapping via nucleus 167 168 rdpr %cwp, %g1 169 wrpr %g1, TSTATE_IE_BIT, %tstate 170 wrpr %i0, 0, %tnpc 171 172 /* 173 * Set primary context according to secondary context. 174 * Secondary context has been already installed by 175 * higher-level functions. 176 */ 177 wr %g0, ASI_DMMU, %asi 178 ldxa [VA_SECONDARY_CONTEXT_REG] %asi, %g1 179 stxa %g1, [VA_PRIMARY_CONTEXT_REG] %asi 180 flush %i7 181 182 done ! jump to userspace -
kernel/arch/sparc64/src/ddi/ddi.c
re0b241f red166f7 27 27 */ 28 28 29 29 /** @addtogroup sparc64ddi 30 30 * @{ 31 31 */ … … 53 53 } 54 54 55 55 /** @} 56 56 */ 57 -
kernel/arch/sparc64/src/dummy.s
re0b241f red166f7 40 40 .global fpu_enable 41 41 .global fpu_init 42 .global userspace43 42 .global sys_tls_set 44 43 … … 56 55 fpu_enable: 57 56 fpu_init: 58 userspace:59 57 sys_tls_set: 60 58 -
kernel/arch/sparc64/src/mm/as.c
re0b241f red166f7 27 27 */ 28 28 29 29 /** @addtogroup sparc64mm 30 30 * @{ 31 31 */ … … 34 34 35 35 #include <arch/mm/as.h> 36 #include <arch/mm/tlb.h> 36 37 #include <genarch/mm/as_ht.h> 37 38 #include <genarch/mm/asid_fifo.h> … … 44 45 } 45 46 46 /** @} 47 void as_install_arch(as_t *as) 48 { 49 tlb_context_reg_t ctx; 50 51 /* 52 * Write ASID to secondary context register. 53 * The primary context register has to be set 54 * from TL>0 so it will be filled from the 55 * secondary context register from the TL=1 56 * code just before switch to userspace. 57 */ 58 ctx.v = 0; 59 ctx.context = as->asid; 60 mmu_secondary_context_write(ctx.v); 61 } 62 63 /** @} 47 64 */ 48 65 -
kernel/arch/sparc64/src/mm/tlb.c
re0b241f red166f7 375 375 void tlb_invalidate_asid(asid_t asid) 376 376 { 377 /* TODO: write asid to some Context register and encode the register in second parameter below. */ 378 itlb_demap(TLB_DEMAP_CONTEXT, TLB_DEMAP_NUCLEUS, 0); 379 dtlb_demap(TLB_DEMAP_CONTEXT, TLB_DEMAP_NUCLEUS, 0); 377 tlb_context_reg_t sc_save, ctx; 378 379 ctx.v = sc_save.v = mmu_secondary_context_read(); 380 ctx.context = asid; 381 mmu_secondary_context_write(ctx.v); 382 383 itlb_demap(TLB_DEMAP_CONTEXT, TLB_DEMAP_SECONDARY, 0); 384 dtlb_demap(TLB_DEMAP_CONTEXT, TLB_DEMAP_SECONDARY, 0); 385 386 mmu_secondary_context_write(sc_save.v); 380 387 } 381 388 … … 389 396 { 390 397 int i; 398 tlb_context_reg_t sc_save, ctx; 399 400 ctx.v = sc_save.v = mmu_secondary_context_read(); 401 ctx.context = asid; 402 mmu_secondary_context_write(ctx.v); 391 403 392 404 for (i = 0; i < cnt; i++) { 393 /* TODO: write asid to some Context register and encode the register in second parameter below. */ 394 itlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_NUCLEUS, page + i * PAGE_SIZE); 395 dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_NUCLEUS, page + i * PAGE_SIZE); 396 } 405 itlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_SECONDARY, page + i * PAGE_SIZE); 406 dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_SECONDARY, page + i * PAGE_SIZE); 407 } 408 409 mmu_secondary_context_write(sc_save.v); 397 410 } 398 411 -
kernel/arch/sparc64/src/proc/scheduler.c
re0b241f red166f7 92 92 * in the userspace window buffer to %g7 in the alternate and interrupt sets. 93 93 */ 94 write_to_ig_g6((uintptr_t) THREAD->kstack + STACK_SIZE - STACK_BIAS); 95 write_to_ag_g6((uintptr_t) THREAD->kstack + STACK_SIZE - STACK_BIAS); 94 uint64_t sp = (uintptr_t) THREAD->kstack + STACK_SIZE 95 - (STACK_BIAS + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT)); 96 write_to_ig_g6(sp); 97 write_to_ag_g6(sp); 96 98 write_to_ag_g7((uintptr_t) THREAD->arch.uspace_window_buffer); 97 99 } -
kernel/arch/sparc64/src/sparc64.c
re0b241f red166f7 35 35 #include <arch.h> 36 36 #include <debug.h> 37 #include <config.h> 37 38 #include <arch/trap/trap.h> 38 39 #include <arch/console.h> … … 42 43 #include <arch/boot/boot.h> 43 44 #include <arch/arch.h> 44 #include <arch/mm/tlb.h> 45 #include <mm/asid.h> 45 #include <arch/mm/page.h> 46 #include <arch/stack.h> 47 #include <userspace.h> 46 48 47 49 bootinfo_t bootinfo; … … 92 94 } 93 95 96 /** Switch to userspace. */ 97 void userspace(uspace_arg_t *kernel_uarg) 98 { 99 switch_to_userspace((uintptr_t) kernel_uarg->uspace_entry, 100 ((uintptr_t) kernel_uarg->uspace_stack) + STACK_SIZE 101 - (ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT) + STACK_BIAS)); 102 103 for (;;) 104 ; 105 /* not reached */ 106 } 107 94 108 /** @} 95 109 */ -
kernel/arch/sparc64/src/start.S
re0b241f red166f7 69 69 wrpr %g1, 0, %pstate 70 70 71 wrpr % r0, 0, %pil ! intialize %pil71 wrpr %g0, 0, %pil ! intialize %pil 72 72 73 73 /* -
kernel/arch/sparc64/src/trap/trap_table.S
re0b241f red166f7 41 41 #include <arch/trap/exception.h> 42 42 #include <arch/trap/mmu.h> 43 #include <arch/mm/mmu.h> 43 44 #include <arch/mm/page.h> 44 45 #include <arch/stack.h> … … 349 350 wrpr %l0, %otherwin 350 351 wrpr %g0, %cansave 351 wrpr %g0, NWINDOW -1, %cleanwin352 wrpr %g0, NWINDOW - 1, %cleanwin 352 353 353 354 /* … … 355 356 */ 356 357 mov VA_PRIMARY_CONTEXT_REG, %l0 357 358 set kernel_image_start, %l0359 358 stxa %g0, [%l0] ASI_DMMU 359 rd %pc, %l0 360 flush %l0 360 361 361 362 ba 1f … … 498 499 */ 499 500 wrpr %g0, WSTATE_OTHER(0) | WSTATE_NORMAL(1), %wstate 501 502 /* 503 * Set primary context according to secondary context. 504 */ 505 wr %g0, ASI_DMMU, %asi 506 ldxa [VA_SECONDARY_CONTEXT_REG] %asi, %g1 507 stxa %g1, [VA_PRIMARY_CONTEXT_REG] %asi 508 flush %o7 500 509 501 510 rdpr %cwp, %g1 -
kernel/generic/include/align.h
re0b241f red166f7 27 27 */ 28 28 29 30 29 /** @addtogroup generic 31 30 * @ingroup others 32 31 * @{ 33 32 */ 34 /** @file 33 /** 34 * @file 35 * @brief Macros for making values and addresses aligned. 35 36 */ 36 37 37 #ifndef __ALIGN_H__38 #define __ALIGN_H__38 #ifndef KERN_ALIGN_H_ 39 #define KERN_ALIGN_H_ 39 40 40 41 /** Align to the nearest lower address.
Note:
See TracChangeset
for help on using the changeset viewer.