summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRalf Baechle <ralf@linux-mips.org>1997-06-09 06:20:52 +0000
committerRalf Baechle <ralf@linux-mips.org>1997-06-09 06:20:52 +0000
commit0b898e7acdab77a9eb047edf7235cb25151ee6da (patch)
treee297c006a447dd9b6869754f8f201b5330a02da1 /include
parenta2320c942ccf93dc1c72869f91829e7779e50ee6 (diff)
Fix a couple of bug related to the new handling of the stack and the
current pointer.
Diffstat (limited to 'include')
-rw-r--r--include/asm-mips/current.h14
-rw-r--r--include/asm-mips/processor.h12
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__ */