From: Wolfgang Denk Date: Sun, 14 Nov 2010 20:23:31 +0100 Subject: [U-Boot] RFC: Aligning arch initialisation sequences In-Reply-To: <4CE0221A.7030502@free.fr> References: <4CD67A22.9040802@gmail.com> <201011091835.38581.vapier@gentoo.org> <4CDE1107.80108@gmail.com> <4CDE4A53.4070106@free.fr> <4CDE741C.1020507@gmail.com> <4CDF6F2E.9040900@gmail.com> <4CDF7821.4080300@gmail.com> <4CDFA8E9.3050803@free.fr> <20101114103001.7EE2014EA7E@gemini.denx.de> <4CDFD1AE.1070409@free.fr> <20101114150102.DAAF914EA7E@gemini.denx.de> <4CE0221A.7030502@free.fr> Message-ID: <20101114192331.62ECA134F54@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Albert ARIBAUD, In message <4CE0221A.7030502@free.fr> you wrote: > > Alright, then I think we should document how we comply, or do not > comply, with GNU EABI / AAPCS (maybe a README.arm that people could read > up) -- and I think if there is a way to access GD both before and after > relocation without making a register unavailable to the whole u-boot > code, then we should use it. By the way - it should be not difficult to use a normal extern pointer to reference the global data; see "arch/powerpc/include/asm/global_data.h": 194 #if 1 195 #define DECLARE_GLOBAL_DATA_PTR register volatile gd_t *gd asm ("r2") 196 #else /* We could use plain global data, but the resulting code is bigger */ 197 #define XTRN_DECLARE_GLOBAL_DATA_PTR extern 198 #define DECLARE_GLOBAL_DATA_PTR XTRN_DECLARE_GLOBAL_DATA_PTR \ 199 gd_t *gd 200 #endif When I implemented this code I tested both versions. There is not much of a difference, except that the register based version results in smaller code. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de You are an excellent tactician, Captain. You let your second in com- mand attack while you sit and watch for weakness. -- Khan Noonian Singh, "Space Seed", stardate 3141.9