Rev 6663 | Rev 7132 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6663 | Rev 6721 | ||
---|---|---|---|
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: 6663 $ |
8 | $Revision: 6721 $ |
9 | 9 | ||
Line 10... | Line 10... | ||
10 | ; Initializes MTRRs. |
10 | ; Initializes MTRRs. |
Line 762... | Line 762... | ||
762 | ; size must be power of 2 that divides base. |
762 | ; size must be power of 2 that divides base. |
763 | proc set_mtrr stdcall, base:dword,size:dword,mem_type:dword |
763 | proc set_mtrr stdcall, base:dword,size:dword,mem_type:dword |
764 | ; find unused register |
764 | ; find unused register |
765 | mov ecx, 0x201 |
765 | mov ecx, 0x201 |
766 | .scan: |
766 | .scan: |
- | 767 | mov eax, [num_variable_mtrrs] |
|
- | 768 | lea eax, [0x200+eax*2] |
|
- | 769 | cmp ecx, eax |
|
- | 770 | jae .ret |
|
767 | rdmsr |
771 | rdmsr |
768 | dec ecx |
772 | dec ecx |
769 | test ah, 8 |
773 | test ah, 8 |
770 | jz .found |
774 | jz .found |
771 | rdmsr |
775 | rdmsr |
Line 774... | Line 778... | ||
774 | and eax, not 0xFFF ; clear reserved bits |
778 | and eax, not 0xFFF ; clear reserved bits |
775 | cmp eax, [base] |
779 | cmp eax, [base] |
776 | jz .ret |
780 | jz .ret |
777 | @@: |
781 | @@: |
778 | add ecx, 3 |
782 | add ecx, 3 |
779 | mov eax, [num_variable_mtrrs] |
- | |
780 | lea eax, [0x200+eax*2] |
- | |
781 | cmp ecx, eax |
- | |
782 | jb .scan |
783 | jmp .scan |
783 | ; no free registers, ignore the call |
784 | ; no free registers, ignore the call |
784 | .ret: |
785 | .ret: |
785 | ret |
786 | ret |
786 | .found: |
787 | .found: |
787 | ; found, write values |
788 | ; found, write values |