extern void arch_send_call_function_single_ipi(int cpu);
extern void arch_send_call_function_ipi_mask(const struct cpumask *mask);
+#define raw_smp_processor_id() (current_thread_info()->cpu)
+
#endif /* !ASSEMBLY */
-/*
- * This is particularly ugly: it appears we can't actually get the definition
- * of task_struct here, but we need access to the CPU this task is running on.
- * Instead of using task_struct we're using TASK_CPU which is extracted from
- * asm-offsets.h by kbuild to get the current processor ID.
- *
- * This also needs to be safeguarded when building asm-offsets.s because at
- * that time TASK_CPU is not defined yet. It could have been guarded by
- * TASK_CPU itself, but we want the build to fail if TASK_CPU is missing
- * when building something else than asm-offsets.s
- */
-#ifdef GENERATING_ASM_OFFSETS
-#define raw_smp_processor_id() (0)
-#else
-#include <asm/asm-offsets.h>
-#define raw_smp_processor_id() (*(unsigned int *)((void *)current + TASK_CPU))
-#endif
#else /* CONFIG_SMP */
static inline void smp_send_all_nop(void) { return; }
struct thread_info {
unsigned long flags; /* thread_info flags (see TIF_*) */
int preempt_count; /* 0=premptable, <0=BUG; will also serve as bh-counter */
+#ifdef CONFIG_SMP
+ unsigned int cpu;
+#endif
};
#define INIT_THREAD_INFO(tsk) \
* Copyright (C) 2003 James Bottomley <jejb at parisc-linux.org>
*/
-#define GENERATING_ASM_OFFSETS /* asm/smp.h */
-
#include <linux/types.h>
#include <linux/sched.h>
#include <linux/thread_info.h>
{
DEFINE(TASK_TI_FLAGS, offsetof(struct task_struct, thread_info.flags));
DEFINE(TASK_STACK, offsetof(struct task_struct, stack));
-#ifdef CONFIG_SMP
- DEFINE(TASK_CPU, offsetof(struct task_struct, cpu));
-#endif
BLANK();
DEFINE(TASK_REGS, offsetof(struct task_struct, thread.regs));
DEFINE(TASK_PT_PSW, offsetof(struct task_struct, thread.regs.gr[ 0]));
const struct cpuinfo_parisc *p = &per_cpu(cpu_data, cpuid);
long timeout;
- idle->cpu = cpuid;
-
/* Let _start know what logical CPU we're booting
** (offset into init_tasks[],cpu_data[])
*/