public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Configure out TSC support
@ 2008-02-13 16:00 Thomas Petazzoni
  2008-02-17 17:03 ` Ingo Molnar
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2008-02-13 16:00 UTC (permalink / raw)
  To: Ingo Molnar, Thomas Gleixner, H. Anvin, Matt Mackall, zwane
  Cc: Linux-tiny, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2992 bytes --]

Hi,

The following patch allows to remove the code needed to support the TSC
timer on x86 32 bits. The TSC seems to be mandatory on x86 64 bits. The
patch adds a X86_TSC_TIMER option to enable/disable the support.

A X86_TSC option already exists, but it is not an option, it's simply
set to true when the processor has a TSC. However, the purpose of the
patch is to disable the TSC support even if the processor has it.

Comments welcome.

Thanks,

Thomas

---

Add a new configuration option that allows the TSC timer support code
to not be compiled, in order to make some space savings on the kernel
code size. The option depends on X86_32, because on 64 bits, the TSC
seems to be mandatory.

The results are:

   text    data     bss     dec     hex filename
1068092  126308   98304 1292704  13b9a0 vmlinux.before
1066956  126296   98304 1291556  13b524 vmlinux.after
  -1136     -12       0   -1148    -47C +/

This patch is part of the Linux Tiny project, and is based on previous
work done by Zwane Mwaikambo <zwane@arm.linux.org.uk>.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

---
 arch/x86/Kconfig         |    6 ++++++
 arch/x86/kernel/Makefile |    3 ++-
 include/asm/tsc.h        |    4 ++++
 3 files changed, 12 insertions(+), 1 deletion(-)

Index: linux/arch/x86/Kconfig
===================================================================
--- linux.orig/arch/x86/Kconfig
+++ linux/arch/x86/Kconfig
@@ -395,6 +395,12 @@
 	def_bool y
 	depends on X86_32 && NUMA && (X86_SUMMIT || X86_GENERICARCH)
 
+config X86_TSC_TIMER
+	default y
+	bool "Enable TSC timer" if EMBEDDED && X86_32
+	help
+	  Enable support for the Time Stamp Counter timer.
+
 config X86_CYCLONE_TIMER
 	def_bool y
 	depends on X86_32 && X86_SUMMIT || X86_GENERICARCH
Index: linux/arch/x86/kernel/Makefile
===================================================================
--- linux.orig/arch/x86/kernel/Makefile
+++ linux/arch/x86/kernel/Makefile
@@ -19,8 +19,9 @@
 obj-y			+= quirks.o i8237.o topology.o kdebugfs.o
 obj-y			+= alternative.o i8253.o
 obj-$(CONFIG_X86_64)	+= pci-nommu_64.o bugs_64.o
-obj-y			+= tsc_$(BITS).o io_delay.o rtc.o
+obj-y			+= io_delay.o rtc.o
 
+obj-$(CONFIG_X86_TSC_TIMER)     += tsc_$(BITS).o
 obj-y				+= i387.o
 obj-y				+= ptrace.o
 obj-y				+= ds.o
Index: linux/include/asm/tsc.h
===================================================================
--- linux.orig/include/asm/tsc.h
+++ linux/include/asm/tsc.h
@@ -45,7 +45,11 @@
 	return (cycles_t) __native_read_tsc();
 }
 
+#ifdef CONFIG_X86_TSC_TIMER
 extern void tsc_init(void);
+#else
+static inline void tsc_init(void) { }
+#endif
 extern void mark_tsc_unstable(char *reason);
 extern int unsynchronized_tsc(void);
 extern void init_tsc_clocksource(void);


-- 
Thomas Petazzoni, Free Electrons
Free Embedded Linux Training Materials
on http://free-electrons.com/training
(More than 1500 pages!)

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

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

end of thread, other threads:[~2008-02-18  2:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-13 16:00 [PATCH] Configure out TSC support Thomas Petazzoni
2008-02-17 17:03 ` Ingo Molnar
2008-02-18  2:27   ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox