ReactOS 0.4.16-dev-92-g0c2cdca
blkcache.c File Reference
#include "bl.h"
Include dependency graph for blkcache.c:

Go to the source code of this file.

Functions

NTSTATUS BcpDestroy (VOID)
 
BOOLEAN BcpCompareKey (_In_ PBL_HASH_ENTRY Entry1, _In_ PBL_HASH_ENTRY Entry2)
 
ULONG BcpHashFunction (_In_ PBL_HASH_ENTRY Entry, _In_ ULONG TableSize)
 
NTSTATUS BcInitialize (VOID)
 

Variables

ULONG BcpBlockAllocatorHandle
 
ULONG BcpHashTableId
 

Function Documentation

◆ BcInitialize()

NTSTATUS BcInitialize ( VOID  )

Definition at line 73 of file blkcache.c.

76{
78
80 if (!NT_SUCCESS(Status))
81 {
82 goto Quickie;
83 }
84
87 {
89 goto Quickie;
90 }
91
93 if (Status >= 0)
94 {
95 return Status;
96 }
97
98Quickie:
99 EfiPrintf(L"Failure path not yet implemented\r\n");
100#if 0
101 if (BcpHashTableId != -1)
102 {
103 BlHtDestroy(BcpHashTableId);
104 }
105 if (BcpBlockAllocatorHandle != -1)
106 {
108 }
109#endif
110 return Status;
111}
LONG NTSTATUS
Definition: precomp.h:26
VOID EfiPrintf(_In_ PWCHAR Format,...)
Definition: firmware.c:126
NTSTATUS BlHtCreate(_In_ ULONG Size, _In_ PBL_HASH_TABLE_HASH_FUNCTION HashFunction, _In_ PBL_HASH_TABLE_COMPARE_FUNCTION CompareFunction, _Out_ PULONG Id)
Definition: util.c:504
NTSTATUS BlpMmCreateBlockAllocator(VOID)
Definition: blkalloc.c:213
NTSTATUS BlpIoRegisterDestroyRoutine(_In_ PBL_IO_DESTROY_ROUTINE DestroyRoutine)
Definition: io.c:21
NTSTATUS BlpMmDeleteBlockAllocator(_In_ ULONG BlockId)
Definition: blkalloc.c:88
ULONG BcpHashTableId
Definition: blkcache.c:16
ULONG BcpHashFunction(_In_ PBL_HASH_ENTRY Entry, _In_ ULONG TableSize)
Definition: blkcache.c:45
ULONG BcpBlockAllocatorHandle
Definition: blkcache.c:15
BOOLEAN BcpCompareKey(_In_ PBL_HASH_ENTRY Entry1, _In_ PBL_HASH_ENTRY Entry2)
Definition: blkcache.c:32
NTSTATUS BcpDestroy(VOID)
Definition: blkcache.c:21
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
Status
Definition: gdiplustypes.h:25
#define L(x)
Definition: ntvdm.h:50
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132

Referenced by BlockIopInitialize().

◆ BcpCompareKey()

BOOLEAN BcpCompareKey ( _In_ PBL_HASH_ENTRY  Entry1,
_In_ PBL_HASH_ENTRY  Entry2 
)

Definition at line 32 of file blkcache.c.

36{
37 PULONG Value1, Value2;
38
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];
42}
uint32_t * PULONG
Definition: typedefs.h:59

Referenced by BcInitialize().

◆ BcpDestroy()

NTSTATUS BcpDestroy ( VOID  )

Definition at line 21 of file blkcache.c.

24{
25 //BcpPurgeCacheEntries();
26 //return BlpMmDeleteBlockAllocator(BcpBlockAllocatorHandle);
27 EfiPrintf(L"Destructor for block cache not yet implemented\r\n");
29}
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:239

Referenced by BcInitialize().

◆ BcpHashFunction()

ULONG BcpHashFunction ( _In_ PBL_HASH_ENTRY  Entry,
_In_ ULONG  TableSize 
)

Definition at line 45 of file blkcache.c.

49{
50 ULONG i, j, ValueHash;
51 PUCHAR ValueBuffer;
52
53 j = 0;
54 ValueHash = 0;
55 i = 0;
56
57 ValueBuffer = Entry->Value;
58
59 do
60 {
61 ValueHash += ValueBuffer[i++];
62 } while (i < 8);
63
64 do
65 {
66 ValueHash += ValueBuffer[j++ + 8];
67 } while (j < 4);
68
69 return ValueHash % TableSize;
70}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
base of all file and directory entries
Definition: entries.h:83
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
_Must_inspect_result_ typedef _Out_ PULONG TableSize
Definition: iotypes.h:4327

Referenced by BcInitialize().

Variable Documentation

◆ BcpBlockAllocatorHandle

ULONG BcpBlockAllocatorHandle

Definition at line 15 of file blkcache.c.

Referenced by BcInitialize().

◆ BcpHashTableId

ULONG BcpHashTableId

Definition at line 16 of file blkcache.c.

Referenced by BcInitialize().