aboutsummaryrefslogtreecommitdiff
path: root/include/libbb.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/libbb.h')
-rw-r--r--include/libbb.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 8d252d455..17c9bc785 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -457,6 +457,11 @@ void *xmmap_anon(size_t size) FAST_FUNC;
457//sparc64,alpha,openrisc: fixed 8k pages 457//sparc64,alpha,openrisc: fixed 8k pages
458#endif 458#endif
459 459
460#if defined(__x86_64__) || defined(i386)
461/* 0x7f would be better, but it causes alignment problems */
462# define ARCH_GLOBAL_PTR_OFF 0x80
463#endif
464
460#if defined BB_ARCH_FIXED_PAGESIZE 465#if defined BB_ARCH_FIXED_PAGESIZE
461# define IF_VARIABLE_ARCH_PAGESIZE(...) /*nothing*/ 466# define IF_VARIABLE_ARCH_PAGESIZE(...) /*nothing*/
462# define bb_getpagesize() BB_ARCH_FIXED_PAGESIZE 467# define bb_getpagesize() BB_ARCH_FIXED_PAGESIZE
@@ -2423,6 +2428,16 @@ void XZALLOC_CONST_PTR(const void *pptr, size_t size) FAST_FUNC;
2423 } \ 2428 } \
2424} while (0) 2429} while (0)
2425 2430
2431#if defined(ARCH_GLOBAL_PTR_OFF)
2432# define SET_OFFSET_PTR_TO_GLOBALS(x) \
2433 ASSIGN_CONST_PTR(&ptr_to_globals, (char*)(x) + ARCH_GLOBAL_PTR_OFF)
2434# define OFFSET_PTR_TO_GLOBALS \
2435 ((struct globals*)((char*)ptr_to_globals - ARCH_GLOBAL_PTR_OFF))
2436#else
2437# define SET_OFFSET_PTR_TO_GLOBALS(x) SET_PTR_TO_GLOBALS(x)
2438# define OFFSET_PTR_TO_GLOBALS ptr_to_globals
2439#endif
2440
2426 2441
2427/* You can change LIBBB_DEFAULT_LOGIN_SHELL, but don't use it, 2442/* You can change LIBBB_DEFAULT_LOGIN_SHELL, but don't use it,
2428 * use bb_default_login_shell and following defines. 2443 * use bb_default_login_shell and following defines.