aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2026-02-02 15:08:20 +0000
committerRon Yorston <rmy@pobox.com>2026-02-02 15:08:20 +0000
commit74ee6e70c9a4f7822e7461069579c4e6ef0a2f04 (patch)
tree1db535ead8de13300dcceadf07278dec22fb2d02 /include
parente27f759c63b338e6e6cf6dc8d9d0711e9c05d6a5 (diff)
parenta2f8c89aecf473f905da6eba53d02fb23eca93cd (diff)
downloadbusybox-w32-74ee6e70c9a4f7822e7461069579c4e6ef0a2f04.tar.gz
busybox-w32-74ee6e70c9a4f7822e7461069579c4e6ef0a2f04.tar.bz2
busybox-w32-74ee6e70c9a4f7822e7461069579c4e6ef0a2f04.zip
Merge branch 'busybox' into mergemerge
Diffstat (limited to 'include')
-rw-r--r--include/libbb.h15
-rw-r--r--include/platform.h2
2 files changed, 17 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h
index 1c75df523..562860cf4 100644
--- a/include/libbb.h
+++ b/include/libbb.h
@@ -506,6 +506,11 @@ void *xmmap_anon(size_t size) FAST_FUNC;
506//sparc64,alpha,openrisc: fixed 8k pages 506//sparc64,alpha,openrisc: fixed 8k pages
507#endif 507#endif
508 508
509#if defined(__x86_64__) || defined(i386)
510/* 0x7f would be better, but it causes alignment problems */
511# define ARCH_GLOBAL_PTR_OFF 0x80
512#endif
513
509#if defined BB_ARCH_FIXED_PAGESIZE 514#if defined BB_ARCH_FIXED_PAGESIZE
510# define IF_VARIABLE_ARCH_PAGESIZE(...) /*nothing*/ 515# define IF_VARIABLE_ARCH_PAGESIZE(...) /*nothing*/
511# define bb_getpagesize() BB_ARCH_FIXED_PAGESIZE 516# define bb_getpagesize() BB_ARCH_FIXED_PAGESIZE
@@ -2680,6 +2685,16 @@ void XZALLOC_CONST_PTR(const void *pptr, size_t size) FAST_FUNC;
2680 } \ 2685 } \
2681} while (0) 2686} while (0)
2682 2687
2688#if defined(ARCH_GLOBAL_PTR_OFF)
2689# define SET_OFFSET_PTR_TO_GLOBALS(x) \
2690 ASSIGN_CONST_PTR(&ptr_to_globals, (char*)(x) + ARCH_GLOBAL_PTR_OFF)
2691# define OFFSET_PTR_TO_GLOBALS \
2692 ((struct globals*)((char*)ptr_to_globals - ARCH_GLOBAL_PTR_OFF))
2693#else
2694# define SET_OFFSET_PTR_TO_GLOBALS(x) SET_PTR_TO_GLOBALS(x)
2695# define OFFSET_PTR_TO_GLOBALS ptr_to_globals
2696#endif
2697
2683 2698
2684/* You can change LIBBB_DEFAULT_LOGIN_SHELL, but don't use it, 2699/* You can change LIBBB_DEFAULT_LOGIN_SHELL, but don't use it,
2685 * use bb_default_login_shell and following defines. 2700 * use bb_default_login_shell and following defines.
diff --git a/include/platform.h b/include/platform.h
index 793639f1c..f46569f0f 100644
--- a/include/platform.h
+++ b/include/platform.h
@@ -232,6 +232,7 @@
232# define IF_LITTLE_ENDIAN(...) 232# define IF_LITTLE_ENDIAN(...)
233/* How do bytes a,b,c,d (sequential in memory) look if fetched into uint32_t? */ 233/* How do bytes a,b,c,d (sequential in memory) look if fetched into uint32_t? */
234# define PACK32_BYTES(a,b,c,d) (uint32_t)((d)+((c)<<8)+((b)<<16)+((a)<<24)) 234# define PACK32_BYTES(a,b,c,d) (uint32_t)((d)+((c)<<8)+((b)<<16)+((a)<<24))
235# define PACK64_LITERAL_STR(s) (((uint64_t)PACK32_BYTES((s)[0],(s)[1],(s)[2],(s)[3])<<32) + PACK32_BYTES((s)[4],(s)[5],(s)[6],(s)[7]))
235#else 236#else
236# define SWAP_BE16(x) bswap_16(x) 237# define SWAP_BE16(x) bswap_16(x)
237# define SWAP_BE32(x) bswap_32(x) 238# define SWAP_BE32(x) bswap_32(x)
@@ -242,6 +243,7 @@
242# define IF_BIG_ENDIAN(...) 243# define IF_BIG_ENDIAN(...)
243# define IF_LITTLE_ENDIAN(...) __VA_ARGS__ 244# define IF_LITTLE_ENDIAN(...) __VA_ARGS__
244# define PACK32_BYTES(a,b,c,d) (uint32_t)((a)+((b)<<8)+((c)<<16)+((d)<<24)) 245# define PACK32_BYTES(a,b,c,d) (uint32_t)((a)+((b)<<8)+((c)<<16)+((d)<<24))
246# define PACK64_LITERAL_STR(s) (((uint64_t)PACK32_BYTES((s)[4],(s)[5],(s)[6],(s)[7])<<32) + PACK32_BYTES((s)[0],(s)[1],(s)[2],(s)[3]))
245#endif 247#endif
246 248
247 249