Subversion Repositories Kolibri OS

Rev

Rev 8111 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8111 Rev 9715
Line 1... Line 1...
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                              ;;
2
;;                                                              ;;
3
;; Copyright (C) KolibriOS team 2004-2020. All rights reserved. ;;
3
;; Copyright (C) KolibriOS team 2004-2022. 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 36... Line 36...
36
        inc     ah
36
        inc     ah
37
        movzx   eax, ah
37
        movzx   eax, ah
38
        mov     [hpet_timers], eax
38
        mov     [hpet_timers], eax
39
        mov     ecx, eax
39
        mov     ecx, eax
Line 40... Line 40...
40
 
40
 
41
        mov     eax, [ebx+HPET_PERIOD]
41
        mov     eax, [ebx + HPET_PERIOD]
42
        xor     edx, edx
42
        xor     edx, edx
43
        shld    edx, eax, 10
43
        shld    edx, eax, 10
44
        shl     eax, 10
44
        shl     eax, 10
45
        mov     esi, 1000000
45
        mov     esi, 1000000
46
        div     esi
46
        div     esi
Line 47... Line 47...
47
        mov     [hpet_period], eax
47
        mov     [hpet_period], eax
48
 
48
 
49
        mov     esi, [ebx+HPET_CFG]
49
        mov     esi, [ebx + HPET_CFG]
Line 50... Line 50...
50
        and     esi, not HPET_CFG_ENABLE
50
        and     esi, not HPET_CFG_ENABLE
51
        mov     [ebx+HPET_CFG], esi             ;stop main counter
51
        mov     [ebx + HPET_CFG], esi             ;stop main counter
52
 
52
 
53
        lea     edx, [ebx+HPET_T0_CFG]
53
        lea     edx, [ebx + HPET_T0_CFG]
54
@@:
54
@@:
55
        jcxz    @F
55
        jcxz    @F
56
        mov     eax, [edx]
56
        mov     eax, [edx]
57
        and     eax, not (HPET_TN_ENABLE+HPET_TN_LEVEL+HPET_TN_FSB)
57
        and     eax, not (HPET_TN_ENABLE + HPET_TN_LEVEL + HPET_TN_FSB)
58
        mov     [edx], eax
58
        mov     [edx], eax
59
        add     edx, 0x20
59
        add     edx, 0x20
60
        dec     ecx
60
        dec     ecx
61
        jmp     @B
61
        jmp     @B
Line 62... Line 62...
62
@@:
62
@@:
63
        mov     [ebx+HPET_COUNTER], ecx         ;reset main counter
63
        mov     [ebx + HPET_COUNTER], ecx         ;reset main counter
Line 64... Line 64...
64
        mov     [ebx+HPET_COUNTER+4], ecx
64
        mov     [ebx + HPET_COUNTER + 4], ecx
65
 
65
 
66
        or      esi, HPET_CFG_ENABLE
66
        or      esi, HPET_CFG_ENABLE
67
        mov     [ebx+HPET_CFG], esi             ;and start again
67
        mov     [ebx + HPET_CFG], esi             ;and start again
Line 68... Line 68...
68
 
68