ARM Initialization Question

ray rayx.cn at gmail.com
Sat Sep 13 17:16:12 UTC 2008


Gene Smith wrote:
> Sebastian Huber wrote:
>    
>> Hi,
>> I am quite new to the ARM architecture and try to develop a BSP for the
>> LPC2478.  I have a question to the initialization code (random start.S):
>>
>>      
You can try begin with rtl22xx BSP, which is base on lpc2210.
>> [...]
>> /* Set up the SVC stack pointer last and stay in SVC mode */
>> mov     r0, #(PSR_MODE_SVC | PSR_I | PSR_F)     /* No interrupts */
>> msr     cpsr, r0
>> ldr     r1, =_svc_stack_size
>> ldr     sp, =_svc_stack
>> add     sp, sp, r1
>> sub     sp, sp, #0x64
>> [...]
>>
>> Why is 0x64 subtracted from the stack pointer?
>>
>>      
>
> I ran my app and skipped the subtract of 100 and it still worked OK.
> Seems like it is just wasting 100 bytes!
>
>    
It is true that it is a wasting of 100 bytes. If you are running on 
small sram cpu like lpc24xx, you can ignore this. But the 'wasting' 100 
byte can help us separating stack from other segment of memory like a 
buffer.
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.com
> http://rtems.rtems.org/mailman/listinfo/rtems-users
>
>    


-- 
Thanks&  Best Regards

---Ray




More information about the users mailing list