git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git://git.ucc.asn.au/tpg/acess2
[tpg/acess2.git]
/
KernelLand
/
Kernel
/
arch
/
x86
/
mm_virt.c
diff --git
a/KernelLand/Kernel/arch/x86/mm_virt.c
b/KernelLand/Kernel/arch/x86/mm_virt.c
index
d15c3d7
..
868fe86
100644
(file)
--- a/
KernelLand/Kernel/arch/x86/mm_virt.c
+++ b/
KernelLand/Kernel/arch/x86/mm_virt.c
@@
-414,13
+414,14
@@
void MM_Deallocate(tVAddr VAddr)
* \fn tPAddr MM_GetPhysAddr(tVAddr Addr)
* \brief Checks if the passed address is accesable
*/
* \fn tPAddr MM_GetPhysAddr(tVAddr Addr)
* \brief Checks if the passed address is accesable
*/
-tPAddr MM_GetPhysAddr(
tVAddr
Addr)
+tPAddr MM_GetPhysAddr(
const void *
Addr)
{
{
- if( !(gaPageDir[Addr >> 22] & 1) )
+ tVAddr addr = (tVAddr)Addr;
+ if( !(gaPageDir[addr >> 22] & 1) )
return 0;
return 0;
- if( !(gaPageTable[
A
ddr >> 12] & 1) )
+ if( !(gaPageTable[
a
ddr >> 12] & 1) )
return 0;
return 0;
- return (gaPageTable[
Addr >> 12] & ~0xFFF) | (A
ddr & 0xFFF);
+ return (gaPageTable[
addr >> 12] & ~0xFFF) | (a
ddr & 0xFFF);
}
/**
}
/**
@@
-717,7
+718,8
@@
tVAddr MM_NewKStack(void)
for(base = MM_KERNEL_STACKS; base < MM_KERNEL_STACKS_END; base += MM_KERNEL_STACK_SIZE)
{
// Check if space is free
for(base = MM_KERNEL_STACKS; base < MM_KERNEL_STACKS_END; base += MM_KERNEL_STACK_SIZE)
{
// Check if space is free
- if(MM_GetPhysAddr(base) != 0) continue;
+ if(MM_GetPhysAddr( (void*) base) != 0)
+ continue;
// Allocate
//for(i = MM_KERNEL_STACK_SIZE; i -= 0x1000 ; )
for(i = 0; i < MM_KERNEL_STACK_SIZE; i += 0x1000 )
// Allocate
//for(i = MM_KERNEL_STACK_SIZE; i -= 0x1000 ; )
for(i = 0; i < MM_KERNEL_STACK_SIZE; i += 0x1000 )
@@
-1069,7
+1071,6
@@
tVAddr MM_MapHWPages(tPAddr PAddr, Uint Number)
*/
tVAddr MM_AllocDMA(int Pages, int MaxBits, tPAddr *PhysAddr)
{
*/
tVAddr MM_AllocDMA(int Pages, int MaxBits, tPAddr *PhysAddr)
{
- tPAddr maxCheck = (1 << MaxBits);
tPAddr phys;
tVAddr ret;
tPAddr phys;
tVAddr ret;
@@
-1084,9
+1085,6
@@
tVAddr MM_AllocDMA(int Pages, int MaxBits, tPAddr *PhysAddr)
return 0;
}
return 0;
}
- // Bound
- if(MaxBits >= PHYS_BITS) maxCheck = -1;
-
// Fast Allocate
if(Pages == 1 && MaxBits >= PHYS_BITS)
{
// Fast Allocate
if(Pages == 1 && MaxBits >= PHYS_BITS)
{
UCC
git Repository :: git.ucc.asn.au