summaryrefslogtreecommitdiff
path: root/firmware/stub
diff options
context:
space:
mode:
authorGaurav Shah <gauravsh@chromium.org>2010-08-20 14:30:03 -0700
committerGaurav Shah <gauravsh@chromium.org>2010-08-20 14:30:03 -0700
commit37dff84dbbe7fc683fce04382e68eca7aa19ea83 (patch)
tree8f5904e8d08b68fb5301e43827730313dd964ac2 /firmware/stub
parent33c44fc14f6981601d0f0743d0705587d5f11c56 (diff)
downloadvboot-37dff84dbbe7fc683fce04382e68eca7aa19ea83.tar.gz
Make sure that our version of certain utility function implementations gets used in the firmware.
Reference code drop-in to firmware should make our implementations of Memset() and SafeMemcmp() get used now. BUG=chrome-os-partner:820 TEST=make && make runtests Change-Id: If0c06dfad85b67398a118985cdb751d20b2b65a4 Review URL: http://codereview.chromium.org/3173035
Diffstat (limited to 'firmware/stub')
-rw-r--r--firmware/stub/utility_stub.c24
1 files changed, 0 insertions, 24 deletions
diff --git a/firmware/stub/utility_stub.c b/firmware/stub/utility_stub.c
index ed58e0b2..61417856 100644
--- a/firmware/stub/utility_stub.c
+++ b/firmware/stub/utility_stub.c
@@ -51,27 +51,3 @@ int Memcmp(const void* src1, const void* src2, size_t n) {
void* Memcpy(void* dest, const void* src, uint64_t n) {
return memcpy(dest, src, (size_t)n);
}
-
-void* Memset(void* d, const uint8_t c, uint64_t n) {
- uint8_t* dest = d; /* the only way to keep both cl and gcc happy */
- while (n--) {
- *dest++ = c;
- }
- return dest;
-}
-
-
-int SafeMemcmp(const void* s1, const void* s2, size_t n) {
- int result = 0;
- if (0 == n)
- return 1;
-
- const unsigned char* us1 = s1;
- const unsigned char* us2 = s2;
- /* Code snippet without data-dependent branch due to
- * Nate Lawson (nate@root.org) of Root Labs. */
- while (n--)
- result |= *us1++ ^ *us2++;
-
- return result != 0;
-}