* [PATCH] - Eliminate machvec calls to null functions
@ 2004-07-07 20:17 Jack Steiner
2004-07-08 23:07 ` David Mosberger
0 siblings, 1 reply; 2+ messages in thread
From: Jack Steiner @ 2004-07-07 20:17 UTC (permalink / raw)
To: davidm, akpm; +Cc: linux-kernel
Here is a patch to eliminate calls to null platform vectors for
non-GENERIC kernels.
If this looks ok, then I'll update the tlb_migrate patch &
resubmit it. (Apply this machvec patch first...)
Signed-off-by: Jack Steiner <steiner@sgi.com>
Index: linux/include/asm-ia64/machvec.h
===================================================================
--- linux.orig/include/asm-ia64/machvec.h
+++ linux/include/asm-ia64/machvec.h
@@ -69,12 +69,20 @@ typedef unsigned short ia64_mv_readw_rel
typedef unsigned int ia64_mv_readl_relaxed_t (void *);
typedef unsigned long ia64_mv_readq_relaxed_t (void *);
-extern void machvec_noop (void);
extern void machvec_setup (char **);
extern void machvec_timer_interrupt (int, void *, struct pt_regs *);
extern void machvec_dma_sync_single (struct device *, dma_addr_t, size_t, int);
extern void machvec_dma_sync_sg (struct device *, struct scatterlist *, int, int);
+#ifdef CONFIG_IA64_GENERIC
+# define machvec_noop(noop_function) noop_function
+#else
+# define machvec_null(...)
+# define machvec_noop(noop_function) machvec_null
+#endif
+extern void machvec_noop_void (void);
+
+
# if defined (CONFIG_IA64_HP_SIM)
# include <asm/machvec_hpsim.h>
# elif defined (CONFIG_IA64_DIG)
@@ -245,10 +253,10 @@ extern ia64_mv_dma_supported swiotlb_dm
# define platform_setup machvec_setup
#endif
#ifndef platform_cpu_init
-# define platform_cpu_init machvec_noop
+# define platform_cpu_init machvec_noop(machvec_noop_void)
#endif
#ifndef platform_irq_init
-# define platform_irq_init machvec_noop
+# define platform_irq_init machvec_noop(machvec_noop_void)
#endif
#ifndef platform_send_ipi
Index: linux/arch/ia64/kernel/machvec.c
===================================================================
--- linux.orig/arch/ia64/kernel/machvec.c
+++ linux/arch/ia64/kernel/machvec.c
@@ -44,10 +44,10 @@ machvec_init (const char *name)
#endif /* CONFIG_IA64_GENERIC */
void
-machvec_noop (void)
+machvec_noop_void (void)
{
}
-EXPORT_SYMBOL(machvec_noop);
+EXPORT_SYMBOL(machvec_noop_void);
void
machvec_setup (char **arg)
Index: linux/include/asm-ia64/machvec_sn2.h
===================================================================
--- linux.orig/include/asm-ia64/machvec_sn2.h
+++ linux/include/asm-ia64/machvec_sn2.h
@@ -101,7 +101,7 @@ extern ia64_mv_dma_supported sn_dma_sup
#define platform_irq_desc sn_irq_desc
#define platform_irq_to_vector sn_irq_to_vector
#define platform_local_vector_to_irq sn_local_vector_to_irq
-#define platform_dma_init machvec_noop
+#define platform_dma_init machvec_noop_void
#define platform_dma_alloc_coherent sn_dma_alloc_coherent
#define platform_dma_free_coherent sn_dma_free_coherent
#define platform_dma_map_single sn_dma_map_single
Index: linux/include/asm-ia64/machvec_hpzx1.h
===================================================================
--- linux.orig/include/asm-ia64/machvec_hpzx1.h
+++ linux/include/asm-ia64/machvec_hpzx1.h
@@ -21,7 +21,7 @@ extern ia64_mv_dma_mapping_error sba_dma
*/
#define platform_name "hpzx1"
#define platform_setup sba_setup
-#define platform_dma_init machvec_noop
+#define platform_dma_init machvec_noop_void
#define platform_dma_alloc_coherent sba_alloc_coherent
#define platform_dma_free_coherent sba_free_coherent
#define platform_dma_map_single sba_map_single
--
Thanks
Jack Steiner (steiner@sgi.com) 651-683-5302
Principal Engineer SGI - Silicon Graphics, Inc.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] - Eliminate machvec calls to null functions
2004-07-07 20:17 [PATCH] - Eliminate machvec calls to null functions Jack Steiner
@ 2004-07-08 23:07 ` David Mosberger
0 siblings, 0 replies; 2+ messages in thread
From: David Mosberger @ 2004-07-08 23:07 UTC (permalink / raw)
To: Jack Steiner; +Cc: davidm, akpm, linux-kernel
>>>>> On Wed, 7 Jul 2004 15:17:16 -0500, Jack Steiner <steiner@sgi.com> said:
Jack> Here is a patch to eliminate calls to null platform vectors for
Jack> non-GENERIC kernels.
Jack> If this looks ok, then I'll update the tlb_migrate patch & resubmit
Jack> it. (Apply this machvec patch first...)
I was about to check this in when it occurred to me that it should be
possible to simply define the no-ops as "static inline". If you take
the address of these functions, the compiler will instantiate the
function automatically, so this ought to work both for GENERIC and
non-GENERIC kernels. The only downside is that for GENERIC, each
machvec definition will get its own definition of the
no-op-function(s), but that seems like an acceptable cost to me.
I tried the patch below both for zx1 and GENERIC and it does seem to
work as expected. If nobody has a problem with the patch, I'll go
ahead and check it in.
--david
===== arch/ia64/kernel/machvec.c 1.8 vs edited =====
--- 1.8/arch/ia64/kernel/machvec.c Fri May 21 14:01:23 2004
+++ edited/arch/ia64/kernel/machvec.c Thu Jul 8 15:34:20 2004
@@ -44,12 +44,6 @@
#endif /* CONFIG_IA64_GENERIC */
void
-machvec_noop (void)
-{
-}
-EXPORT_SYMBOL(machvec_noop);
-
-void
machvec_setup (char **arg)
{
}
===== include/asm-ia64/machvec.h 1.23 vs edited =====
--- 1.23/include/asm-ia64/machvec.h Thu Mar 25 11:54:44 2004
+++ edited/include/asm-ia64/machvec.h Thu Jul 8 15:34:06 2004
@@ -69,7 +69,11 @@
typedef unsigned int ia64_mv_readl_relaxed_t (void *);
typedef unsigned long ia64_mv_readq_relaxed_t (void *);
-extern void machvec_noop (void);
+static inline void
+machvec_noop (void)
+{
+}
+
extern void machvec_setup (char **);
extern void machvec_timer_interrupt (int, void *, struct pt_regs *);
extern void machvec_dma_sync_single (struct device *, dma_addr_t, size_t, int);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-07-08 23:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-07 20:17 [PATCH] - Eliminate machvec calls to null functions Jack Steiner
2004-07-08 23:07 ` David Mosberger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox