CFLAGS =
ASFLAGS = -f elf
+USE_ACPICA ?= 1
USE_MP=0
ifeq ($(PLATFORM),default)
endif
ASFLAGS += -D USE_MP=$(USE_MP)
-CPPFLAGS += -DUSE_MP=$(USE_MP)
+CPPFLAGS += -DUSE_MP=$(USE_MP) -DUSE_ACPICA=$(USE_ACPICA)
A_OBJ = start.ao main.o mboot.o lib.o desctab.ao errors.o irq.o
A_OBJ += mm_phys.o mm_virt.o
A_OBJ += proc.o proc.ao time.o vm8086.o
A_OBJ += kpanic.o pci.o vpci.o
-#A_OBJ += acpica.o
-#EXTERNS += ACPICA
+ifeq ($(USE_ACPICA),1)
+A_OBJ += acpica.o
+EXTERNS += ACPICA
+endif
* acpica.c
* - ACPICA Interface
*/
+#define ACPI_DEBUG_OUTPUT 1
#define DEBUG 1
#define _AcpiModuleName "Shim"
#define _COMPONENT "Acess"
int namelen = (CacheName ? strlen(CacheName) : 0) + 1;
LOG("CacheName=%s, ObjSize=%x, MaxDepth=%x", CacheName, ObjectSize, MaxDepth);
+ namelen = (namelen + 3) & ~3;
+
ret = malloc(sizeof(*ret) + MaxDepth*sizeof(char) + namelen + MaxDepth*ObjectSize);
if( !ret ) return AE_NO_MEMORY;
void *AcpiOsAcquireObject(ACPI_CACHE_T *Cache)
{
- LOG("(Cache=%p)", Cache);
+ ENTER("pCache", Cache);
for(int i = 0; i < Cache->nObj; i ++ )
{
if( !Cache->ObjectStates[i] ) {
Cache->ObjectStates[i] = 1;
- return (char*)Cache->First + i*Cache->ObjectSize;
+ void *rv = (char*)Cache->First + i*Cache->ObjectSize;
+ LEAVE('p', rv);
+ return rv;
}
}
- // TODO
+
+ LEAVE('n');
return NULL;
}
tVAddr delta = (tVAddr)Object - (tVAddr)Cache->First;
delta /= Cache->ObjectSize;
+ LOG("delta = %i, (limit %i)", delta, Cache->nObj);
if( delta > Cache->nObj )
return AE_BAD_PARAMETER;
Uint ofs = PhysicalAddress & (PAGE_SIZE-1);
int npages = (ofs + Length + (PAGE_SIZE-1)) / PAGE_SIZE;
void *rv = ((char*)MM_MapHWPages(PhysicalAddress, npages)) + ofs;
+// MM_DumpTables(0, -1);
LOG("Map (%P+%i pg) to %p", PhysicalAddress, npages, rv);
return rv;
}
extern void MM_Install(int NPMemRanges, tPMemMapEnt *PMemRanges);
extern void MM_InstallVirtual(void);
extern int Time_Setup(void);
-//extern int ACPICA_Initialise(void);
+extern int ACPICA_Initialise(void);
// === PROTOTYPES ===
int kmain(Uint MbMagic, void *MbInfoPtr);
// Start Multitasking
Threads_Init();
+ #if USE_ACPICA
// Poke ACPICA
-// ACPICA_Initialise();
+ ACPICA_Initialise();
+ #endif
Log_Log("Arch", "Starting VFS...");
// Load Virtual Filesystem