Author: bonefish Date: 2010-06-21 22:21:06 +0200 (Mon, 21 Jun 2010) New Revision: 37210 Changeset: http://dev.haiku-os.org/changeset/37210/haiku Modified: haiku/trunk/src/add-ons/kernel/bus_managers/agp_gart/agp_gart.cpp Log: Added work-arounds for intel_gart not being able to deal with physical addresses > 4 GB. Modified: haiku/trunk/src/add-ons/kernel/bus_managers/agp_gart/agp_gart.cpp =================================================================== --- haiku/trunk/src/add-ons/kernel/bus_managers/agp_gart/agp_gart.cpp 2010-06-21 19:25:50 UTC (rev 37209) +++ haiku/trunk/src/add-ons/kernel/bus_managers/agp_gart/agp_gart.cpp 2010-06-21 20:21:06 UTC (rev 37210) @@ -540,6 +540,11 @@ if ((flags & B_APERTURE_NEED_PHYSICAL) != 0) { physical_address_restrictions restrictions = {}; +#if B_HAIKU_PHYSICAL_BITS > 32 + restrictions.high_address = (phys_addr_t)1 << 32; + // TODO: Work-around until intel_gart can deal with physical + // addresses > 4 GB. +#endif memory->page = vm_page_allocate_page_run( PAGE_STATE_WIRED | VM_PAGE_ALLOC_CLEAR, count, &restrictions, VM_PRIORITY_SYSTEM); @@ -551,6 +556,20 @@ if (memory->pages == NULL) return B_NO_MEMORY; +#if B_HAIKU_PHYSICAL_BITS > 32 + // TODO: Work-around until intel_gart can deal with physical + // addresses > 4 GB. + physical_address_restrictions restrictions = {}; + restrictions.high_address = (phys_addr_t)1 << 32; + vm_page* page = vm_page_allocate_page_run( + PAGE_STATE_WIRED | VM_PAGE_ALLOC_CLEAR, count, &restrictions, + VM_PRIORITY_SYSTEM); + if (page == NULL) + return B_NO_MEMORY; + + for (uint32 i = 0; i < count; i++) + memory->pages[i] = page + i; +#else vm_page_reservation reservation; vm_page_reserve_pages(&reservation, count, VM_PRIORITY_SYSTEM); for (uint32 i = 0; i < count; i++) { @@ -558,6 +577,7 @@ PAGE_STATE_WIRED | VM_PAGE_ALLOC_CLEAR); } vm_page_unreserve_pages(&reservation); +#endif } #ifdef DEBUG_PAGE_ACCESS