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

Unified Diff: host/include/crossystem_arch.h

Issue 6780008: Refactor crossystem to move x86-specific implementation to its own file. (Closed) Base URL: ssh://gitrw.chromium.org:9222/vboot_reference.git@master
Patch Set: post-pull Created 9 years, 8 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
« no previous file with comments | « host/arch/x86/lib/crossystem_arch.c ('k') | host/include/host_misc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: host/include/crossystem_arch.h
diff --git a/host/include/crossystem_arch.h b/host/include/crossystem_arch.h
new file mode 100644
index 0000000000000000000000000000000000000000..ee8425b4d2b7e281082e08871e925a0536ba587d
--- /dev/null
+++ b/host/include/crossystem_arch.h
@@ -0,0 +1,80 @@
+/* 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.
+ *
+ * Architecture-specific APIs for crossystem
+ */
+
+#ifndef VBOOT_REFERENCE_CROSSYSTEM_ARCH_H_
+#define VBOOT_REFERENCE_CROSSYSTEM_ARCH_H_
+
+#include "vboot_nvstorage.h"
+#include "vboot_struct.h"
+
+
+/* INTERNAL APIS FOR CROSSYSTEM AVAILABLE TO ARCH-SPECIFIC FUNCTIONS */
+
+/* Read an integer property from VbNvStorage.
+ *
+ * Returns the parameter value, or -1 if error. */
+int VbGetNvStorage(VbNvParam param);
+
+/* Write an integer property to VbNvStorage.
+ *
+ * Returns 0 if success, -1 if error. */
+int VbSetNvStorage(VbNvParam param, int value);
+
+/* Return true if the FWID starts with the specified string. */
+int FwidStartsWith(const char *start);
+
+
+/* APIS WITH ARCH-SPECIFIC IMPLEMENTATIONS */
+
+/* Read the non-volatile context from NVRAM.
+ *
+ * Returns 0 if success, -1 if error. */
+int VbReadNvStorage(VbNvContext* vnc);
+
+/* Write the non-volatile context to NVRAM.
+ *
+ * Returns 0 if success, -1 if error. */
+int VbWriteNvStorage(VbNvContext* vnc);
+
+/* Read the VbSharedData buffer.
+ *
+ * Verifies the buffer contains at least enough data for the
+ * VbSharedDataHeader; if not, this is an error.
+ *
+ * If less data is read than expected, sets the returned structure's data_size
+ * to the actual amount of data read. If this is less than data_used, then
+ * some data was not returned; callers must handle this; this is not considered
+ * an error.
+ *
+ * Returns the data buffer, which must be freed by the caller, or NULL if
+ * error. */
+VbSharedDataHeader* VbSharedDataRead(void);
+
+/* Read an architecture-specific system property integer.
+ *
+ * Returns the property value, or -1 if error. */
+int VbGetArchPropertyInt(const char* name);
+
+/* Read an architecture-specific system property string into a
+ * destination buffer of the specified size. Returned string will be
+ * null-terminated. If the buffer is too small, the returned string
+ * will be truncated.
+ *
+ * Returns the passed buffer, or NULL if error. */
+const char* VbGetArchPropertyString(const char* name, char* dest, int size);
+
+/* Set an architecture-specific system property integer.
+ *
+ * Returns 0 if success, -1 if error. */
+int VbSetArchPropertyInt(const char* name, int value);
+
+/* Set an architecture-specific system property string.
+ *
+ * Returns 0 if success, -1 if error. */
+int VbSetArchPropertyString(const char* name, const char* value);
+
+#endif /* VBOOT_REFERENCE__CROSSYSTEM_ARCH_H_ */
« no previous file with comments | « host/arch/x86/lib/crossystem_arch.c ('k') | host/include/host_misc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698