Rev 9715 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 9715 | Rev 9950 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2022. 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 | ||
8 | $Revision: 9715 $ |
- | |
9 | - | ||
10 | ; Initializes MTRRs. |
- | |
Line -... | Line 8... | ||
- | 8 | $Revision: 9950 $ |
|
- | 9 | ||
11 | proc init_mtrr |
10 | ; Initializes PAT (Page Attribute Table) and MTRRs. |
12 | 11 | proc init_pat_mtrr |
|
Line -... | Line 12... | ||
- | 12 | cmp [BOOT.mtrr], byte 2 |
|
- | 13 | je .exit |
|
- | 14 | ||
- | 15 | bt [cpu_caps], CAPS_PAT ; if PAT is not supported, use MTRR |
|
- | 16 | jnc .use_mtrr |
|
- | 17 | ||
- | 18 | ; Change PAT_MSR for write combining memory. |
|
- | 19 | mov ecx, MSR_CR_PAT |
|
- | 20 | mov eax, PAT_VALUE ; UC UCM WC WB |
|
- | 21 | mov edx, eax |
|
- | 22 | wrmsr |
|
13 | cmp [BOOT.mtrr], byte 2 |
23 | ret |
14 | je .exit |
24 | |
Line 15... | Line 25... | ||
15 | 25 | .use_mtrr: |
|
16 | bt [cpu_caps], CAPS_MTRR |
26 | bt [cpu_caps], CAPS_MTRR |
Line 737... | Line 747... | ||
737 | wrmsr |
747 | wrmsr |
738 | inc ecx |
748 | inc ecx |
739 | jmp @b |
749 | jmp @b |
740 | @@: |
750 | @@: |
Line 741... | Line -... | ||
741 | - | ||
742 | ; 9i. Check PAT support and reprogram PAT_MASR for write combining memory |
- | |
743 | bt [cpu_caps], CAPS_PAT |
- | |
744 | jnc @F |
- | |
745 | - | ||
746 | mov ecx, MSR_CR_PAT |
- | |
747 | mov eax, PAT_VALUE ;UC UCM WC WB |
- | |
748 | mov edx, eax |
- | |
749 | wrmsr |
- | |
750 | @@: |
- | |
751 | 751 | ||
752 | ; 9j. Changes are done. |
752 | ; 9i. Changes are done. |
Line 753... | Line 753... | ||
753 | call mtrr_end_change |
753 | call mtrr_end_change |
754 | 754 | ||
755 | .abort: |
755 | .abort: |