Skip to content

Commit

Permalink
cris: Make THREAD_SIZE available to vmlinux.lds
Browse files Browse the repository at this point in the history
Make THREAD_SIZE available to vmlinux.lds on cris by moving it to
asm/thread_info.h and including that from the linker script.

This allows init_stack to be allocated in the linker script in a subsequent
patch.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Guenter Roeck <linux@roeck-us.net>
cc: Mikael Starvik <starvik@axis.com>
cc: Jesper Nilsson <jesper.nilsson@axis.com>
cc: linux-cris-kernel@axis.com
  • Loading branch information
David Howells committed Jan 8, 2018
1 parent 30a7acd commit 7066d74
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
7 changes: 0 additions & 7 deletions arch/cris/include/asm/processor.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,6 @@ struct task_struct;
*/
#define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3))

/* THREAD_SIZE is the size of the thread_info/kernel_stack combo.
* normally, the stack is found by doing something like p + THREAD_SIZE
* in CRIS, a page is 8192 bytes, which seems like a sane size
*/
#define THREAD_SIZE PAGE_SIZE
#define THREAD_SIZE_ORDER (0)

/*
* At user->kernel entry, the pt_regs struct is stacked on the top of the kernel-stack.
* This macro allows us to find those regs for a task.
Expand Down
7 changes: 7 additions & 0 deletions arch/cris/include/asm/thread_info.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@
#endif


/* THREAD_SIZE is the size of the thread_info/kernel_stack combo.
* normally, the stack is found by doing something like p + THREAD_SIZE
* in CRIS, a page is 8192 bytes, which seems like a sane size
*/
#define THREAD_SIZE PAGE_SIZE
#define THREAD_SIZE_ORDER (0)

/*
* low level task data that entry.S needs immediate access to
* - this struct should fit entirely inside of one cache line
Expand Down
1 change: 1 addition & 0 deletions arch/cris/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <asm-generic/vmlinux.lds.h>
#include <asm/page.h>
#include <asm/thread_info.h>

#ifdef CONFIG_ETRAX_VMEM_SIZE
#define __CONFIG_ETRAX_VMEM_SIZE CONFIG_ETRAX_VMEM_SIZE
Expand Down

0 comments on commit 7066d74

Please sign in to comment.