diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-27 18:41:59 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2008-02-27 18:41:59 +0000 |
commit | 574f2f43948bb21d6e4187936ba5a5afccba25f6 (patch) | |
tree | 0b39aca564149e5ad30b3cc791228655ff1b1827 /libbb | |
parent | fe66a0eca1bfeae0abc0fc1e7d3709f271e05e82 (diff) | |
download | busybox-w32-574f2f43948bb21d6e4187936ba5a5afccba25f6.tar.gz busybox-w32-574f2f43948bb21d6e4187936ba5a5afccba25f6.tar.bz2 busybox-w32-574f2f43948bb21d6e4187936ba5a5afccba25f6.zip |
*: add optimization barrier to all "G trick" locations
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/Kbuild | 1 | ||||
-rw-r--r-- | libbb/appletlib.c | 1 | ||||
-rw-r--r-- | libbb/lineedit.c | 1 | ||||
-rw-r--r-- | libbb/messages.c | 4 | ||||
-rw-r--r-- | libbb/ptr_to_globals.c | 11 |
5 files changed, 14 insertions, 4 deletions
diff --git a/libbb/Kbuild b/libbb/Kbuild index fc87f625b..fd366559a 100644 --- a/libbb/Kbuild +++ b/libbb/Kbuild | |||
@@ -69,6 +69,7 @@ lib-y += pidfile.o | |||
69 | lib-y += printable.o | 69 | lib-y += printable.o |
70 | lib-y += process_escape_sequence.o | 70 | lib-y += process_escape_sequence.o |
71 | lib-y += procps.o | 71 | lib-y += procps.o |
72 | lib-y += ptr_to_globals.o | ||
72 | lib-y += read.o | 73 | lib-y += read.o |
73 | lib-y += recursive_action.o | 74 | lib-y += recursive_action.o |
74 | lib-y += remove_file.o | 75 | lib-y += remove_file.o |
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 793e3dc96..fec99c5ce 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c | |||
@@ -127,6 +127,7 @@ void lbb_prepare(const char *applet, char **argv) | |||
127 | { | 127 | { |
128 | #ifdef __GLIBC__ | 128 | #ifdef __GLIBC__ |
129 | (*(int **)&bb_errno) = __errno_location(); | 129 | (*(int **)&bb_errno) = __errno_location(); |
130 | barrier(); | ||
130 | #endif | 131 | #endif |
131 | applet_name = applet; | 132 | applet_name = applet; |
132 | 133 | ||
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index c6aa45c93..d716169d4 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -146,6 +146,7 @@ static struct statics *const ptr_to_statics __attribute__ ((section (".data"))); | |||
146 | 146 | ||
147 | #define INIT_S() do { \ | 147 | #define INIT_S() do { \ |
148 | (*(struct statics**)&ptr_to_statics) = xzalloc(sizeof(S)); \ | 148 | (*(struct statics**)&ptr_to_statics) = xzalloc(sizeof(S)); \ |
149 | barrier(); \ | ||
149 | cmdedit_termw = 80; \ | 150 | cmdedit_termw = 80; \ |
150 | USE_FEATURE_EDITING_FANCY_PROMPT(num_ok_lines = 1;) \ | 151 | USE_FEATURE_EDITING_FANCY_PROMPT(num_ok_lines = 1;) \ |
151 | USE_FEATURE_GETUSERNAME_AND_HOMEDIR(home_pwd_buf = (char*)null_str;) \ | 152 | USE_FEATURE_GETUSERNAME_AND_HOMEDIR(home_pwd_buf = (char*)null_str;) \ |
diff --git a/libbb/messages.c b/libbb/messages.c index 2a011f815..74a070c49 100644 --- a/libbb/messages.c +++ b/libbb/messages.c | |||
@@ -71,7 +71,3 @@ const char bb_path_wtmp_file[] ALIGN1 = | |||
71 | * Since gcc insists on aligning struct global's members, it would be a pity | 71 | * Since gcc insists on aligning struct global's members, it would be a pity |
72 | * (and an alignment fault on some CPUs) to mess it up. */ | 72 | * (and an alignment fault on some CPUs) to mess it up. */ |
73 | char bb_common_bufsiz1[COMMON_BUFSIZE] __attribute__(( aligned(sizeof(long long)) )); | 73 | char bb_common_bufsiz1[COMMON_BUFSIZE] __attribute__(( aligned(sizeof(long long)) )); |
74 | |||
75 | struct globals; | ||
76 | /* Make it reside in R/W memory: */ | ||
77 | struct globals *const ptr_to_globals __attribute__ ((section (".data"))); | ||
diff --git a/libbb/ptr_to_globals.c b/libbb/ptr_to_globals.c new file mode 100644 index 000000000..f8ccbf142 --- /dev/null +++ b/libbb/ptr_to_globals.c | |||
@@ -0,0 +1,11 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | ||
2 | /* | ||
3 | * Copyright (C) 2008 by Denys Vlasenko <vda.linux@googlemail.com> | ||
4 | * | ||
5 | * Licensed under GPLv2, see file LICENSE in this tarball for details. | ||
6 | */ | ||
7 | |||
8 | /* We cheat here. It is declared as const ptr in libbb.h, | ||
9 | * but here we make it live in R/W memory */ | ||
10 | struct globals; | ||
11 | struct globals *ptr_to_globals; | ||