Rev 2288 | Rev 2455 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2288 | Rev 2443 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2008. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 7... | Line 7... | ||
7 | 7 | ||
Line 8... | Line 8... | ||
8 | $Revision: 2288 $ |
8 | $Revision: 2443 $ |
9 | 9 | ||
10 | 10 | ||
Line 430... | Line 430... | ||
430 | shr eax, 8 |
430 | shr eax, 8 |
431 | and eax, 0x0f |
431 | and eax, 0x0f |
432 | ret |
432 | ret |
433 | endp |
433 | endp |
Line -... | Line 434... | ||
- | 434 | ||
- | 435 | iglobal |
|
- | 436 | align 4 |
|
- | 437 | acpi_lapic_base dd 0xfee00000 ; default local apic base |
|
- | 438 | endg |
|
434 | 439 | ||
435 | uglobal |
440 | uglobal |
436 | align 4 |
441 | align 4 |
437 | acpi_rsdp rd 1 |
442 | acpi_rsdp rd 1 |
438 | acpi_rsdt rd 1 |
443 | acpi_rsdt rd 1 |
Line 441... | Line 446... | ||
441 | acpi_dev_data rd 1 |
446 | acpi_dev_data rd 1 |
442 | acpi_dev_size rd 1 |
447 | acpi_dev_size rd 1 |
Line 443... | Line 448... | ||
443 | 448 | ||
444 | acpi_rsdt_base rd 1 |
449 | acpi_rsdt_base rd 1 |
445 | acpi_madt_base rd 1 |
- | |
446 | acpi_lapic_base rd 1 |
450 | acpi_madt_base rd 1 |
- | 451 | acpi_ioapic_base rd 1 |
|
- | 452 | ||
- | 453 | cpu_count rd 1 |
|
447 | acpi_ioapic_base rd 1 |
454 | smpt rd 16 |
Line 448... | Line 455... | ||
448 | endg |
455 | endg |
449 | 456 | ||
450 | ACPI_HI_RSDP_WINDOW_START equ 0x000E0000 |
457 | ACPI_HI_RSDP_WINDOW_START equ 0x000E0000 |
Line 491... | Line 498... | ||
491 | push esi |
498 | push esi |
Line 492... | Line 499... | ||
492 | 499 | ||
493 | lea ebx, [ecx+36] |
500 | lea ebx, [ecx+36] |
494 | mov esi, [ecx+4] |
501 | mov esi, [ecx+4] |
- | 502 | add esi, ecx |
|
495 | add esi, ecx |
503 | align 4 |
496 | .next: |
504 | .next: |
497 | mov eax, [ebx] |
505 | mov eax, [ebx] |
498 | cmp [eax], edx |
506 | cmp [eax], edx |
Line 511... | Line 519... | ||
511 | mov eax, [ebx] |
519 | mov eax, [ebx] |
512 | pop esi |
520 | pop esi |
513 | pop ebx |
521 | pop ebx |
514 | ret |
522 | ret |
Line 515... | Line -... | ||
515 | - | ||
516 | 523 | ||
517 | align 4 |
- | |
518 | 524 | align 4 |
|
Line 519... | Line 525... | ||
519 | check_acpi: |
525 | check_acpi: |
520 | 526 | ||
521 | call acpi_locate |
527 | call acpi_locate |
Line 531... | Line 537... | ||
531 | 537 | ||
532 | mov [acpi_madt_base-OS_BASE], eax |
538 | mov [acpi_madt_base-OS_BASE], eax |
533 | mov ecx, [eax+36] |
539 | mov ecx, [eax+36] |
Line -... | Line 540... | ||
- | 540 | mov [acpi_lapic_base-OS_BASE], ecx |
|
- | 541 | ||
- | 542 | mov edi, smpt-OS_BASE |
|
- | 543 | mov ebx, [ecx+0x20] |
|
- | 544 | shr ebx, 24 ; read APIC ID |
|
- | 545 | ||
- | 546 | mov [edi], ebx ; bootstrap always first |
|
- | 547 | inc [cpu_count-OS_BASE] |
|
534 | mov [acpi_lapic_base-OS_BASE], ecx |
548 | add edi, 4 |
535 | 549 | ||
536 | lea edx, [eax+44] |
550 | lea edx, [eax+44] |
537 | mov ecx, [eax+4] |
551 | mov ecx, [eax+4] |
538 | add ecx, eax |
552 | add ecx, eax |
539 | .check: |
553 | .check: |
540 | mov eax, [edx] |
554 | mov eax, [edx] |
Line -... | Line 555... | ||
- | 555 | cmp al, 0 |
|
- | 556 | jne .io_apic |
|
- | 557 | ||
- | 558 | shr eax, 24 ; get APIC ID |
|
- | 559 | cmp eax, ebx ; skip self |
|
- | 560 | je .next |
|
- | 561 | ||
- | 562 | test [edx+4], byte 1 ; is enabled ? |
|
- | 563 | jz .next |
|
- | 564 | ||
- | 565 | cmp [cpu_count-OS_BASE], 16 |
|
- | 566 | jae .next |
|
541 | cmp al, 1 |
567 | |
- | 568 | stosd ; store APIC ID |
|
542 | je .ioapic |
569 | inc [cpu_count-OS_BASE] |
543 | 570 | .next: |
|
544 | .next: |
571 | mov eax, [edx] |
545 | movzx eax, ah |
572 | movzx eax, ah |
546 | add edx, eax |
573 | add edx, eax |
547 | cmp edx, ecx |
574 | cmp edx, ecx |
- | 575 | jb .check |
|
548 | jb .check |
576 | .done: |
- | 577 | ret |
|
- | 578 | ||
- | 579 | .io_apic: |
|
549 | .done: |
580 | cmp al, 1 |
550 | ret |
581 | jne .next |
551 | .ioapic: |
582 |