Commit 9b9d6b2a authored by Takashi YOSHII's avatar Takashi YOSHII Committed by Paul Mundt

sh: Provide a FLAT_PLAT_INIT() definition.

SH needs this in order to make sure that r4 has a sane value at process
entry time, which the libc expects has already been taken care of.

Fixes random crashes in flat binaries.
Signed-off-by: default avatarTakashi YOSHII <yoshii.takashi@renesas.com>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 74c27c43
...@@ -21,4 +21,11 @@ ...@@ -21,4 +21,11 @@
#define flat_get_relocate_addr(rel) (rel) #define flat_get_relocate_addr(rel) (rel)
#define flat_set_persistent(relval, p) ({ (void)p; 0; }) #define flat_set_persistent(relval, p) ({ (void)p; 0; })
#define FLAT_PLAT_INIT(_r) \
do { _r->regs[0]=0; _r->regs[1]=0; _r->regs[2]=0; _r->regs[3]=0; \
_r->regs[4]=0; _r->regs[5]=0; _r->regs[6]=0; _r->regs[7]=0; \
_r->regs[8]=0; _r->regs[9]=0; _r->regs[10]=0; _r->regs[11]=0; \
_r->regs[12]=0; _r->regs[13]=0; _r->regs[14]=0; \
_r->sr = SR_FD; } while (0)
#endif /* __ASM_SH_FLAT_H */ #endif /* __ASM_SH_FLAT_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment