| 477 | } |
| 478 | |
| 479 | U32 CPU::lar(U32 selector, U32 ar) { |
| 480 | this->fillFlags(); |
| 481 | if (selector == 0 || selector>=LDT_ENTRIES) { |
| 482 | this->flags &=~ZF; |
| 483 | return ar; |
| 484 | } |
| 485 | struct user_desc* ldt = this->thread->getLDT(selector >> 3); |
| 486 | this->flags |= ZF; |
| 487 | ar = 0; |
| 488 | if (!ldt->seg_not_present) |
| 489 | ar|=0x0100; |
| 490 | ar|=0x0600; // ring 3 (dpl) |
| 491 | ar|=0x0800; // not system |
| 492 | // bits 5,6,7 = type, hopefully not used |
| 493 | ar|=0x8000; // accessed; |
| 494 | return ar; |
| 495 | } |
| 496 | |
| 497 | U32 CPU::lsl(U32 selector, U32 limit) { |
| 498 | this->fillFlags(); |
no test coverage detected