Skip to content

Commit 40a19d1

Browse files
committed
ArmPkg: Include: Add CLANGPDB Support in Assembly Macros
The change will guard the CLANG-unsupported directives outside of the __clang__ macro define. This change does not have functional change other than minimal section literals. Signed-off-by: Kun Qin <[email protected]>
1 parent 8f20fe3 commit 40a19d1

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

ArmPkg/Include/AsmMacroIoLib.h

+10
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,22 @@
1212
#ifndef ASM_MACRO_IO_LIB_H_
1313
#define ASM_MACRO_IO_LIB_H_
1414

15+
#ifndef __clang__ // MU_CHANGE
1516
#define _ASM_FUNC(Name, Section) \
1617
.global Name ; \
1718
.section #Section, "ax" ; \
1819
.type Name, %function ; \
1920
.p2align 2 ; \
2021
Name:
22+
// MU_CHANGE Starts: CLANGPDB support
23+
#else
24+
#define _ASM_FUNC(Name, Section) \
25+
.global Name ; \
26+
.section #Section, "ax" ; \
27+
.p2align 2 ; \
28+
Name:
29+
#endif
30+
// MU_CHANGE Ends
2131

2232
#define ASM_FUNC(Name) _ASM_FUNC(ASM_PFX(Name), .text. ## Name)
2333

ArmPkg/Include/AsmMacroIoLibV8.h

+21
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,41 @@ bgt %b6 __CR__ \
103103

104104
#if !defined (_MSC_VER)
105105

106+
#ifndef __clang__ // MU_CHANGE
106107
#define _ASM_FUNC(Name, Section) \
107108
.global Name ; \
108109
.section #Section, "ax" ; \
109110
.type Name, %function ; \
110111
Name: ; \
111112
AARCH64_BTI(c)
113+
// MU_CHANGE Starts: CLANGPDB support
114+
#else
115+
#define _ASM_FUNC(Name, Section) \
116+
.global Name ; \
117+
.section #Section, "ax" ; \
118+
Name: ; \
119+
AARCH64_BTI(c)
120+
#endif
121+
// MU_CHANGE Ends
112122

123+
#ifndef __clang__ // MU_CHANGE
113124
#define _ASM_FUNC_ALIGN(Name, Section, Align) \
114125
.global Name ; \
115126
.section #Section, "ax" ; \
116127
.type Name, %function ; \
117128
.balign Align ; \
118129
Name: ; \
119130
AARCH64_BTI(c)
131+
// MU_CHANGE Starts: CLANGPDB support
132+
#else
133+
#define _ASM_FUNC_ALIGN(Name, Section, Align) \
134+
.global Name ; \
135+
.section #Section, "ax" ; \
136+
.balign Align ; \
137+
Name: ; \
138+
AARCH64_BTI(c)
139+
#endif
140+
// MU_CHANGE Ends
120141

121142
#define ASM_FUNC(Name) _ASM_FUNC(ASM_PFX(Name), .text. ## Name)
122143

ArmPkg/Include/Chipset/AArch64.h

+9
Original file line numberDiff line numberDiff line change
@@ -139,9 +139,18 @@
139139
#define VECTOR_ENTRY(tbl, off) \
140140
.org off
141141

142+
#ifndef __clang__ // MU_CHANGE
142143
#define VECTOR_END(tbl) \
143144
.org 0x800; \
144145
.previous
146+
// MU_CHANGE Starts: CLANGPDB support
147+
#else
148+
#define VECTOR_END(tbl) \
149+
.org 0x800; \
150+
.section .text.##tbl##,"ax"; \
151+
.align 3
152+
#endif
153+
// MU_CHANGE Ends
145154

146155
#else
147156

0 commit comments

Comments
 (0)