nds32: remove macro "RO"

"RO" is a workaround for GP base instructions.
And now we have added "-mno-gp-direct" option in the NDS32 toolchain.
So the compiler would not generate GP base instructions directly,
and we can remove this "RO".

Signed-off-by: Dino Li <dino.li@ite.com.tw>

BRANCH=none
BUG=chrome-os-partner:24378
TEST=console "version" and "gpioget"

Change-Id: I23cb6374fb8eb57081d713bf5c70b80a87dd2fb5
Signed-off-by: Dino Li <dino.li@ite.com.tw>
Reviewed-on: https://chromium-review.googlesource.com/281862
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
Reviewed-by: Alec Berg <alecaberg@chromium.org>
This commit is contained in:
Dino Li
2015-06-29 17:35:11 +08:00
committed by ChromeOS Commit Bot
parent 943e9292f1
commit edb53663dd
4 changed files with 4 additions and 25 deletions

View File

@@ -64,7 +64,7 @@ static int last_val_changed(int i, int v)
void gpio_config_module(enum module_id id, int enable)
{
const struct gpio_alt_func *af = gpio_alt_funcs;
int count = RO(gpio_alt_funcs_count);
int count = gpio_alt_funcs_count;
int i;
/* Set module's pins to alternate functions */

View File

@@ -544,7 +544,7 @@ const char *system_get_version(enum system_image_copy_t copy)
/* Handle version of current image */
if (copy == active_copy || copy == SYSTEM_IMAGE_UNKNOWN)
return &RO(version_data).version[0];
return &version_data.version[0];
if (active_copy == SYSTEM_IMAGE_UNKNOWN)
return "";
@@ -590,8 +590,8 @@ const char *system_get_version(enum system_image_copy_t copy)
/* Make sure the version struct cookies match before returning the
* version string. */
if (v->cookie1 == RO(version_data).cookie1 &&
v->cookie2 == RO(version_data).cookie2)
if (v->cookie1 == version_data.cookie1 &&
v->cookie2 == version_data.cookie2)
return v->version;
return "";

View File

@@ -16,17 +16,4 @@
*/
#define CONFIG_SOFTWARE_CLZ
/*
* Force the compiler to use a proper relocation when accessing an external
* variable in a read-only section.
* TODO(crosbug.com/p/24378): remove me when the nds32 toolchain bug is fixed.
*/
#undef RO
#define RO(var) \
({ \
typeof(var) *__ptr_val; \
asm volatile("la %0, " #var "\n" : "=r"(__ptr_val)); \
((typeof(var))(*__ptr_val)); \
})
#endif /* __CROS_EC_CONFIG_CORE_H */

View File

@@ -135,12 +135,4 @@ enum ec_error_list {
#define test_export_static static
#endif
/*
* accessor allowing to override some read only data accesses.
* used to workaround a buggy toolchain (cf http://crosbug.com/p/24378)
*/
#ifndef RO
#define RO(var) var
#endif
#endif /* __CROS_EC_COMMON_H */