Skip to contentSkip to conversation

ARM: Fix XIP build due to PHYS_OFFSET definition moving

PATCH In review Stephen Boyd 1 participant 3 messages Aug 3, 2012 – Aug 22, 2012 Arm (32-bit)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: Fix XIP build due to PHYS_OFFSET definition moving

During the p2v changes, the PHYS_OFFSET #define moved into a !__ASSEMBLY__ section. This causes a XIP build to fail with

arch/arm/kernel/head.o: In function 'stext':
arch/arm/kernel/head.S:146: undefined reference to 'PHYS_OFFSET'

Momentarily leave the #ifndef __ASSEMBLY__ section so we can define PHYS_OFFSET for all compilation units.

---

I don't know if it's worth stable, seems that nobody has compiled XIP for a year (back to 2.6.39 days?).

 arch/arm/include/asm/memory.h | 3 +++
 1 file changed, 3 insertions(+)
arch/arm/include/asm/memory.h +3 -0
index fcb5757..3299b2d 100644
@@ -187,6 +187,7 @@ static inline unsigned long __phys_to_virt(unsigned long x)
 #define __phys_to_virt(x)	((x) - PHYS_OFFSET + PAGE_OFFSET)
 #endif
 #endif
+#endif /* __ASSEMBLY__ */
 
 #ifndef PHYS_OFFSET
 #ifdef PLAT_PHYS_OFFSET
@@ -196,6 +197,8 @@ static inline unsigned long __phys_to_virt(unsigned long x)
 #endif
 #endif
 
+#ifndef __ASSEMBLY__
+
 /*
  * PFNs are used to describe any physical page; this means
  * PFN 0 == physical address 0.
Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#1 lore raw
Quoted 6 lines · Stephen Boyd

During the p2v changes, the PHYS_OFFSET #define moved into a !__ASSEMBLY__ section. This causes a XIP build to fail with

arch/arm/kernel/head.o: In function 'stext':
arch/arm/kernel/head.S:146: undefined reference to 'PHYS_OFFSET'

Quoted 8 lines

Momentarily leave the #ifndef __ASSEMBLY__ section so we can define PHYS_OFFSET for all compilation units.

---

I don't know if it's worth stable, seems that nobody has compiled XIP for a year (back to 2.6.39 days?).

Is this approach acceptable? Shall I put this in the patch tracker?

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.
#2 lore raw
Quoted 10 lines · Stephen Boyd
Quoted 9 lines · Stephen Boyd

During the p2v changes, the PHYS_OFFSET #define moved into a !__ASSEMBLY__ section. This causes a XIP build to fail with

arch/arm/kernel/head.o: In function 'stext':
arch/arm/kernel/head.S:146: undefined reference to 'PHYS_OFFSET'

Momentarily leave the #ifndef __ASSEMBLY__ section so we can define PHYS_OFFSET for all compilation units.

Quoted 7 lines
Quoted 5 lines

---

I don't know if it's worth stable, seems that nobody has compiled XIP for a year (back to 2.6.39 days?).

Is this approach acceptable? Shall I put this in the patch tracker?

I'll take silence to mean "yes", so I'll put this in the patch tracker unless someone objects.

Signature · 2 lines
Sent by an employee of the Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.