Changeset 1433ecda in mainline for kernel/arch/sparc64
- Timestamp:
- 2018-04-04T15:42:37Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2c4e1cc
- Parents:
- 47b2d7e3
- Location:
- kernel/arch/sparc64
- Files:
-
- 34 edited
-
include/arch/atomic.h (modified) (3 diffs)
-
include/arch/barrier.h (modified) (2 diffs)
-
include/arch/cpu_family.h (modified) (2 diffs)
-
include/arch/drivers/niagara_buf.h (modified) (2 diffs)
-
include/arch/mm/page.h (modified) (1 diff)
-
include/arch/mm/sun4u/as.h (modified) (2 diffs)
-
include/arch/mm/sun4u/frame.h (modified) (1 diff)
-
include/arch/mm/sun4u/mmu.h (modified) (1 diff)
-
include/arch/mm/sun4u/tlb.h (modified) (10 diffs)
-
include/arch/mm/sun4u/tsb.h (modified) (1 diff)
-
include/arch/mm/sun4u/tte.h (modified) (2 diffs)
-
include/arch/mm/sun4v/as.h (modified) (2 diffs)
-
include/arch/mm/sun4v/page.h (modified) (1 diff)
-
include/arch/mm/sun4v/tlb.h (modified) (3 diffs)
-
include/arch/mm/sun4v/tsb.h (modified) (1 diff)
-
include/arch/mm/sun4v/tte.h (modified) (1 diff)
-
include/arch/register.h (modified) (6 diffs)
-
include/arch/sun4u/asm.h (modified) (1 diff)
-
include/arch/sun4v/hypercall.h (modified) (6 diffs)
-
include/arch/sun4v/register.h (modified) (1 diff)
-
src/cpu/sun4u/cpu.c (modified) (3 diffs)
-
src/cpu/sun4v/cpu.c (modified) (1 diff)
-
src/debug/stacktrace.c (modified) (1 diff)
-
src/drivers/niagara.c (modified) (5 diffs)
-
src/drivers/tick.c (modified) (1 diff)
-
src/mm/sun4v/tlb.c (modified) (7 diffs)
-
src/proc/thread.c (modified) (1 diff)
-
src/smp/sun4u/ipi.c (modified) (3 diffs)
-
src/smp/sun4u/smp.c (modified) (1 diff)
-
src/smp/sun4v/ipi.c (modified) (5 diffs)
-
src/smp/sun4v/smp.c (modified) (4 diffs)
-
src/sun4u/sparc64.c (modified) (2 diffs)
-
src/sun4v/sparc64.c (modified) (2 diffs)
-
src/trap/sun4v/interrupt.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/include/arch/atomic.h
r47b2d7e3 r1433ecda 64 64 65 65 asm volatile ( 66 "casx %0, %2, %1\n"67 : "+m" (*((atomic_count_t *) ptr)),66 "casx %0, %2, %1\n" 67 : "+m" (*((atomic_count_t *) ptr)), 68 68 "+r" (b) 69 69 : "r" (a) … … 110 110 111 111 asm volatile ( 112 "casx %0, %2, %1\n"113 : "+m" (*((atomic_count_t *) ptr)),112 "casx %0, %2, %1\n" 113 : "+m" (*((atomic_count_t *) ptr)), 114 114 "+r" (v) 115 115 : "r" (0) … … 129 129 130 130 asm volatile ( 131 "0:\n"132 "casx %0, %3, %1\n"133 "brz %1, 2f\n"134 "nop\n"135 "1:\n"136 "ldx %0, %2\n"137 "brz %2, 0b\n"138 "nop\n"139 "ba,a %%xcc, 1b\n"140 "2:\n"141 : "+m" (*((atomic_count_t *) ptr)),142 "+r" (tmp1),143 "+r" (tmp2)144 : "r" (0)131 "0:\n" 132 "casx %0, %3, %1\n" 133 "brz %1, 2f\n" 134 "nop\n" 135 "1:\n" 136 "ldx %0, %2\n" 137 "brz %2, 0b\n" 138 "nop\n" 139 "ba,a %%xcc, 1b\n" 140 "2:\n" 141 : "+m" (*((atomic_count_t *) ptr)), 142 "+r" (tmp1), 143 "+r" (tmp2) 144 : "r" (0) 145 145 ); 146 146 -
kernel/arch/sparc64/include/arch/barrier.h
r47b2d7e3 r1433ecda 96 96 97 97 asm volatile ( 98 "rd %%pc, %[pc]\n"99 "flush %[pc]\n"100 : [pc] "=&r" (pc)98 "rd %%pc, %[pc]\n" 99 "flush %[pc]\n" 100 : [pc] "=&r" (pc) 101 101 ); 102 102 } … … 106 106 { 107 107 asm volatile ( 108 "membar #Sync\n"108 "membar #Sync\n" 109 109 ); 110 110 } -
kernel/arch/sparc64/include/arch/cpu_family.h
r47b2d7e3 r1433ecda 50 50 int impl = ((ver_reg_t) ver_read()).impl; 51 51 return (impl == IMPL_ULTRASPARCI) || (impl == IMPL_ULTRASPARCII) || 52 (impl == IMPL_ULTRASPARCII_I) || (impl == IMPL_ULTRASPARCII_E);52 (impl == IMPL_ULTRASPARCII_I) || (impl == IMPL_ULTRASPARCII_E); 53 53 } 54 54 … … 62 62 int impl = ((ver_reg_t) ver_read()).impl; 63 63 return (impl == IMPL_ULTRASPARCIII) || 64 (impl == IMPL_ULTRASPARCIII_PLUS) ||65 (impl == IMPL_ULTRASPARCIII_I);64 (impl == IMPL_ULTRASPARCIII_PLUS) || 65 (impl == IMPL_ULTRASPARCIII_I); 66 66 } 67 67 -
kernel/arch/sparc64/include/arch/drivers/niagara_buf.h
r47b2d7e3 r1433ecda 50 50 uint64_t write_ptr; 51 51 char data[OUTPUT_BUFFER_SIZE]; 52 } __attribute__ ((packed)) niagara_output_buffer_t;52 } __attribute__((packed)) niagara_output_buffer_t; 53 53 54 54 #define INPUT_BUFFER_SIZE ((PAGE_SIZE) - 2 * 8) … … 58 58 uint64_t read_ptr; 59 59 char data[INPUT_BUFFER_SIZE]; 60 } __attribute__ ((packed)) niagara_input_buffer_t;60 } __attribute__((packed)) niagara_input_buffer_t; 61 61 62 62 /** @} -
kernel/arch/sparc64/include/arch/mm/page.h
r47b2d7e3 r1433ecda 68 68 uint64_t vpn : 51; /**< Virtual Page Number. */ 69 69 unsigned offset : 13; /**< Offset. */ 70 } __attribute__ ((packed));70 } __attribute__((packed)); 71 71 } page_address_t; 72 72 -
kernel/arch/sparc64/include/arch/mm/sun4u/as.h
r47b2d7e3 r1433ecda 56 56 unsigned : 6; 57 57 uint64_t va_tag : 42; /**< Virtual address bits <63:22>. */ 58 } __attribute__ ((packed));58 } __attribute__((packed)); 59 59 } tsb_tag_target_t; 60 60 … … 63 63 tsb_tag_target_t tag; 64 64 tte_data_t data; 65 } __attribute__ ((packed)) tsb_entry_t;65 } __attribute__((packed)) tsb_entry_t; 66 66 67 67 typedef struct { -
kernel/arch/sparc64/include/arch/mm/sun4u/frame.h
r47b2d7e3 r1433ecda 69 69 #endif 70 70 unsigned offset : 13; /**< Offset. */ 71 } __attribute__ ((packed));71 } __attribute__((packed)); 72 72 }; 73 73 -
kernel/arch/sparc64/include/arch/mm/sun4u/mmu.h
r47b2d7e3 r1433ecda 112 112 unsigned ic : 1; /**< I-Cache enable. */ 113 113 114 } __attribute__ ((packed));114 } __attribute__((packed)); 115 115 } lsu_cr_reg_t; 116 116 #endif /* US */ -
kernel/arch/sparc64/include/arch/mm/sun4u/tlb.h
r47b2d7e3 r1433ecda 109 109 unsigned long : 51; 110 110 unsigned context : 13; /**< Context/ASID. */ 111 } __attribute__ ((packed));111 } __attribute__((packed)); 112 112 }; 113 113 typedef union tlb_context_reg tlb_context_reg_t; … … 126 126 unsigned tlb_entry : 6; 127 127 unsigned : 3; 128 } __attribute__ ((packed));128 } __attribute__((packed)); 129 129 }; 130 130 typedef union tlb_data_access_addr dtlb_data_access_addr_t; … … 155 155 unsigned local_tlb_entry : 9; 156 156 unsigned : 3; 157 } __attribute__ ((packed));157 } __attribute__((packed)); 158 158 }; 159 159 typedef union dtlb_data_access_addr dtlb_data_access_addr_t; … … 169 169 unsigned local_tlb_entry : 7; 170 170 unsigned : 3; 171 } __attribute__ ((packed));171 } __attribute__((packed)); 172 172 }; 173 173 typedef union itlb_data_access_addr itlb_data_access_addr_t; … … 182 182 uint64_t vpn : 51; /**< Virtual Address bits 63:13. */ 183 183 unsigned context : 13; /**< Context identifier. */ 184 } __attribute__ ((packed));184 } __attribute__((packed)); 185 185 }; 186 186 typedef union tlb_tag_read_reg tlb_tag_read_reg_t; … … 192 192 uint64_t value; 193 193 struct { 194 uint64_t vpn : 51; /**< Virtual Address bits 63:13. */194 uint64_t vpn : 51; /**< Virtual Address bits 63:13. */ 195 195 #if defined (US) 196 196 unsigned : 6; /**< Ignored. */ … … 198 198 #elif defined (US3) 199 199 unsigned : 5; /**< Ignored. */ 200 unsigned type : 2; /**< The type of demap operation. */200 unsigned type : 2; /**< The type of demap operation. */ 201 201 #endif 202 202 unsigned context : 2; /**< Context register selection. */ 203 203 unsigned : 4; /**< Zero. */ 204 } __attribute__ ((packed));204 } __attribute__((packed)); 205 205 }; 206 206 typedef union tlb_demap_addr tlb_demap_addr_t; … … 229 229 unsigned ow : 1; /**< Overwrite bit. */ 230 230 unsigned fv : 1; /**< Fault Valid bit. */ 231 } __attribute__ ((packed));231 } __attribute__((packed)); 232 232 }; 233 233 typedef union tlb_sfsr_reg tlb_sfsr_reg_t; … … 436 436 */ 437 437 NO_TRACE static inline void itlb_data_access_write(int tlb, size_t entry, 438 uint64_t value)438 uint64_t value) 439 439 { 440 440 itlb_data_access_addr_t reg; … … 472 472 */ 473 473 NO_TRACE static inline void dtlb_data_access_write(int tlb, size_t entry, 474 uint64_t value)474 uint64_t value) 475 475 { 476 476 dtlb_data_access_addr_t reg; -
kernel/arch/sparc64/include/arch/mm/sun4u/tsb.h
r47b2d7e3 r1433ecda 75 75 unsigned size : 3; /**< TSB size. Number of entries is 76 76 * 512 * 2^size. */ 77 } __attribute__ ((packed));77 } __attribute__((packed)); 78 78 } tsb_base_reg_t; 79 79 -
kernel/arch/sparc64/include/arch/mm/sun4u/tte.h
r47b2d7e3 r1433ecda 63 63 unsigned : 6; /**< Reserved. */ 64 64 uint64_t va_tag : 42; /**< Virtual Address Tag, bits 63:22. */ 65 } __attribute__ ((packed));65 } __attribute__((packed)); 66 66 }; 67 67 … … 92 92 unsigned w : 1; /**< Writable. */ 93 93 unsigned g : 1; /**< Global. */ 94 } __attribute__ ((packed));94 } __attribute__((packed)); 95 95 }; 96 96 -
kernel/arch/sparc64/include/arch/mm/sun4v/as.h
r47b2d7e3 r1433ecda 63 63 unsigned : 6; 64 64 uint64_t va_tag : 42; /**< Virtual address bits <63:22>. */ 65 } __attribute__ ((packed));65 } __attribute__((packed)); 66 66 } tte_tag_t; 67 67 … … 70 70 tte_tag_t tag; 71 71 tte_data_t data; 72 } __attribute__ ((packed)) tsb_entry_t;72 } __attribute__((packed)) tsb_entry_t; 73 73 74 74 typedef struct { -
kernel/arch/sparc64/include/arch/mm/sun4v/page.h
r47b2d7e3 r1433ecda 60 60 uint64_t vpn : 51; /**< Virtual Page Number. */ 61 61 unsigned offset : 13; /**< Offset. */ 62 } __attribute__ ((packed));62 } __attribute__((packed)); 63 63 } page_address_t; 64 64 -
kernel/arch/sparc64/include/arch/mm/sun4v/tlb.h
r47b2d7e3 r1433ecda 68 68 uint64_t dfc; /**< Data fault context (DFC) */ 69 69 uint8_t reserved2[0x28]; 70 } __attribute__ ((packed)) mmu_fault_status_area_t;70 } __attribute__((packed)) mmu_fault_status_area_t; 71 71 72 72 #define DTLB_MAX_LOCKED_ENTRIES 8 … … 126 126 * @param mmu_flag MMU_FLAG_DTLB, MMU_FLAG_ITLB or a combination of both 127 127 */ 128 NO_TRACE static inline void mmu_demap_ctx(int context, int mmu_flag) { 128 NO_TRACE static inline void mmu_demap_ctx(int context, int mmu_flag) 129 { 129 130 __hypercall_fast4(MMU_DEMAP_CTX, 0, 0, context, mmu_flag); 130 131 } … … 137 138 * @param mmu_flag MMU_FLAG_DTLB, MMU_FLAG_ITLB or a combination of both 138 139 */ 139 NO_TRACE static inline void mmu_demap_page(uintptr_t vaddr, int context, int mmu_flag) { 140 NO_TRACE static inline void mmu_demap_page(uintptr_t vaddr, int context, int mmu_flag) 141 { 140 142 __hypercall_fast5(MMU_DEMAP_PAGE, 0, 0, vaddr, context, mmu_flag); 141 143 } -
kernel/arch/sparc64/include/arch/mm/sun4v/tsb.h
r47b2d7e3 r1433ecda 65 65 uint64_t tsb_base; /**< Real address of TSB base. */ 66 66 uint64_t reserved; 67 } __attribute__ ((packed)) tsb_descr_t;67 } __attribute__((packed)) tsb_descr_t; 68 68 69 69 -
kernel/arch/sparc64/include/arch/mm/sun4v/tte.h
r47b2d7e3 r1433ecda 69 69 unsigned soft2 : 2; /**< Software defined field. */ 70 70 unsigned size : 4; /**< Page size. */ 71 } __attribute__ ((packed));71 } __attribute__((packed)); 72 72 }; 73 73 -
kernel/arch/sparc64/include/arch/register.h
r47b2d7e3 r1433ecda 50 50 unsigned : 3; 51 51 unsigned maxwin : 5; 52 } __attribute__ ((packed));52 } __attribute__((packed)); 53 53 }; 54 54 typedef union ver_reg ver_reg_t; … … 70 70 unsigned ie : 1; /**< Interrupt Enable. */ 71 71 unsigned ag : 1; /**< Alternate Globals*/ 72 } __attribute__ ((packed));72 } __attribute__((packed)); 73 73 }; 74 74 typedef union pstate_reg pstate_reg_t; … … 80 80 unsigned npt : 1; /**< Non-privileged Trap enable. */ 81 81 uint64_t counter : 63; /**< Elapsed CPU clck cycle counter. */ 82 } __attribute__ ((packed));82 } __attribute__((packed)); 83 83 }; 84 84 typedef union tick_reg tick_reg_t; … … 90 90 unsigned int_dis : 1; /**< TICK_INT interrupt disabled flag. */ 91 91 uint64_t tick_cmpr : 63; /**< Compare value for TICK interrupts. */ 92 } __attribute__ ((packed));92 } __attribute__((packed)); 93 93 }; 94 94 typedef union tick_compare_reg tick_compare_reg_t; … … 102 102 unsigned int_level : 15; 103 103 unsigned tick_int : 1; 104 } __attribute__ ((packed));104 } __attribute__((packed)); 105 105 }; 106 106 typedef union softint_reg softint_reg_t; … … 114 114 unsigned du : 1; 115 115 unsigned dl : 1; 116 } __attribute__ ((packed));116 } __attribute__((packed)); 117 117 }; 118 118 typedef union fprs_reg fprs_reg_t; -
kernel/arch/sparc64/include/arch/sun4u/asm.h
r47b2d7e3 r1433ecda 48 48 49 49 asm volatile ( 50 "rdpr %%ver, %[v]\n"51 : [v] "=r" (v)50 "rdpr %%ver, %[v]\n" 51 : [v] "=r" (v) 52 52 ); 53 53 -
kernel/arch/sparc64/include/arch/sun4v/hypercall.h
r47b2d7e3 r1433ecda 152 152 */ 153 153 static inline uint64_t 154 __hypercall_fast(const uint64_t p1, const uint64_t p2, const uint64_t p3,154 __hypercall_fast(const uint64_t p1, const uint64_t p2, const uint64_t p3, 155 155 const uint64_t p4, const uint64_t p5, const uint64_t function_number) 156 156 { … … 163 163 164 164 asm volatile ( 165 "ta %7\n"166 : "=r" (a1)167 : "r" (a1), "r" (a2), "r" (a3), "r" (a4), "r" (a5), "r" (a6),168 "i" (FAST_TRAP)169 : "memory"165 "ta %7\n" 166 : "=r" (a1) 167 : "r" (a1), "r" (a2), "r" (a3), "r" (a4), "r" (a5), "r" (a6), 168 "i" (FAST_TRAP) 169 : "memory" 170 170 ); 171 171 … … 187 187 */ 188 188 static inline uint64_t 189 __hypercall_fast_ret1(const uint64_t p1, const uint64_t p2, const uint64_t p3,189 __hypercall_fast_ret1(const uint64_t p1, const uint64_t p2, const uint64_t p3, 190 190 const uint64_t p4, const uint64_t p5, const uint64_t function_number, 191 191 uint64_t *ret1) … … 199 199 200 200 asm volatile ( 201 "ta %8\n"202 : "=r" (a1), "=r" (a2)203 : "r" (a1), "r" (a2), "r" (a3), "r" (a4), "r" (a5), "r" (a6),204 "i" (FAST_TRAP)205 : "memory"201 "ta %8\n" 202 : "=r" (a1), "=r" (a2) 203 : "r" (a1), "r" (a2), "r" (a3), "r" (a4), "r" (a5), "r" (a6), 204 "i" (FAST_TRAP) 205 : "memory" 206 206 ); 207 207 … … 223 223 */ 224 224 static inline uint64_t 225 __hypercall_hyperfast(const uint64_t p1, const uint64_t p2, const uint64_t p3,225 __hypercall_hyperfast(const uint64_t p1, const uint64_t p2, const uint64_t p3, 226 226 const uint64_t p4, const uint64_t p5, const uint64_t sw_trap_number) 227 227 { … … 233 233 234 234 asm volatile ( 235 "ta %6\n"236 : "=r" (a1)237 : "r" (a1), "r" (a2), "r" (a3), "r" (a4), "r" (a5),238 "i" (sw_trap_number)239 : "memory"235 "ta %6\n" 236 : "=r" (a1) 237 : "r" (a1), "r" (a2), "r" (a3), "r" (a4), "r" (a5), 238 "i" (sw_trap_number) 239 : "memory" 240 240 ); 241 241 -
kernel/arch/sparc64/include/arch/sun4v/register.h
r47b2d7e3 r1433ecda 53 53 unsigned ie : 1; /**< Interrupt Enable. */ 54 54 unsigned : 1; 55 } __attribute__ ((packed));55 } __attribute__((packed)); 56 56 }; 57 57 typedef union pstate_reg pstate_reg_t; -
kernel/arch/sparc64/src/cpu/sun4u/cpu.c
r47b2d7e3 r1433ecda 99 99 int f; 100 100 f = find_cpu_frequency( 101 ofw_tree_find_child(node, "cpu@0"));101 ofw_tree_find_child(node, "cpu@0")); 102 102 if (f != -1) 103 103 clock_frequency = (uint32_t) f; 104 104 f = find_cpu_frequency( 105 ofw_tree_find_child(node, "cpu@1"));105 ofw_tree_find_child(node, "cpu@1")); 106 106 if (f != -1) 107 107 clock_frequency = (uint32_t) f; … … 140 140 break; 141 141 case MANUF_SUN: 142 manuf = "Sun";142 manuf = "Sun"; 143 143 break; 144 144 default: … … 184 184 185 185 printf("cpu%d: manuf=%s, impl=%s, mask=%d (%d MHz)\n", m->id, manuf, 186 impl, m->arch.ver.mask, m->arch.clock_frequency / 1000000);186 impl, m->arch.ver.mask, m->arch.clock_frequency / 1000000); 187 187 } 188 188 -
kernel/arch/sparc64/src/cpu/sun4v/cpu.c
r47b2d7e3 r1433ecda 66 66 uint64_t clock_frequency = 0; 67 67 md_get_integer_property(node, "clock-frequency", 68 &clock_frequency);68 &clock_frequency); 69 69 CPU->arch.clock_frequency = clock_frequency; 70 70 break; -
kernel/arch/sparc64/src/debug/stacktrace.c
r47b2d7e3 r1433ecda 98 98 } 99 99 100 bool uspace_return_address_get(stack_trace_context_t *ctx , uintptr_t *ra)100 bool uspace_return_address_get(stack_trace_context_t *ctx, uintptr_t *ra) 101 101 { 102 102 return false; -
kernel/arch/sparc64/src/drivers/niagara.c
r47b2d7e3 r1433ecda 82 82 * buffer definition follows. 83 83 */ 84 static volatile niagara_output_buffer_t __attribute__ ((aligned(PAGE_SIZE)))84 static volatile niagara_output_buffer_t __attribute__((aligned(PAGE_SIZE))) 85 85 output_buffer; 86 86 … … 90 90 * Analogous to the output_buffer, see the previous definition. 91 91 */ 92 static volatile niagara_input_buffer_t __attribute__ ((aligned(PAGE_SIZE)))92 static volatile niagara_input_buffer_t __attribute__((aligned(PAGE_SIZE))) 93 93 input_buffer; 94 94 … … 96 96 97 97 /** Write a single character to the standard output. */ 98 static inline void do_putchar(const char c) { 98 static inline void do_putchar(const char c) 99 { 99 100 /* Repeat until the buffer is non-full */ 100 while (__hypercall_fast1(CONS_PUTCHAR, c) == HV_EWOULDBLOCK); 101 while (__hypercall_fast1(CONS_PUTCHAR, c) == HV_EWOULDBLOCK) 102 ; 101 103 } 102 104 … … 160 162 * 161 163 */ 162 static void kniagarapoll(void *arg) { 164 static void kniagarapoll(void *arg) 165 { 163 166 while (true) { 164 167 niagara_poll(); … … 213 216 PAGE_SIZE); 214 217 sysinfo_set_item_val("niagara.inbuf.datasize", NULL, 215 INPUT_BUFFER_SIZE);218 INPUT_BUFFER_SIZE); 216 219 217 220 outbuf_parea.pbase = (uintptr_t) (KA2PA(&output_buffer)); -
kernel/arch/sparc64/src/drivers/tick.c
r47b2d7e3 r1433ecda 54 54 compare.int_dis = false; 55 55 compare.tick_cmpr = tick_counter_read() + 56 CPU->arch.clock_frequency / HZ;56 CPU->arch.clock_frequency / HZ; 57 57 CPU->arch.next_tick_cmpr = compare.tick_cmpr; 58 58 tick_compare_write(compare.value); -
kernel/arch/sparc64/src/mm/sun4v/tlb.c
r47b2d7e3 r1433ecda 103 103 "unaligned access", 104 104 "invalid page size" 105 };105 }; 106 106 107 107 /** Array of MMU fault status areas. */ … … 146 146 if (locked) { 147 147 __hypercall_fast4( 148 MMU_MAP_PERM_ADDR, page, 0, data.value, MMU_FLAG_DTLB);148 MMU_MAP_PERM_ADDR, page, 0, data.value, MMU_FLAG_DTLB); 149 149 } else { 150 150 __hypercall_hyperfast( 151 page, ASID_KERNEL, data.value, MMU_FLAG_DTLB, 0,152 MMU_MAP_ADDR);151 page, ASID_KERNEL, data.value, MMU_FLAG_DTLB, 0, 152 MMU_MAP_ADDR); 153 153 } 154 154 } … … 180 180 181 181 __hypercall_hyperfast( 182 t->page, t->as->asid, data.value, MMU_FLAG_DTLB, 0, MMU_MAP_ADDR);182 t->page, t->as->asid, data.value, MMU_FLAG_DTLB, 0, MMU_MAP_ADDR); 183 183 } 184 184 … … 205 205 206 206 __hypercall_hyperfast( 207 t->page, t->as->asid, data.value, MMU_FLAG_ITLB, 0, MMU_MAP_ADDR);207 t->page, t->as->asid, data.value, MMU_FLAG_ITLB, 0, MMU_MAP_ADDR); 208 208 } 209 209 … … 349 349 350 350 printf("condition which caused the fault: %s\n", 351 fault_types[mmu_fsas[myid].dft]);351 fault_types[mmu_fsas[myid].dft]); 352 352 } 353 353 … … 356 356 { 357 357 uint64_t errno = __hypercall_fast3(MMU_DEMAP_ALL, 0, 0, 358 MMU_FLAG_DTLB | MMU_FLAG_ITLB);358 MMU_FLAG_DTLB | MMU_FLAG_ITLB); 359 359 if (errno != HV_EOK) 360 360 panic("Error code = %" PRIu64 ".\n", errno); … … 372 372 373 373 __hypercall_fast4(MMU_DEMAP_CTX, 0, 0, asid, 374 MMU_FLAG_ITLB | MMU_FLAG_DTLB);374 MMU_FLAG_ITLB | MMU_FLAG_DTLB); 375 375 376 376 nucleus_leave(); -
kernel/arch/sparc64/src/proc/thread.c
r47b2d7e3 r1433ecda 64 64 void thread_create_arch(thread_t *t) 65 65 { 66 if ((t->uspace) && (!t->arch.uspace_window_buffer)) 67 { 66 if ((t->uspace) && (!t->arch.uspace_window_buffer)) { 68 67 /* 69 68 * The thread needs userspace window buffer and the object -
kernel/arch/sparc64/src/smp/sun4u/ipi.c
r47b2d7e3 r1433ecda 59 59 * @param func value the first data item of the vector will be set to 60 60 */ 61 static inline void set_intr_w_data(void (* func)(void))61 static inline void set_intr_w_data(void (*func)(void)) 62 62 { 63 63 #if defined (US) … … 87 87 * @param func Function to be invoked. 88 88 */ 89 static void cross_call(int mid, void (* func)(void))89 static void cross_call(int mid, void (*func)(void)) 90 90 { 91 91 uint64_t status; … … 148 148 unsigned int i; 149 149 150 void (* func)(void);150 void (*func)(void); 151 151 152 152 switch (ipi) { -
kernel/arch/sparc64/src/smp/sun4u/smp.c
r47b2d7e3 r1433ecda 121 121 node = ofw_tree_find_child_by_device_type(cpus_parent(), "cpu"); 122 122 for (i = 0; node; 123 node = ofw_tree_find_peer_by_device_type(node, "cpu"), i++)123 node = ofw_tree_find_peer_by_device_type(node, "cpu"), i++) 124 124 wakeup_cpu(node); 125 125 } else if (is_us_iv()) { -
kernel/arch/sparc64/src/smp/sun4v/ipi.c
r47b2d7e3 r1433ecda 45 45 46 46 static uint64_t data[MAX_NUM_STRANDS][IPI_MESSAGE_SIZE] 47 __attribute__ ((aligned(64)));47 __attribute__((aligned(64))); 48 48 49 49 static uint16_t ipi_cpu_list[MAX_NUM_STRANDS][MAX_NUM_STRANDS]; … … 60 60 */ 61 61 uint64_t ipi_brodcast_to(void (*func)(void), uint16_t cpu_list[MAX_NUM_STRANDS], 62 uint64_t list_size) { 62 uint64_t list_size) 63 { 63 64 64 65 data[CPU->arch.id][0] = (uint64_t) func; … … 70 71 71 72 return __hypercall_fast3(CPU_MONDO_SEND, list_size, 72 KA2PA(ipi_cpu_list[CPU->arch.id]), KA2PA(data[CPU->arch.id]));73 KA2PA(ipi_cpu_list[CPU->arch.id]), KA2PA(data[CPU->arch.id])); 73 74 } 74 75 … … 81 82 * @return error code returned by the CPU_MONDO_SEND hypercall 82 83 */ 83 uint64_t ipi_unicast_to(void (*func)(void), uint16_t cpu_id) { 84 uint64_t ipi_unicast_to(void (*func)(void), uint16_t cpu_id) 85 { 84 86 ipi_cpu_list[CPU->arch.id][0] = cpu_id; 85 87 return ipi_brodcast_to(func, ipi_cpu_list[CPU->arch.id], 1); … … 95 97 void ipi_broadcast_arch(int ipi) 96 98 { 97 void (* func)(void);99 void (*func)(void); 98 100 99 101 switch (ipi) { -
kernel/arch/sparc64/src/smp/sun4v/smp.c
r47b2d7e3 r1433ecda 88 88 * stored to the proposed_nrdy variable of the cpu_arch_t struture. 89 89 */ 90 bool calculate_optimal_nrdy(exec_unit_t *exec_unit) { 90 bool calculate_optimal_nrdy(exec_unit_t *exec_unit) 91 { 91 92 92 93 /* calculate the number of threads the core will steal */ … … 103 104 for (k = 0; k < exec_unit->strand_count; k++) { 104 105 exec_units->cpus[k]->arch.proposed_nrdy = 105 atomic_get(&(exec_unit->cpus[k]->nrdy));106 atomic_get(&(exec_unit->cpus[k]->nrdy)); 106 107 } 107 108 … … 112 113 unsigned int least_busy = 0; 113 114 unsigned int least_busy_nrdy = 114 exec_unit->cpus[0]->arch.proposed_nrdy;115 exec_unit->cpus[0]->arch.proposed_nrdy; 115 116 116 117 /* for each stolen thread, give it to the least busy CPU */ 117 118 for (k = 0; k < exec_unit->strand_count; k++) { 118 if (exec_unit->cpus[k]->arch.proposed_nrdy 119 < least_busy_nrdy) { 119 if (exec_unit->cpus[k]->arch.proposed_nrdy < least_busy_nrdy) { 120 120 least_busy = k; 121 121 least_busy_nrdy = 122 exec_unit->cpus[k]->arch.proposed_nrdy;122 exec_unit->cpus[k]->arch.proposed_nrdy; 123 123 } 124 124 } … … 247 247 exec_units[i].strand_count++; 248 248 max_core_strands = 249 exec_units[i].strand_count > max_core_strands ?250 exec_units[i].strand_count : max_core_strands;249 exec_units[i].strand_count > max_core_strands ? 250 exec_units[i].strand_count : max_core_strands; 251 251 252 252 /* detecting execution unit failed */ -
kernel/arch/sparc64/src/sun4u/sparc64.c
r47b2d7e3 r1433ecda 169 169 170 170 /* Not reached */ 171 while (1); 171 while (1) 172 ; 172 173 } 173 174 … … 175 176 { 176 177 // TODO 177 while (1); 178 while (1) 179 ; 178 180 } 179 181 -
kernel/arch/sparc64/src/sun4v/sparc64.c
r47b2d7e3 r1433ecda 167 167 168 168 /* Not reached */ 169 while (1); 169 while (1) 170 ; 170 171 } 171 172 … … 173 174 { 174 175 // TODO 175 while (1); 176 while (1) 177 ; 176 178 } 177 179 -
kernel/arch/sparc64/src/trap/sun4v/interrupt.c
r47b2d7e3 r1433ecda 74 74 */ 75 75 uint64_t cpu_mondo_queues[MAX_NUM_STRANDS][CPU_MONDO_QUEUE_SIZE] 76 __attribute__((aligned( 77 CPU_MONDO_QUEUE_SIZE * sizeof(uint64_t)))); 76 __attribute__((aligned(CPU_MONDO_QUEUE_SIZE * sizeof(uint64_t)))); 78 77 79 78 /** … … 83 82 { 84 83 if (__hypercall_fast3( 85 CPU_QCONF,86 CPU_MONDO_QUEUE_ID,87 KA2PA(cpu_mondo_queues[CPU->id]),88 CPU_MONDO_NENTRIES) != HV_EOK)89 panic("Initializing mondo queue failed on CPU %" PRIu64 ".\n",90 CPU->arch.id);84 CPU_QCONF, 85 CPU_MONDO_QUEUE_ID, 86 KA2PA(cpu_mondo_queues[CPU->id]), 87 CPU_MONDO_NENTRIES) != HV_EOK) 88 panic("Initializing mondo queue failed on CPU %" PRIu64 ".\n", 89 CPU->arch.id); 91 90 } 92 91
Note:
See TracChangeset
for help on using the changeset viewer.
