forked from pbatard/EfiFs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path0001-GRUB-fixes.patch
83 lines (76 loc) · 2.38 KB
/
0001-GRUB-fixes.patch
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
From d1c8ad74e0e313dc83f2cca42b9ad1ce240c9046 Mon Sep 17 00:00:00 2001
From: danjujan <[email protected]>
Date: Wed, 17 Jan 2024 21:11:37 +0100
Subject: [PATCH] Efifs patch
---
grub-core/fs/reiserfs.c | 5 ++++-
grub-core/kern/misc.c | 6 +++---
include/grub/misc.h | 2 ++
3 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/grub-core/fs/reiserfs.c b/grub-core/fs/reiserfs.c
index 36b26ac98..1cb4a4d99 100644
--- a/grub-core/fs/reiserfs.c
+++ b/grub-core/fs/reiserfs.c
@@ -42,15 +42,18 @@
GRUB_MOD_LICENSE ("GPLv3+");
+#ifndef MIN
#define MIN(a, b) \
({ typeof (a) _a = (a); \
typeof (b) _b = (b); \
_a < _b ? _a : _b; })
-
+#endif
+#ifndef MAX
#define MAX(a, b) \
({ typeof (a) _a = (a); \
typeof (b) _b = (b); \
_a > _b ? _a : _b; })
+#endif
#define REISERFS_SUPER_BLOCK_OFFSET 0x10000
#define REISERFS_MAGIC_LEN 12
diff --git a/grub-core/kern/misc.c b/grub-core/kern/misc.c
index 7cee5d75c..5a5828b7a 100644
--- a/grub-core/kern/misc.c
+++ b/grub-core/kern/misc.c
@@ -37,7 +37,7 @@ union printf_arg
INT, LONG, LONGLONG,
UNSIGNED_INT = 3, UNSIGNED_LONG, UNSIGNED_LONGLONG,
STRING,
- GUID
+ MYGUID
} type;
long long ll;
};
@@ -900,7 +900,7 @@ parse_printf_arg_fmt (const char *fmt0, struct printf_args *args,
else
args->ptr[curn].type = UNSIGNED_INT;
if (*(fmt) == 'G') {
- args->ptr[curn].type = GUID;
+ args->ptr[curn].type = MYGUID;
++fmt;
}
break;
@@ -944,7 +944,7 @@ parse_printf_args (const char *fmt0, struct printf_args *args, va_list args_in)
args->ptr[n].ll = va_arg (args_in, long long);
break;
case STRING:
- case GUID:
+ case MYGUID:
if (sizeof (void *) == sizeof (long long))
args->ptr[n].ll = va_arg (args_in, long long);
else
diff --git a/include/grub/misc.h b/include/grub/misc.h
index 1b35a167f..f522a55c2 100644
--- a/include/grub/misc.h
+++ b/include/grub/misc.h
@@ -32,7 +32,9 @@
#define ALIGN_UP_OVERHEAD(addr, align) ((-(addr)) & ((typeof (addr)) (align) - 1))
#define ALIGN_DOWN(addr, align) \
((addr) & ~((typeof (addr)) (align) - 1))
+#ifndef ARRAY_SIZE
#define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0]))
+#endif
#define COMPILE_TIME_ASSERT(cond) switch (0) { case 1: case !(cond): ; }
#define grub_dprintf(condition, ...) grub_real_dprintf(GRUB_FILE, __LINE__, condition, __VA_ARGS__)
--
2.43.0