Began work on fixing up APCs.
svn path=/trunk/; revision=1212
-/* $Id: zw.h,v 1.30 2000/05/13 13:50:55 dwelch Exp $
+/* $Id: zw.h,v 1.31 2000/06/27 19:20:42 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
STDCALL
NtContinue(
IN PCONTEXT Context,
- IN CINT IrqLevel
+ IN BOOLEAN TestAlert
);
NTSTATUS STDCALL ZwContinue(IN PCONTEXT Context, IN CINT IrqLevel);
mkdir -p $1/reactos/bin
#cp fdisk.exe $1
#cp format.exe $1
-#cp loaders/dos/loadros.com $1
-#cp ntoskrnl/ntoskrnl.exe $1
-#cp services/fs/vfat/vfatfs.sys $1
-#cp services/dd/ide/ide.sys $1
+cp loaders/dos/loadros.com $1
+cp ntoskrnl/ntoskrnl.exe $1
+cp services/fs/vfat/vfatfs.sys $1
+cp services/dd/ide/ide.sys $1
cp ntoskrnl/ntoskrnl.exe $1/reactos/system32/
cp services/fs/vfat/vfatfs.sys $1/reactos/system32/drivers/
cp services/dd/ide/ide.sys $1/reactos/system32/drivers/
-/* $Id: apc.c,v 1.1 2000/05/13 13:50:57 dwelch Exp $
+/* $Id: apc.c,v 1.2 2000/06/27 19:20:43 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
/* FUNCTIONS ***************************************************************/
-VOID KiUserApcDispatcher(PIO_APC_ROUTINE ApcRoutine,
- PVOID ApcContext,
- PIO_STATUS_BLOCK Iosb,
- ULONG Reserved,
- PCONTEXT Context)
+VOID STDCALL KiUserApcDispatcher(PIO_APC_ROUTINE ApcRoutine,
+ PVOID ApcContext,
+ PIO_STATUS_BLOCK Iosb,
+ ULONG Reserved,
+ PCONTEXT Context)
{
ApcRoutine(ApcContext,
Iosb,
Esp = (PULONG)UserContext->Esp;
memcpy(&SavedContext, UserContext, sizeof(CONTEXT));
+
+ Esp = Esp - (sizeof(CONTEXT) + (5 * sizeof(ULONG)));
+ memcpy(Esp, &SavedContext, sizeof(CONTEXT));
+ Top = sizeof(CONTEXT) / 4;
+ Esp[Top] = (ULONG)Apc->NormalRoutine;
+ Esp[Top + 1] = (ULONG)Apc->NormalContext;
+ Esp[Top + 2] = (ULONG)Apc->SystemArgument1;
+ Esp[Top + 3] = (ULONG)Apc->SystemArgument2;
+ Esp[Top + 4] = (ULONG)Esp - sizeof(CONTEXT);
+ UserContext->Eip = 0; // KiUserApcDispatcher
+
+ KeReleaseSpinLock(&PiApcLock, oldlvl);
/*
* Now call for the kernel routine for the APC, which will free
*/
KeCallKernelRoutineApc(Apc);
- Esp = Esp - (sizeof(CONTEXT) + (4 * sizeof(ULONG)));
- memcpy(Esp, &SavedContext, sizeof(CONTEXT));
- Top = sizeof(CONTEXT) / 4;
- Esp[Top] = (ULONG)Apc->SystemArgument2;
- Esp[Top + 1] = (ULONG)Apc->SystemArgument1;
- Esp[Top + 2] = (ULONG)Apc->NormalContext;
- Esp[Top + 3] = (ULONG)Apc->NormalRoutine;
- UserContext->Eip = 0;
-
- current_entry = current_entry->Flink;
-
-
return(TRUE);
}
/* GLOBALS *******************************************************************/
static PVOID SystemDllEntryPoint = NULL;
-//static PVOID SystemDllApcDispatcher = NULL;
+static PVOID SystemDllApcDispatcher = NULL;
//static PVOID SystemDllCallbackDispatcher = NULL;
//static PVOID SystemDllExceptionDispatcher = NULL;
return(SystemDllEntryPoint);
}
+PVOID LdrpGetSystemDllApcDispatcher(VOID)
+{
+ return(SystemDllApcDispatcher);
+}
+
NTSTATUS LdrpMapSystemDll(HANDLE ProcessHandle,
PVOID* LdrStartupAddr)
/*
DPRINT("LdrStartupAddr %x\n", LdrStartupAddr);
SystemDllEntryPoint = *LdrStartupAddr;
+ /*
+ * FIXME: retrieve the offset of the APC dispatcher from NTDLL
+ */
+ SystemDllApcDispatcher = NULL;
+
/*
* Create a section for NTDLL
*/
MiNrFreePages = 0;
MiNrUsedPages = 0;
+ for (i = 0; i < Reserved; i++)
+ {
+ if (!MmIsPagePresent(NULL,
+ (PVOID)((ULONG)MmPageArray + (i * PAGESIZE))))
+ {
+ MmSetPage(NULL,
+ (PVOID)((ULONG)MmPageArray + (i * PAGESIZE)),
+ PAGE_READWRITE,
+ (ULONG)(LastPhysKernelAddress - (i * PAGESIZE)));
+ }
+ }
+
i = 1;
if ((ULONG)FirstPhysKernelAddress < 0xa0000)
{
}
MiNrUsedPages = MiNrUsedPages +
((((ULONG)LastPhysKernelAddress) / PAGESIZE) - i);
- for (; i<((ULONG)LastKernelAddress / PAGESIZE); i++)
+ for (; i<((ULONG)LastPhysKernelAddress / PAGESIZE); i++)
{
MmPageArray[i].Flags = PHYSICAL_PAGE_INUSE;
MmPageArray[i].ReferenceCount = 1;
-/* $Id: create.c,v 1.16 2000/06/03 21:36:32 ekohl Exp $
+/* $Id: create.c,v 1.17 2000/06/27 19:20:45 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
VOID PiBeforeBeginThread(CONTEXT c)
{
- DPRINT1("PiBeforeBeginThread(Eip %x)\n", c.Eip);
+ DPRINT("PiBeforeBeginThread(Eip %x)\n", c.Eip);
//KeReleaseSpinLock(&PiThreadListLock, PASSIVE_LEVEL);
KeLowerIrql(PASSIVE_LEVEL);
}
-/* $Id: thread.c,v 1.48 2000/06/04 19:51:05 ekohl Exp $
+/* $Id: thread.c,v 1.49 2000/06/27 19:20:45 dwelch Exp $
*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
NTSTATUS STDCALL NtContinue(IN PCONTEXT Context,
- IN CINT IrqLevel)
+ IN BOOLEAN TestAlert)
{
PULONG StackTop;