Skip to content

Commit

Permalink
[POWERPC] Add thread_info_cache_init() weak hook
Browse files Browse the repository at this point in the history
Some architectures need to maintain a kmem cache for thread info
structures.  The next commit adds that to powerpc to fix an alignment
problem.

There is no good arch callback to use to initialize that cache
that I can find, so this adds a new one in the form of a weak
function whose default is empty.

Signed-off-by: Benjamin Herrenschmidt <[email protected]>
Acked-by: Andrew Morton <[email protected]>
Signed-off-by: Paul Mackerras <[email protected]>
  • Loading branch information
ozbenh authored and paulusmack committed Apr 24, 2008
1 parent 1d32e21 commit 8c9843e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -1926,6 +1926,8 @@ static inline unsigned long *end_of_stack(struct task_struct *p)

#endif

extern void thread_info_cache_init(void);

/* set thread flags in other task's structures
* - see asm/thread_info.h for TIF_xxxx flags available
*/
Expand Down
5 changes: 5 additions & 0 deletions init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,10 @@ void __init __attribute__((weak)) smp_setup_processor_id(void)
{
}

void __init __weak thread_info_cache_init(void)
{
}

asmlinkage void __init start_kernel(void)
{
char * command_line;
Expand Down Expand Up @@ -645,6 +649,7 @@ asmlinkage void __init start_kernel(void)
if (efi_enabled)
efi_enter_virtual_mode();
#endif
thread_info_cache_init();
fork_init(num_physpages);
proc_caches_init();
buffer_init();
Expand Down

0 comments on commit 8c9843e

Please sign in to comment.