From bcc2ed072290ade7a82140dcd6540f627f1bc4c0 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Sat, 13 Jun 2009 02:35:19 +0000 Subject: [PATCH] Fix the length calculated in generic_get_mtrr(). The +1 would usually be added to the mask and then shifted, but as we don't do the shifting at all, we need to add a page size instead of just 1. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@31024 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/cpu/x86/generic_x86.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/add-ons/kernel/cpu/x86/generic_x86.cpp b/src/add-ons/kernel/cpu/x86/generic_x86.cpp index e4a0063573..de300b0ce9 100644 --- a/src/add-ons/kernel/cpu/x86/generic_x86.cpp +++ b/src/add-ons/kernel/cpu/x86/generic_x86.cpp @@ -151,7 +151,7 @@ generic_get_mtrr(uint32 index, uint64 *_base, uint64 *_length, uint8 *_type) uint64 base = x86_read_msr(IA32_MSR_MTRR_PHYSICAL_BASE_0 + index * 2); *_base = base & ~(B_PAGE_SIZE - 1); - *_length = (~mask & gPhysicalMask) + 1; + *_length = (~mask & gPhysicalMask) + B_PAGE_SIZE; *_type = base & 0xff; return B_OK;