blob: 89fb6dc649b60eeeadc627c465c466db21125ee9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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);
}
|