git.ucc.asn.au
/
tpg
/
acess2.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
87db7ec
)
Kernel/x86 - Added USE_ACPICA makefile variable to easily enable/disable
author
John Hodge (sonata)
<
[email protected]
>
Sun, 9 Dec 2012 05:02:34 +0000
(13:02 +0800)
committer
John Hodge (sonata)
<
[email protected]
>
Sun, 9 Dec 2012 05:02:34 +0000
(13:02 +0800)
KernelLand/Kernel/arch/x86/Makefile
patch
|
blob
|
history
KernelLand/Kernel/arch/x86/acpica.c
patch
|
blob
|
history
KernelLand/Kernel/arch/x86/desctab.asm
patch
|
blob
|
history
KernelLand/Kernel/arch/x86/main.c
patch
|
blob
|
history
diff --git
a/KernelLand/Kernel/arch/x86/Makefile
b/KernelLand/Kernel/arch/x86/Makefile
index
9e5a883
..
a9368f4
100644
(file)
--- a/
KernelLand/Kernel/arch/x86/Makefile
+++ b/
KernelLand/Kernel/arch/x86/Makefile
@@
-9,6
+9,7
@@
CPPFLAGS =
CFLAGS =
ASFLAGS = -f elf
CFLAGS =
ASFLAGS = -f elf
+USE_ACPICA ?= 1
USE_MP=0
ifeq ($(PLATFORM),default)
USE_MP=0
ifeq ($(PLATFORM),default)
@@
-18,13
+19,15
@@
else ifeq ($(PLATFORM),smp)
endif
ASFLAGS += -D USE_MP=$(USE_MP)
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 = 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
diff --git
a/KernelLand/Kernel/arch/x86/acpica.c
b/KernelLand/Kernel/arch/x86/acpica.c
index
f310fc5
..
7bbe1cd
100644
(file)
--- a/
KernelLand/Kernel/arch/x86/acpica.c
+++ b/
KernelLand/Kernel/arch/x86/acpica.c
@@
-5,6
+5,7
@@
* acpica.c
* - ACPICA Interface
*/
* acpica.c
* - ACPICA Interface
*/
+#define ACPI_DEBUG_OUTPUT 1
#define DEBUG 1
#define _AcpiModuleName "Shim"
#define _COMPONENT "Acess"
#define DEBUG 1
#define _AcpiModuleName "Shim"
#define _COMPONENT "Acess"
@@
-133,6
+134,8
@@
ACPI_STATUS AcpiOsCreateCache(char *CacheName, UINT16 ObjectSize, UINT16 MaxDept
int namelen = (CacheName ? strlen(CacheName) : 0) + 1;
LOG("CacheName=%s, ObjSize=%x, MaxDepth=%x", CacheName, ObjectSize, MaxDepth);
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;
ret = malloc(sizeof(*ret) + MaxDepth*sizeof(char) + namelen + MaxDepth*ObjectSize);
if( !ret ) return AE_NO_MEMORY;
@@
-174,15
+177,18
@@
ACPI_STATUS AcpiOsPurgeCache(ACPI_CACHE_T *Cache)
void *AcpiOsAcquireObject(ACPI_CACHE_T *Cache)
{
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;
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;
}
return NULL;
}
@@
-193,6
+199,7
@@
ACPI_STATUS AcpiOsReleaseObject(ACPI_CACHE_T *Cache, void *Object)
tVAddr delta = (tVAddr)Object - (tVAddr)Cache->First;
delta /= Cache->ObjectSize;
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;
if( delta > Cache->nObj )
return AE_BAD_PARAMETER;
@@
-210,6
+217,7
@@
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;
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;
}
LOG("Map (%P+%i pg) to %p", PhysicalAddress, npages, rv);
return rv;
}
diff --git
a/KernelLand/Kernel/arch/x86/desctab.asm
b/KernelLand/Kernel/arch/x86/desctab.asm
index
6eaa651
..
18ed10d
100644
(file)
--- a/
KernelLand/Kernel/arch/x86/desctab.asm
+++ b/
KernelLand/Kernel/arch/x86/desctab.asm
@@
-215,7
+215,7
@@
Isr240.jmp:
%endif
; - Assignable
%assign i 0xF1
%endif
; - Assignable
%assign i 0xF1
-%rep 1
6
+%rep 1
5
DEF_IRQ i
%assign i i+1
%endrep
DEF_IRQ i
%assign i i+1
%endrep
diff --git
a/KernelLand/Kernel/arch/x86/main.c
b/KernelLand/Kernel/arch/x86/main.c
index
8f36f47
..
3abf548
100644
(file)
--- a/
KernelLand/Kernel/arch/x86/main.c
+++ b/
KernelLand/Kernel/arch/x86/main.c
@@
-24,7
+24,7
@@
extern void MM_PreinitVirtual(void);
extern void MM_Install(int NPMemRanges, tPMemMapEnt *PMemRanges);
extern void MM_InstallVirtual(void);
extern int Time_Setup(void);
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);
// === PROTOTYPES ===
int kmain(Uint MbMagic, void *MbInfoPtr);
@@
-85,8
+85,10
@@
int kmain(Uint MbMagic, void *MbInfoPtr)
// Start Multitasking
Threads_Init();
// Start Multitasking
Threads_Init();
+ #if USE_ACPICA
// Poke ACPICA
// Poke ACPICA
-// ACPICA_Initialise();
+ ACPICA_Initialise();
+ #endif
Log_Log("Arch", "Starting VFS...");
// Load Virtual Filesystem
Log_Log("Arch", "Starting VFS...");
// Load Virtual Filesystem
UCC
git Repository :: git.ucc.asn.au