Changeset 3bacee1 in mainline for kernel/arch
- Timestamp:
- 2018-04-12T16:27:17Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3cf22f9
- Parents:
- 76d0981d
- git-author:
- Jiri Svoboda <jiri@…> (2018-04-11 19:25:33)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-04-12 16:27:17)
- Location:
- kernel/arch
- Files:
-
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/amd64/include/arch/asm.h
r76d0981d r3bacee1 55 55 56 56 asm volatile ( 57 58 59 57 "andq %%rsp, %[v]\n" 58 : [v] "=r" (v) 59 : "0" (~((uint64_t) STACK_SIZE - 1)) 60 60 ); 61 61 … … 66 66 { 67 67 asm volatile ( 68 68 "hlt\n" 69 69 ); 70 70 } … … 74 74 while (true) { 75 75 asm volatile ( 76 76 "hlt\n" 77 77 ); 78 78 } … … 93 93 94 94 asm volatile ( 95 96 97 95 "inb %w[port], %b[val]\n" 96 : [val] "=a" (val) 97 : [port] "d" (port) 98 98 ); 99 99 … … 117 117 118 118 asm volatile ( 119 120 121 119 "inw %w[port], %w[val]\n" 120 : [val] "=a" (val) 121 : [port] "d" (port) 122 122 ); 123 123 … … 141 141 142 142 asm volatile ( 143 144 145 143 "inl %w[port], %[val]\n" 144 : [val] "=a" (val) 145 : [port] "d" (port) 146 146 ); 147 147 … … 163 163 if (port < (ioport8_t *) IO_SPACE_BOUNDARY) { 164 164 asm volatile ( 165 166 165 "outb %b[val], %w[port]\n" 166 :: [val] "a" (val), [port] "d" (port) 167 167 ); 168 168 } else … … 182 182 if (port < (ioport16_t *) IO_SPACE_BOUNDARY) { 183 183 asm volatile ( 184 185 184 "outw %w[val], %w[port]\n" 185 :: [val] "a" (val), [port] "d" (port) 186 186 ); 187 187 } else … … 201 201 if (port < (ioport32_t *) IO_SPACE_BOUNDARY) { 202 202 asm volatile ( 203 204 203 "outl %[val], %w[port]\n" 204 :: [val] "a" (val), [port] "d" (port) 205 205 ); 206 206 } else … … 213 213 214 214 asm volatile ( 215 216 217 215 "pushfq\n" 216 "popq %[v]\n" 217 : [v] "=r" (rflags) 218 218 ); 219 219 … … 224 224 { 225 225 asm volatile ( 226 227 228 226 "pushq %[v]\n" 227 "popfq\n" 228 :: [v] "r" (rflags) 229 229 ); 230 230 } … … 300 300 { 301 301 asm volatile ( 302 303 304 305 302 "wrmsr\n" 303 :: "c" (msr), 304 "a" ((uint32_t) (value)), 305 "d" ((uint32_t) (value >> 32)) 306 306 ); 307 307 } … … 312 312 313 313 asm volatile ( 314 315 316 314 "rdmsr\n" 315 : "=a" (ax), "=d" (dx) 316 : "c" (msr) 317 317 ); 318 318 … … 328 328 { 329 329 asm volatile ( 330 331 330 "invlpg %[addr]\n" 331 :: [addr] "m" (*((sysarg_t *) addr)) 332 332 ); 333 333 } … … 341 341 { 342 342 asm volatile ( 343 344 343 "lgdtq %[gdtr_reg]\n" 344 :: [gdtr_reg] "m" (*gdtr_reg) 345 345 ); 346 346 } … … 354 354 { 355 355 asm volatile ( 356 357 356 "sgdtq %[gdtr_reg]\n" 357 :: [gdtr_reg] "m" (*gdtr_reg) 358 358 ); 359 359 } … … 367 367 { 368 368 asm volatile ( 369 370 369 "lidtq %[idtr_reg]\n" 370 :: [idtr_reg] "m" (*idtr_reg)); 371 371 } 372 372 … … 379 379 { 380 380 asm volatile ( 381 382 381 "ltr %[sel]" 382 :: [sel] "r" (sel) 383 383 ); 384 384 } -
kernel/arch/amd64/src/amd64.c
r76d0981d r3bacee1 215 215 outdev_t **ns16550_out_ptr = NULL; 216 216 #endif 217 ns16550_instance_t *ns16550_instance 218 =ns16550_init(NS16550_BASE, 0, IRQ_NS16550, NULL, NULL,217 ns16550_instance_t *ns16550_instance = 218 ns16550_init(NS16550_BASE, 0, IRQ_NS16550, NULL, NULL, 219 219 ns16550_out_ptr); 220 220 if (ns16550_instance) { -
kernel/arch/arm32/include/arch/asm.h
r76d0981d r3bacee1 59 59 { 60 60 #ifdef PROCESSOR_ARCH_armv7_a 61 asm volatile ( "wfe");61 asm volatile ("wfe"); 62 62 #elif defined(PROCESSOR_ARCH_armv6) | defined(PROCESSOR_arm926ej_s) | defined(PROCESSOR_arm920t) 63 63 WFI_write(0); … … 107 107 108 108 asm volatile ( 109 110 111 109 "and %[v], sp, %[size]\n" 110 : [v] "=r" (v) 111 : [size] "r" (~(STACK_SIZE - 1)) 112 112 ); 113 113 -
kernel/arch/arm32/include/arch/security_ext.h
r76d0981d r3bacee1 77 77 static inline bool sec_ext_is_secure(void) 78 78 { 79 return sec_ext_is_implemented() 80 &&(sec_ext_is_monitor_mode() || !(SCR_read() & SCR_NS_FLAG));79 return sec_ext_is_implemented() && 80 (sec_ext_is_monitor_mode() || !(SCR_read() & SCR_NS_FLAG)); 81 81 } 82 82 -
kernel/arch/arm32/src/mach/raspberrypi/raspberrypi.c
r76d0981d r3bacee1 103 103 /* Initialize interrupt controller */ 104 104 raspi.irc = (void *) km_map(BCM2835_IRC_ADDR, sizeof(bcm2835_irc_t), 105 105 PAGE_NOT_CACHEABLE); 106 106 assert(raspi.irc); 107 107 bcm2835_irc_init(raspi.irc); … … 109 109 /* Initialize system timer */ 110 110 raspi.timer = (void *) km_map(BCM2835_TIMER_ADDR, 111 112 111 sizeof(bcm2835_timer_t), 112 PAGE_NOT_CACHEABLE); 113 113 } 114 114 … … 129 129 static void raspberrypi_cpu_halt(void) 130 130 { 131 while (true) ; 131 while (true) 132 ; 132 133 } 133 134 … … 184 185 #ifdef CONFIG_PL011_UART 185 186 if (pl011_uart_init(&raspi.uart, BCM2835_UART_IRQ, 186 187 BCM2835_UART0_BASE_ADDRESS)) 187 188 stdout_wire(&raspi.uart.outdev); 188 189 #endif -
kernel/arch/arm32/src/mm/page.c
r76d0981d r3bacee1 63 63 for (uintptr_t cur = PHYSMEM_START_ADDR; 64 64 cur < min(KA2PA(config.identity_base) + 65 65 config.identity_size, config.physmem_end); 66 66 cur += FRAME_SIZE) 67 67 page_mapping_insert(AS_KERNEL, PA2KA(cur), cur, flags); -
kernel/arch/ia32/include/arch/asm.h
r76d0981d r3bacee1 52 52 while (true) { 53 53 asm volatile ( 54 54 "hlt\n" 55 55 ); 56 56 } … … 60 60 { 61 61 asm volatile ( 62 62 "hlt\n" 63 63 ); 64 64 } … … 117 117 if (port < (ioport8_t *) IO_SPACE_BOUNDARY) { 118 118 asm volatile ( 119 120 119 "outb %b[val], %w[port]\n" 120 :: [val] "a" (val), [port] "d" (port) 121 121 ); 122 122 } else … … 136 136 if (port < (ioport16_t *) IO_SPACE_BOUNDARY) { 137 137 asm volatile ( 138 139 138 "outw %w[val], %w[port]\n" 139 :: [val] "a" (val), [port] "d" (port) 140 140 ); 141 141 } else … … 155 155 if (port < (ioport32_t *) IO_SPACE_BOUNDARY) { 156 156 asm volatile ( 157 158 157 "outl %[val], %w[port]\n" 158 :: [val] "a" (val), [port] "d" (port) 159 159 ); 160 160 } else … … 176 176 177 177 asm volatile ( 178 179 180 178 "inb %w[port], %b[val]\n" 179 : [val] "=a" (val) 180 : [port] "d" (port) 181 181 ); 182 182 … … 200 200 201 201 asm volatile ( 202 203 204 202 "inw %w[port], %w[val]\n" 203 : [val] "=a" (val) 204 : [port] "d" (port) 205 205 ); 206 206 … … 224 224 225 225 asm volatile ( 226 227 228 226 "inl %w[port], %[val]\n" 227 : [val] "=a" (val) 228 : [port] "d" (port) 229 229 ); 230 230 … … 239 239 240 240 asm volatile ( 241 242 243 241 "pushf\n" 242 "popl %[v]\n" 243 : [v] "=r" (eflags) 244 244 ); 245 245 … … 250 250 { 251 251 asm volatile ( 252 253 254 252 "pushl %[v]\n" 253 "popf\n" 254 :: [v] "r" (eflags) 255 255 ); 256 256 } … … 326 326 { 327 327 asm volatile ( 328 329 330 331 328 "wrmsr" 329 :: "c" (msr), 330 "a" ((uint32_t) (value)), 331 "d" ((uint32_t) (value >> 32)) 332 332 ); 333 333 } … … 338 338 339 339 asm volatile ( 340 341 342 343 340 "rdmsr" 341 : "=a" (ax), 342 "=d" (dx) 343 : "c" (msr) 344 344 ); 345 345 … … 362 362 363 363 asm volatile ( 364 365 366 364 "andl %%esp, %[v]\n" 365 : [v] "=r" (v) 366 : "0" (~(STACK_SIZE - 1)) 367 367 ); 368 368 … … 378 378 { 379 379 asm volatile ( 380 381 380 "invlpg %[addr]\n" 381 :: [addr] "m" (*(sysarg_t *) addr) 382 382 ); 383 383 } … … 391 391 { 392 392 asm volatile ( 393 394 393 "lgdtl %[gdtr_reg]\n" 394 :: [gdtr_reg] "m" (*gdtr_reg) 395 395 ); 396 396 } … … 404 404 { 405 405 asm volatile ( 406 407 406 "sgdtl %[gdtr_reg]\n" 407 : [gdtr_reg] "=m" (*gdtr_reg) 408 408 ); 409 409 } … … 417 417 { 418 418 asm volatile ( 419 420 419 "lidtl %[idtr_reg]\n" 420 :: [idtr_reg] "m" (*idtr_reg) 421 421 ); 422 422 } … … 430 430 { 431 431 asm volatile ( 432 433 432 "ltr %[sel]" 433 :: [sel] "r" (sel) 434 434 ); 435 435 } … … 443 443 { 444 444 asm volatile ( 445 446 445 "mov %[sel], %%gs" 446 :: [sel] "r" (sel) 447 447 ); 448 448 } -
kernel/arch/ia32/src/cpu/cpu.c
r76d0981d r3bacee1 101 101 if (CPU->arch.fi.bits.sse) { 102 102 asm volatile ( 103 104 105 106 107 103 "mov %%cr4, %[help]\n" 104 "or %[mask], %[help]\n" 105 "mov %[help], %%cr4\n" 106 : [help] "+r" (help) 107 : [mask] "i" (CR4_OSFXSR | CR4_OSXMMEXCPT) 108 108 ); 109 109 } … … 128 128 * Check for AMD processor. 129 129 */ 130 if ((info.cpuid_ebx == AMD_CPUID_EBX) 131 && (info.cpuid_ecx == AMD_CPUID_ECX)132 &&(info.cpuid_edx == AMD_CPUID_EDX))130 if ((info.cpuid_ebx == AMD_CPUID_EBX) && 131 (info.cpuid_ecx == AMD_CPUID_ECX) && 132 (info.cpuid_edx == AMD_CPUID_EDX)) 133 133 CPU->arch.vendor = VendorAMD; 134 134 … … 136 136 * Check for Intel processor. 137 137 */ 138 if ((info.cpuid_ebx == INTEL_CPUID_EBX) 139 && (info.cpuid_ecx == INTEL_CPUID_ECX)140 &&(info.cpuid_edx == INTEL_CPUID_EDX))138 if ((info.cpuid_ebx == INTEL_CPUID_EBX) && 139 (info.cpuid_ecx == INTEL_CPUID_ECX) && 140 (info.cpuid_edx == INTEL_CPUID_EDX)) 141 141 CPU->arch.vendor = VendorIntel; 142 142 … … 148 148 } 149 149 150 void cpu_print_report(cpu_t *cpu)150 void cpu_print_report(cpu_t *cpu) 151 151 { 152 152 printf("cpu%u: (%s family=%u model=%u stepping=%u apicid=%u) %" PRIu16 153 154 153 " MHz\n", cpu->id, vendor_str[cpu->arch.vendor], cpu->arch.family, 154 cpu->arch.model, cpu->arch.stepping, cpu->arch.id, cpu->frequency_mhz); 155 155 } 156 156 -
kernel/arch/ia32/src/ia32.c
r76d0981d r3bacee1 200 200 outdev_t **ns16550_out_ptr = NULL; 201 201 #endif 202 ns16550_instance_t *ns16550_instance 203 =ns16550_init(NS16550_BASE, 0, IRQ_NS16550, NULL, NULL,202 ns16550_instance_t *ns16550_instance = 203 ns16550_init(NS16550_BASE, 0, IRQ_NS16550, NULL, NULL, 204 204 ns16550_out_ptr); 205 205 if (ns16550_instance) { -
kernel/arch/ia64/src/drivers/ski.c
r76d0981d r3bacee1 84 84 85 85 asm volatile ( 86 87 88 89 90 91 92 86 "mov r15 = %1\n" 87 "break 0x80000;;\n" /* modifies r8 */ 88 "mov %0 = r8;;\n" 89 90 : "=r" (ch) 91 : "i" (SKI_GETCHAR) 92 : "r15", "r8" 93 93 ); 94 94 … … 143 143 144 144 asm volatile ( 145 146 147 148 149 145 "mov r15 = %0\n" 146 "break 0x80000\n" 147 : 148 : "i" (SKI_INIT_CONSOLE) 149 : "r15", "r8" 150 150 ); 151 151 … … 169 169 { 170 170 asm volatile ( 171 172 173 174 175 176 171 "mov r15 = %[cmd]\n" 172 "mov r32 = %[ch]\n" /* r32 is in0 */ 173 "break 0x80000\n" /* modifies r8 */ 174 : 175 : [cmd] "i" (SKI_PUTCHAR), [ch] "r" (ch) 176 : "r15", "in0", "r8" 177 177 ); 178 178 } -
kernel/arch/ia64/src/ia64.c
r76d0981d r3bacee1 181 181 182 182 #ifdef CONFIG_NS16550 183 ns16550_instance_t *ns16550_instance 184 =ns16550_init(NS16550_BASE, 0, NS16550_IRQ, NULL, NULL,183 ns16550_instance_t *ns16550_instance = 184 ns16550_init(NS16550_BASE, 0, NS16550_IRQ, NULL, NULL, 185 185 NULL); 186 186 if (ns16550_instance) { … … 253 253 (uintptr_t) kernel_uarg->uspace_uarg, psr.value, rsc.value); 254 254 255 while (true); 255 while (true) 256 ; 256 257 } 257 258 … … 259 260 { 260 261 pio_write_8((ioport8_t *)0x64, 0xfe); 261 while (true); 262 while (true) 263 ; 262 264 } 263 265 -
kernel/arch/ia64/src/interrupt.c
r76d0981d r3bacee1 229 229 { 230 230 asm volatile ( 231 231 "mov cr.eoi = r0 ;;" 232 232 ); 233 233 } … … 245 245 case INTERRUPT_SPURIOUS: 246 246 #ifdef CONFIG_DEBUG 247 247 printf("cpu%d: spurious interrupt\n", CPU->id); 248 248 #endif 249 249 break; -
kernel/arch/mips32/include/arch/asm.h
r76d0981d r3bacee1 57 57 58 58 asm volatile ( 59 60 61 59 "and %[base], $29, %[mask]\n" 60 : [base] "=r" (base) 61 : [mask] "r" (~(STACK_SIZE - 1)) 62 62 ); 63 63 -
kernel/arch/mips32/include/arch/mm/tlb.h
r76d0981d r3bacee1 82 82 unsigned : 2; /* zero */ 83 83 #endif 84 } __attribute__ 84 } __attribute__((packed)); 85 85 uint32_t value; 86 86 } entry_lo_t; … … 97 97 unsigned vpn2 : 19; 98 98 #endif 99 } __attribute__ 99 } __attribute__((packed)); 100 100 uint32_t value; 101 101 } entry_hi_t; … … 112 112 unsigned : 7; 113 113 #endif 114 } __attribute__ 114 } __attribute__((packed)); 115 115 uint32_t value; 116 116 } page_mask_t; … … 127 127 unsigned p : 1; 128 128 #endif 129 } __attribute__ 129 } __attribute__((packed)); 130 130 uint32_t value; 131 131 } tlb_index_t; -
kernel/arch/mips32/src/debugger.c
r76d0981d r3bacee1 102 102 uint32_t value; 103 103 } jmpinstr[] = { 104 { 0xf3ff0000, 0x41000000}, /* BCzF */105 { 0xf3ff0000, 0x41020000}, /* BCzFL */106 { 0xf3ff0000, 0x41010000}, /* BCzT */107 { 0xf3ff0000, 0x41030000}, /* BCzTL */108 { 0xfc000000, 0x10000000}, /* BEQ */109 { 0xfc000000, 0x50000000}, /* BEQL */110 { 0xfc1f0000, 0x04010000}, /* BEQL */111 { 0xfc1f0000, 0x04110000}, /* BGEZAL */112 { 0xfc1f0000, 0x04130000}, /* BGEZALL */113 { 0xfc1f0000, 0x04030000}, /* BGEZL */114 { 0xfc1f0000, 0x1c000000}, /* BGTZ */115 { 0xfc1f0000, 0x5c000000}, /* BGTZL */116 { 0xfc1f0000, 0x18000000}, /* BLEZ */117 { 0xfc1f0000, 0x58000000}, /* BLEZL */118 { 0xfc1f0000, 0x04000000}, /* BLTZ */119 { 0xfc1f0000, 0x04100000}, /* BLTZAL */120 { 0xfc1f0000, 0x04120000}, /* BLTZALL */121 { 0xfc1f0000, 0x04020000}, /* BLTZL */122 { 0xfc000000, 0x14000000}, /* BNE */123 { 0xfc000000, 0x54000000}, /* BNEL */124 { 0xfc000000, 0x08000000}, /* J */125 { 0xfc000000, 0x0c000000}, /* JAL */126 { 0xfc1f07ff, 0x00000009}, /* JALR */127 { 0, 0} /* end of table */104 { 0xf3ff0000, 0x41000000 }, /* BCzF */ 105 { 0xf3ff0000, 0x41020000 }, /* BCzFL */ 106 { 0xf3ff0000, 0x41010000 }, /* BCzT */ 107 { 0xf3ff0000, 0x41030000 }, /* BCzTL */ 108 { 0xfc000000, 0x10000000 }, /* BEQ */ 109 { 0xfc000000, 0x50000000 }, /* BEQL */ 110 { 0xfc1f0000, 0x04010000 }, /* BEQL */ 111 { 0xfc1f0000, 0x04110000 }, /* BGEZAL */ 112 { 0xfc1f0000, 0x04130000 }, /* BGEZALL */ 113 { 0xfc1f0000, 0x04030000 }, /* BGEZL */ 114 { 0xfc1f0000, 0x1c000000 }, /* BGTZ */ 115 { 0xfc1f0000, 0x5c000000 }, /* BGTZL */ 116 { 0xfc1f0000, 0x18000000 }, /* BLEZ */ 117 { 0xfc1f0000, 0x58000000 }, /* BLEZL */ 118 { 0xfc1f0000, 0x04000000 }, /* BLTZ */ 119 { 0xfc1f0000, 0x04100000 }, /* BLTZAL */ 120 { 0xfc1f0000, 0x04120000 }, /* BLTZALL */ 121 { 0xfc1f0000, 0x04020000 }, /* BLTZL */ 122 { 0xfc000000, 0x14000000 }, /* BNE */ 123 { 0xfc000000, 0x54000000 }, /* BNEL */ 124 { 0xfc000000, 0x08000000 }, /* J */ 125 { 0xfc000000, 0x0c000000 }, /* JAL */ 126 { 0xfc1f07ff, 0x00000009 }, /* JALR */ 127 { 0, 0 } /* end of table */ 128 128 }; 129 129 … … 273 273 breakpoints[i].counter, (void *) breakpoints[i].address, 274 274 ((breakpoints[i].flags & BKPOINT_INPROG) ? "true" : 275 "false"), ((breakpoints[i].flags & BKPOINT_ONESHOT) 276 ?"true" : "false"), ((breakpoints[i].flags &275 "false"), ((breakpoints[i].flags & BKPOINT_ONESHOT) ? 276 "true" : "false"), ((breakpoints[i].flags & 277 277 BKPOINT_FUNCCALL) ? "true" : "false"), symbol); 278 278 } … … 382 382 smc_coherence(cur->address); 383 383 384 if (! 384 if (!(cur->flags & BKPOINT_ONESHOT)) { 385 385 /* Set Breakpoint on next instruction */ 386 386 ((uint32_t *)cur->address)[1] = 0x0d; … … 422 422 } 423 423 424 if ((cur) && (cur->address == fireaddr) 425 &&((cur->flags & BKPOINT_INPROG))) {424 if ((cur) && (cur->address == fireaddr) && 425 ((cur->flags & BKPOINT_INPROG))) { 426 426 /* Remove one-shot breakpoint */ 427 427 if ((cur->flags & BKPOINT_ONESHOT)) -
kernel/arch/mips32/src/mach/msim/msim.c
r76d0981d r3bacee1 94 94 * interrupts. 95 95 */ 96 dsrlnin_instance_t *dsrlnin_instance 97 =dsrlnin_init((dsrlnin_t *) MSIM_KBD_ADDRESS, MSIM_KBD_IRQ);96 dsrlnin_instance_t *dsrlnin_instance = 97 dsrlnin_init((dsrlnin_t *) MSIM_KBD_ADDRESS, MSIM_KBD_IRQ); 98 98 if (dsrlnin_instance) { 99 99 srln_instance_t *srln_instance = srln_init(); -
kernel/arch/mips32/src/mm/km.c
r76d0981d r3bacee1 51 51 bool km_is_non_identity_arch(uintptr_t addr) 52 52 { 53 return iswithin(KM_MIPS32_KSSEG_START, KM_MIPS32_KSSEG_SIZE, addr, 1) 54 ||iswithin(KM_MIPS32_KSEG3_START, KM_MIPS32_KSEG3_SIZE, addr, 1);53 return iswithin(KM_MIPS32_KSSEG_START, KM_MIPS32_KSSEG_SIZE, addr, 1) || 54 iswithin(KM_MIPS32_KSEG3_START, KM_MIPS32_KSEG3_SIZE, addr, 1); 55 55 } 56 56 -
kernel/arch/ppc32/src/mm/pht.c
r76d0981d r3bacee1 109 109 /* Find colliding PTE in PTEG */ 110 110 for (i = 0; i < 8; i++) { 111 if ((phte[base + i].v) 112 && (phte[base + i].vsid == vsid)113 && (phte[base + i].api == api)114 &&(phte[base + i].h == 0)) {111 if ((phte[base + i].v) && 112 (phte[base + i].vsid == vsid) && 113 (phte[base + i].api == api) && 114 (phte[base + i].h == 0)) { 115 115 found = true; 116 116 break; … … 134 134 /* Find colliding PTE in PTEG */ 135 135 for (i = 0; i < 8; i++) { 136 if ((phte[base2 + i].v) 137 && (phte[base2 + i].vsid == vsid)138 && (phte[base2 + i].api == api)139 &&(phte[base2 + i].h == 1)) {136 if ((phte[base2 + i].v) && 137 (phte[base2 + i].vsid == vsid) && 138 (phte[base2 + i].api == api) && 139 (phte[base2 + i].h == 1)) { 140 140 found = true; 141 141 base = base2; -
kernel/arch/ppc32/src/ppc32.c
r76d0981d r3bacee1 185 185 fb_scanline = *((uint32_t *) prop->value); 186 186 187 if ((fb_addr) && (fb_width > 0) && (fb_height > 0) 188 &&(fb_scanline > 0) && (visual != VISUAL_UNKNOWN)) {187 if ((fb_addr) && (fb_width > 0) && (fb_height > 0) && 188 (fb_scanline > 0) && (visual != VISUAL_UNKNOWN)) { 189 189 fb_properties_t fb_prop = { 190 190 .addr = fb_addr, … … 301 301 302 302 /* Unreachable */ 303 while (true); 303 while (true) 304 ; 304 305 } 305 306 … … 321 322 { 322 323 // TODO 323 while (true); 324 while (true) 325 ; 324 326 } 325 327 -
kernel/arch/sparc64/include/arch/asm.h
r76d0981d r3bacee1 93 93 94 94 asm volatile ( 95 96 95 "rdpr %%pstate, %[v]\n" 96 : [v] "=r" (v) 97 97 ); 98 98 … … 108 108 { 109 109 asm volatile ( 110 111 112 110 "wrpr %[v], %[zero], %%pstate\n" 111 :: [v] "r" (v), 112 [zero] "i" (0) 113 113 ); 114 114 } … … 124 124 125 125 asm volatile ( 126 127 126 "rd %%tick_cmpr, %[v]\n" 127 : [v] "=r" (v) 128 128 ); 129 129 … … 139 139 { 140 140 asm volatile ( 141 142 143 141 "wr %[v], %[zero], %%tick_cmpr\n" 142 :: [v] "r" (v), 143 [zero] "i" (0) 144 144 ); 145 145 } … … 155 155 156 156 asm volatile ( 157 158 157 "rd %%asr25, %[v]\n" 158 : [v] "=r" (v) 159 159 ); 160 160 … … 170 170 { 171 171 asm volatile ( 172 173 174 172 "wr %[v], %[zero], %%asr25\n" 173 :: [v] "r" (v), 174 [zero] "i" (0) 175 175 ); 176 176 } … … 186 186 187 187 asm volatile ( 188 189 188 "rdpr %%tick, %[v]\n" 189 : [v] "=r" (v) 190 190 ); 191 191 … … 201 201 { 202 202 asm volatile ( 203 204 205 203 "wrpr %[v], %[zero], %%tick\n" 204 :: [v] "r" (v), 205 [zero] "i" (0) 206 206 ); 207 207 } … … 217 217 218 218 asm volatile ( 219 220 219 "rd %%fprs, %[v]\n" 220 : [v] "=r" (v) 221 221 ); 222 222 … … 232 232 { 233 233 asm volatile ( 234 235 236 234 "wr %[v], %[zero], %%fprs\n" 235 :: [v] "r" (v), 236 [zero] "i" (0) 237 237 ); 238 238 } … … 248 248 249 249 asm volatile ( 250 251 250 "rd %%softint, %[v]\n" 251 : [v] "=r" (v) 252 252 ); 253 253 … … 263 263 { 264 264 asm volatile ( 265 266 267 265 "wr %[v], %[zero], %%softint\n" 266 :: [v] "r" (v), 267 [zero] "i" (0) 268 268 ); 269 269 } … … 279 279 { 280 280 asm volatile ( 281 282 283 281 "wr %[v], %[zero], %%clear_softint\n" 282 :: [v] "r" (v), 283 [zero] "i" (0) 284 284 ); 285 285 } … … 295 295 { 296 296 asm volatile ( 297 298 299 297 "wr %[v], %[zero], %%set_softint\n" 298 :: [v] "r" (v), 299 [zero] "i" (0) 300 300 ); 301 301 } … … 309 309 * 310 310 */ 311 NO_TRACE static inline ipl_t interrupts_enable(void) { 311 NO_TRACE static inline ipl_t interrupts_enable(void) 312 { 312 313 pstate_reg_t pstate; 313 314 uint64_t value = pstate_read(); … … 328 329 * 329 330 */ 330 NO_TRACE static inline ipl_t interrupts_disable(void) { 331 NO_TRACE static inline ipl_t interrupts_disable(void) 332 { 331 333 pstate_reg_t pstate; 332 334 uint64_t value = pstate_read(); … … 346 348 * 347 349 */ 348 NO_TRACE static inline void interrupts_restore(ipl_t ipl) { 350 NO_TRACE static inline void interrupts_restore(ipl_t ipl) 351 { 349 352 pstate_reg_t pstate; 350 353 … … 361 364 * 362 365 */ 363 NO_TRACE static inline ipl_t interrupts_read(void) { 366 NO_TRACE static inline ipl_t interrupts_read(void) 367 { 364 368 return (ipl_t) pstate_read(); 365 369 } … … 390 394 391 395 asm volatile ( 392 393 394 396 "add %%sp, %[stack_bias], %[unbiased_sp]\n" 397 : [unbiased_sp] "=r" (unbiased_sp) 398 : [stack_bias] "i" (STACK_BIAS) 395 399 ); 396 400 … … 408 412 409 413 asm volatile ( 410 411 414 "rdpr %%ver, %[v]\n" 415 : [v] "=r" (v) 412 416 ); 413 417 … … 425 429 426 430 asm volatile ( 427 428 431 "rdpr %%tpc, %[v]\n" 432 : [v] "=r" (v) 429 433 ); 430 434 … … 442 446 443 447 asm volatile ( 444 445 448 "rdpr %%tl, %[v]\n" 449 : [v] "=r" (v) 446 450 ); 447 451 … … 459 463 460 464 asm volatile ( 461 462 465 "rdpr %%tba, %[v]\n" 466 : [v] "=r" (v) 463 467 ); 464 468 … … 474 478 { 475 479 asm volatile ( 476 477 478 480 "wrpr %[v], %[zero], %%tba\n" 481 :: [v] "r" (v), 482 [zero] "i" (0) 479 483 ); 480 484 } … … 494 498 495 499 asm volatile ( 496 497 498 499 500 "ldxa [%[va]] %[asi], %[v]\n" 501 : [v] "=r" (v) 502 : [va] "r" (va), 503 [asi] "i" ((unsigned int) asi) 500 504 ); 501 505 … … 513 517 { 514 518 asm volatile ( 515 516 517 518 519 519 "stxa %[v], [%[va]] %[asi]\n" 520 :: [v] "r" (v), 521 [va] "r" (va), 522 [asi] "i" ((unsigned int) asi) 523 : "memory" 520 524 ); 521 525 } -
kernel/arch/sparc64/src/fpu_context.c
r76d0981d r3bacee1 41 41 { 42 42 asm volatile ( 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 43 "std %%f0, %0\n" 44 "std %%f2, %1\n" 45 "std %%f4, %2\n" 46 "std %%f6, %3\n" 47 "std %%f8, %4\n" 48 "std %%f10, %5\n" 49 "std %%f12, %6\n" 50 "std %%f14, %7\n" 51 "std %%f16, %8\n" 52 "std %%f18, %9\n" 53 "std %%f20, %10\n" 54 "std %%f22, %11\n" 55 "std %%f24, %12\n" 56 "std %%f26, %13\n" 57 "std %%f28, %14\n" 58 "std %%f30, %15\n" 59 : "=m" (fctx->d[0]), "=m" (fctx->d[1]), "=m" (fctx->d[2]), "=m" (fctx->d[3]), 60 "=m" (fctx->d[4]), "=m" (fctx->d[5]), "=m" (fctx->d[6]), "=m" (fctx->d[7]), 61 "=m" (fctx->d[8]), "=m" (fctx->d[9]), "=m" (fctx->d[10]), "=m" (fctx->d[11]), 62 "=m" (fctx->d[12]), "=m" (fctx->d[13]), "=m" (fctx->d[14]), "=m" (fctx->d[15]) 63 63 ); 64 64 … … 69 69 70 70 asm volatile ( 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 71 "std %%f32, %0\n" 72 "std %%f34, %1\n" 73 "std %%f36, %2\n" 74 "std %%f38, %3\n" 75 "std %%f40, %4\n" 76 "std %%f42, %5\n" 77 "std %%f44, %6\n" 78 "std %%f46, %7\n" 79 "std %%f48, %8\n" 80 "std %%f50, %9\n" 81 "std %%f52, %10\n" 82 "std %%f54, %11\n" 83 "std %%f56, %12\n" 84 "std %%f58, %13\n" 85 "std %%f60, %14\n" 86 "std %%f62, %15\n" 87 : "=m" (fctx->d[16]), "=m" (fctx->d[17]), "=m" (fctx->d[18]), "=m" (fctx->d[19]), 88 "=m" (fctx->d[20]), "=m" (fctx->d[21]), "=m" (fctx->d[22]), "=m" (fctx->d[23]), 89 "=m" (fctx->d[24]), "=m" (fctx->d[25]), "=m" (fctx->d[26]), "=m" (fctx->d[27]), 90 "=m" (fctx->d[28]), "=m" (fctx->d[29]), "=m" (fctx->d[30]), "=m" (fctx->d[31]) 91 91 ); 92 92 … … 97 97 { 98 98 asm volatile ( 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 99 "ldd %0, %%f0\n" 100 "ldd %1, %%f2\n" 101 "ldd %2, %%f4\n" 102 "ldd %3, %%f6\n" 103 "ldd %4, %%f8\n" 104 "ldd %5, %%f10\n" 105 "ldd %6, %%f12\n" 106 "ldd %7, %%f14\n" 107 "ldd %8, %%f16\n" 108 "ldd %9, %%f18\n" 109 "ldd %10, %%f20\n" 110 "ldd %11, %%f22\n" 111 "ldd %12, %%f24\n" 112 "ldd %13, %%f26\n" 113 "ldd %14, %%f28\n" 114 "ldd %15, %%f30\n" 115 : 116 : "m" (fctx->d[0]), "m" (fctx->d[1]), "m" (fctx->d[2]), "m" (fctx->d[3]), 117 "m" (fctx->d[4]), "m" (fctx->d[5]), "m" (fctx->d[6]), "m" (fctx->d[7]), 118 "m" (fctx->d[8]), "m" (fctx->d[9]), "m" (fctx->d[10]), "m" (fctx->d[11]), 119 "m" (fctx->d[12]), "m" (fctx->d[13]), "m" (fctx->d[14]), "m" (fctx->d[15]) 120 120 ); 121 121 … … 126 126 127 127 asm volatile ( 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 128 "ldd %0, %%f32\n" 129 "ldd %1, %%f34\n" 130 "ldd %2, %%f36\n" 131 "ldd %3, %%f38\n" 132 "ldd %4, %%f40\n" 133 "ldd %5, %%f42\n" 134 "ldd %6, %%f44\n" 135 "ldd %7, %%f46\n" 136 "ldd %8, %%f48\n" 137 "ldd %9, %%f50\n" 138 "ldd %10, %%f52\n" 139 "ldd %11, %%f54\n" 140 "ldd %12, %%f56\n" 141 "ldd %13, %%f58\n" 142 "ldd %14, %%f60\n" 143 "ldd %15, %%f62\n" 144 : 145 : "m" (fctx->d[16]), "m" (fctx->d[17]), "m" (fctx->d[18]), "m" (fctx->d[19]), 146 "m" (fctx->d[20]), "m" (fctx->d[21]), "m" (fctx->d[22]), "m" (fctx->d[23]), 147 "m" (fctx->d[24]), "m" (fctx->d[25]), "m" (fctx->d[26]), "m" (fctx->d[27]), 148 "m" (fctx->d[28]), "m" (fctx->d[29]), "m" (fctx->d[30]), "m" (fctx->d[31]) 149 149 ); 150 150 -
kernel/arch/sparc64/src/sun4v/md.c
r76d0981d r3bacee1 62 62 uint32_t name_blk_sz; /**< Size in bytes of name block */ 63 63 uint32_t data_blk_sz; /**< Size in bytes of data block */ 64 } __attribute__ 64 } __attribute__((packed)) md_header_t; 65 65 66 66 /** machine description element (in the node block) */ … … 91 91 uint64_t val; 92 92 } d; 93 } __attribute__ 93 } __attribute__((packed)) md_element_t; 94 94 95 95 /** index of the element within the node block */ … … 98 98 /** buffer to which the machine description will be saved */ 99 99 static uint8_t mach_desc[MD_MAX_SIZE] 100 __attribute__ ((aligned(16)));100 __attribute__((aligned(16))); 101 101 102 102 … … 129 129 */ 130 130 bool md_get_integer_property(md_node_t node, const char *key, 131 131 uint64_t *result) 132 132 { 133 133 element_idx_t idx = node; … … 152 152 */ 153 153 bool md_get_string_property(md_node_t node, const char *key, 154 154 const char **result) 155 155 { 156 156 md_header_t *md_header = (md_header_t *) mach_desc;
Note:
See TracChangeset
for help on using the changeset viewer.