Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Unified Diff: utility/fmap.c

Issue 6465018: Add load_firmware_test utility program (Closed) Base URL: ssh://git@gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: Created 9 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: utility/fmap.c
diff --git a/utility/fmap.c b/utility/fmap.c
new file mode 100644
index 0000000000000000000000000000000000000000..b9308b52e0d89dd6b88d5e7488a9838997104294
--- /dev/null
+++ b/utility/fmap.c
@@ -0,0 +1,23 @@
+/*
Randall Spangler 2011/02/09 19:42:14 Move this to host/lib Or firmware/lib if you're u
Che-Liang Chiou 2011/02/10 09:11:03 Done.
+ * Copyright (c) 2011 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include <errno.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "fmap.h"
+
+/* Return NULL if fail */
+char *find_fmap(char *ptr, size_t size)
gauravsh 2011/02/09 19:58:22 since this is just a library, move to */lib
Che-Liang Chiou 2011/02/10 09:11:03 Done.
+{
+ size_t i;
+ for (i=0; i<size; i += FMAP_SEARCH_STRIDE) {
+ if (0 == strncmp(ptr, "__FMAP__", 8))
+ return ptr;
+ ptr += FMAP_SEARCH_STRIDE;
+ }
+ return NULL;
+}

Powered by Google App Engine
This is Rietveld 408576698