#include <asm/processor.h>
#include <asm/thread_info.h>
#include <asm/elf.h>
+#include <asm/pda.h>
#define DEFINE(sym, val) \
asm volatile("\n->" #sym " %0 " #val : : "i" (val))
BLANK();
OFFSET(PDA_cpu, i386_pda, cpu_number);
+ OFFSET(PDA_pcurrent, i386_pda, pcurrent);
}
struct i386_pda boot_pda = {
._pda = &boot_pda,
.cpu_number = 0,
+ .pcurrent = &init_task,
};
static inline void set_kernel_gs(void)
memset(pda, 0, sizeof(*pda));
pda->_pda = pda;
pda->cpu_number = cpu;
+ pda->pcurrent = idle;
return 1;
}
if (unlikely(prev->fs | next->fs))
loadsegment(fs, next->fs);
+ write_pda(pcurrent, next_p);
/*
* Restore IOPL if needed.
#ifndef _I386_CURRENT_H
#define _I386_CURRENT_H
-#include <linux/thread_info.h>
+#include <asm/pda.h>
+#include <linux/compiler.h>
struct task_struct;
-static __always_inline struct task_struct * get_current(void)
+static __always_inline struct task_struct *get_current(void)
{
- return current_thread_info()->task;
+ return read_pda(pcurrent);
}
#define current get_current()
#define _I386_PDA_H
#include <linux/stddef.h>
+#include <linux/types.h>
struct i386_pda
{
struct i386_pda *_pda; /* pointer to self */
int cpu_number;
+ struct task_struct *pcurrent; /* current process */
};
extern struct i386_pda *_cpu_pda[];