Re: [edk2] GCC needs __attribute__((returns_twice)) for SetJump

2016-12-09 Thread Michael Zimmermann
I've tested it with clang 3.9.0 and it seems to support this attribute. But what about MSVC and all the other compilers which can be found in edk2's tools_def? I wasn't able to find anything useful about twice-returning function support for these compilers. So do they just never apply

Re: [edk2] GCC needs __attribute__((returns_twice)) for SetJump

2016-12-08 Thread Ard Biesheuvel
On 8 December 2016 at 13:30, Michael Zimmermann wrote: > When compiling with any ARM toolchain and Os, registers can get > trashed when returning for the second time from SetJump because GCC > only handles this correctly when using standard names like 'setjmp' or >

[edk2] GCC needs __attribute__((returns_twice)) for SetJump

2016-12-08 Thread Michael Zimmermann
When compiling with any ARM toolchain and Os, registers can get trashed when returning for the second time from SetJump because GCC only handles this correctly when using standard names like 'setjmp' or 'getcontext'. When different names are used you have to use the attribute 'returns_twice' to