From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: make head.S less dependent on the compile time PHYS_OFFSET define
Date: Thu, 13 Jan 2011 23:23:27 +0000 [thread overview]
Message-ID: <20110113232327.GG24149@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <alpine.LFD.2.00.1101131659220.11803@xanadu.home>
On Thu, Jan 13, 2011 at 05:04:28PM -0500, Nicolas Pitre wrote:
> + .macro phys_offset, rd
> + mov \rd, pc
> + and \rd, \rd, #0xf8000000
> + .endm
We can do loads better than that, as the p2v fixup code has proven.
Now that r8 has been eliminated, I may rebase the p2v stuff ontop of
that commit, and move the computation of phys_offset out of the p2v
fixup code - and have it in r8 for __create_page_tables to use.
FYI, the real PHYS_OFFSET value can be found by (eg):
1: .long .
.long PAGE_OFFSET
adr r0, 1b
ldmia r0, {r1, r2}
sub r1, r0, r1
add r3, r2, r1
r1 now contains the offset between virtual and physical spaces, r2
contains the compile-time PAGE_OFFSET constant, and r3 the runtime
equivalent of PHYS_OFFSET.
None of this uses troublesome masking which will trip up on platforms
such as MSM - we really must stop writing code which assumes that
physical memory is aligned to >= 32MB.
next prev parent reply other threads:[~2011-01-13 23:23 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-13 22:04 [PATCH] ARM: make head.S less dependent on the compile time PHYS_OFFSET define Nicolas Pitre
2011-01-13 23:23 ` Russell King - ARM Linux [this message]
2011-01-14 6:18 ` Nicolas Pitre
2011-01-15 0:44 ` Russell King - ARM Linux
2011-01-15 4:49 ` Nicolas Pitre
2011-01-15 12:01 ` Russell King - ARM Linux
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=20110113232327.GG24149@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
/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;
as well as URLs for NNTP newsgroup(s).