Re: [microblaze-uclinux] [PATCH 10/11] microblaze: use generic system.h

From: Arnd Bergmann
Date: Wed Jul 01 2009 - 07:40:21 EST


On Wednesday 01 July 2009, Michal Simek wrote:
> this patch can't be applied because generic implementation expect pointer to task struct
> but microblaze low level code expect thread_info. I have one patch for MMU kernel which fixed it
> but I don't have it for noMMU kernel.

Ok, just leave it out for now then, it's not important because it does not impact the ABI.

Maybe I should allow overriding switch_to() in the generic file?

Arnd <><
---
asm-generic: make parts of system.h optional

The asm-generic/system.h file was originally meant as an example, but by
letting the architecture override some of its contents, it immediately
becomes much more useful.

Signed-off-by: Arnd Bergmann <arnd@xxxxxxxx>

--- a/include/asm-generic/system.h
+++ b/include/asm-generic/system.h
@@ -24,6 +24,7 @@

struct task_struct;

+#ifndef switch_to
/* context switching is now performed out-of-line in switch_to.S */
extern struct task_struct *__switch_to(struct task_struct *,
struct task_struct *);
@@ -31,10 +32,15 @@ extern struct task_struct *__switch_to(struct task_struct *,
do { \
((last) = __switch_to((prev), (next))); \
} while (0)
+#endif

+#ifndef arch_align_stack
#define arch_align_stack(x) (x)
+#endif

+#ifndef nop
#define nop() asm volatile ("nop")
+#define nop

#endif /* !__ASSEMBLY__ */

@@ -46,9 +52,11 @@ extern struct task_struct *__switch_to(struct task_struct *,
* This implementation only contains a compiler barrier.
*/

+#ifndef mb()
#define mb() asm volatile ("": : :"memory")
#define rmb() mb()
#define wmb() asm volatile ("": : :"memory")
+#endif

#ifdef CONFIG_SMP
#define smp_mb() mb()
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/