TianoCore EDK2 master
Loading...
Searching...
No Matches
ScanMemGeneric.c
Go to the documentation of this file.
1
14#include "../MemLibInternals.h"
15
27CONST VOID *
28EFIAPI
30 IN CONST VOID *Buffer,
31 IN UINTN Length,
32 IN UINT16 Value
33 )
34{
35 CONST UINT16 *Pointer;
36
37 Pointer = (CONST UINT16 *)Buffer;
38 do {
39 if (*Pointer == Value) {
40 return Pointer;
41 }
42
43 ++Pointer;
44 } while (--Length != 0);
45
46 return NULL;
47}
48
60CONST VOID *
61EFIAPI
63 IN CONST VOID *Buffer,
64 IN UINTN Length,
65 IN UINT32 Value
66 )
67{
68 CONST UINT32 *Pointer;
69
70 Pointer = (CONST UINT32 *)Buffer;
71 do {
72 if (*Pointer == Value) {
73 return Pointer;
74 }
75
76 ++Pointer;
77 } while (--Length != 0);
78
79 return NULL;
80}
81
93CONST VOID *
94EFIAPI
96 IN CONST VOID *Buffer,
97 IN UINTN Length,
98 IN UINT64 Value
99 )
100{
101 CONST UINT64 *Pointer;
102
103 Pointer = (CONST UINT64 *)Buffer;
104 do {
105 if (*Pointer == Value) {
106 return Pointer;
107 }
108
109 ++Pointer;
110 } while (--Length != 0);
111
112 return NULL;
113}
114
125BOOLEAN
126EFIAPI
128 IN CONST VOID *Buffer,
129 IN UINTN Length
130 )
131{
132 CONST UINT8 *BufferData;
133 UINTN Index;
134
135 BufferData = Buffer;
136 for (Index = 0; Index < Length; Index++) {
137 if (BufferData[Index] != 0) {
138 return FALSE;
139 }
140 }
141
142 return TRUE;
143}
UINT64 UINTN
#define NULL
Definition: Base.h:319
#define CONST
Definition: Base.h:259
#define TRUE
Definition: Base.h:301
#define FALSE
Definition: Base.h:307
#define IN
Definition: Base.h:279
CONST VOID *EFIAPI InternalMemScanMem32(IN CONST VOID *Buffer, IN UINTN Length, IN UINT32 Value)
CONST VOID *EFIAPI InternalMemScanMem64(IN CONST VOID *Buffer, IN UINTN Length, IN UINT64 Value)
BOOLEAN EFIAPI InternalMemIsZeroBuffer(IN CONST VOID *Buffer, IN UINTN Length)
CONST VOID *EFIAPI InternalMemScanMem16(IN CONST VOID *Buffer, IN UINTN Length, IN UINT16 Value)