All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Make __declare_dbe_table() static
@ 2007-02-18 15:44 Atsushi Nemoto
  2007-02-18 15:54 ` Ralf Baechle
  0 siblings, 1 reply; 5+ messages in thread
From: Atsushi Nemoto @ 2007-02-18 15:44 UTC (permalink / raw)
  To: linux-mips; +Cc: ralf

Make __declare_dbe_table() static and call it explicitly to ensure not
optimized out.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
---
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index cfd1785..78a3f75 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -340,7 +340,7 @@ NORET_TYPE void ATTRIB_NORET die(const c
 extern const struct exception_table_entry __start___dbe_table[];
 extern const struct exception_table_entry __stop___dbe_table[];
 
-void __declare_dbe_table(void)
+static void __declare_dbe_table(void)
 {
 	__asm__ __volatile__(
 	".section\t__dbe_table,\"a\"\n\t"
@@ -1576,4 +1576,5 @@ void __init trap_init(void)
 
 	flush_icache_range(ebase, ebase + 0x400);
 	flush_tlb_handlers();
+	__declare_dbe_table();
 }

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Make __declare_dbe_table() static
  2007-02-18 15:44 [PATCH] Make __declare_dbe_table() static Atsushi Nemoto
@ 2007-02-18 15:54 ` Ralf Baechle
  2007-02-18 15:58   ` Atsushi Nemoto
  0 siblings, 1 reply; 5+ messages in thread
From: Ralf Baechle @ 2007-02-18 15:54 UTC (permalink / raw)
  To: Atsushi Nemoto; +Cc: linux-mips

On Mon, Feb 19, 2007 at 12:44:35AM +0900, Atsushi Nemoto wrote:

> Make __declare_dbe_table() static and call it explicitly to ensure not
> optimized out.

That's what __attribute_used__ was meant to be used for.

  Ralf

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index cfd1785..db0a9a2 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -340,7 +340,7 @@ NORET_TYPE void ATTRIB_NORET die(const char * str, struct pt_regs * regs)
 extern const struct exception_table_entry __start___dbe_table[];
 extern const struct exception_table_entry __stop___dbe_table[];
 
-void __declare_dbe_table(void)
+static void __attribute_used__ __declare_dbe_table(void)
 {
 	__asm__ __volatile__(
 	".section\t__dbe_table,\"a\"\n\t"

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] Make __declare_dbe_table() static
  2007-02-18 15:54 ` Ralf Baechle
@ 2007-02-18 15:58   ` Atsushi Nemoto
  2007-02-18 16:13     ` Ralf Baechle
  0 siblings, 1 reply; 5+ messages in thread
From: Atsushi Nemoto @ 2007-02-18 15:58 UTC (permalink / raw)
  To: ralf; +Cc: linux-mips

On Sun, 18 Feb 2007 15:54:08 +0000, Ralf Baechle <ralf@linux-mips.org> wrote:
> > Make __declare_dbe_table() static and call it explicitly to ensure not
> > optimized out.
> 
> That's what __attribute_used__ was meant to be used for.

But we do not need empty __declare_dbe_table() function body (jr ra +
nop) at all.  If we called it explicitly, compiler will optimized it
out.  Saves two instructions ;)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Make __declare_dbe_table() static
  2007-02-18 15:58   ` Atsushi Nemoto
@ 2007-02-18 16:13     ` Ralf Baechle
  2007-02-18 16:20       ` Atsushi Nemoto
  0 siblings, 1 reply; 5+ messages in thread
From: Ralf Baechle @ 2007-02-18 16:13 UTC (permalink / raw)
  To: Atsushi Nemoto; +Cc: linux-mips

On Mon, Feb 19, 2007 at 12:58:50AM +0900, Atsushi Nemoto wrote:

> On Sun, 18 Feb 2007 15:54:08 +0000, Ralf Baechle <ralf@linux-mips.org> wrote:
> > > Make __declare_dbe_table() static and call it explicitly to ensure not
> > > optimized out.
> > 
> > That's what __attribute_used__ was meant to be used for.
> 
> But we do not need empty __declare_dbe_table() function body (jr ra +
> nop) at all.  If we called it explicitly, compiler will optimized it
> out.  Saves two instructions ;)

_asm__(
"       .section        __dbe_table, \"a\"\n"
"       .previous                       \n");

is even simpler :-)

  Ralf

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] Make __declare_dbe_table() static
  2007-02-18 16:13     ` Ralf Baechle
@ 2007-02-18 16:20       ` Atsushi Nemoto
  0 siblings, 0 replies; 5+ messages in thread
From: Atsushi Nemoto @ 2007-02-18 16:20 UTC (permalink / raw)
  To: ralf; +Cc: linux-mips

On Sun, 18 Feb 2007 16:13:52 +0000, Ralf Baechle <ralf@linux-mips.org> wrote:
> _asm__(
> "       .section        __dbe_table, \"a\"\n"
> "       .previous                       \n");
> 
> is even simpler :-)

Oh yes.  Right fix it should be.
---
Atsushi Nemoto

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-02-18 16:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-18 15:44 [PATCH] Make __declare_dbe_table() static Atsushi Nemoto
2007-02-18 15:54 ` Ralf Baechle
2007-02-18 15:58   ` Atsushi Nemoto
2007-02-18 16:13     ` Ralf Baechle
2007-02-18 16:20       ` Atsushi Nemoto

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.