aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 707e8d69b..8305e59fc 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -1208,10 +1208,14 @@ extern char bb_common_bufsiz1[COMMON_BUFSIZE];
1208struct globals; 1208struct globals;
1209/* '*const' ptr makes gcc optimize code much better. 1209/* '*const' ptr makes gcc optimize code much better.
1210 * Magic prevents ptr_to_globals from going into rodata. 1210 * Magic prevents ptr_to_globals from going into rodata.
1211 * If you want to assign a value, use PTR_TO_GLOBALS = xxx */ 1211 * If you want to assign a value, use SET_PTR_TO_GLOBALS(x) */
1212extern struct globals *const ptr_to_globals; 1212extern struct globals *const ptr_to_globals;
1213#define PTR_TO_GLOBALS (*(struct globals**)&ptr_to_globals) 1213/* At least gcc 3.4.6 on mipsel system needs optimization barrier */
1214 1214#define barrier() asm volatile("":::"memory")
1215#define SET_PTR_TO_GLOBALS(x) do { \
1216 (*(struct globals**)&ptr_to_globals) = (x); \
1217 barrier(); \
1218} while (0)
1215 1219
1216/* You can change LIBBB_DEFAULT_LOGIN_SHELL, but don't use it, 1220/* You can change LIBBB_DEFAULT_LOGIN_SHELL, but don't use it,
1217 * use bb_default_login_shell and following defines. 1221 * use bb_default_login_shell and following defines.