summaryrefslogtreecommitdiff
path: root/host/include/vboot_host.h
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2013-03-29 11:09:30 -0700
committerChromeBot <chrome-bot@google.com>2013-04-02 14:12:52 -0700
commit0c3ba249abb1dc60f5ebabccf84ff13206440b83 (patch)
tree81cd2ada3845b8bb4b83fde6e27050483d5b941e /host/include/vboot_host.h
parent28b65ca99f4042fcc1218a4c18297f7ffb32ea15 (diff)
downloadvboot-0c3ba249abb1dc60f5ebabccf84ff13206440b83.tar.gz
Massive refactoring of external header files.
This reduces the number of exported header files to the minimum needed by the existing userspace utilities and firmware implementations. BUG=chromium:221544 BRANCH=none TEST=manual, trybots CQ-DEPEND=CL:47019,CL:47022,CL:47023 sudo FEATURES=test emerge vboot_reference FEATURES=test emerge-$BOARD \ vboot_reference \ chromeos-cryptohome \ chromeos-installer \ chromeos-u-boot \ peach-u-boot \ depthcharge Change-Id: I2946cc2dbaf5459a6c5eca92ca57d546498e6d85 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/47021 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'host/include/vboot_host.h')
-rw-r--r--host/include/vboot_host.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/host/include/vboot_host.h b/host/include/vboot_host.h
new file mode 100644
index 00000000..b22eea2d
--- /dev/null
+++ b/host/include/vboot_host.h
@@ -0,0 +1,62 @@
+/* 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.
+ *
+ * vboot-related functions exported for use by userspace programs
+ */
+
+#ifndef VBOOT_HOST_H_
+#define VBOOT_HOST_H_
+#include <inttypes.h>
+#include <stdint.h>
+#include <stdlib.h>
+
+/****************************************************************************/
+/* EFI GPT manipulation */
+
+#include "cgpt_params.h"
+
+/* partition table manipulation */
+int CgptCreate(CgptCreateParams *params);
+int CgptAdd(CgptAddParams *params);
+int CgptSetAttributes(CgptAddParams *params);
+int CgptGetPartitionDetails(CgptAddParams *params);
+int CgptBoot(CgptBootParams *params);
+int CgptGetBootPartitionNumber(CgptBootParams *params);
+int CgptShow(CgptShowParams *params);
+int CgptGetNumNonEmptyPartitions(CgptShowParams *params);
+int CgptRepair(CgptRepairParams *params);
+int CgptPrioritize(CgptPrioritizeParams *params);
+void CgptFind(CgptFindParams *params);
+int CgptLegacy(CgptLegacyParams *params);
+
+/* GUID conversion functions. Accepted format:
+ *
+ * "C12A7328-F81F-11D2-BA4B-00A0C93EC93B"
+ *
+ * At least GUID_STRLEN bytes should be reserved in 'str' (included the tailing
+ * '\0').
+ */
+#define GUID_STRLEN 37
+int StrToGuid(const char *str, Guid *guid);
+void GuidToStr(const Guid *guid, char *str, unsigned int buflen);
+int GuidEqual(const Guid *guid1, const Guid *guid2);
+int GuidIsZero(const Guid *guid);
+
+
+/****************************************************************************/
+/* Kernel command line */
+
+/* TODO(wfrichar): This needs a better location */
+#define MAX_KERNEL_CONFIG_SIZE 4096
+
+/* Use this to obtain the body load address from the kernel preamble */
+#define USE_PREAMBLE_LOAD_ADDR (~0)
+
+/* Returns a new copy of the kernel cmdline. The caller must free it. */
+char *FindKernelConfig(const char *filename,
+ uint64_t kernel_body_load_address);
+
+/****************************************************************************/
+
+#endif /* VBOOT_HOST_H_ */