Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions return.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,20 +260,13 @@ asm void ASM_GET_RET_ADDR(file)
/*************************************/

/*
* For Powerpc 603 based system running LynxOS 2.3.1 using gcc/gas.
*/
#if defined(__powerpc__) && defined(__GNUC__) && !defined(__OPTIMIZE__)

/*
* This won't compile if "-O2" is used, but it seems to work fine with
* "-O0". I'm no assembler expert; I was happy enough to come up with
* something that works at all... :-)
* For PowerPC using gcc/gas.
*/
#if defined(__powerpc__) && defined(__GNUC__)

#define GET_RET_ADDR(file) \
do { \
asm("mflr 0"); \
asm("stw 0,%0" : "=g" (file)); \
asm("mflr %0" : "=r" (file)); \
} while(0)

#endif /* __powerpc__ && __GNUC__ && !__OPTIMIZE__ */
Expand Down