ipm_console: add Kconfig for receiver stack size

Change-Id: I27c1189e3bf87b4ea3dc06d38f63cab21663697b
Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
Andrew Boie 2017-02-28 13:45:46 -08:00
commit 3cc4d41438
4 changed files with 14 additions and 4 deletions

View file

@ -41,7 +41,7 @@ QUARK_SE_IPM_DEFINE(quark_se_ipm4, 4, QUARK_SE_IPM_INBOUND);
#define QUARK_SE_IPM_CONSOLE_LINE_BUF_SIZE 80
static uint32_t ipm_console_ring_buf_data[CONFIG_QUARK_SE_IPM_CONSOLE_RING_BUF_SIZE32];
static char __stack ipm_console_thread_stack[IPM_CONSOLE_STACK_SIZE];
static char __stack ipm_console_thread_stack[CONFIG_IPM_CONSOLE_STACK_SIZE];
static char ipm_console_line_buf[QUARK_SE_IPM_CONSOLE_LINE_BUF_SIZE];
static struct ipm_console_receiver_config_info quark_se_ipm_receiver_config = {

View file

@ -136,6 +136,16 @@ config IPM_CONSOLE_RECEIVER
help
Enable the receiving side of IPM console
config IPM_CONSOLE_STACK_SIZE
int
prompt "Stack size for IPM console receiver thread"
depends on IPM_CONSOLE_RECEIVER
default 512
help
Eack instance of the IPM console receiver driver creates a worker
thread to print out incoming messages from the remote CPU. Specify the
stack size for these threads here.
config IPM_CONSOLE_INIT_PRIORITY
int
prompt "IPM console init priority"

View file

@ -144,7 +144,7 @@ int ipm_console_receiver_init(struct device *d)
ipm_register_callback(ipm, ipm_console_receive_callback, d);
k_thread_spawn(config_info->thread_stack, IPM_CONSOLE_STACK_SIZE,
k_thread_spawn(config_info->thread_stack, CONFIG_IPM_CONSOLE_STACK_SIZE,
ipm_console_thread, d, NULL, NULL,
K_PRIO_COOP(IPM_CONSOLE_PRI), 0, 0);
ipm_set_enabled(ipm, 1);

View file

@ -24,7 +24,7 @@ extern "C" {
* Good way to determine these numbers other than trial-and-error?
* using printf() in the thread seems to require a lot more stack space
*/
#define IPM_CONSOLE_STACK_SIZE 512
#define IPM_CONSOLE_STACK_SIZE CONFIG_IPM_CONSOLE_STACK_SIZE
#define IPM_CONSOLE_PRI 2
struct ipm_console_receiver_config_info {
@ -33,7 +33,7 @@ struct ipm_console_receiver_config_info {
/**
* Stack for the receiver's thread, which prints out messages as
* they come in. Should be sized IPM_CONSOLE_STACK_SIZE
* they come in. Should be sized CONFIG_IPM_CONSOLE_STACK_SIZE
*/
char *thread_stack;