Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 43023
b: refs/heads/master
c: ec7fcaa
h: refs/heads/master
i:
  43021: 1e576c7
  43019: a348485
  43015: d479166
  43007: 23e9d19
v: v3
  • Loading branch information
Jeremy Fitzhardinge authored and Andi Kleen committed Dec 7, 2006
1 parent 0de4a68 commit c42067a
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b2938f880890ebfcccad356275e0000193153623
refs/heads/master: ec7fcaabbfb3c5bd5189f857b6ac7bb9745ef291
2 changes: 2 additions & 0 deletions trunk/arch/i386/kernel/asm-offsets.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#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))
Expand Down Expand Up @@ -99,4 +100,5 @@ void foo(void)

BLANK();
OFFSET(PDA_cpu, i386_pda, cpu_number);
OFFSET(PDA_pcurrent, i386_pda, pcurrent);
}
2 changes: 2 additions & 0 deletions trunk/arch/i386/kernel/cpu/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,7 @@ __cpuinit int alloc_gdt(int cpu)
struct i386_pda boot_pda = {
._pda = &boot_pda,
.cpu_number = 0,
.pcurrent = &init_task,
};

static inline void set_kernel_gs(void)
Expand Down Expand Up @@ -696,6 +697,7 @@ __cpuinit int init_gdt(int cpu, struct task_struct *idle)
memset(pda, 0, sizeof(*pda));
pda->_pda = pda;
pda->cpu_number = cpu;
pda->pcurrent = idle;

return 1;
}
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/i386/kernel/process.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@ struct task_struct fastcall * __switch_to(struct task_struct *prev_p, struct tas
if (unlikely(prev->fs | next->fs))
loadsegment(fs, next->fs);

write_pda(pcurrent, next_p);

/*
* Restore IOPL if needed.
Expand Down
7 changes: 4 additions & 3 deletions trunk/include/asm-i386/current.h
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#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()
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/asm-i386/pda.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@
#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[];
Expand Down

0 comments on commit c42067a

Please sign in to comment.