reduce memory use by cmsis rtx
able to run with IAR host cmsis rtx
This commit is contained in:
+14
-14
@@ -15,19 +15,19 @@
|
||||
* - Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* - Neither the name of ARM nor the names of its contributors may be used
|
||||
* to endorse or promote products derived from this software without
|
||||
* - Neither the name of ARM nor the names of its contributors may be used
|
||||
* to endorse or promote products derived from this software without
|
||||
* specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
* ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE
|
||||
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*---------------------------------------------------------------------------*/
|
||||
@@ -115,9 +115,9 @@ _declare_box8 (mp_stk, OS_STKSIZE*4, OS_TASK_CNT-OS_PRIV_CNT+1);
|
||||
uint32_t const mp_stk_size = sizeof(mp_stk);
|
||||
|
||||
/* Memory pool for user specified stack allocation (+main, +timer) */
|
||||
#ifdef __CODE_RED
|
||||
__attribute__ (( section(".data.$RAM2") )) // overflow RamLoc32
|
||||
#endif
|
||||
//#ifdef __CODE_RED
|
||||
//__attribute__ (( section(".data.$RAM2") )) // overflow RamLoc32
|
||||
//#endif
|
||||
uint64_t os_stack_mem[2+OS_PRIV_CNT+(OS_STACK_SZ/8)];
|
||||
uint32_t const os_stack_sz = sizeof(os_stack_mem);
|
||||
|
||||
@@ -147,7 +147,7 @@ osMessageQId osMessageQId_osTimerMessageQ;
|
||||
#endif
|
||||
|
||||
/* Legacy RTX User Timers not used */
|
||||
uint32_t os_tmr = 0;
|
||||
uint32_t os_tmr = 0;
|
||||
uint32_t const *m_tmr = NULL;
|
||||
uint16_t const mp_tmr_size = 0;
|
||||
|
||||
@@ -315,7 +315,7 @@ __attribute ((noreturn)) void __cs3_start_c (void){
|
||||
if (src != dst)
|
||||
for (count = 0; count != limit; count += sizeof (long long))
|
||||
*dst++ = *src++;
|
||||
else
|
||||
else
|
||||
dst = (long long *)((char *)dst + limit);
|
||||
limit = rptr->zero_size;
|
||||
for (count = 0; count != limit; count += sizeof (long long))
|
||||
@@ -365,7 +365,7 @@ extern void exit(int arg);
|
||||
|
||||
__noreturn __stackless void __cmain(void) {
|
||||
int a;
|
||||
|
||||
|
||||
if (__low_level_init() != 0) {
|
||||
__iar_data_init3();
|
||||
}
|
||||
|
||||
Vendored
+2
-2
@@ -62,7 +62,7 @@
|
||||
// <i> Defines stack size for main thread.
|
||||
// <i> Default: 200
|
||||
#ifndef OS_MAINSTKSIZE
|
||||
#define OS_MAINSTKSIZE 200
|
||||
#define OS_MAINSTKSIZE 50
|
||||
#endif
|
||||
|
||||
// <o>Number of threads with user-provided stack size <0-250>
|
||||
@@ -76,7 +76,7 @@
|
||||
// <i> Defines the combined stack size for threads with user-provided stack size.
|
||||
// <i> Default: 0
|
||||
#ifndef OS_PRIVSTKSIZE
|
||||
#define OS_PRIVSTKSIZE (8*1024)
|
||||
#define OS_PRIVSTKSIZE (3*1024)
|
||||
#endif
|
||||
|
||||
// <q>Check for stack overflow
|
||||
|
||||
Reference in New Issue
Block a user