Changeset 203 for trunk/hal/x86_64/core/hal_init.c
- Timestamp:
- Jul 13, 2017, 3:24:38 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/core/hal_init.c
r202 r203 419 419 /* -------------------------------------------------------------------------- */ 420 420 421 struct { 422 bool_t busy[256]; 423 } idt_bitmap __in_kdata; 424 425 int idt_slot_alloc() 426 { 427 size_t i; 428 429 for (i = 0; i < 256; i++) { 430 if (!idt_bitmap.busy[i]) 431 break; 432 } 433 if (i == 256) { 434 return -1; 435 } 436 437 idt_bitmap.busy[i] = true; 438 return (int)i; 439 } 440 441 void idt_slot_free(int slot) 442 { 443 idt_bitmap.busy[slot] = false; 444 } 445 421 446 static void 422 447 idt_set_seg(struct idt_seg *seg, void *func, int ist, int type, int dpl, int sel) … … 441 466 size_t i; 442 467 468 memset(&idt_bitmap, 0, sizeof(idt_bitmap)); 443 469 idt = (struct idt_seg *)&idtstore; 444 470 … … 453 479 idt_set_seg(&idt[i], (void *)x86_traps[i - CPUVEC_MIN], 0, 454 480 SDT_SYS386IGT, SEL_KPL, GDT_FIXED_SEL(GDT_KCODE_SEL, SEL_KPL)); 481 idt_bitmap.busy[i] = true; 455 482 } 456 483 … … 459 486 idt_set_seg(&idt[i], (void *)x86_intrs[i - DYNVEC_MIN], 0, 460 487 SDT_SYS386IGT, SEL_KPL, GDT_FIXED_SEL(GDT_KCODE_SEL, SEL_KPL)); 488 idt_bitmap.busy[i] = true; 461 489 } 462 490 }
Note: See TracChangeset
for help on using the changeset viewer.