summaryrefslogtreecommitdiff
path: root/firmware/lib/cgptlib/include
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2013-01-24 12:25:26 -0800
committerChromeBot <chrome-bot@google.com>2013-01-24 16:46:52 -0800
commit0bda13f5154afc8068e7d2d4563ff20b152f1c87 (patch)
tree268db6481da233a3d219862339d21209b90da033 /firmware/lib/cgptlib/include
parente9213a7c133681d6f565adbf218bafa7a3115c22 (diff)
downloadvboot-0bda13f5154afc8068e7d2d4563ff20b152f1c87.tar.gz
Improve coverage of cgptlib.c
BUG=chromium-os:38139 BRANCH=none TEST=make runtests Change-Id: I5719c6b8aa1a23fc65bf38d7096320479152f0ca Signed-off-by: Randall Spangler <rspangler@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/41955 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'firmware/lib/cgptlib/include')
-rw-r--r--firmware/lib/cgptlib/include/cgptlib.h4
-rw-r--r--firmware/lib/cgptlib/include/cgptlib_internal.h11
2 files changed, 13 insertions, 2 deletions
diff --git a/firmware/lib/cgptlib/include/cgptlib.h b/firmware/lib/cgptlib/include/cgptlib.h
index b6b27c96..6633733e 100644
--- a/firmware/lib/cgptlib/include/cgptlib.h
+++ b/firmware/lib/cgptlib/include/cgptlib.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
+/* Copyright (c) 2013 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.
*/
@@ -21,6 +21,8 @@ enum {
GPT_ERROR_START_LBA_OVERLAP,
GPT_ERROR_END_LBA_OVERLAP,
GPT_ERROR_DUP_GUID,
+ /* Number of errors */
+ GPT_ERROR_COUNT
};
/* Bit masks for GptData.modified field. */
diff --git a/firmware/lib/cgptlib/include/cgptlib_internal.h b/firmware/lib/cgptlib/include/cgptlib_internal.h
index f899eab0..36e598c2 100644
--- a/firmware/lib/cgptlib/include/cgptlib_internal.h
+++ b/firmware/lib/cgptlib/include/cgptlib_internal.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2010-2011 The Chromium OS Authors. All rights reserved.
+/* Copyright (c) 2013 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.
*/
@@ -89,6 +89,15 @@ uint32_t HeaderCrc(GptHeader* h);
* Returns 0 if entries are valid, 1 if invalid. */
int CheckEntries(GptEntry* entries, GptHeader* h);
+/* Return 0 if the GptHeaders are the same for all fields which don't
+ * differ between the primary and secondary headers - that is, all
+ * fields other than:
+ *
+ * my_lba
+ * alternate_lba
+ * entries_lba */
+int HeaderFieldsSame(GptHeader *h1, GptHeader *h2);
+
/* Check GptData, headers, entries.
*
* If successful, sets gpt->valid_headers and gpt->valid_entries and returns