mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-09 22:36:39 +07:00
b5cdb5797d
If enable is moved by GCC in a register its value may not be preserved after coming back there with longjmp(). So, mark it as volatile to prevent this; this is suggested (it seems) in info gcc, when it talks about -Wuninitialized. I re-read this and it seems to say something different, but I still believe this may be needed. Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Cc: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
24 lines
401 B
C
24 lines
401 B
C
#ifndef __UML_LONGJMP_H
|
|
#define __UML_LONGJMP_H
|
|
|
|
#include "sysdep/archsetjmp.h"
|
|
#include "os.h"
|
|
|
|
extern int setjmp(jmp_buf);
|
|
extern void longjmp(jmp_buf, int);
|
|
|
|
#define UML_LONGJMP(buf, val) do { \
|
|
longjmp(*buf, val); \
|
|
} while(0)
|
|
|
|
#define UML_SETJMP(buf) ({ \
|
|
int n; \
|
|
volatile int enable; \
|
|
enable = get_signals(); \
|
|
n = setjmp(*buf); \
|
|
if(n != 0) \
|
|
set_signals(enable); \
|
|
n; })
|
|
|
|
#endif
|