mirror of https://github.com/ARMmbed/mbed-os.git
				
				
				
			Interrupt stack is always explicitly specified, hence other condition is not needed
Earlier if interrupt stack is specified it was used and remaining section of IRAM was used to allocate heap, if stack is not specified heap section was reduced by isr stack size and it was added at the end of RAM With 2-region RAM support interrupt stack will always be specified.pull/9571/head
							parent
							
								
									26a6a9a1c8
								
							
						
					
					
						commit
						a1fe75093e
					
				| 
						 | 
				
			
			@ -58,23 +58,11 @@ extern uint32_t Image$$RW_IRAM1$$ZI$$Limit[];
 | 
			
		|||
 */
 | 
			
		||||
void __rt_entry(void)
 | 
			
		||||
{
 | 
			
		||||
    unsigned char *free_start = HEAP_START;
 | 
			
		||||
    uint32_t free_size = HEAP_SIZE;
 | 
			
		||||
 | 
			
		||||
#ifdef ISR_STACK_START
 | 
			
		||||
    /* Interrupt stack explicitly specified */
 | 
			
		||||
    mbed_stack_isr_size = ISR_STACK_SIZE;
 | 
			
		||||
    mbed_stack_isr_size = (unsigned char *)ISR_STACK_SIZE;
 | 
			
		||||
    mbed_stack_isr_start = ISR_STACK_START;
 | 
			
		||||
#else
 | 
			
		||||
    /* Interrupt stack -  reserve space at the end of the free block */
 | 
			
		||||
    mbed_stack_isr_size = ISR_STACK_SIZE < free_size ? ISR_STACK_SIZE : free_size;
 | 
			
		||||
    mbed_stack_isr_start = free_start + free_size - mbed_stack_isr_size;
 | 
			
		||||
    free_size -= mbed_stack_isr_size;
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
    /* Heap - everything else */
 | 
			
		||||
    mbed_heap_size = free_size;
 | 
			
		||||
    mbed_heap_start = free_start;
 | 
			
		||||
    mbed_heap_size = (uint32_t)HEAP_SIZE;
 | 
			
		||||
    mbed_heap_start = (unsigned char *)HEAP_START;
 | 
			
		||||
    mbed_init();
 | 
			
		||||
 | 
			
		||||
    _platform_post_stackheap_init();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -52,24 +52,13 @@ extern void __libc_init_array(void);
 | 
			
		|||
 */
 | 
			
		||||
void software_init_hook(void)
 | 
			
		||||
{
 | 
			
		||||
    unsigned char *free_start = HEAP_START;
 | 
			
		||||
    uint32_t free_size = HEAP_SIZE;
 | 
			
		||||
 | 
			
		||||
#ifdef ISR_STACK_START
 | 
			
		||||
    /* Interrupt stack explicitly specified */
 | 
			
		||||
    mbed_stack_isr_size = ISR_STACK_SIZE;
 | 
			
		||||
    mbed_stack_isr_start = ISR_STACK_START;
 | 
			
		||||
#else
 | 
			
		||||
    /* Interrupt stack -  reserve space at the end of the free block */
 | 
			
		||||
    mbed_stack_isr_size = ISR_STACK_SIZE < free_size ? ISR_STACK_SIZE : free_size;
 | 
			
		||||
    mbed_stack_isr_start = free_start + free_size - mbed_stack_isr_size;
 | 
			
		||||
    free_size -= mbed_stack_isr_size;
 | 
			
		||||
#endif
 | 
			
		||||
    mbed_stack_isr_size = (unsigned char *)ISR_STACK_SIZE;
 | 
			
		||||
    mbed_stack_isr_start = (uint32_t)ISR_STACK_START;
 | 
			
		||||
 | 
			
		||||
    /* Heap - everything else */
 | 
			
		||||
    mbed_heap_size = free_size;
 | 
			
		||||
    mbed_heap_start = free_start;
 | 
			
		||||
 | 
			
		||||
    mbed_heap_size = (uint32_t)HEAP_SIZE;
 | 
			
		||||
    mbed_heap_start = (unsigned char *)HEAP_START;
 | 
			
		||||
 | 
			
		||||
    mbed_init();
 | 
			
		||||
    mbed_rtos_start();
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue