summaryrefslogtreecommitdiffstats
path: root/arch/mips/mm/stack.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/mm/stack.c')
-rw-r--r--arch/mips/mm/stack.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/mips/mm/stack.c b/arch/mips/mm/stack.c
new file mode 100644
index 000000000..89fb6dc64
--- /dev/null
+++ b/arch/mips/mm/stack.c
@@ -0,0 +1,27 @@
+/*
+ * Kernel stack allocation/deallocation
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 1996, 1997 by Ralf Baechle
+ *
+ * (This is _bad_ if the free page pool is fragmented ...)
+ */
+#include <linux/sched.h>
+#include <linux/mm.h>
+#include <asm/processor.h>
+
+extern unsigned long alloc_kernel_stack(struct task_struct *tsk)
+{
+ unsigned long stack;
+ stack = __get_free_pages(GFP_KERNEL, 1, 0);
+
+ return stack;
+}
+
+extern void free_kernel_stack(unsigned long stack)
+{
+ free_pages(stack, 1);
+}