diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-mips/current.h | 14 | ||||
-rw-r--r-- | include/asm-mips/processor.h | 12 |
2 files changed, 22 insertions, 4 deletions
diff --git a/include/asm-mips/current.h b/include/asm-mips/current.h index 743f91902..7d1547b3c 100644 --- a/include/asm-mips/current.h +++ b/include/asm-mips/current.h @@ -29,6 +29,20 @@ static inline struct task_struct *__get_current(void) ori reg, 8191; \ xori reg, 8191 +/* + * Special variant for use by exception handlers when the stack pointer + * is not loaded. + */ +#define _GET_CURRENT(reg) \ + lui reg, %hi(kernelsp); \ + .set push; \ + .set noreorder; \ + lw reg, %lo(kernelsp)(reg); \ + .set pop; \ + ori reg, 8191; \ + xori reg, 8191 + + #endif #endif /* __ASM_MIPS_CURRENT_H */ diff --git a/include/asm-mips/processor.h b/include/asm-mips/processor.h index 0c47c2580..c4c0e849b 100644 --- a/include/asm-mips/processor.h +++ b/include/asm-mips/processor.h @@ -164,11 +164,15 @@ extern void start_thread(struct pt_regs * regs, unsigned long pc, unsigned long #define USES_USER_TIME(regs) (!((regs)->cp0_status & 0x18)) /* Allocation and freeing of basic task resources. */ -#define alloc_task_struct() kmalloc(sizeof(struct task_struct), GFP_KERNEL) -#define free_task_struct(p) kfree(p) +/* + * NOTE! The task struct and the stack go together + */ +#define alloc_task_struct() \ + ((struct task_struct *) __get_free_pages(GFP_KERNEL,1,0)) +#define free_task_struct(p) free_pages((unsigned long)(p),1) -#define init_task (init_task_union.task) -#define init_stack (init_task_union.stack) +#define init_task (init_task_union.task) +#define init_stack (init_task_union.stack) #endif /* !defined (__LANGUAGE_ASSEMBLY__) */ #endif /* __KERNEL__ */ |