Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Franck Bui-Huu <vagabon.xyz@gmail.com>
To: ralf@linux-mips.org
Cc: anemo@mba.ocn.ne.jp, ths@networkno.de, linux-mips@linux-mips.org,
	Franck Bui-Huu <fbuihuu@gmail.com>
Subject: [PATCH 4/7] Introduce __pa_symbol()
Date: Thu, 19 Oct 2006 13:20:02 +0200	[thread overview]
Message-ID: <11612568062682-git-send-email-fbuihuu@gmail.com> (raw)
In-Reply-To: <11612568052624-git-send-email-fbuihuu@gmail.com>

This patch introduces __pa_symbol() macro which should be used to
calculate the physical address of kernel symbols. It also relies
on RELOC_HIDE() to avoid any compiler's oddities when doing
arithmetics on symbols.

Signed-off-by: Franck Bui-Huu <fbuihuu@gmail.com>
---
 include/asm-mips/page.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/include/asm-mips/page.h b/include/asm-mips/page.h
index 119daee..5c4284b 100644
--- a/include/asm-mips/page.h
+++ b/include/asm-mips/page.h
@@ -139,6 +139,7 @@ #else
 #define __pa_page_offset(x)	PAGE_OFFSET
 #endif
 #define __pa(x)			((unsigned long)(x) - __pa_page_offset(x))
+#define __pa_symbol(x)		__pa(RELOC_HIDE((unsigned long)(x),0))
 #define __va(x)			((void *)((unsigned long)(x) + PAGE_OFFSET))
 
 #define pfn_to_kaddr(pfn)	__va((pfn) << PAGE_SHIFT)
-- 
1.4.2.3

  parent reply	other threads:[~2006-10-19 11:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-19 11:19 [PATCH 0/7] Get ride of CPHYSADDR() in setup.c [take #4] Franck Bui-Huu
2006-10-19 11:19 ` [PATCH 1/7] page.h: remove __pa() usages Franck Bui-Huu
2006-10-19 11:20 ` [PATCH 2/7] Make __pa() aware of XKPHYS/CKSEG0 address mix for 64 bit kernels Franck Bui-Huu
2006-10-19 11:20 ` [PATCH 3/7] setup.c: get ride of CPHYSADDR() Franck Bui-Huu
2006-10-19 11:20 ` Franck Bui-Huu [this message]
2006-10-19 11:20 ` [PATCH 5/7] setup.c: use __pa_symbol() where needed Franck Bui-Huu
2006-10-19 11:20 ` [PATCH 6/7] setup.c: clean up initrd related code Franck Bui-Huu
2006-10-19 11:20 ` [PATCH 7/7] Make free_init_pages() arguments to be physical addresses Franck Bui-Huu
2006-10-20  3:19 ` [PATCH 0/7] Get ride of CPHYSADDR() in setup.c [take #4] Atsushi Nemoto
  -- strict thread matches above, loose matches on Subject: below --
2006-10-16 16:12 [PATCH 0/7] Get ride of CPHYSADDR() in setup.c [take #3] Franck Bui-Huu
2006-10-16 16:12 ` [PATCH 4/7] Introduce __pa_symbol() Franck Bui-Huu
2006-10-13 12:38 [PATCH 0/7] Get ride of CPHYSADDR() in setup.c [take #2] Franck Bui-Huu
2006-10-13 12:39 ` [PATCH 4/7] Introduce __pa_symbol() Franck Bui-Huu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11612568062682-git-send-email-fbuihuu@gmail.com \
    --to=vagabon.xyz@gmail.com \
    --cc=anemo@mba.ocn.ne.jp \
    --cc=fbuihuu@gmail.com \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=ths@networkno.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox