Some work on portabilitity

svn path=/trunk/; revision=1687
This commit is contained in:
David Welch 2001-03-14 00:21:22 +00:00
parent f7186d4cc3
commit fc5f4ae9a5
13 changed files with 162 additions and 204 deletions

View file

@ -1,9 +1,14 @@
# $Id: Makefile,v 1.17 2001/03/12 19:23:48 dwelch Exp $ # $Id: Makefile,v 1.18 2001/03/14 00:21:21 dwelch Exp $
# #
# ReactOS Operating System # ReactOS Operating System
# #
PATH_TO_TOP = .. PATH_TO_TOP = ..
#
# Architecture to build for
#
ARCH := i386
TARGETNAME = ntoskrnl TARGETNAME = ntoskrnl
OBJECTS_PATH = objects OBJECTS_PATH = objects
@ -19,11 +24,18 @@ all: \
$(TARGETNAME).nostrip.exe \ $(TARGETNAME).nostrip.exe \
$(TARGETNAME).exe $(TARGETNAME).exe
#
# Hardware Abstraction Layer (Hal) # Hardware Abstraction Layer (Hal)
# Defines $(OBJECTS_HAL) # Defines $(OBJECTS_HAL)
# #
include hal/x86/sources include hal/x86/sources
#
# Architecture specific Makefile
# Defines $(OBJECTS_ARCH)
#
include Makefile.$(ARCH)
# System API (Nt/Zw) # System API (Nt/Zw)
OBJECTS_NT = \ OBJECTS_NT = \
nt/atom.o \ nt/atom.o \
@ -68,7 +80,6 @@ OBJECTS_RTL = \
# Kernel (Ke) # Kernel (Ke)
# Note: head.o MUST be the first file!!! # Note: head.o MUST be the first file!!!
OBJECTS_KE = \ OBJECTS_KE = \
ke/multiboot.o \
ke/apc.o \ ke/apc.o \
ke/bug.o \ ke/bug.o \
ke/catch.o \ ke/catch.o \
@ -76,11 +87,8 @@ OBJECTS_KE = \
ke/dpc.o \ ke/dpc.o \
ke/error.o \ ke/error.o \
ke/event.o \ ke/event.o \
ke/gdt.o \
ke/idt.o \
ke/kernel.o \ ke/kernel.o \
ke/kqueue.o \ ke/kqueue.o \
ke/ldt.o \
ke/main.o \ ke/main.o \
ke/mutex.o \ ke/mutex.o \
ke/process.o \ ke/process.o \
@ -90,21 +98,6 @@ OBJECTS_KE = \
ke/wait.o \ ke/wait.o \
ke/kthread.o ke/kthread.o
OBJECTS_KE_I386 = \
ke/i386/exp.o \
ke/i386/irq.o \
ke/i386/irqhand.o \
ke/i386/thread.o \
ke/i386/usercall.o \
ke/i386/trap.o \
ke/i386/bthread.o \
ke/i386/syscall.o \
ke/i386/tskswitch.o \
ke/i386/v86m.o \
ke/i386/v86m_sup.o \
ke/i386/bios.o \
ke/i386/i386-mcount.o
# Memory Manager (Mm) # Memory Manager (Mm)
OBJECTS_MM = \ OBJECTS_MM = \
mm/aspace.o \ mm/aspace.o \
@ -286,8 +279,8 @@ OBJECTS_KD = \
kd/service.o \ kd/service.o \
kd/dlog.o kd/dlog.o
C_OBJECTS := $(OBJECTS_NT) $(OBJECTS_HAL) $(OBJECTS_MM) $(OBJECTS_MM_I386) \ C_OBJECTS := $(OBJECTS_NT) $(OBJECTS_HAL) $(OBJECTS_MM) $(OBJECTS_ARCH) \
$(OBJECTS_IO) $(OBJECTS_KE) $(OBJECTS_KE_I386) $(OBJECTS_OB) \ $(OBJECTS_IO) $(OBJECTS_KE) $(OBJECTS_OB) \
$(OBJECTS_PS) $(OBJECTS_EX) $(OBJECTS_CC) $(OBJECTS_FS) $(OBJECTS_SE) \ $(OBJECTS_PS) $(OBJECTS_EX) $(OBJECTS_CC) $(OBJECTS_FS) $(OBJECTS_SE) \
$(OBJECTS_DBG) $(OBJECTS_CM) $(OBJECTS_LDR) $(OBJECTS_LPC) \ $(OBJECTS_DBG) $(OBJECTS_CM) $(OBJECTS_LDR) $(OBJECTS_LPC) \
$(OBJECTS_PO) $(OBJECTS_KD) $(OBJECTS_RTL) $(OBJECTS_PO) $(OBJECTS_KD) $(OBJECTS_RTL)
@ -316,18 +309,20 @@ $(OBJECTS_PATH)/hal.o: $(OBJECTS_HAL)
-o $(OBJECTS_PATH)/hal.o \ -o $(OBJECTS_PATH)/hal.o \
$(OBJECTS_HAL) $(OBJECTS_HAL)
$(OBJECTS_PATH)/arch.o: $(OBJECTS_ARCH)
$(LD) -r -o $(OBJECTS_PATH)/arch.o $(OBJECTS_ARCH)
$(OBJECTS_PATH)/io.o: $(OBJECTS_IO) $(OBJECTS_PATH)/io.o: $(OBJECTS_IO)
$(LD) \ $(LD) \
-r \ -r \
-o $(OBJECTS_PATH)/io.o \ -o $(OBJECTS_PATH)/io.o \
$(OBJECTS_IO) $(OBJECTS_IO)
$(OBJECTS_PATH)/ke.o: $(OBJECTS_KE) $(OBJECTS_KE_I386) $(OBJECTS_PATH)/ke.o: $(OBJECTS_KE)
$(LD) \ $(LD) \
-r \ -r \
-o $(OBJECTS_PATH)/ke.o \ -o $(OBJECTS_PATH)/ke.o \
$(OBJECTS_KE) \ $(OBJECTS_KE)
$(OBJECTS_KE_I386)
$(OBJECTS_PATH)/rtl.o: $(OBJECTS_RTL) $(OBJECTS_PATH)/rtl.o: $(OBJECTS_RTL)
$(LD) \ $(LD) \
@ -335,12 +330,11 @@ $(OBJECTS_PATH)/rtl.o: $(OBJECTS_RTL)
-o $(OBJECTS_PATH)/rtl.o \ -o $(OBJECTS_PATH)/rtl.o \
$(OBJECTS_RTL) $(OBJECTS_RTL)
$(OBJECTS_PATH)/mm.o: $(OBJECTS_MM) $(OBJECTS_MM_I386) $(OBJECTS_PATH)/mm.o: $(OBJECTS_MM)
$(LD) \ $(LD) \
-r \ -r \
-o $(OBJECTS_PATH)/mm.o \ -o $(OBJECTS_PATH)/mm.o \
$(OBJECTS_MM) \ $(OBJECTS_MM)
$(OBJECTS_MM_I386)
$(OBJECTS_PATH)/ob.o: $(OBJECTS_OB) $(OBJECTS_PATH)/ob.o: $(OBJECTS_OB)
$(LD) \ $(LD) \
@ -430,7 +424,8 @@ $(TARGETNAME).coff: $(TARGETNAME).rc ../include/reactos/resource.h
# Note: ke.o MUST be the first file!!! # Note: ke.o MUST be the first file!!!
OBJECTS = \ OBJECTS := \
$(OBJECTS_PATH)/arch.o \
$(OBJECTS_PATH)/ke.o \ $(OBJECTS_PATH)/ke.o \
$(OBJECTS_PATH)/hal.o \ $(OBJECTS_PATH)/hal.o \
$(OBJECTS_PATH)/cc.o \ $(OBJECTS_PATH)/cc.o \

