Date: Wed, 27 Feb 2013 22:27:06 -0800 From: Tim Kientzle <kientzle@freebsd.org> To: freebsd-arm@freebsd.org Subject: PHYSADDR Message-ID: <E886046B-1612-425B-902B-72D4B0E93618@freebsd.org>
next in thread | raw e-mail | index | archive | help
--Apple-Mail=_2781E653-7090-4675-87D1-DADE99D8603C
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
charset=windows-1252
Starting to look at what is needed for a Generic ARM kernel.
There's a lot here; I sincerely hope I'm not the only one=85 ;-)
First up: Can we get rid of PHYSADDR?
I think we can always compute it at runtime from PC.
For example, I think this works in several places:
and r0, pc, #0xF0000000
And I've found at least one reference that I think can be simply
eliminated:
Index: arm/elf_trampoline.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- arm/elf_trampoline.c (revision 247250)
+++ arm/elf_trampoline.c (working copy)
@@ -169,7 +169,7 @@
void
_startC(void)
{
- int physaddr =3D KERNPHYSADDR;
+ unsigned int physaddr =3D (unsigned int)&_start & 0xfffff000;
int tmp1;
unsigned int sp =3D ((unsigned int)&_end & ~3) + 4;
#if defined(FLASHADDR) && defined(LOADERRAMADDR)
@@ -189,10 +189,9 @@
*/
unsigned int target_addr;
unsigned int tmp_sp;
- uint32_t src_addr =3D (uint32_t)&_start - PHYSADDR + =
FLASHADDR
- + (pc - FLASHADDR - ((uint32_t)&_startC - PHYSADDR)) =
& 0xfffff000;
+ uint32_t src_addr =3D (uint32_t)&_start;
=20
- target_addr =3D (unsigned int)&_start - PHYSADDR + =
LOADERRAMADDR;
+ target_addr =3D (unsigned int)&_start - (pc & =
0xf0000000) + LOADERRAMADDR;
tmp_sp =3D target_addr + 0x100000 +
(unsigned int)&_end - (unsigned int)&_start;
memcpy((char *)target_addr, (char *)src_addr,
Tim
--Apple-Mail=_2781E653-7090-4675-87D1-DADE99D8603C
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename=signature.asc
Content-Type: application/pgp-signature;
name=signature.asc
Content-Description: Message signed with OpenPGP using GPGMail
-----BEGIN PGP SIGNATURE-----
Version: GnuPG/MacGPG2 v2.0.18 (Darwin)
iQEcBAEBAgAGBQJRLvi7AAoJEGMNyGo0rfFBdMwIAL3EPXt8BlsCYTnt3/c3tpPW
E4k6S06Nx9Q1YlQeO/mHV97WMJJ/zmbD0lKvFT6TIOAgbOqRiC2cq+AXRZLxwYLO
ypzgHQz8wjvqOjwSgsKBzGymOpNwNdPYTgCCGLwv4VwM7Mlq7Hj8ZSVk00sbB26z
O3e37u4YWYS8n8aIe8mNbnZDbj4QKM5OkTJ/NwcjS2Lj9108EB0VqcENcmITFo+U
9XnRaTOrbVQYy683iVLp7D7YHzrSjUQNPo0ik7SQ0ep0FIKixEpVoCBriAOwqn+e
CSfKRgEj0+w5AeyjhR2aZQ4cAE2uxNzvpz9OPxe+KS0u8VXDSWqor7rMlYSi5IA=
=uTxh
-----END PGP SIGNATURE-----
--Apple-Mail=_2781E653-7090-4675-87D1-DADE99D8603C--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E886046B-1612-425B-902B-72D4B0E93618>
