Changeset b2fa1204 in mainline for kernel/arch/ia32
- Timestamp:
- 2014-01-05T21:12:26Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ca05e9b
- Parents:
- bd6ff94
- Location:
- kernel/arch/ia32/src
- Files:
-
- 4 edited
-
drivers/i8259.c (modified) (2 diffs)
-
smp/apic.c (modified) (8 diffs)
-
smp/mps.c (modified) (9 diffs)
-
smp/smp.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/ia32/src/drivers/i8259.c
rbd6ff94 rb2fa1204 42 42 #include <arch/asm.h> 43 43 #include <arch.h> 44 #include < print.h>44 #include <log.h> 45 45 #include <interrupt.h> 46 46 … … 129 129 { 130 130 #ifdef CONFIG_DEBUG 131 printf("cpu%u: PIC spurious interrupt\n", CPU->id);131 log(LF_ARCH, LVL_DEBUG, "cpu%u: PIC spurious interrupt", CPU->id); 132 132 #endif 133 133 } -
kernel/arch/ia32/src/smp/apic.c
rbd6ff94 rb2fa1204 42 42 #include <interrupt.h> 43 43 #include <arch/interrupt.h> 44 #include < print.h>44 #include <log.h> 45 45 #include <arch/asm.h> 46 46 #include <arch.h> … … 135 135 { 136 136 #ifdef CONFIG_DEBUG 137 printf("cpu%u: APIC spurious interrupt\n", CPU->id);137 log(LF_ARCH, LVL_DEBUG, "cpu%u: APIC spurious interrupt", CPU->id); 138 138 #endif 139 139 } … … 241 241 esr.value = l_apic[ESR]; 242 242 243 if (esr.send_checksum_error) 244 printf("Send Checksum Error\n"); 245 if (esr.receive_checksum_error) 246 printf("Receive Checksum Error\n"); 247 if (esr.send_accept_error) 248 printf("Send Accept Error\n"); 249 if (esr.receive_accept_error) 250 printf("Receive Accept Error\n"); 251 if (esr.send_illegal_vector) 252 printf("Send Illegal Vector\n"); 253 if (esr.received_illegal_vector) 254 printf("Received Illegal Vector\n"); 255 if (esr.illegal_register_address) 256 printf("Illegal Register Address\n"); 243 if (esr.err_bitmap) { 244 log_begin(LF_ARCH, LVL_ERROR); 245 log_printf("APIC errors detected:"); 246 if (esr.send_checksum_error) 247 log_printf("\nSend Checksum Error"); 248 if (esr.receive_checksum_error) 249 log_printf("\nReceive Checksum Error"); 250 if (esr.send_accept_error) 251 log_printf("\nSend Accept Error"); 252 if (esr.receive_accept_error) 253 log_printf("\nReceive Accept Error"); 254 if (esr.send_illegal_vector) 255 log_printf("\nSend Illegal Vector"); 256 if (esr.received_illegal_vector) 257 log_printf("\nReceived Illegal Vector"); 258 if (esr.illegal_register_address) 259 log_printf("\nIllegal Register Address"); 260 log_end(); 261 } 257 262 258 263 return !esr.err_bitmap; … … 270 275 retries = 0; 271 276 #ifdef CONFIG_DEBUG 272 printf("IPI is pending.\n");277 log(LF_ARCH, LVL_DEBUG, "IPI is pending."); 273 278 #endif 274 279 delay(20); … … 489 494 { 490 495 #ifdef LAPIC_VERBOSE 491 printf("LVT on cpu%u, LAPIC ID: %" PRIu8 "\n", 496 log_begin(LF_ARCH, LVL_DEBUG); 497 log_printf("LVT on cpu%u, LAPIC ID: %" PRIu8 "\n", 492 498 CPU->id, l_apic_id()); 493 499 494 500 lvt_tm_t tm; 495 501 tm.value = l_apic[LVT_Tm]; 496 printf("LVT Tm: vector=%" PRIu8 ", %s, %s, %s\n",502 log_printf("LVT Tm: vector=%" PRIu8 ", %s, %s, %s\n", 497 503 tm.vector, delivs_str[tm.delivs], mask_str[tm.masked], 498 504 tm_mode_str[tm.mode]); … … 500 506 lvt_lint_t lint; 501 507 lint.value = l_apic[LVT_LINT0]; 502 printf("LVT LINT0: vector=%" PRIu8 ", %s, %s, %s, irr=%u, %s, %s\n",508 log_printf("LVT LINT0: vector=%" PRIu8 ", %s, %s, %s, irr=%u, %s, %s\n", 503 509 tm.vector, delmod_str[lint.delmod], delivs_str[lint.delivs], 504 510 intpol_str[lint.intpol], lint.irr, trigmod_str[lint.trigger_mode], … … 506 512 507 513 lint.value = l_apic[LVT_LINT1]; 508 printf("LVT LINT1: vector=%" PRIu8 ", %s, %s, %s, irr=%u, %s, %s\n",514 log_printf("LVT LINT1: vector=%" PRIu8 ", %s, %s, %s, irr=%u, %s, %s\n", 509 515 tm.vector, delmod_str[lint.delmod], delivs_str[lint.delivs], 510 516 intpol_str[lint.intpol], lint.irr, trigmod_str[lint.trigger_mode], … … 513 519 lvt_error_t error; 514 520 error.value = l_apic[LVT_Err]; 515 printf("LVT Err: vector=%" PRIu8 ", %s, %s\n", error.vector,521 log_printf("LVT Err: vector=%" PRIu8 ", %s, %s\n", error.vector, 516 522 delivs_str[error.delivs], mask_str[error.masked]); 523 log_end(); 517 524 #endif 518 525 } -
kernel/arch/ia32/src/smp/mps.c
rbd6ff94 rb2fa1204 36 36 37 37 #include <config.h> 38 #include < print.h>38 #include <log.h> 39 39 #include <debug.h> 40 40 #include <arch/smp/mps.h> … … 181 181 buf[6] = 0; 182 182 183 printf("MPS: bus=%" PRIu8 " (%s)\n", bus->bus_id, buf);183 log(LF_ARCH, LVL_DEBUG, "MPS: bus=%" PRIu8 " (%s)", bus->bus_id, buf); 184 184 #endif 185 185 } … … 205 205 { 206 206 #ifdef MPSCT_VERBOSE 207 printf("MPS: "); 207 log_begin(LF_ARCH, LVL_DEBUG); 208 log_printf("MPS: "); 208 209 209 210 switch (iointr->intr_type) { 210 211 case 0: 211 printf("INT");212 break; 213 case 1: 214 printf("NMI");215 break; 216 case 2: 217 printf("SMI");218 break; 219 case 3: 220 printf("ExtINT");221 break; 222 } 223 224 printf(", ");212 log_printf("INT"); 213 break; 214 case 1: 215 log_printf("NMI"); 216 break; 217 case 2: 218 log_printf("SMI"); 219 break; 220 case 3: 221 log_printf("ExtINT"); 222 break; 223 } 224 225 log_printf(", "); 225 226 226 227 switch (iointr->poel & 3) { 227 228 case 0: 228 printf("bus-like");229 break; 230 case 1: 231 printf("active high");232 break; 233 case 2: 234 printf("reserved");235 break; 236 case 3: 237 printf("active low");238 break; 239 } 240 241 printf(", ");229 log_printf("bus-like"); 230 break; 231 case 1: 232 log_printf("active high"); 233 break; 234 case 2: 235 log_printf("reserved"); 236 break; 237 case 3: 238 log_printf("active low"); 239 break; 240 } 241 242 log_printf(", "); 242 243 243 244 switch ((iointr->poel >> 2) & 3) { 244 245 case 0: 245 printf("bus-like");246 break; 247 case 1: 248 printf("edge-triggered");249 break; 250 case 2: 251 printf("reserved");252 break; 253 case 3: 254 printf("level-triggered");255 break; 256 } 257 258 printf(", bus=%" PRIu8 " irq=%" PRIu8 " io_apic=%" PRIu8" pin=%"259 PRIu8 "\n", iointr->src_bus_id, iointr->src_bus_irq,246 log_printf("bus-like"); 247 break; 248 case 1: 249 log_printf("edge-triggered"); 250 break; 251 case 2: 252 log_printf("reserved"); 253 break; 254 case 3: 255 log_printf("level-triggered"); 256 break; 257 } 258 259 log_printf(", bus=%" PRIu8 " irq=%" PRIu8 " io_apic=%" PRIu8" pin=%" 260 PRIu8, iointr->src_bus_id, iointr->src_bus_irq, 260 261 iointr->dst_io_apic_id, iointr->dst_io_apic_pin); 262 log_end(); 261 263 #endif 262 264 } … … 266 268 { 267 269 #ifdef MPSCT_VERBOSE 268 printf("MPS: "); 270 log_begin(LF_ARCH, LVL_DEBUG); 271 log_printf("MPS: "); 269 272 270 273 switch (lintr->intr_type) { 271 274 case 0: 272 printf("INT");273 break; 274 case 1: 275 printf("NMI");276 break; 277 case 2: 278 printf("SMI");279 break; 280 case 3: 281 printf("ExtINT");282 break; 283 } 284 285 printf(", ");275 log_printf("INT"); 276 break; 277 case 1: 278 log_printf("NMI"); 279 break; 280 case 2: 281 log_printf("SMI"); 282 break; 283 case 3: 284 log_printf("ExtINT"); 285 break; 286 } 287 288 log_printf(", "); 286 289 287 290 switch (lintr->poel & 3) { 288 291 case 0: 289 printf("bus-like");290 break; 291 case 1: 292 printf("active high");293 break; 294 case 2: 295 printf("reserved");296 break; 297 case 3: 298 printf("active low");299 break; 300 } 301 302 printf(", ");292 log_printf("bus-like"); 293 break; 294 case 1: 295 log_printf("active high"); 296 break; 297 case 2: 298 log_printf("reserved"); 299 break; 300 case 3: 301 log_printf("active low"); 302 break; 303 } 304 305 log_printf(", "); 303 306 304 307 switch ((lintr->poel >> 2) & 3) { 305 308 case 0: 306 printf("bus-like");307 break; 308 case 1: 309 printf("edge-triggered");310 break; 311 case 2: 312 printf("reserved");313 break; 314 case 3: 315 printf("level-triggered");316 break; 317 } 318 319 printf(", bus=%" PRIu8 " irq=%" PRIu8 " l_apic=%" PRIu8" pin=%"320 PRIu8 "\n", lintr->src_bus_id, lintr->src_bus_irq,309 log_printf("bus-like"); 310 break; 311 case 1: 312 log_printf("edge-triggered"); 313 break; 314 case 2: 315 log_printf("reserved"); 316 break; 317 case 3: 318 log_printf("level-triggered"); 319 break; 320 } 321 322 log_printf(", bus=%" PRIu8 " irq=%" PRIu8 " l_apic=%" PRIu8" pin=%" 323 PRIu8, lintr->src_bus_id, lintr->src_bus_irq, 321 324 lintr->dst_l_apic_id, lintr->dst_l_apic_pin); 325 log_end(); 322 326 #endif 323 327 } … … 332 336 switch (cur[CT_EXT_ENTRY_TYPE]) { 333 337 default: 334 printf("MPS: Skipping MP Configuration Table extended " 335 "entry type %" PRIu8 "\n", cur[CT_EXT_ENTRY_TYPE]); 338 log(LF_ARCH, LVL_NOTE, "MPS: Skipping MP Configuration" 339 " Table extended entry type %" PRIu8, 340 cur[CT_EXT_ENTRY_TYPE]); 336 341 } 337 342 } … … 341 346 { 342 347 if (ct->signature != CT_SIGNATURE) { 343 printf("MPS: Wrong ct->signature\n");348 log(LF_ARCH, LVL_WARN, "MPS: Wrong ct->signature"); 344 349 return; 345 350 } 346 351 347 352 if (!mps_ct_check()) { 348 printf("MPS: Wrong ct checksum\n");353 log(LF_ARCH, LVL_WARN, "MPS: Wrong ct checksum"); 349 354 return; 350 355 } 351 356 352 357 if (ct->oem_table) { 353 printf("MPS: ct->oem_table not supported\n");358 log(LF_ARCH, LVL_WARN, "MPS: ct->oem_table not supported"); 354 359 return; 355 360 } … … 402 407 * Something is wrong. Fallback to UP mode. 403 408 */ 404 printf("MPS: ct badness %" PRIu8 "\n", *cur);409 log(LF_ARCH, LVL_WARN, "MPS: ct badness %" PRIu8, *cur); 405 410 return; 406 411 } … … 418 423 * Not yet implemented. 419 424 */ 420 printf("MPS: Default configuration not supported\n");425 log(LF_ARCH, LVL_WARN, "MPS: Default configuration not supported"); 421 426 } 422 427 … … 449 454 450 455 fs_found: 451 printf("%p: MPS Floating Pointer Structure\n", fs);456 log(LF_ARCH, LVL_NOTE, "%p: MPS Floating Pointer Structure", fs); 452 457 453 458 if ((fs->config_type == 0) && (fs->configuration_table)) { 454 459 if (fs->mpfib2 >> 7) { 455 printf("MPS: PIC mode not supported\n");460 log(LF_ARCH, LVL_WARN, "MPS: PIC mode not supported\n"); 456 461 return; 457 462 } -
kernel/arch/ia32/src/smp/smp.c
rbd6ff94 rb2fa1204 52 52 #include <mm/slab.h> 53 53 #include <mm/as.h> 54 #include < print.h>54 #include <log.h> 55 55 #include <memstr.h> 56 56 #include <arch/drivers/i8259.h> … … 129 129 130 130 if (ops->cpu_apic_id(i) == bsp_l_apic) { 131 printf("kmp: bad processor entry #%u, will not send IPI"132 " to myself\n", i);131 log(LF_ARCH, LVL_ERROR, "kmp: bad processor entry #%u, " 132 "will not send IPI to myself", i); 133 133 continue; 134 134 } … … 162 162 if (waitq_sleep_timeout(&ap_completion_wq, 1000000, 163 163 SYNCH_FLAGS_NONE) == ESYNCH_TIMEOUT) { 164 printf("%s: waiting for cpu%u (APIC ID = %d)"165 " timed out\n", __FUNCTION__, i,166 ops->cpu_apic_id(i));164 log(LF_ARCH, LVL_NOTE, "%s: waiting for cpu%u " 165 "(APIC ID = %d) timed out", __FUNCTION__, 166 i, ops->cpu_apic_id(i)); 167 167 } 168 168 } else 169 printf("INIT IPI for l_apic%d failed\n",169 log(LF_ARCH, LVL_ERROR, "INIT IPI for l_apic%d failed", 170 170 ops->cpu_apic_id(i)); 171 171 }
Note:
See TracChangeset
for help on using the changeset viewer.
