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
Modules/Tegra2Vid - Misc
[tpg/acess2.git]
/
KernelLand
/
Kernel
/
vfs
/
mmap.c
diff --git
a/KernelLand/Kernel/vfs/mmap.c
b/KernelLand/Kernel/vfs/mmap.c
index
591ae28
..
b6d5c2d
100644
(file)
--- a/
KernelLand/Kernel/vfs/mmap.c
+++ b/
KernelLand/Kernel/vfs/mmap.c
@@
-71,7
+71,7
@@
void *VFS_MMap(void *DestHint, size_t Length, int Protection, int Flags, int FD,
// - Sorted list of 16 page blocks
for(
pb = h->Node->MMapInfo, prev = NULL;
// - Sorted list of 16 page blocks
for(
pb = h->Node->MMapInfo, prev = NULL;
- pb && pb->BaseOffset + MMAP_PAGES_PER_BLOCK < pagenum;
+ pb && pb->BaseOffset + MMAP_PAGES_PER_BLOCK <
=
pagenum;
prev = pb, pb = pb->Next
)
;
prev = pb, pb = pb->Next
)
;
@@
-98,6
+98,8
@@
void *VFS_MMap(void *DestHint, size_t Length, int Protection, int Flags, int FD,
// - Map (and allocate) pages
while( npages -- )
{
// - Map (and allocate) pages
while( npages -- )
{
+ assert( pagenum >= pb->BaseOffset );
+ assert( pagenum - pb->BaseOffset < MMAP_PAGES_PER_BLOCK );
if( MM_GetPhysAddr( mapping_dest ) == 0 )
{
if( pb->PhysAddrs[pagenum - pb->BaseOffset] == 0 )
if( MM_GetPhysAddr( mapping_dest ) == 0 )
{
if( pb->PhysAddrs[pagenum - pb->BaseOffset] == 0 )
UCC
git Repository :: git.ucc.asn.au