* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
-/* $Id: view.c,v 1.69 2003/10/12 17:05:44 hbirr Exp $
+/* $Id: view.c,v 1.70 2003/12/30 18:52:03 fireball Exp $
*
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/cc/view.c
static CLIENT_ID LazyCloseThreadId;
static volatile BOOLEAN LazyCloseThreadShouldTerminate;
+#if defined(__GNUC__)
void * alloca(size_t size);
+#elif defined(_MSC_VER)
+void* _alloca(size_t size);
+#else
+#error Unknown compiler for alloca intrinsic stack allocation "function"
+#endif
+
NTSTATUS
CcRosInternalFreeCacheSegment(PCACHE_SEGMENT CacheSeg);
for (i = 0; i < current->Bcb->CacheSegmentSize / PAGE_SIZE; i++)
{
PHYSICAL_ADDRESS Page;
- Page = MmGetPhysicalAddress(current->BaseAddress + i * PAGE_SIZE);
+ Page = MmGetPhysicalAddress((char*)current->BaseAddress + i * PAGE_SIZE);
Status = MmPageOutPhysicalAddress(Page);
if (!NT_SUCCESS(Status))
{
}
Status = MmCreateVirtualMapping(NULL,
- current->BaseAddress + (i * PAGE_SIZE),
+ (char*)current->BaseAddress + (i * PAGE_SIZE),
PAGE_READWRITE,
Page,
TRUE);
Length = ROUND_UP(Length, Bcb->CacheSegmentSize);
+#if defined(__GNUC__)
CacheSegList = alloca(sizeof(PCACHE_SEGMENT) *
(Length / Bcb->CacheSegmentSize));
+#elif defined(_MSC_VER)
+ CacheSegList = _alloca(sizeof(PCACHE_SEGMENT) *
+ (Length / Bcb->CacheSegmentSize));
+#else
+#error Unknown compiler for alloca intrinsic stack allocation "function"
+#endif
/*
* Look for a cache segment already mapping the same data.
}
else
{
+#if defined(__GNUC__)
Offset.QuadPart = 0LL;
+#else
+ Offset.QuadPart = 0;
+#endif
Length = Bcb->FileSize.u.LowPart;
}
while (1)
{
+#if defined(__GNUC__)
Timeout.QuadPart += 100000000LL; // 10sec
+#else
+ Timeout.QuadPart += 100000000; // 10sec
+#endif
Status = KeWaitForSingleObject(&LazyCloseThreadEvent,
0,
KernelMode,