diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-29 03:31:20 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-11-29 03:31:20 +0000 |
commit | 745cd17926a9d75cdd6482d5ce58227b492d1ebe (patch) | |
tree | 568f3236704000eed61d3460f9eef92e9535b746 /include | |
parent | c253778de92441b61806e1e4e7806e91f17ea50f (diff) | |
download | busybox-w32-745cd17926a9d75cdd6482d5ce58227b492d1ebe.tar.gz busybox-w32-745cd17926a9d75cdd6482d5ce58227b492d1ebe.tar.bz2 busybox-w32-745cd17926a9d75cdd6482d5ce58227b492d1ebe.zip |
Further optimize applet tables; prettify build output
text data bss dec hex filename
775923 929 9100 785952 bfe20 busybox_old
775565 929 9100 785594 bfcba busybox_unstripped
Diffstat (limited to 'include')
-rw-r--r-- | include/busybox.h | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/include/busybox.h b/include/busybox.h index f99901aa3..ec6953e87 100644 --- a/include/busybox.h +++ b/include/busybox.h | |||
@@ -28,28 +28,31 @@ typedef enum bb_suid_t { | |||
28 | /* Defined in appletlib.c (by including generated applet_tables.h) */ | 28 | /* Defined in appletlib.c (by including generated applet_tables.h) */ |
29 | /* Keep in sync with applets/applet_tables.c! */ | 29 | /* Keep in sync with applets/applet_tables.c! */ |
30 | extern const char applet_names[]; | 30 | extern const char applet_names[]; |
31 | extern int (*const applet_mains[])(int argc, char **argv); | 31 | extern int (*const applet_main[])(int argc, char **argv); |
32 | extern const uint16_t applet_nameofs[]; | ||
33 | extern const uint8_t applet_install_loc[]; | ||
32 | 34 | ||
33 | #if ENABLE_FEATURE_INSTALLER || ENABLE_FEATURE_PREFER_APPLETS | 35 | #if ENABLE_FEATURE_SUID || ENABLE_FEATURE_PREFER_APPLETS |
34 | extern const uint32_t applet_nameofs[]; | 36 | #define APPLET_NAME(i) (applet_names + (applet_nameofs[i] & 0x0fff)) |
35 | #else | 37 | #else |
36 | extern const uint16_t applet_nameofs[]; | 38 | #define APPLET_NAME(i) (applet_names + applet_nameofs[i]) |
39 | #endif | ||
40 | |||
41 | #if ENABLE_FEATURE_PREFER_APPLETS | ||
42 | #define APPLET_IS_NOFORK(i) (applet_nameofs[i] & (1 << 12)) | ||
43 | #define APPLET_IS_NOEXEC(i) (applet_nameofs[i] & (1 << 13)) | ||
37 | #endif | 44 | #endif |
38 | 45 | ||
39 | #if ENABLE_FEATURE_SUID | 46 | #if ENABLE_FEATURE_SUID |
40 | #define APPLET_NAME(i) (applet_names + (applet_nameofs[i] & 0x3fff)) | ||
41 | #define APPLET_SUID(i) ((applet_nameofs[i] >> 14) & 0x3) | 47 | #define APPLET_SUID(i) ((applet_nameofs[i] >> 14) & 0x3) |
42 | #else | ||
43 | #define APPLET_NAME(i) (applet_names + (applet_nameofs[i] & 0xffff)) | ||
44 | #endif | 48 | #endif |
45 | 49 | ||
46 | #if ENABLE_FEATURE_INSTALLER | 50 | #if ENABLE_FEATURE_INSTALLER |
47 | #define APPLET_INSTALL_LOC(i) ((applet_nameofs[i] >> 16) & 0x7) | 51 | #define APPLET_INSTALL_LOC(i) ({ \ |
48 | #endif | 52 | unsigned v = (i); \ |
49 | 53 | if (v & 1) v = applet_install_loc[v/2] >> 4; \ | |
50 | #if ENABLE_FEATURE_PREFER_APPLETS | 54 | else v = applet_install_loc[v/2] & 0xf; \ |
51 | #define APPLET_IS_NOFORK(i) (applet_nameofs[i] & (1 << 19)) | 55 | v; }) |
52 | #define APPLET_IS_NOEXEC(i) (applet_nameofs[i] & (1 << 20)) | ||
53 | #endif | 56 | #endif |
54 | 57 | ||
55 | 58 | ||