You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2021/04/27 11:31:52 UTC

[GitHub] [incubator-nuttx] gustavonihei edited a comment on issue #3612: RV32: syslog/printf handling of 64-bit integers is broken

gustavonihei edited a comment on issue #3612:
URL: https://github.com/apache/incubator-nuttx/issues/3612#issuecomment-827535446


   > https://github.com/apache/incubator-nuttx/blob/master/arch/risc-v/src/common/riscv_createstack.c#L50-L54
   > 
   > ```
   > #if defined(CONFIG_LIBC_FLOATINGPOINT) || defined (CONFIG_ARCH_RV64GC)
   > #  define STACK_ALIGNMENT   8
   > #else
   > #  define STACK_ALIGNMENT   4
   > #endif
   > ```
   > 
   > Look like RISCV always need 8 bytes alignment?
   
   Nice finding.
   Actually, the [calling convention](https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md#user-content--integer-calling-convention:~:text=The%20stack%20grows%20downwards%20(towards%20lower,are%20stored%20at%20correspondingly%20higher%20addresses.) states the following:
   
   >The stack grows downwards (towards lower addresses) and the stack pointer shall be aligned to a 128-bit boundary upon procedure entry. 
   
   So it seems that the correct `STACK_ALIGNMENT` should be 16.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org