Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8fd49936 authored by Namhyung Kim's avatar Namhyung Kim Committed by Ingo Molnar
Browse files

x86: Document __phys_reloc_hide() usage in __pa_symbol()



Until all supported versions of gcc recognize
-fno-strict-overflow, we should keep the RELOC_HIDE() magic in
__pa_symbol(). Comment it.

Signed-off-by: default avatarNamhyung Kim <namhyung@gmail.com>
LKML-Reference: <1281508661-29507-1-git-send-email-namhyung@gmail.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 5989cd6a
Loading
Loading
Loading
Loading
+7 −0
Original line number Original line Diff line number Diff line
@@ -37,6 +37,13 @@ static inline void copy_user_page(void *to, void *from, unsigned long vaddr,
#define __pa_nodebug(x)	__phys_addr_nodebug((unsigned long)(x))
#define __pa_nodebug(x)	__phys_addr_nodebug((unsigned long)(x))
/* __pa_symbol should be used for C visible symbols.
/* __pa_symbol should be used for C visible symbols.
   This seems to be the official gcc blessed way to do such arithmetic. */
   This seems to be the official gcc blessed way to do such arithmetic. */
/*
 * We need __phys_reloc_hide() here because gcc may assume that there is no
 * overflow during __pa() calculation and can optimize it unexpectedly.
 * Newer versions of gcc provide -fno-strict-overflow switch to handle this
 * case properly. Once all supported versions of gcc understand it, we can
 * remove this Voodoo magic stuff. (i.e. once gcc3.x is deprecated)
 */
#define __pa_symbol(x)	__pa(__phys_reloc_hide((unsigned long)(x)))
#define __pa_symbol(x)	__pa(__phys_reloc_hide((unsigned long)(x)))


#define __va(x)			((void *)((unsigned long)(x)+PAGE_OFFSET))
#define __va(x)			((void *)((unsigned long)(x)+PAGE_OFFSET))