~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to arch/sh/kernel/process.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#if THREAD_SHIFT < PAGE_SHIFT
33
33
static struct kmem_cache *thread_info_cache;
34
34
 
35
 
struct thread_info *alloc_thread_info(struct task_struct *tsk)
 
35
struct thread_info *alloc_thread_info_node(struct task_struct *tsk, int node)
36
36
{
37
37
        struct thread_info *ti;
38
 
 
39
 
        ti = kmem_cache_alloc(thread_info_cache, GFP_KERNEL);
40
 
        if (unlikely(ti == NULL))
41
 
                return NULL;
42
38
#ifdef CONFIG_DEBUG_STACK_USAGE
43
 
        memset(ti, 0, THREAD_SIZE);
 
39
        gfp_t mask = GFP_KERNEL | __GFP_ZERO;
 
40
#else
 
41
        gfp_t mask = GFP_KERNEL;
44
42
#endif
 
43
 
 
44
        ti = kmem_cache_alloc_node(thread_info_cache, mask, node);
45
45
        return ti;
46
46
}
47
47
 
57
57
                                              THREAD_SIZE, SLAB_PANIC, NULL);
58
58
}
59
59
#else
60
 
struct thread_info *alloc_thread_info(struct task_struct *tsk)
 
60
struct thread_info *alloc_thread_info_node(struct task_struct *tsk, int node)
61
61
{
62
62
#ifdef CONFIG_DEBUG_STACK_USAGE
63
63
        gfp_t mask = GFP_KERNEL | __GFP_ZERO;
64
64
#else
65
65
        gfp_t mask = GFP_KERNEL;
66
66
#endif
67
 
        return (struct thread_info *)__get_free_pages(mask, THREAD_SIZE_ORDER);
 
67
        struct page *page = alloc_pages_node(node, mask, THREAD_SIZE_ORDER);
 
68
 
 
69
        return page ? page_address(page) : NULL;
68
70
}
69
71
 
70
72
void free_thread_info(struct thread_info *ti)