* [U-Boot] [PATCH] MX5: Reuse the gd->tbl value for timestamp and add gd->lastinc for lastinc bss
@ 2011-01-23 16:08 Stefano Babic
2011-01-23 16:28 ` Wolfgang Denk
0 siblings, 1 reply; 3+ messages in thread
From: Stefano Babic @ 2011-01-23 16:08 UTC (permalink / raw)
To: u-boot
The usage of bss values in drivers before initialisation of bss is forbidden.
In that special case some data in .rel.dyn gets corrupted.
This patch is the same as recently applied for arm926js architecture.
Signed-off-by: Stefano Babic <sbabic@denx.de>
CC: Heiko Schocher <hs@denx.de>
---
arch/arm/cpu/armv7/mx5/timer.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/arch/arm/cpu/armv7/mx5/timer.c b/arch/arm/cpu/armv7/mx5/timer.c
index 3044fcf..1972f64 100644
--- a/arch/arm/cpu/armv7/mx5/timer.c
+++ b/arch/arm/cpu/armv7/mx5/timer.c
@@ -44,8 +44,10 @@ static struct mxc_gpt *cur_gpt = (struct mxc_gpt *)GPT1_BASE_ADDR;
#define GPTCR_CLKSOURCE_32 (4<<6) /* Clock source */
#define GPTCR_TEN (1) /* Timer enable */
-static ulong timestamp;
-static ulong lastinc;
+DECLARE_GLOBAL_DATA_PTR;
+
+#define timestamp (gd->tbl)
+#define lastinc (gd->lastinc)
int timer_init(void)
{
--
1.7.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] MX5: Reuse the gd->tbl value for timestamp and add gd->lastinc for lastinc bss
2011-01-23 16:08 [U-Boot] [PATCH] MX5: Reuse the gd->tbl value for timestamp and add gd->lastinc for lastinc bss Stefano Babic
@ 2011-01-23 16:28 ` Wolfgang Denk
2011-01-23 16:30 ` Stefano Babic
0 siblings, 1 reply; 3+ messages in thread
From: Wolfgang Denk @ 2011-01-23 16:28 UTC (permalink / raw)
To: u-boot
Dear Stefano Babic,
In message <1295798910-20382-1-git-send-email-sbabic@denx.de> you wrote:
> The usage of bss values in drivers before initialisation of bss is forbidden.
> In that special case some data in .rel.dyn gets corrupted.
>
> This patch is the same as recently applied for arm926js architecture.
>
> Signed-off-by: Stefano Babic <sbabic@denx.de>
> CC: Heiko Schocher <hs@denx.de>
> ---
> arch/arm/cpu/armv7/mx5/timer.c | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/cpu/armv7/mx5/timer.c b/arch/arm/cpu/armv7/mx5/timer.c
> index 3044fcf..1972f64 100644
> --- a/arch/arm/cpu/armv7/mx5/timer.c
> +++ b/arch/arm/cpu/armv7/mx5/timer.c
> @@ -44,8 +44,10 @@ static struct mxc_gpt *cur_gpt = (struct mxc_gpt *)GPT1_BASE_ADDR;
> #define GPTCR_CLKSOURCE_32 (4<<6) /* Clock source */
> #define GPTCR_TEN (1) /* Timer enable */
>
> -static ulong timestamp;
> -static ulong lastinc;
> +DECLARE_GLOBAL_DATA_PTR;
> +
> +#define timestamp (gd->tbl)
> +#define lastinc (gd->lastinc)
Why do we need these parens?
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
"UNIX was not designed to stop you from doing stupid things, because
that would also stop you from doing clever things." - Doug Gwyn
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] MX5: Reuse the gd->tbl value for timestamp and add gd->lastinc for lastinc bss
2011-01-23 16:28 ` Wolfgang Denk
@ 2011-01-23 16:30 ` Stefano Babic
0 siblings, 0 replies; 3+ messages in thread
From: Stefano Babic @ 2011-01-23 16:30 UTC (permalink / raw)
To: u-boot
On 01/23/2011 05:28 PM, Wolfgang Denk wrote:
> Why do we need these parens?
Checkpatch raises warnings without them.
Best regards,
Stefano Babic
--
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-01-23 16:30 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-23 16:08 [U-Boot] [PATCH] MX5: Reuse the gd->tbl value for timestamp and add gd->lastinc for lastinc bss Stefano Babic
2011-01-23 16:28 ` Wolfgang Denk
2011-01-23 16:30 ` Stefano Babic
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox