From: John Hodge Date: Sun, 17 Jul 2011 15:43:45 +0000 (+0800) Subject: Fixing compile errors X-Git-Tag: rel0.10~38 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=e9391ef54c88fb5180d6330a7a1b43c3115befb8;p=tpg%2Facess2.git Fixing compile errors --- diff --git a/Kernel/vfs/mmap.c b/Kernel/vfs/mmap.c index f8422bbd..dbdd4b2a 100644 --- a/Kernel/vfs/mmap.c +++ b/Kernel/vfs/mmap.c @@ -9,20 +9,22 @@ #include #define MMAP_PAGES_PER_BLOCK 16 +#define PAGE_SIZE 0x1000 // Should be in mm_virt.h // === STRUCTURES === -typedef struct sVFS_MMapPageBlock +typedef struct sVFS_MMapPageBlock tVFS_MMapPageBlock; +struct sVFS_MMapPageBlock { tVFS_MMapPageBlock *Next; Uint64 BaseOffset; // Must be a multiple of MMAP_PAGES_PER_BLOCK*PAGE_SIZE tPAddr PhysAddrs[MMAP_PAGES_PER_BLOCK]; -} tVFS_MMapPageBlock; +}; // === CODE === void *VFS_MMap(int *ErrNo, void *DestHint, size_t Length, int Protection, int Flags, int FD, Uint64 Offset) { tVFS_Handle *h; - void *mapping_dest; + tVAddr mapping_dest; int npages, pagenum; tVFS_MMapPageBlock *pb, *prev; @@ -35,7 +37,7 @@ void *VFS_MMap(int *ErrNo, void *DestHint, size_t Length, int Protection, int Fl if( Flags & MAP_ANONYMOUS ) { MM_Allocate(mapping_dest); - return mapping_dest; + return (void*)mapping_dest; } h = VFS_GetHandle(FD); @@ -69,14 +71,14 @@ void *VFS_MMap(int *ErrNo, void *DestHint, size_t Length, int Protection, int Fl if( pb->PhysAddrs[pagenum - pb->BaseOffset] == 0 ) { if( h->Node->MMap ) - h->Node->MMap(h->Node, pagenum*PAGE_SIZE, PAGE_SIZE, mapping_dest); + h->Node->MMap(h->Node, pagenum*PAGE_SIZE, PAGE_SIZE, (void*)mapping_dest); else { // Allocate pages and read data MM_Allocate(mapping_dest); - h->Node->Read(h->Node, pagenum*PAGE_SIZE, PAGE_SIZE, mapping_dest); + h->Node->Read(h->Node, pagenum*PAGE_SIZE, PAGE_SIZE, (void*)mapping_dest); } - pb->PhysAddrs[pagenum -> pb->BaseOffset] = MM_GetPhysAddr( mapping_dest ); + pb->PhysAddrs[pagenum - pb->BaseOffset] = MM_GetPhysAddr( mapping_dest ); } else {