Skip to contentSkip to conversation

aspeed/timer: move static variables under arch_global_data

PATCH Applied Cédric Le Goater 2 participants 2 messages Oct 10, 2017 – Oct 20, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 aspeed/timer: move static variables under arch_global_data

The timestamp and lastdec variables are under BSS which is a problem as the timer_init() routine is called in the early init phase. Move them under arch_global_data.

---

Tested on AST2500 EVB

 arch/arm/mach-aspeed/timer.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
arch/arm/mach-aspeed/timer.c +4 -2
index 626f992429b6..d4a85116e80b 100644
@@ -31,8 +31,10 @@
 #define READ_CLK (*(volatile ulong *)(AST_TIMER_BASE + 0))
 #define READ_TIMER (READ_CLK / CLK_PER_HZ)
 
-static ulong timestamp;
-static ulong lastdec;
+DECLARE_GLOBAL_DATA_PTR;
+
+#define timestamp gd->arch.tbl
+#define lastdec gd->arch.lastinc
 
 int timer_init (void)
 {
Signature · 1 line
2.13.6
#1 lore raw
Quoted 5 lines · Cédric Le Goater

The timestamp and lastdec variables are under BSS which is a problem as the timer_init() routine is called in the early init phase. Move them under arch_global_data.

Applied to v2016.07-aspeed-openbmc.

Cheers,

Andrew

Quoted 24 lines

---

 Tested on AST2500 EVB

 arch/arm/mach-aspeed/timer.c | 6 ++++--

 1 file changed, 4 insertions(+), 2 deletions(-)

arch/arm/mach-aspeed/timer.c +0 -0
index 626f992429b6..d4a85116e80b 100644
@@ -31,8 +31,10 @@
  #define READ_CLK (*(volatile ulong *)(AST_TIMER_BASE + 0))
  #define READ_TIMER (READ_CLK / CLK_PER_HZ)

arch/arm/mach-aspeed/timer.c +4 -2
-static ulong timestamp;
-static ulong lastdec;
+DECLARE_GLOBAL_DATA_PTR;
+
+#define timestamp gd->arch.tbl
+#define lastdec gd->arch.lastinc


 int timer_init (void)
 {