diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-27 02:52:20 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-06-27 02:52:20 +0000 |
commit | defc1ea34074e7882724c460260d307cdf981a70 (patch) | |
tree | fca9b9a5fe243f9c0c76b84824ea2ff92ea8e589 /networking/interface.c | |
parent | 26bc57d8b26425f23f4be974cce7bf35c95c9a1a (diff) | |
download | busybox-w32-defc1ea34074e7882724c460260d307cdf981a70.tar.gz busybox-w32-defc1ea34074e7882724c460260d307cdf981a70.tar.bz2 busybox-w32-defc1ea34074e7882724c460260d307cdf981a70.zip |
*: introduce and use FAST_FUNC: regparm on i386, otherwise no-on
text data bss dec hex filename
808035 611 6868 815514 c719a busybox_old
804472 611 6868 811951 c63af busybox_unstripped
Diffstat (limited to 'networking/interface.c')
-rw-r--r-- | networking/interface.c | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/networking/interface.c b/networking/interface.c index efae03bf3..afc7d0b80 100644 --- a/networking/interface.c +++ b/networking/interface.c | |||
@@ -89,7 +89,7 @@ struct in6_ifreq { | |||
89 | #endif | 89 | #endif |
90 | 90 | ||
91 | /* Display an Internet socket address. */ | 91 | /* Display an Internet socket address. */ |
92 | static const char *INET_sprint(struct sockaddr *sap, int numeric) | 92 | static const char* FAST_FUNC INET_sprint(struct sockaddr *sap, int numeric) |
93 | { | 93 | { |
94 | static char *buff; | 94 | static char *buff; |
95 | 95 | ||
@@ -143,7 +143,7 @@ static int INET_getsock(char *bufp, struct sockaddr *sap) | |||
143 | } | 143 | } |
144 | #endif | 144 | #endif |
145 | 145 | ||
146 | static int INET_input(/*int type,*/ const char *bufp, struct sockaddr *sap) | 146 | static int FAST_FUNC INET_input(/*int type,*/ const char *bufp, struct sockaddr *sap) |
147 | { | 147 | { |
148 | return INET_resolve(bufp, (struct sockaddr_in *) sap, 0); | 148 | return INET_resolve(bufp, (struct sockaddr_in *) sap, 0); |
149 | /* | 149 | /* |
@@ -159,19 +159,19 @@ static int INET_input(/*int type,*/ const char *bufp, struct sockaddr *sap) | |||
159 | } | 159 | } |
160 | 160 | ||
161 | static const struct aftype inet_aftype = { | 161 | static const struct aftype inet_aftype = { |
162 | .name = "inet", | 162 | .name = "inet", |
163 | .title = "DARPA Internet", | 163 | .title = "DARPA Internet", |
164 | .af = AF_INET, | 164 | .af = AF_INET, |
165 | .alen = 4, | 165 | .alen = 4, |
166 | .sprint = INET_sprint, | 166 | .sprint = INET_sprint, |
167 | .input = INET_input, | 167 | .input = INET_input, |
168 | }; | 168 | }; |
169 | 169 | ||
170 | #ifdef HAVE_AFINET6 | 170 | #ifdef HAVE_AFINET6 |
171 | 171 | ||
172 | /* Display an Internet socket address. */ | 172 | /* Display an Internet socket address. */ |
173 | /* dirty! struct sockaddr usually doesn't suffer for inet6 addresses, fst. */ | 173 | /* dirty! struct sockaddr usually doesn't suffer for inet6 addresses, fst. */ |
174 | static const char *INET6_sprint(struct sockaddr *sap, int numeric) | 174 | static const char* FAST_FUNC INET6_sprint(struct sockaddr *sap, int numeric) |
175 | { | 175 | { |
176 | static char *buff; | 176 | static char *buff; |
177 | 177 | ||
@@ -198,7 +198,7 @@ static int INET6_getsock(char *bufp, struct sockaddr *sap) | |||
198 | } | 198 | } |
199 | #endif | 199 | #endif |
200 | 200 | ||
201 | static int INET6_input(/*int type,*/ const char *bufp, struct sockaddr *sap) | 201 | static int FAST_FUNC INET6_input(/*int type,*/ const char *bufp, struct sockaddr *sap) |
202 | { | 202 | { |
203 | return INET6_resolve(bufp, (struct sockaddr_in6 *) sap); | 203 | return INET6_resolve(bufp, (struct sockaddr_in6 *) sap); |
204 | /* | 204 | /* |
@@ -212,18 +212,18 @@ static int INET6_input(/*int type,*/ const char *bufp, struct sockaddr *sap) | |||
212 | } | 212 | } |
213 | 213 | ||
214 | static const struct aftype inet6_aftype = { | 214 | static const struct aftype inet6_aftype = { |
215 | .name = "inet6", | 215 | .name = "inet6", |
216 | .title = "IPv6", | 216 | .title = "IPv6", |
217 | .af = AF_INET6, | 217 | .af = AF_INET6, |
218 | .alen = sizeof(struct in6_addr), | 218 | .alen = sizeof(struct in6_addr), |
219 | .sprint = INET6_sprint, | 219 | .sprint = INET6_sprint, |
220 | .input = INET6_input, | 220 | .input = INET6_input, |
221 | }; | 221 | }; |
222 | 222 | ||
223 | #endif /* HAVE_AFINET6 */ | 223 | #endif /* HAVE_AFINET6 */ |
224 | 224 | ||
225 | /* Display an UNSPEC address. */ | 225 | /* Display an UNSPEC address. */ |
226 | static char *UNSPEC_print(unsigned char *ptr) | 226 | static char* FAST_FUNC UNSPEC_print(unsigned char *ptr) |
227 | { | 227 | { |
228 | static char *buff; | 228 | static char *buff; |
229 | 229 | ||
@@ -244,7 +244,7 @@ static char *UNSPEC_print(unsigned char *ptr) | |||
244 | } | 244 | } |
245 | 245 | ||
246 | /* Display an UNSPEC socket address. */ | 246 | /* Display an UNSPEC socket address. */ |
247 | static const char *UNSPEC_sprint(struct sockaddr *sap, int numeric ATTRIBUTE_UNUSED) | 247 | static const char* FAST_FUNC UNSPEC_sprint(struct sockaddr *sap, int numeric ATTRIBUTE_UNUSED) |
248 | { | 248 | { |
249 | if (sap->sa_family == 0xFFFF || sap->sa_family == 0) | 249 | if (sap->sa_family == 0xFFFF || sap->sa_family == 0) |
250 | return "[NONE SET]"; | 250 | return "[NONE SET]"; |
@@ -270,7 +270,7 @@ static const struct aftype *const aftypes[] = { | |||
270 | }; | 270 | }; |
271 | 271 | ||
272 | /* Check our protocol family table for this family. */ | 272 | /* Check our protocol family table for this family. */ |
273 | const struct aftype *get_aftype(const char *name) | 273 | const struct aftype* FAST_FUNC get_aftype(const char *name) |
274 | { | 274 | { |
275 | const struct aftype *const *afp; | 275 | const struct aftype *const *afp; |
276 | 276 | ||
@@ -720,7 +720,7 @@ static const struct hwtype loop_hwtype = { | |||
720 | #endif | 720 | #endif |
721 | 721 | ||
722 | /* Display an Ethernet address in readable format. */ | 722 | /* Display an Ethernet address in readable format. */ |
723 | static char *pr_ether(unsigned char *ptr) | 723 | static char* FAST_FUNC ether_print(unsigned char *ptr) |
724 | { | 724 | { |
725 | static char *buff; | 725 | static char *buff; |
726 | 726 | ||
@@ -732,15 +732,15 @@ static char *pr_ether(unsigned char *ptr) | |||
732 | return buff; | 732 | return buff; |
733 | } | 733 | } |
734 | 734 | ||
735 | static int in_ether(const char *bufp, struct sockaddr *sap); | 735 | static int FAST_FUNC ether_input(const char *bufp, struct sockaddr *sap); |
736 | 736 | ||
737 | static const struct hwtype ether_hwtype = { | 737 | static const struct hwtype ether_hwtype = { |
738 | .name = "ether", | 738 | .name = "ether", |
739 | .title = "Ethernet", | 739 | .title = "Ethernet", |
740 | .type = ARPHRD_ETHER, | 740 | .type = ARPHRD_ETHER, |
741 | .alen = ETH_ALEN, | 741 | .alen = ETH_ALEN, |
742 | .print = pr_ether, | 742 | .print = ether_print, |
743 | .input = in_ether | 743 | .input = ether_input |
744 | }; | 744 | }; |
745 | 745 | ||
746 | static unsigned hexchar2int(char c) | 746 | static unsigned hexchar2int(char c) |
@@ -754,7 +754,7 @@ static unsigned hexchar2int(char c) | |||
754 | } | 754 | } |
755 | 755 | ||
756 | /* Input an Ethernet address and convert to binary. */ | 756 | /* Input an Ethernet address and convert to binary. */ |
757 | static int in_ether(const char *bufp, struct sockaddr *sap) | 757 | static int FAST_FUNC ether_input(const char *bufp, struct sockaddr *sap) |
758 | { | 758 | { |
759 | unsigned char *ptr; | 759 | unsigned char *ptr; |
760 | char c; | 760 | char c; |
@@ -813,12 +813,12 @@ static const struct hwtype sit_hwtype = { | |||
813 | #endif | 813 | #endif |
814 | #if ENABLE_FEATURE_HWIB | 814 | #if ENABLE_FEATURE_HWIB |
815 | static const struct hwtype ib_hwtype = { | 815 | static const struct hwtype ib_hwtype = { |
816 | .name = "infiniband", | 816 | .name = "infiniband", |
817 | .title = "InfiniBand", | 817 | .title = "InfiniBand", |
818 | .type = ARPHRD_INFINIBAND, | 818 | .type = ARPHRD_INFINIBAND, |
819 | .alen = INFINIBAND_ALEN, | 819 | .alen = INFINIBAND_ALEN, |
820 | .print = UNSPEC_print, | 820 | .print = UNSPEC_print, |
821 | .input = in_ib, | 821 | .input = in_ib, |
822 | }; | 822 | }; |
823 | #endif | 823 | #endif |
824 | 824 | ||
@@ -852,7 +852,7 @@ static const char *const if_port_text[] = { | |||
852 | #endif | 852 | #endif |
853 | 853 | ||
854 | /* Check our hardware type table for this type. */ | 854 | /* Check our hardware type table for this type. */ |
855 | const struct hwtype *get_hwtype(const char *name) | 855 | const struct hwtype* FAST_FUNC get_hwtype(const char *name) |
856 | { | 856 | { |
857 | const struct hwtype *const *hwp; | 857 | const struct hwtype *const *hwp; |
858 | 858 | ||
@@ -866,7 +866,7 @@ const struct hwtype *get_hwtype(const char *name) | |||
866 | } | 866 | } |
867 | 867 | ||
868 | /* Check our hardware type table for this type. */ | 868 | /* Check our hardware type table for this type. */ |
869 | const struct hwtype *get_hwntype(int type) | 869 | const struct hwtype* FAST_FUNC get_hwntype(int type) |
870 | { | 870 | { |
871 | const struct hwtype *const *hwp; | 871 | const struct hwtype *const *hwp; |
872 | 872 | ||
@@ -1214,7 +1214,7 @@ static int if_print(char *ifname) | |||
1214 | 1214 | ||
1215 | #if ENABLE_FEATURE_HWIB | 1215 | #if ENABLE_FEATURE_HWIB |
1216 | /* Input an Infiniband address and convert to binary. */ | 1216 | /* Input an Infiniband address and convert to binary. */ |
1217 | int in_ib(const char *bufp, struct sockaddr *sap) | 1217 | int FAST_FUNC in_ib(const char *bufp, struct sockaddr *sap) |
1218 | { | 1218 | { |
1219 | unsigned char *ptr; | 1219 | unsigned char *ptr; |
1220 | char c; | 1220 | char c; |
@@ -1272,7 +1272,7 @@ int in_ib(const char *bufp, struct sockaddr *sap) | |||
1272 | #endif | 1272 | #endif |
1273 | 1273 | ||
1274 | 1274 | ||
1275 | int display_interfaces(char *ifname) | 1275 | int FAST_FUNC display_interfaces(char *ifname) |
1276 | { | 1276 | { |
1277 | int status; | 1277 | int status; |
1278 | 1278 | ||