Skip to contentSkip to conversation

Fix compilation of 2.6.16-rt13 real-time preemption patch on PowerPC

PATCH Applied Walter L. Wimer III 2 participants 2 messages Apr 7, 2006 – Apr 8, 2006 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix compilation of 2.6.16-rt13 real-time preemption patch on PowerPC

The following patch corrects errors encountered when compiling the 2.6.16-rt13 real-time preemption patch on the PowerPC architecture:

* The INIT_FS and INIT_FILES macro definitions changed, but corresponding changes to the calls were missed on PowerPC.

* The new TIF_NEED_RESCHED_DELAYED definition caused an overflow of a 16-bit immediate load field in several PowerPC assembly-language instructions (e.g. in entry.S). This patch changes the definition of TIF_NEED_RESCHED_DELAYED from the value 16 to the value 13 (which appears to have been previously unused). (All bits from 0 to 15 are now in use on PPC, so if any new thread_info flags are needed, we'll have to actually fix the PPC assembly code to deal with the resulting 32-bit quantity.)

* The file include/asm-powerpc/irqflags.h was missing completely on PowerPC. For now, I've supplied a stub file. There is currently no support for CONFIG_DEBUG_TRACE_IRQFLAGS.

Thanks go to Thomas Gleixner for his comments/suggestions on this patch.

I've successfully built and test-booted this on an AMCC440EP "Bamboo" board.

arch/powerpc/kernel/init_task.c +3 -3
diff -Naur linux-2.6.16-rt13-orig/arch/powerpc/kernel/init_task.c linux-2.6.16-rt13-fixd/arch/powerpc/kernel/init_task.c
@@ -3,12 +3,12 @@
 #include <linux/sched.h>
 #include <linux/init.h>
 #include <linux/init_task.h>
-#include <linux/fs_struct.h>
+#include <linux/fs.h>
 #include <linux/mqueue.h>
 #include <asm/uaccess.h>
 
-static struct fs_struct init_fs = INIT_FS(init_fs);
-static struct files_struct init_files = INIT_FILES(init_files);
+static struct fs_struct init_fs = INIT_FS;
+static struct files_struct init_files = INIT_FILES;
 static struct signal_struct init_signals = INIT_SIGNALS(init_signals);
 static struct sighand_struct init_sighand = INIT_SIGHAND(init_sighand);
 struct mm_struct init_mm = INIT_MM(init_mm);
include/asm-powerpc/thread_info.h +1 -1
diff -Naur linux-2.6.16-rt13-orig/include/asm-powerpc/thread_info.h linux-2.6.16-rt13-fixd/include/asm-powerpc/thread_info.h
@@ -119,9 +119,9 @@
 #define TIF_MEMDIE		10
 #define TIF_SECCOMP		11	/* secure computing */
 #define TIF_RESTOREALL		12	/* Restore all regs (implies NOERROR) */
+#define TIF_NEED_RESCHED_DELAYED 13	/* reschedule on return to userspace */
 #define TIF_NOERROR		14	/* Force successful syscall return */
 #define TIF_RESTORE_SIGMASK	15	/* Restore signal mask in do_signal */
-#define TIF_NEED_RESCHED_DELAYED 16	/* reschedule on return to userspace */
 
 /* as above, but as bit values */
 #define _TIF_SYSCALL_TRACE	(1<<TIF_SYSCALL_TRACE)
include/asm-powerpc/irqflags.h +33 -0
diff -Naur linux-2.6.16-rt13-orig/include/asm-powerpc/irqflags.h linux-2.6.16-rt13-fixd/include/asm-powerpc/irqflags.h
@@ -0,0 +1,33 @@
+/*
+ * include/asm-powerpc/irqflags.h
+ *
+ * IRQ flags handling
+ *
+ * This file gets included from lowlevel asm headers too, to provide
+ * wrapped versions of the local_irq_*() APIs, based on the
+ * raw_local_irq_*() macros from the lowlevel headers.
+ */
+#ifndef _ASM_IRQFLAGS_H
+#define _ASM_IRQFLAGS_H
+
+/*
+ * Get definitions for raw_local_save_flags(x), etc.
+ */
+#include <asm-powerpc/hw_irq.h>
+
+/*
+ * Do the CPU's IRQ-state tracing from assembly code. We call a
+ * C function, so save all the C-clobbered registers:
+ */
+#ifdef CONFIG_DEBUG_TRACE_IRQFLAGS
+
+#error No support on PowerPC yet for CONFIG_DEBUG_TRACE_IRQFLAGS
+
+#else
+# define TRACE_IRQS_ON
+# define TRACE_IRQS_OFF
+# define TRACE_IRQS_ON_STR
+# define TRACE_IRQS_OFF_STR
+#endif
+
+#endif
Applied
#1 lore raw
Quoted 20 lines · Walter L. Wimer III

The following patch corrects errors encountered when compiling the 2.6.16-rt13 real-time preemption patch on the PowerPC architecture:

* The INIT_FS and INIT_FILES macro definitions changed, but corresponding changes to the calls were missed on PowerPC.

* The new TIF_NEED_RESCHED_DELAYED definition caused an overflow of a 16-bit immediate load field in several PowerPC assembly-language instructions (e.g. in entry.S). This patch changes the definition of TIF_NEED_RESCHED_DELAYED from the value 16 to the value 13 (which appears to have been previously unused). (All bits from 0 to 15 are now in use on PPC, so if any new thread_info flags are needed, we'll have to actually fix the PPC assembly code to deal with the resulting 32-bit quantity.)

* The file include/asm-powerpc/irqflags.h was missing completely on PowerPC. For now, I've supplied a stub file. There is currently no support for CONFIG_DEBUG_TRACE_IRQFLAGS.

Quoted 5 lines

Thanks go to Thomas Gleixner for his comments/suggestions on this patch.

I've successfully built and test-booted this on an AMCC440EP "Bamboo" board.

thanks, applied.

Ingo