Skip to contentSkip to conversation

2.6.24-x86: consolidate common 32/64-bit code

PATCH New Jan Kiszka 1 participant 1 message Jan 8, 2008 x86

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 2/3 2.6.24-x86: consolidate common 32/64-bit code

This is a rebased version of [1] over 2.6.24-rc6-x86-2.0-01. No regressions were found while testing over the last days.

Jan

[1] https://mail.gna.org/public/adeos-main/2007-12/msg00064.html

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
---
 arch/x86/kernel/Makefile_32     |    2 
 arch/x86/kernel/Makefile_64     |    2 
 arch/x86/kernel/entry_64.S      |   30 -
 arch/x86/kernel/ipipe.c         | 1003 ++++++++++++++++++++++++++++++++++++++++
 arch/x86/kernel/ipipe_32.c      |  838 ---------------------------------
 arch/x86/kernel/ipipe_64.c      |  803 --------------------------------
 include/asm-x86/ipipe.h         |  116 ++++
 include/asm-x86/ipipe_32.h      |   85 ---
 include/asm-x86/ipipe_64.h      |   85 ---
 include/asm-x86/ipipe_base.h    |   93 +++
 include/asm-x86/ipipe_base_32.h |   63 --
 include/asm-x86/ipipe_base_64.h |   63 --
 include/asm-x86/unistd_64.h     |    2 
 13 files changed, 1229 insertions(+), 1956 deletions(-)
include/asm-x86/ipipe_base.h +93 -0
Index: linux-2.6.24-rc6-xeno_64/include/asm-x86/ipipe_base.h
===================================================================
@@ -1,5 +1,98 @@
+/*   -*- linux-c -*-
+ *   include/asm-x86/ipipe_base.h
+ *
+ *   Copyright (C) 2007 Philippe Gerum.
+ *
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139,
+ *   USA; either version 2 of the License, or (at your option) any later
+ *   version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this program; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __X86_IPIPE_BASE_H
+#define __X86_IPIPE_BASE_H
+
 #ifdef CONFIG_X86_32
 # include "ipipe_base_32.h"
 #else
 # include "ipipe_base_64.h"
 #endif
+
+#define ex_do_divide_error			0
+#define ex_do_debug				1
+/* NMI not pipelined. */
+#define ex_do_int3				3
+#define ex_do_overflow				4
+#define ex_do_bounds				5
+#define ex_do_invalid_op			6
+#define ex_device_not_available			7	/* x86_32 */
+#define ex_math_state_restore			7	/* x86_64 */
+/* Double fault not pipelined. */
+#define ex_do_coprocessor_segment_overrun	9
+#define ex_do_invalid_TSS			10
+#define ex_do_segment_not_present		11
+#define ex_do_stack_segment			12
+#define ex_do_general_protection		13
+#define ex_do_page_fault			14
+#define ex_do_spurious_interrupt_bug		15
+#define ex_do_coprocessor_error			16
+#define ex_do_alignment_check			17
+#define ex_machine_check_vector			18
+#define ex_reserved				ex_machine_check_vector
+#define ex_do_simd_coprocessor_error		19
+#define ex_do_iret_error			32
+
+#if !defined(__ASSEMBLY__) && !defined(CONFIG_SMP)
+
+#if __GNUC__ >= 4
+/* Alias to ipipe_root_cpudom_var(status) */
+extern unsigned long __ipipe_root_status;
+#else
+extern unsigned long *const __ipipe_root_status_addr;
+#define __ipipe_root_status	(*__ipipe_root_status_addr)
+#endif
+
+static inline void __ipipe_stall_root(void)
+{
+	volatile unsigned long *p = &__ipipe_root_status;
+	__asm__ __volatile__("btsl $0,%0;"
+			     :"+m" (*p) : : "memory");
+}
+
+static inline unsigned long __ipipe_test_and_stall_root(void)
+{
+	volatile unsigned long *p = &__ipipe_root_status;
+	int oldbit;
+
+	__asm__ __volatile__("btsl $0,%1;"
+			     "sbbl %0,%0;"
+			     :"=r" (oldbit), "+m" (*p)
+			     : : "memory");
+	return oldbit;
+}
+
+static inline unsigned long __ipipe_test_root(void)
+{
+	volatile unsigned long *p = &__ipipe_root_status;
+	int oldbit;
+
+	__asm__ __volatile__("btl $0,%1;"
+			     "sbbl %0,%0;"
+			     :"=r" (oldbit)
+			     :"m" (*p));
+	return oldbit;
+}
+
+#endif	/* !__ASSEMBLY__ && !CONFIG_SMP */
+
+#endif	/* !__X86_IPIPE_BASE_H */
include/asm-x86/ipipe_base_32.h +0 -63

75 lines not on this page · raw message

include/asm-x86/ipipe_base_64.h +0 -63

75 lines not on this page · raw message

arch/x86/kernel/Makefile_32 +1 -1
Index: linux-2.6.24-rc6-xeno_64/arch/x86/kernel/Makefile_32
===================================================================
@@ -34,7 +34,7 @@ obj-$(CONFIG_X86_SUMMIT_NUMA)	+= summit_
 obj-$(CONFIG_KPROBES)		+= kprobes_32.o
 obj-$(CONFIG_MODULES)		+= module_32.o
 obj-y				+= sysenter_32.o vsyscall_32.o
-obj-$(CONFIG_IPIPE)		+= ipipe_32.o
+obj-$(CONFIG_IPIPE)		+= ipipe.o
 obj-$(CONFIG_IPIPE_TRACE_MCOUNT)	+= mcount_32.o
 obj-$(CONFIG_ACPI_SRAT) 	+= srat_32.o
 obj-$(CONFIG_EFI) 		+= efi_32.o efi_stub_32.o
arch/x86/kernel/Makefile_64 +1 -1
Index: linux-2.6.24-rc6-xeno_64/arch/x86/kernel/Makefile_64
===================================================================
@@ -35,7 +35,7 @@ obj-$(CONFIG_X86_PM_TIMER)	+= pmtimer_64
 obj-$(CONFIG_X86_VSMP)		+= vsmp_64.o
 obj-$(CONFIG_K8_NB)		+= k8.o
 obj-$(CONFIG_AUDIT)		+= audit_64.o
-obj-$(CONFIG_IPIPE)		+= ipipe_64.o
+obj-$(CONFIG_IPIPE)		+= ipipe.o
 obj-$(CONFIG_IPIPE_TRACE_MCOUNT)	+= mcount_64.o
 
 obj-$(CONFIG_MODULES)		+= module_64.o
arch/x86/kernel/ipipe.c new file +1003 -0

1,003 lines not on this page · raw message

arch/x86/kernel/ipipe_32.c deleted +0 -838

838 lines not on this page · raw message

arch/x86/kernel/ipipe_64.c deleted +0 -803

803 lines not on this page · raw message

include/asm-x86/ipipe.h +115 -1

92 lines not on this page · raw message

include/asm-x86/ipipe_32.h +0 -85

85 lines not on this page · raw message

include/asm-x86/ipipe_64.h +0 -85

85 lines not on this page · raw message

include/asm-x86/unistd_64.h +1 -1
Index: linux-2.6.24-rc6-xeno_64/include/asm-x86/unistd_64.h
===================================================================

Lines of this file are not shown. View the raw message.

arch/x86/kernel/entry_64.S +15 -15
Index: linux-2.6.24-rc6-xeno_64/arch/x86/kernel/entry_64.S
===================================================================

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.