Rev 5565 | Rev 5645 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5565 | Rev 5629 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2015. 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: 5565 $ |
8 | $Revision: 5629 $ |
9 | 9 | ||
10 | 10 | ||
Line 433... | Line 433... | ||
433 | acpi_fadt_base rd 1 |
433 | acpi_fadt_base rd 1 |
434 | acpi_dsdt_base rd 1 |
434 | acpi_dsdt_base rd 1 |
435 | acpi_dsdt_size rd 1 |
435 | acpi_dsdt_size rd 1 |
436 | acpi_madt_base rd 1 |
436 | acpi_madt_base rd 1 |
437 | acpi_ioapic_base rd 1 |
437 | acpi_ioapic_base rd 1 |
- | 438 | acpi_hpet_base rd 1 |
|
- | 439 | hpet_base rd 1 |
|
- | 440 | hpet_period rd 1 |
|
Line 438... | Line 441... | ||
438 | 441 | ||
439 | cpu_count rd 1 |
442 | cpu_count rd 1 |
440 | smpt rd 16 |
443 | smpt rd 16 |
Line 441... | Line 444... | ||
441 | endg |
444 | endg |
442 | 445 | ||
443 | ACPI_HI_RSDP_WINDOW_START equ 0x000E0000 |
446 | ACPI_HI_RSDP_WINDOW_START equ 0x000E0000 |
- | 447 | ACPI_HI_RSDP_WINDOW_END equ 0x00100000 |
|
- | 448 | ACPI_RSDP_CHECKSUM_LENGTH equ 20 |
|
444 | ACPI_HI_RSDP_WINDOW_END equ 0x00100000 |
449 | |
445 | ACPI_RSDP_CHECKSUM_LENGTH equ 20 |
450 | ACPI_HPET_SIGN equ 0x54455048 |
Line 446... | Line 451... | ||
446 | ACPI_MADT_SIGN equ 0x43495041 |
451 | ACPI_MADT_SIGN equ 0x43495041 |
Line 514... | Line 519... | ||
514 | call acpi_locate |
519 | call acpi_locate |
515 | test eax, eax |
520 | test eax, eax |
516 | jz .done |
521 | jz .done |
Line 517... | Line 522... | ||
517 | 522 | ||
518 | mov ecx, [eax+16] |
523 | mov ecx, [eax+16] |
519 | mov edx, 0x50434146 |
524 | mov edx, ACPI_FADT_SIGN |
520 | mov [acpi_rsdt_base-OS_BASE], ecx |
525 | mov [acpi_rsdt_base-OS_BASE], ecx |
521 | call rsdt_find |
526 | call rsdt_find |
522 | mov [acpi_fadt_base-OS_BASE], eax |
527 | mov [acpi_fadt_base-OS_BASE], eax |
523 | test eax, eax |
528 | test eax, eax |
Line 524... | Line 529... | ||
524 | jz @f |
529 | jz @f |
525 | 530 | ||
526 | mov eax, [eax+40] |
531 | mov eax, [eax+40] |
527 | mov [acpi_dsdt_base-OS_BASE], eax |
532 | mov [acpi_dsdt_base-OS_BASE], eax |
- | 533 | mov eax, [eax+4] |
|
- | 534 | mov [acpi_dsdt_size-OS_BASE], eax |
|
- | 535 | @@: |
|
- | 536 | mov edx, ACPI_HPET_SIGN |
|
- | 537 | mov ecx, [acpi_rsdt_base-OS_BASE] |
|
- | 538 | call rsdt_find |
|
Line -... | Line 539... | ||
- | 539 | test eax, eax |
|
- | 540 | jz @F |
|
- | 541 | ||
528 | mov eax, [eax+4] |
542 | mov [acpi_hpet_base-OS_BASE], eax |
529 | mov [acpi_dsdt_size-OS_BASE], eax |
543 | mov eax, [eax+44] |
530 | 544 | mov [hpet_base-OS_BASE], eax |
|
531 | @@: |
545 | @@: |
532 | mov edx, ACPI_MADT_SIGN |
546 | mov edx, ACPI_MADT_SIGN |
Line 581... | Line 595... | ||
581 | jne .next |
595 | jne .next |
Line 582... | Line 596... | ||
582 | 596 | ||
583 | mov eax, [edx+4] |
597 | mov eax, [edx+4] |
584 | mov [acpi_ioapic_base-OS_BASE], eax |
598 | mov [acpi_ioapic_base-OS_BASE], eax |
- | 599 | jmp .next |
|
- | 600 | ||
- | 601 | HPET_PERIOD equ 0x004 |
|
- | 602 | HPET_CFG_ENABLE equ 1 |
|
- | 603 | HPET_CFG equ 0x010 |
|
- | 604 | ||
- | 605 | align 4 |
|
- | 606 | init_hpet: |
|
- | 607 | mov ebx, [hpet_base-OS_BASE] |
|
- | 608 | ||
- | 609 | mov eax, [ebx+HPET_PERIOD] |
|
- | 610 | mov edx, 0x431BDE83 |
|
- | 611 | mul edx |
|
- | 612 | shr edx, 18 |
|
- | 613 | mov [hpet_period-OS_BASE], edx |
|
- | 614 | ||
- | 615 | mov eax, [ebx+HPET_CFG] |
|
- | 616 | and eax, not HPET_CFG_ENABLE |
|
- | 617 | mov [ebx+HPET_CFG], eax ;stop main counter |
|
- | 618 | ||
- | 619 | xor ecx, ecx |
|
- | 620 | mov [ebx+0xF0], ecx ;reset counter |
|
- | 621 | mov [ebx+0xF4], ecx |
|
- | 622 | ||
- | 623 | or eax, HPET_CFG_ENABLE |
|
- | 624 | mov [ebx+HPET_CFG], eax ;and start again |
|
- | 625 | ret |
|
- | 626 | ||
- | 627 | ||
- | 628 |