diff options
Diffstat (limited to 'arch/sh/mm')
-rw-r--r-- | arch/sh/mm/init.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c index 31211bfdc6d8..2a53943924b2 100644 --- a/arch/sh/mm/init.c +++ b/arch/sh/mm/init.c | |||
@@ -265,6 +265,35 @@ void free_initrd_mem(unsigned long start, unsigned long end) | |||
265 | } | 265 | } |
266 | #endif | 266 | #endif |
267 | 267 | ||
268 | #if THREAD_SHIFT < PAGE_SHIFT | ||
269 | static struct kmem_cache *thread_info_cache; | ||
270 | |||
271 | struct thread_info *alloc_thread_info(struct task_struct *tsk) | ||
272 | { | ||
273 | struct thread_info *ti; | ||
274 | |||
275 | ti = kmem_cache_alloc(thread_info_cache, GFP_KERNEL); | ||
276 | if (unlikely(ti == NULL)) | ||
277 | return NULL; | ||
278 | #ifdef CONFIG_DEBUG_STACK_USAGE | ||
279 | memset(ti, 0, THREAD_SIZE); | ||
280 | #endif | ||
281 | return ti; | ||
282 | } | ||
283 | |||
284 | void free_thread_info(struct thread_info *ti) | ||
285 | { | ||
286 | kmem_cache_free(thread_info_cache, ti); | ||
287 | } | ||
288 | |||
289 | void thread_info_cache_init(void) | ||
290 | { | ||
291 | thread_info_cache = kmem_cache_create("thread_info", THREAD_SIZE, | ||
292 | THREAD_SIZE, 0, NULL); | ||
293 | BUG_ON(thread_info_cache == NULL); | ||
294 | } | ||
295 | #endif /* THREAD_SHIFT < PAGE_SHIFT */ | ||
296 | |||
268 | #ifdef CONFIG_MEMORY_HOTPLUG | 297 | #ifdef CONFIG_MEMORY_HOTPLUG |
269 | int arch_add_memory(int nid, u64 start, u64 size) | 298 | int arch_add_memory(int nid, u64 start, u64 size) |
270 | { | 299 | { |