forked from isabella232/shim-tdx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.c
67 lines (54 loc) · 1.36 KB
/
test.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// SPDX-License-Identifier: BSD-2-Clause-Patent
/*
* test.c - stuff we need for test harnesses
* Copyright Peter Jones <[email protected]>
*/
#ifndef SHIM_UNIT_TEST
#define SHIM_UNIT_TEST
#endif
#include "shim.h"
UINT8 in_protocol = 0;
int debug = DEFAULT_DEBUG_PRINT_STATE;
#pragma GCC diagnostic ignored "-Wunused-parameter"
#pragma GCC diagnostic ignored "-Wunused-function"
EFI_STATUS EFIAPI
LogError_(const char *file, int line, const char *func, const CHAR16 *fmt, ...)
{
assert(0);
return EFI_SUCCESS;
}
INTN
StrCmp(CONST CHAR16 *s1, CONST CHAR16 *s2) {
assert(s1 != NULL);
assert(s2 != NULL);
int i;
for (i = 0; s1[i] && s2[i]; i++) {
if (s1[i] != s2[i])
return s2[i] - s1[i];
}
return 0;
}
INTN
StrnCmp(CONST CHAR16 *s1, CONST CHAR16 *s2, UINTN len) {
assert(s1 != NULL);
assert(s2 != NULL);
UINTN i;
for (i = 0; i < len && s1[i] && s2[i]; i++) {
if (s1[i] != s2[i])
return s2[i] - s1[i];
}
return 0;
}
EFI_STATUS
get_variable_attr(const CHAR16 * const var, UINT8 **data, UINTN *len,
EFI_GUID owner, UINT32 *attributes)
{
return EFI_UNSUPPORTED;
}
EFI_STATUS
get_variable(const CHAR16 * const var, UINT8 **data, UINTN *len, EFI_GUID owner)
{
return get_variable_attr(var, data, len, owner, NULL);
}
EFI_GUID SHIM_LOCK_GUID = {0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23 } };
// vim:fenc=utf-8:tw=75:noet