Kernel/x86 - Report ACPICA cache name on exhaustion
[tpg/acess2.git] / KernelLand / Kernel / arch / x86 / acpica.c
index 57d7fe8..a7a0883 100644 (file)
@@ -94,7 +94,7 @@ ACPI_PHYSICAL_ADDRESS AcpiOsGetRootPointer(void)
        if( ACPI_FAILURE(rv) )
                return 0;
 
-       LOG("val=%x", val);
+       LOG("val=0x%x", val);
        
        return val;
        // (Or use EFI)
@@ -192,7 +192,7 @@ void *AcpiOsAcquireObject(ACPI_CACHE_T *Cache)
                }
        }
 
-       Log_Debug("ACPICA", "AcpiOsAcquireObject: %i objects used", Cache->nObj);       
+       Log_Debug("ACPICA", "AcpiOsAcquireObject: %i objects used in cache '%s'", Cache->nObj, Cache->Name);
 
        LEAVE('n');
        return NULL;
@@ -222,8 +222,13 @@ void *AcpiOsMapMemory(ACPI_PHYSICAL_ADDRESS PhysicalAddress, ACPI_SIZE Length)
        
        Uint    ofs = PhysicalAddress & (PAGE_SIZE-1);
        int npages = (ofs + Length + (PAGE_SIZE-1)) / PAGE_SIZE;
-       void *rv = ((char*)MM_MapHWPages(PhysicalAddress, npages)) + ofs;
+       char *maploc = (void*)MM_MapHWPages(PhysicalAddress, npages);
+       if(!maploc) {
+               LOG("Mapping %P+0x%x failed", PhysicalAddress, Length);
+               return NULL;
+       }
 //     MM_DumpTables(0, -1);
+       void *rv = maploc + ofs;
        LOG("Map (%P+%i pg) to %p", PhysicalAddress, npages, rv);
        return rv;
 }

UCC git Repository :: git.ucc.asn.au