2 * COPYRIGHT: See COPYING.ARM in the top level directory
3 * PROJECT: ReactOS UEFI Boot Library
4 * FILE: boot/environ/lib/io/blkcache.c
5 * PURPOSE: Boot Library Block Cache Management Routines
6 * PROGRAMMER: Alex Ionescu (alex.ionescu@reactos.org)
9 /* INCLUDES ******************************************************************/
13 /* DATA VARIABLES ************************************************************/
15 ULONG BcpBlockAllocatorHandle
;
18 /* FUNCTIONS *****************************************************************/
25 //BcpPurgeCacheEntries();
26 //return BlpMmDeleteBlockAllocator(BcpBlockAllocatorHandle);
27 EfiPrintf(L
"Destructor for block cache not yet implemented\r\n");
28 return STATUS_NOT_IMPLEMENTED
;
33 _In_ PBL_HASH_ENTRY Entry1
,
34 _In_ PBL_HASH_ENTRY Entry2
37 PULONG Value1
, Value2
;
39 Value1
= Entry1
->Value
;
40 Value2
= Entry2
->Value
;
41 return Entry1
->Size
== Entry2
->Size
&& Entry1
->Flags
== Entry2
->Flags
&& *Value1
== *Value2
&& Value1
[1] == Value2
[1] && Value1
[2] == Value2
[2];
46 _In_ PBL_HASH_ENTRY Entry
,
50 ULONG i
, j
, ValueHash
;
57 ValueBuffer
= Entry
->Value
;
61 ValueHash
+= ValueBuffer
[i
++];
66 ValueHash
+= ValueBuffer
[j
++ + 8];
69 return ValueHash
% TableSize
;
79 Status
= BlHtCreate(50, BcpHashFunction
, BcpCompareKey
, &BcpHashTableId
);
80 if (!NT_SUCCESS(Status
))
85 BcpBlockAllocatorHandle
= BlpMmCreateBlockAllocator();
86 if (BcpBlockAllocatorHandle
== -1)
88 Status
= STATUS_UNSUCCESSFUL
;
92 Status
= BlpIoRegisterDestroyRoutine(BcpDestroy
);
99 EfiPrintf(L
"Failure path not yet implemented\r\n");
101 if (BcpHashTableId
!= -1)
103 BlHtDestroy(BcpHashTableId
);
105 if (BcpBlockAllocatorHandle
!= -1)
107 BlpMmDeleteBlockAllocator(BcpBlockAllocatorHandle
);