* - ACPICA Interface
*/
#define ACPI_DEBUG_OUTPUT 0
-#define DEBUG 1
+#define DEBUG 0
#define _AcpiModuleName "Shim"
#define _COMPONENT "Acess"
#include <acpi.h>
}
// -- Memory Management ---
+#if USE_ACESS_ACPI_CACHE
struct sACPICache
{
Uint16 nObj;
LEAVE('i', AE_OK);
return AE_OK;
}
+#endif
void *AcpiOsMapMemory(ACPI_PHYSICAL_ADDRESS PhysicalAddress, ACPI_SIZE Length)
{
- if( PhysicalAddress < ONEMEG )
+ if( PhysicalAddress < ONEMEG ) {
+ ASSERTCR(Length, <=, ONEMEG-PhysicalAddress, NULL);
return (void*)(KERNEL_BASE | PhysicalAddress);
+ }
Uint ofs = PhysicalAddress & (PAGE_SIZE-1);
int npages = (ofs + Length + (PAGE_SIZE-1)) / PAGE_SIZE;
- char *maploc = (void*)MM_MapHWPages(PhysicalAddress, npages);
+ char *maploc = MM_MapHWPages(PhysicalAddress, npages);
if(!maploc) {
LOG("Mapping %P+0x%x failed", PhysicalAddress, Length);
return NULL;
void AcpiOsUnmapMemory(void *LogicalAddress, ACPI_SIZE Length)
{
- if( (tVAddr)LogicalAddress - KERNEL_BASE < ONEMEG )
+ if( (tVAddr)LogicalAddress - KERNEL_BASE < ONEMEG ) {
return ;
+ }
LOG("%p", LogicalAddress);
Uint ofs = (tVAddr)LogicalAddress & (PAGE_SIZE-1);
int npages = (ofs + Length + (PAGE_SIZE-1)) / PAGE_SIZE;
// TODO: Validate `Length` is the same as was passed to AcpiOsMapMemory
- MM_UnmapHWPages( (tVAddr)LogicalAddress, npages);
+ MM_UnmapHWPages( LogicalAddress, npages);
}
ACPI_STATUS AcpiOsGetPhysicalAddress(void *LogicalAddress, ACPI_PHYSICAL_ADDRESS *PhysicalAddress)
MM_FreeTemp(ptr);
}
+ LOG("*%P = [%i]%X", Address, Width, *Value);
+
return AE_OK;
}
return AE_BAD_PARAMETER;
}
- if( Address >= 1024*1024 ) {
+ if( Address >= ONEMEG ) {
MM_FreeTemp(ptr);
}