mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Lucas Stach <dev@lynxeye.de>
To: barebox@lists.infradead.org
Subject: [PATCH 2/8] tegra: try harder inlining early startup functions
Date: Sun, 29 Sep 2013 21:59:30 +0200	[thread overview]
Message-ID: <1380484776-32266-3-git-send-email-dev@lynxeye.de> (raw)
In-Reply-To: <1380484776-32266-1-git-send-email-dev@lynxeye.de>

It seems GCC 4.8 tries to be clever by not inlining some of those
functions. This causes havok, as it's absolutely required to inline
the early startup function, otherwise we may end up calling ARMv7 code
on the ARMv4 AVP.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
---
 arch/arm/mach-tegra/include/mach/lowlevel.h | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/arch/arm/mach-tegra/include/mach/lowlevel.h b/arch/arm/mach-tegra/include/mach/lowlevel.h
index 071416f..2d3f312 100644
--- a/arch/arm/mach-tegra/include/mach/lowlevel.h
+++ b/arch/arm/mach-tegra/include/mach/lowlevel.h
@@ -40,7 +40,8 @@
 #define T20_ODMDATA_UARTID_SHIFT	15
 #define T20_ODMDATA_UARTID_MASK		(7 << T20_ODMDATA_UARTID_SHIFT)
 
-static inline u32 tegra_get_odmdata(void)
+static inline __attribute__((always_inline))
+u32 tegra_get_odmdata(void)
 {
 	u32 bctsize, bctptr, odmdata;
 
@@ -62,7 +63,8 @@ enum tegra_chiptype {
 	TEGRA20 = 0,
 };
 
-static inline enum tegra_chiptype tegra_get_chiptype(void)
+static inline __attribute__((always_inline))
+enum tegra_chiptype tegra_get_chiptype(void)
 {
 	u32 hidrev;
 
@@ -76,7 +78,8 @@ static inline enum tegra_chiptype tegra_get_chiptype(void)
 	}
 }
 
-static inline int tegra_get_num_cores(void)
+static inline __attribute__((always_inline))
+int tegra_get_num_cores(void)
 {
 	switch (tegra_get_chiptype()) {
 	case TEGRA20:
@@ -89,7 +92,8 @@ static inline int tegra_get_num_cores(void)
 }
 
 /* Runtime data */
-static inline int tegra_cpu_is_maincomplex(void)
+static inline __attribute__((always_inline))
+int tegra_cpu_is_maincomplex(void)
 {
 	u32 tag0;
 
@@ -98,7 +102,8 @@ static inline int tegra_cpu_is_maincomplex(void)
 	return (tag0 & 0xff) == 0x55;
 }
 
-static inline uint32_t tegra20_get_ramsize(void)
+static inline __attribute__((always_inline))
+uint32_t tegra20_get_ramsize(void)
 {
 	switch ((tegra_get_odmdata() & T20_ODMDATA_RAMSIZE_MASK) >>
 		T20_ODMDATA_RAMSIZE_SHIFT) {
@@ -120,7 +125,8 @@ static long uart_id_to_base[] = {
 	TEGRA_UARTE_BASE,
 };
 
-static inline long tegra20_get_debuguart_base(void)
+static inline __attribute__((always_inline))
+long tegra20_get_debuguart_base(void)
 {
 	u32 odmdata;
 	int id;
@@ -146,7 +152,8 @@ static inline long tegra20_get_debuguart_base(void)
 #define CRC_OSC_CTRL_OSC_FREQ_SHIFT	30
 #define CRC_OSC_CTRL_OSC_FREQ_MASK	(0x3 << CRC_OSC_CTRL_OSC_FREQ_SHIFT)
 
-static inline unsigned int tegra_get_osc_clock(void)
+static inline unsigned __attribute__((always_inline))
+int tegra_get_osc_clock(void)
 {
 	u32 osc_ctrl = readl(TEGRA_CLK_RESET_BASE + CRC_OSC_CTRL);
 
-- 
1.8.3.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2013-09-29 19:57 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-29 19:59 [PATCH 0/8] Tegra multi image support Lucas Stach
2013-09-29 19:59 ` [PATCH 1/8] images: correctly linebreak built images output Lucas Stach
2013-10-02  8:20   ` Sascha Hauer
2013-09-29 19:59 ` Lucas Stach [this message]
2013-09-29 19:59 ` [PATCH 3/8] tegra: start maincomplex execution at correct offset Lucas Stach
2013-09-29 19:59 ` [PATCH 4/8] tegra: fix PBL build Lucas Stach
2013-09-29 19:59 ` [PATCH 5/8] tegra: mandate relocatable binary Lucas Stach
2013-09-29 19:59 ` [PATCH 6/8] tegra: don't force to choose between Tegra arches Lucas Stach
2013-09-29 19:59 ` [PATCH 7/8] tegra: ac100: delete custom Kconfig Lucas Stach
2013-09-29 19:59 ` [PATCH 8/8] tegra: switch to multi image Lucas Stach

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=1380484776-32266-3-git-send-email-dev@lynxeye.de \
    --to=dev@lynxeye.de \
    --cc=barebox@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