diff options
author | Mark Whitley <markw@lineo.com> | 2001-04-20 17:40:33 +0000 |
---|---|---|
committer | Mark Whitley <markw@lineo.com> | 2001-04-20 17:40:33 +0000 |
commit | 3e310ac309a3d61c5d2b651e200a625f71d9faa4 (patch) | |
tree | 2b016a3098f06fc60b812281614b26b9bdb3bd25 | |
parent | 6ebd63382931ce047de3f801e9cb0ae41007242c (diff) | |
download | busybox-w32-3e310ac309a3d61c5d2b651e200a625f71d9faa4.tar.gz busybox-w32-3e310ac309a3d61c5d2b651e200a625f71d9faa4.tar.bz2 busybox-w32-3e310ac309a3d61c5d2b651e200a625f71d9faa4.zip |
Applied patch from Larry Doolittle to give users the third option of putting
buffers in BSS (in addition to stack and heap).
-rw-r--r-- | Config.h | 5 | ||||
-rw-r--r-- | busybox.h | 5 | ||||
-rw-r--r-- | include/busybox.h | 5 |
3 files changed, 15 insertions, 0 deletions
@@ -144,6 +144,11 @@ | |||
144 | // them put on the stack. For some very small machines with limited stack | 144 | // them put on the stack. For some very small machines with limited stack |
145 | // space, this can be deadly. For most folks, this works just fine... | 145 | // space, this can be deadly. For most folks, this works just fine... |
146 | //#define BB_FEATURE_BUFFERS_GO_ON_STACK | 146 | //#define BB_FEATURE_BUFFERS_GO_ON_STACK |
147 | // The third alternative for buffer allocation is to use BSS. This works | ||
148 | // beautifully for computers with a real MMU (and OS support), but wastes | ||
149 | // runtime RAM for uCLinux. This behavior was the only one available for | ||
150 | // BusyBox versions 0.48 and earlier. | ||
151 | //#define BB_FEATURE_BUFFERS_GO_IN_BSS | ||
147 | // | 152 | // |
148 | // Turn this on to use Erik's very cool devps, and devmtab kernel drivers, | 153 | // Turn this on to use Erik's very cool devps, and devmtab kernel drivers, |
149 | // thereby eliminating the need for the /proc filesystem and thereby saving | 154 | // thereby eliminating the need for the /proc filesystem and thereby saving |
@@ -72,9 +72,14 @@ extern const char *applet_name; | |||
72 | #define RESERVE_BB_BUFFER(buffer,len) char buffer[len] | 72 | #define RESERVE_BB_BUFFER(buffer,len) char buffer[len] |
73 | #define RESERVE_BB_UBUFFER(buffer,len) unsigned char buffer[len] | 73 | #define RESERVE_BB_UBUFFER(buffer,len) unsigned char buffer[len] |
74 | #else | 74 | #else |
75 | #ifdef BB_FEATURE_BUFFERS_GO_IN_BSS | ||
76 | #define RESERVE_BB_BUFFER(buffer,len) static char buffer[len] | ||
77 | #define RESERVE_BB_UBUFFER(buffer,len) static unsigned char buffer[len] | ||
78 | #else | ||
75 | #define RESERVE_BB_BUFFER(buffer,len) char *buffer=xmalloc(len) | 79 | #define RESERVE_BB_BUFFER(buffer,len) char *buffer=xmalloc(len) |
76 | #define RESERVE_BB_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len) | 80 | #define RESERVE_BB_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len) |
77 | #endif | 81 | #endif |
82 | #endif | ||
78 | 83 | ||
79 | 84 | ||
80 | /* Bit map related macros -- libc5 doens't provide these... sigh. */ | 85 | /* Bit map related macros -- libc5 doens't provide these... sigh. */ |
diff --git a/include/busybox.h b/include/busybox.h index ebbe759e2..8905b0dbd 100644 --- a/include/busybox.h +++ b/include/busybox.h | |||
@@ -72,9 +72,14 @@ extern const char *applet_name; | |||
72 | #define RESERVE_BB_BUFFER(buffer,len) char buffer[len] | 72 | #define RESERVE_BB_BUFFER(buffer,len) char buffer[len] |
73 | #define RESERVE_BB_UBUFFER(buffer,len) unsigned char buffer[len] | 73 | #define RESERVE_BB_UBUFFER(buffer,len) unsigned char buffer[len] |
74 | #else | 74 | #else |
75 | #ifdef BB_FEATURE_BUFFERS_GO_IN_BSS | ||
76 | #define RESERVE_BB_BUFFER(buffer,len) static char buffer[len] | ||
77 | #define RESERVE_BB_UBUFFER(buffer,len) static unsigned char buffer[len] | ||
78 | #else | ||
75 | #define RESERVE_BB_BUFFER(buffer,len) char *buffer=xmalloc(len) | 79 | #define RESERVE_BB_BUFFER(buffer,len) char *buffer=xmalloc(len) |
76 | #define RESERVE_BB_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len) | 80 | #define RESERVE_BB_UBUFFER(buffer,len) unsigned char *buffer=xmalloc(len) |
77 | #endif | 81 | #endif |
82 | #endif | ||
78 | 83 | ||
79 | 84 | ||
80 | /* Bit map related macros -- libc5 doens't provide these... sigh. */ | 85 | /* Bit map related macros -- libc5 doens't provide these... sigh. */ |