View file

@ -0,0 +1,26 @@
OBJECTS_BOOT := ke/i386/multiboot.o
OBJECTS_KE_I386 := \
ke/i386/exp.o \
ke/i386/irq.o \
ke/i386/irqhand.o \
ke/i386/thread.o \
ke/i386/usercall.o \
ke/i386/trap.o \
ke/i386/bthread.o \
ke/i386/syscall.o \
ke/i386/tskswitch.o \
ke/i386/v86m.o \
ke/i386/v86m_sup.o \
ke/i386/bios.o \
ke/i386/i386-mcount.o \
ke/i386/gdt.o \
ke/i386/idt.o \
ke/i386/ldt.o
OBJECTS_MM_I386 := \
mm/i386/memsafe.o \
mm/i386/page.o \
mm/i386/pfault.o
OBJECTS_ARCH = $(OBJECTS_BOOT) $(OBJECTS_KE_I386) $(OBJECTS_MM_I386)

View file

@ -33,7 +33,8 @@
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
NTSTATUS CcInit(VOID) NTSTATUS
CcInit(VOID)
{ {
/* Nothing in here at the moment */ /* Nothing in here at the moment */

View file

@ -1,9 +1,27 @@
/* /*
* COPYRIGHT: See COPYING in the top level directory * ReactOS kernel
* Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/*
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
* FILE: ntoskrnl/ke/apc.c * FILE: ntoskrnl/ke/apc.c
* PURPOSE: Possible implementation of APCs * PURPOSE: Possible implementation of APCs
* PROGRAMMER: David Welch (welch@cwcom.net) * PROGRAMMER: David Welch (welch@cwcom.net)
* PORTABILITY: Unchecked
* UPDATE HISTORY: * UPDATE HISTORY:
* Created 22/05/98 * Created 22/05/98
* 12/11/99: Phillip Susi: Reworked the APC code * 12/11/99: Phillip Susi: Reworked the APC code
@ -21,10 +39,6 @@
#define NDEBUG #define NDEBUG
#include <internal/debug.h> #include <internal/debug.h>
/* NOTES *********************************************************************/
/* GLOBALS *******************************************************************/ /* GLOBALS *******************************************************************/
KSPIN_LOCK PiApcLock; KSPIN_LOCK PiApcLock;

View file

@ -1,10 +1,28 @@
/* $Id: bug.c,v 1.15 2001/03/07 08:57:08 dwelch Exp $ /*
* ReactOS kernel
* Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
/* $Id: bug.c,v 1.16 2001/03/14 00:21:22 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
* FILE: ntoskrnl/ke/bug.c * FILE: ntoskrnl/ke/bug.c
* PURPOSE: Graceful system shutdown if a bug is detected * PURPOSE: Graceful system shutdown if a bug is detected
* PROGRAMMER: David Welch (welch@cwcom.net) * PROGRAMMER: David Welch (welch@cwcom.net)
* PORTABILITY: Unchecked
* UPDATE HISTORY: * UPDATE HISTORY:
* Created 22/05/98 * Created 22/05/98
* Phillip Susi: 12/8/99: Minor fix * Phillip Susi: 12/8/99: Minor fix
@ -27,45 +45,40 @@ VOID PsDumpThreads(VOID);
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
VOID KeInitializeBugCheck(VOID) VOID
KeInitializeBugCheck(VOID)
{ {
InitializeListHead(&BugcheckCallbackListHead); InitializeListHead(&BugcheckCallbackListHead);
InBugCheck = 0; InBugCheck = 0;
} }
BOOLEAN STDCALL BOOLEAN STDCALL
KeDeregisterBugCheckCallback ( KeDeregisterBugCheckCallback (PKBUGCHECK_CALLBACK_RECORD CallbackRecord)
PKBUGCHECK_CALLBACK_RECORD CallbackRecord
)
{ {
UNIMPLEMENTED; UNIMPLEMENTED;
} }
BOOLEAN STDCALL BOOLEAN STDCALL
KeRegisterBugCheckCallback ( KeRegisterBugCheckCallback (PKBUGCHECK_CALLBACK_RECORD CallbackRecord,
PKBUGCHECK_CALLBACK_RECORD CallbackRecord, PKBUGCHECK_CALLBACK_ROUTINE CallbackRoutine,
PKBUGCHECK_CALLBACK_ROUTINE CallbackRoutine, PVOID Buffer,
PVOID Buffer, ULONG Length,
ULONG Length, PUCHAR Component)
PUCHAR Component
)
{ {
InsertTailList(&BugcheckCallbackListHead,&CallbackRecord->Entry); InsertTailList(&BugcheckCallbackListHead,&CallbackRecord->Entry);
CallbackRecord->Length=Length; CallbackRecord->Length=Length;
CallbackRecord->Buffer=Buffer; CallbackRecord->Buffer=Buffer;
CallbackRecord->Component=Component; CallbackRecord->Component=Component;
CallbackRecord->CallbackRoutine=CallbackRoutine; CallbackRecord->CallbackRoutine=CallbackRoutine;
return(TRUE); return(TRUE);
} }
VOID STDCALL VOID STDCALL
KeBugCheckEx ( KeBugCheckEx (ULONG BugCheckCode,
ULONG BugCheckCode, ULONG BugCheckParameter1,
ULONG BugCheckParameter1, ULONG BugCheckParameter2,
ULONG BugCheckParameter2, ULONG BugCheckParameter3,
ULONG BugCheckParameter3, ULONG BugCheckParameter4)
ULONG BugCheckParameter4
)
/* /*
* FUNCTION: Brings the system down in a controlled manner when an * FUNCTION: Brings the system down in a controlled manner when an
* inconsistency that might otherwise cause corruption has been detected * inconsistency that might otherwise cause corruption has been detected
@ -75,7 +88,8 @@ KeBugCheckEx (
* RETURNS: Doesn't * RETURNS: Doesn't
*/ */
{ {
__asm__("cli\n\t"); //PJS: disable interrupts first, then do the rest /* PJS: disable interrupts first, then do the rest */
__asm__("cli\n\t");
DbgPrint("Bug detected (code %x param %x %x %x %x)\n",BugCheckCode, DbgPrint("Bug detected (code %x param %x %x %x %x)\n",BugCheckCode,
BugCheckParameter1,BugCheckParameter2,BugCheckParameter3, BugCheckParameter1,BugCheckParameter2,BugCheckParameter3,
BugCheckParameter4); BugCheckParameter4);

View file

@ -1,40 +0,0 @@
/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel
* FILE: ntoskrnl/ke/cont.c
* PURPOSE: Continues from the specified context
* PROGRAMMER: David Welch (welch@mcmail.com)
* UPDATE HISTORY:
* Created 02/10/98
*/
/* INCLUDES *****************************************************************/
#include <ddk/ntddk.h>
#include <internal/debug.h>
/* FUNCTIONS *****************************************************************/
VOID KeContinue(PCONTEXT Context)
/*
* FUNCTION: Continues from the specified processor context
* NOTE: This function doesn't return
*/
{
_
__asm__("movl %0,%%eax\n\t"
"movw $"STR(USER_DS)",%%bx\n\t"
"movw %%bx,%%ds\n\t"
"movw %%bx,%%es\n\t"
"movw %%bx,%%fs\n\t"
"movw %%bx,%%gs\n\t"
"pushl $"STR(USER_DS)"\n\t"
"pushl $0x2000\n\t" // ESP
"pushl $0x202\n\t" // EFLAGS
"pushl $"STR(USER_CS)"\n\t" // CS
"pushl %%eax\n\t" // EIP
"iret\n\t"
: /* no output */
: "d" (Eip));
}

View file

@ -1,42 +0,0 @@
#include <internal/ntoskrnl.h>
#define NR_TASKS 128
.globl _start
.globl _NtProcessStartup
.globl _init_stack
.globl _init_stack_top
_NtProcessStartup:
_start:
lidt _idt_descr
lgdt _gdt_descr
movw $0x10,%ax
movw %ax,%ds
popl %eax
popl %eax
movl $_init_stack_top,%esp
pushl %eax
pushl $0
jmp __main
.data
_idt_descr:
.word (256*8)-1
.long _KiIdt
_gdt_descr:
.word ((8+NR_TASKS)*8)-1
.long _KiGdt
.align 8
_init_stack:
.fill MM_STACK_SIZE,1,0
_init_stack_top:

View file

@ -1,4 +1,4 @@
/* $Id: timer.c,v 1.39 2001/02/18 19:43:15 phreak Exp $ /* $Id: timer.c,v 1.40 2001/03/14 00:21:22 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -379,10 +379,10 @@ static void HandleExpiredTimer(PKTIMER current)
NULL); NULL);
DPRINT("Finished dpc routine\n"); DPRINT("Finished dpc routine\n");
} }
KeAcquireDispatcherDatabaseLock( FALSE ); KeAcquireDispatcherDatabaseLock(FALSE);
current->Header.SignalState = TRUE; current->Header.SignalState = TRUE;
KeDispatcherObjectWake( &current->Header ); KeDispatcherObjectWake(&current->Header);
KeReleaseDispatcherDatabaseLock( FALSE ); KeReleaseDispatcherDatabaseLock(FALSE);
if (current->Period != 0) if (current->Period != 0)
{ {
current->DueTime.QuadPart += current->DueTime.QuadPart +=
@ -395,10 +395,11 @@ static void HandleExpiredTimer(PKTIMER current)
} }
} }
VOID KeExpireTimers( PKDPC Dpc, VOID
PVOID Context1, KeExpireTimers(PKDPC Dpc,
PVOID Arg1, PVOID Context1,
PVOID Arg2 ) PVOID Arg1,
PVOID Arg2)
{ {
PLIST_ENTRY current_entry = NULL; PLIST_ENTRY current_entry = NULL;
PKTIMER current = NULL; PKTIMER current = NULL;
@ -409,36 +410,29 @@ VOID KeExpireTimers( PKDPC Dpc,
KeAcquireSpinLockAtDpcLevel(&TimerListLock); KeAcquireSpinLockAtDpcLevel(&TimerListLock);
while (current_entry!=(&TimerListHead)) while (current_entry != &TimerListHead)
{ {
current = CONTAINING_RECORD(current_entry, KTIMER, TimerListEntry); current = CONTAINING_RECORD(current_entry, KTIMER, TimerListEntry);
current_entry = current_entry->Flink; current_entry = current_entry->Flink;
if (system_time >= current->DueTime.QuadPart) if (system_time >= current->DueTime.QuadPart)
{ {
HandleExpiredTimer(current); HandleExpiredTimer(current);
} }
} }
KeReleaseSpinLockFromDpcLevel( &TimerListLock ); KeReleaseSpinLockFromDpcLevel(&TimerListLock);
} }
VOID KiUpdateSystemTime (VOID) VOID
KiUpdateSystemTime (VOID)
/* /*
* FUNCTION: Handles a timer interrupt * FUNCTION: Handles a timer interrupt
*/ */
{ {
char str[36]; char* vidmem=(char *)physical_to_linear(0xb8000 + 160 - 2);
char* vidmem=(char *)physical_to_linear(0xb8000 + 160 - 36);
int i;
int x,y;
// extern ULONG EiNrUsedBlocks;
extern unsigned int EiFreeNonPagedPool;
extern unsigned int EiUsedNonPagedPool;
// extern ULONG PiNrThreads;
// extern ULONG MiNrFreePages;
KiRawTicks++; KiRawTicks++;
@ -456,40 +450,35 @@ VOID KiUpdateSystemTime (VOID)
* Display the tick count in the top left of the screen as a debugging * Display the tick count in the top left of the screen as a debugging
* aid * aid
*/ */
// sprintf(str,"%.8u %.8u",nr_used_blocks,ticks); switch (KiTimerTicks % 4)
if ((EiFreeNonPagedPool + EiUsedNonPagedPool) == 0)
{ {
x = y = 0; case 0:
} vidmem[0] = '|';
else break;
{
x = (EiFreeNonPagedPool * 100) / case 1:
(EiFreeNonPagedPool + EiUsedNonPagedPool); vidmem[0] = '/';
y = (EiUsedNonPagedPool * 100) / break;
(EiFreeNonPagedPool + EiUsedNonPagedPool);
}
memset(str, 0, sizeof(str));
// sprintf(str,"%.8u %.8u",(unsigned int)EiNrUsedBlocks,
// (unsigned int)EiFreeNonPagedPool);
// sprintf(str,"%.8u %.8u",EiFreeNonPagedPool,EiUsedNonPagedPool);
// sprintf(str,"%.8u %.8u",(unsigned int)PiNrRunnableThreads,
// (unsigned int)PiNrThreads);
// sprintf(str,"%.8u %.8u", (unsigned int)PiNrRunnableThreads,
// (unsigned int)MiNrFreePages);
sprintf(str,"%.8u %.8u",EiFreeNonPagedPool,(unsigned int)KiTimerTicks);
for (i=0;i<17;i++) case 2:
{ vidmem[0] = '-';
*vidmem=str[i]; break;
vidmem++;
*vidmem=0x7; case 3:
vidmem++; vidmem[0] = '\\';
break;
} }
KeInsertQueueDpc( &ExpireTimerDpc, 0, 0 ); vidmem[1] = 0x7;
/*
* Queue a DPC that will expire timers
*/
KeInsertQueueDpc(&ExpireTimerDpc, 0, 0);
} }
VOID KeInitializeTimerImpl(VOID) VOID
KeInitializeTimerImpl(VOID)
/* /*
* FUNCTION: Initializes timer irq handling * FUNCTION: Initializes timer irq handling
* NOTE: This is only called once from main() * NOTE: This is only called once from main()
@ -505,7 +494,7 @@ VOID KeInitializeTimerImpl(VOID)
InitializeListHead(&TimerListHead); InitializeListHead(&TimerListHead);
KeInitializeSpinLock(&TimerListLock); KeInitializeSpinLock(&TimerListLock);
KeInitializeDpc( &ExpireTimerDpc, KeExpireTimers, 0 ); KeInitializeDpc(&ExpireTimerDpc, KeExpireTimers, 0);
TimerInitDone = TRUE; TimerInitDone = TRUE;
/* /*

View file

@ -1,4 +1,4 @@
/* $Id: npool.c,v 1.40 2001/03/13 21:46:43 dwelch Exp $ /* $Id: npool.c,v 1.41 2001/03/14 00:21:22 dwelch Exp $
* *
* COPYRIGHT: See COPYING in the top level directory * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -163,7 +163,8 @@ MiAddToTagHashTable(BLOCK_HDR* block)
} }
} }
VOID ExInitNonPagedPool(ULONG BaseAddress) VOID
ExInitNonPagedPool(ULONG BaseAddress)
{ {
kernel_pool_base = BaseAddress; kernel_pool_base = BaseAddress;
KeInitializeSpinLock(&MmNpoolLock); KeInitializeSpinLock(&MmNpoolLock);
@ -546,7 +547,7 @@ add_to_free_list(BLOCK_HDR* blk)
* FUNCTION: add the block to the free list (internal) * FUNCTION: add the block to the free list (internal)
*/ */
{ {
#if 0 #if 1
PLIST_ENTRY current_entry; PLIST_ENTRY current_entry;
PLIST_ENTRY next_entry; PLIST_ENTRY next_entry;
BLOCK_HDR* current; BLOCK_HDR* current;