diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-27 03:55:18 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-27 03:55:18 +0000 |
commit | 42b8daf88a600289d6b72c52777183ef64b05bb0 (patch) | |
tree | 7a213fa6c8779f28f8befa6257c3fa9b0f960c33 /include/platform.h | |
parent | defc1ea34074e7882724c460260d307cdf981a70 (diff) | |
download | busybox-w32-42b8daf88a600289d6b72c52777183ef64b05bb0.tar.gz busybox-w32-42b8daf88a600289d6b72c52777183ef64b05bb0.tar.bz2 busybox-w32-42b8daf88a600289d6b72c52777183ef64b05bb0.zip |
expand comment about FAST_FUNC
Diffstat (limited to 'include/platform.h')
-rw-r--r-- | include/platform.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/platform.h b/include/platform.h index 8d6ed9a3e..fe68547f0 100644 --- a/include/platform.h +++ b/include/platform.h | |||
@@ -97,9 +97,15 @@ | |||
97 | # endif | 97 | # endif |
98 | #endif | 98 | #endif |
99 | 99 | ||
100 | /* FAST_FUNC is a qualifier which (possibly) makes function call faster | ||
101 | * and/or smaller by using modified ABI. It is usually only needed | ||
102 | * on non-static, busybox internal functions. Recent versions of gcc | ||
103 | * optimize statics automatically. FAST_FUNC on static is required | ||
104 | * only if you need to match a function pointer's type */ | ||
100 | #if __GNUC_PREREQ(3,0) && defined(i386) | 105 | #if __GNUC_PREREQ(3,0) && defined(i386) |
101 | /* || defined(__x86_64__)? */ | 106 | /* || defined(__x86_64__)? */ |
102 | # define FAST_FUNC __attribute__((regparm(3))) | 107 | # define FAST_FUNC __attribute__((regparm(3))) |
108 | /* #elif ... - add your favorite arch today! */ | ||
103 | #else | 109 | #else |
104 | # define FAST_FUNC | 110 | # define FAST_FUNC |
105 | #endif | 111 | #endif |
@@ -145,8 +151,9 @@ | |||
145 | /* ---- Unaligned access ------------------------------------ */ | 151 | /* ---- Unaligned access ------------------------------------ */ |
146 | 152 | ||
147 | /* parameter is supposed to be an uint32_t* ptr */ | 153 | /* parameter is supposed to be an uint32_t* ptr */ |
148 | #if defined(i386) || defined(__x86_64__) /* + other arches? */ | 154 | #if defined(i386) || defined(__x86_64__) |
149 | #define get_unaligned_u32p(u32p) (*(u32p)) | 155 | #define get_unaligned_u32p(u32p) (*(u32p)) |
156 | /* #elif ... - add your favorite arch today! */ | ||
150 | #else | 157 | #else |
151 | /* performs reasonably well (gcc usually inlines memcpy here) */ | 158 | /* performs reasonably well (gcc usually inlines memcpy here) */ |
152 | #define get_unaligned_u32p(u32p) ({ uint32_t __t; memcpy(&__t, (u32p), 4); __t; }) | 159 | #define get_unaligned_u32p(u32p) ({ uint32_t __t; memcpy(&__t, (u32p), 4); __t; }) |