Subversion Repositories Kolibri OS

Rev

Rev 8119 | Rev 8158 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8119 Rev 8139
Line 69... Line 69...
69
format binary as "mnt"
69
format binary as "mnt"
Line 70... Line 70...
70
 
70
 
71
include 'macros.inc'
71
include 'macros.inc'
Line 72... Line 72...
72
include 'struct.inc'
72
include 'struct.inc'
Line 73... Line 73...
73
 
73
 
74
$Revision: 8119 $
74
$Revision: 8139 $
Line 554... Line 554...
554
        call    check_acpi
554
        call    check_acpi
Line 555... Line 555...
555
 
555
 
556
        mov     eax, [hpet_base]
556
        mov     eax, [hpet_base]
557
        test    eax, eax
557
        test    eax, eax
558
        jz      @F
-
 
559
        mov     eax, [hpet_base]
558
        jz      @F
560
        stdcall map_io_mem, [hpet_base], 1024, PG_GLOBAL+PAT_UC+PG_SWR
559
        stdcall map_io_mem, [hpet_base], 1024, PG_GLOBAL+PAT_UC+PG_SWR
561
        mov     [hpet_base], eax
560
        mov     [hpet_base], eax
562
        mov     eax, [eax+HPET_ID]
561
        mov     eax, [eax+HPET_ID]
563
        DEBUGF  1, "K : HPET caps %x\n", eax
562
        DEBUGF  1, "K : HPET caps %x\n", eax
Line 3929... Line 3928...
3929
  imax    dd 0x0
3928
  imax    dd 0x0
3930
endg
3929
endg
3931
;-----------------------------------------------------------------------------
3930
;-----------------------------------------------------------------------------
3932
align 4
3931
align 4
3933
delay_ms:     ; delay in 1/1000 sec
3932
delay_ms:     ; delay in 1/1000 sec
-
 
3933
        pushad
-
 
3934
 
-
 
3935
        cmp     [hpet_base], 0
-
 
3936
        jz      .no_hpet
-
 
3937
        mov     eax, esi
-
 
3938
        mov     edx, 10_000_000 ; cs to ns
-
 
3939
        mul     edx
-
 
3940
        mov     ebx, edx
-
 
3941
        mov     ecx, eax
-
 
3942
 
3934
        push    eax
3943
        push    ecx
-
 
3944
        call    get_clock_ns
-
 
3945
        pop     ecx
-
 
3946
        mov     edi, edx
-
 
3947
        mov     esi, eax
-
 
3948
.wait:
3935
        push    ecx
3949
        push    ecx
-
 
3950
        call    get_clock_ns
-
 
3951
        pop     ecx
-
 
3952
        sub     eax, esi
-
 
3953
        sbb     edx, edi
-
 
3954
        sub     eax, ecx
-
 
3955
        sbb     edx, ebx
-
 
3956
        jc      .wait
-
 
3957
        jmp     .done
Line -... Line 3958...
-
 
3958
 
3936
 
3959
.no_hpet:
3937
        mov     ecx, esi
3960
        mov     ecx, esi
3938
        ; 
3961
        ; 
3939
        imul    ecx, 33941
3962
        imul    ecx, 33941
3940
        shr     ecx, 9
3963
        shr     ecx, 9
Line 3941... Line 3964...
3941
        ; 
3964
        ; 
3942
 
3965
 
3943
        in      al, 0x61
3966
        in      al, 0x61
3944
        and     al, 0x10
3967
        and     al, 0x10
3945
        mov     ah, al
-
 
3946
        cld
3968
        mov     ah, al
3947
;--------------------------------------
3969
        cld
3948
align 4
3970
 
3949
cnt1:
3971
.cnt1:
3950
        in      al, 0x61
3972
        in      al, 0x61
3951
        and     al, 0x10
3973
        and     al, 0x10
Line 3952... Line 3974...
3952
        cmp     al, ah
3974
        cmp     al, ah
3953
        jz      cnt1
3975
        jz      .cnt1
Line 3954... Line 3976...
3954
 
3976
 
3955
        mov     ah, al
3977
        mov     ah, al
3956
        loop    cnt1
3978
        loop    .cnt1
3957
 
3979
 
3958
        pop     ecx
3980
.done:
3959
        pop     eax
3981
        popad
3960
        ret
3982
        ret