[arch][kernel] handle default stack size better

-let arch define the default stack size in ARCH_DEFAULT_STACK_SIZE
-platform/target/project can override with CUSTOM_DEFAULT_STACK_SIZE
This commit is contained in:
Travis Geiselbrecht
2012-05-10 16:25:44 -07:00
parent fe179b7fef
commit 06d781f162
3 changed files with 12 additions and 5 deletions

View File

@@ -115,6 +115,9 @@ OBJS += \
$(LOCAL_DIR)/arm/mmu.o \
$(LOCAL_DIR)/arm/thread.o \
$(LOCAL_DIR)/arm/dcc.o
DEFINES += \
ARCH_DEFAULT_STACK_SIZE=4096
endif
ifeq ($(SUBARCH),arm-m)
OBJS += \
@@ -128,9 +131,8 @@ OBJS += \
INCLUDES += \
-I$(LOCAL_DIR)/arm-m/CMSIS/CM3/CoreSupport
# set a much smaller stack size
DEFINES += \
DEFAULT_STACK_SIZE=1024
ARCH_DEFAULT_STACK_SIZE=1024
endif
# set the default toolchain to arm elf and set a #define

View File

@@ -28,5 +28,7 @@
// TODO: define to resolve to platform setup discovered value
#define CACHE_LINE 32
#define ARCH_DEFAULT_STACK_SIZE 8192
#endif

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2008-2009 Travis Geiselbrecht
* Copyright (c) 2008-2012 Travis Geiselbrecht
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files
@@ -26,6 +26,7 @@
#include <sys/types.h>
#include <list.h>
#include <compiler.h>
#include <arch/defines.h>
#include <arch/ops.h>
#include <arch/thread.h>
@@ -93,8 +94,10 @@ typedef struct thread {
#define HIGH_PRIORITY ((NUM_PRIORITIES / 4) * 3)
/* stack size */
#ifndef DEFAULT_STACK_SIZE
#define DEFAULT_STACK_SIZE 8192
#ifdef CUSTOM_DEFAULT_STACK_SIZE
#define DEFAULT_STACK_SIZE CUSTOM_DEFAULT_STACK_SIZE
#else
#define DEFAULT_STACK_SIZE ARCH_DEFAULT_STACK_SIZE
#endif
/* functions */