summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@chromium.org>2018-09-01 17:29:18 -0400
committerchrome-bot <chrome-bot@chromium.org>2018-09-04 21:04:01 -0700
commit483fcf08acb9ad9bbedbb5f980314144260d5da4 (patch)
treecc44505da08c7a21ec675001bead117181658071
parentb7a007a22971e3a257b40844d4f685875ee56d5e (diff)
downloadvboot-483fcf08acb9ad9bbedbb5f980314144260d5da4.tar.gz
add extern C markers to installed headers
Some of the headers have extern C markings already, so add to the rest of the installed files so users don't have to. BUG=chromium:878440 TEST=build passes BRANCH=none Change-Id: I3edf56ca2235269803049207806a9f7eb4c664f2 Reviewed-on: https://chromium-review.googlesource.com/1201042 Commit-Ready: Mike Frysinger <vapier@chromium.org> Tested-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--firmware/2lib/include/2id.h8
-rw-r--r--firmware/include/bmpblk_header.h8
-rw-r--r--firmware/include/gbb_access.h8
-rw-r--r--firmware/include/gpt.h8
-rw-r--r--firmware/include/gpt_misc.h8
-rw-r--r--firmware/include/tpm1_tss_constants.h8
-rw-r--r--firmware/include/tpm2_marshaling.h8
-rw-r--r--firmware/include/tpm2_tss_constants.h8
-rw-r--r--firmware/include/vboot_api.h9
-rw-r--r--firmware/include/vboot_struct.h8
-rw-r--r--firmware/lib21/include/vb21_common.h8
-rw-r--r--firmware/lib21/include/vb21_struct.h8
-rw-r--r--host/include/cgpt_params.h9
-rw-r--r--host/include/openssl_compat.h8
-rw-r--r--host/include/vboot_host.h7
15 files changed, 121 insertions, 0 deletions
diff --git a/firmware/2lib/include/2id.h b/firmware/2lib/include/2id.h
index 03f6d961..28ba5538 100644
--- a/firmware/2lib/include/2id.h
+++ b/firmware/2lib/include/2id.h
@@ -12,6 +12,10 @@
#define VBOOT_REFERENCE_VBOOT_2ID_H_
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
#define VB2_ID_NUM_BYTES 20
struct vb2_id {
@@ -25,4 +29,8 @@ struct vb2_id {
#define VB2_ID_NONE_SHA256 {{0x02, 0x56,}}
#define VB2_ID_NONE_SHA512 {{0x05, 0x12,}}
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif /* VBOOT_REFERENCE_VBOOT_2ID_H_ */
diff --git a/firmware/include/bmpblk_header.h b/firmware/include/bmpblk_header.h
index a010f071..fec309d8 100644
--- a/firmware/include/bmpblk_header.h
+++ b/firmware/include/bmpblk_header.h
@@ -45,6 +45,10 @@
#define VBOOT_REFERENCE_BMPBLK_HEADER_H_
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
#define BMPBLOCK_SIGNATURE "$BMP"
#define BMPBLOCK_SIGNATURE_SIZE (4)
@@ -138,4 +142,8 @@ typedef enum ImageFormat {
#define RENDER_HWID "$HWID"
#define RENDER_HWID_RTOL "$HWID.rtol"
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif /* VBOOT_REFERENCE_BMPBLK_HEADER_H_ */
diff --git a/firmware/include/gbb_access.h b/firmware/include/gbb_access.h
index 4842563b..09a88fa0 100644
--- a/firmware/include/gbb_access.h
+++ b/firmware/include/gbb_access.h
@@ -10,6 +10,10 @@
#include "vboot_api.h"
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
struct vb2_context;
struct VbPublicKey;
@@ -47,4 +51,8 @@ VbError_t VbGbbReadRecoveryKey(struct vb2_context *ctx,
*/
VbError_t VbGbbReadHWID(struct vb2_context *ctx, char *hwid, uint32_t max_size);
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif
diff --git a/firmware/include/gpt.h b/firmware/include/gpt.h
index 45702372..0f27cef5 100644
--- a/firmware/include/gpt.h
+++ b/firmware/include/gpt.h
@@ -11,6 +11,10 @@
#define VBOOT_REFERENCE_CGPTLIB_GPT_H_
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
/* From the specification */
#define GPT_HEADER_SIGNATURE_SIZE 8
#define GPT_HEADER_REVISION 0x00010000
@@ -124,4 +128,8 @@ typedef struct {
#define GPTENTRY_EXPECTED_SIZE 128
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif /* VBOOT_REFERENCE_CGPTLIB_GPT_H_ */
diff --git a/firmware/include/gpt_misc.h b/firmware/include/gpt_misc.h
index 7c4367b8..b3b062b1 100644
--- a/firmware/include/gpt_misc.h
+++ b/firmware/include/gpt_misc.h
@@ -9,6 +9,10 @@
#include "gpt.h"
#include "vboot_api.h"
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
enum {
GPT_SUCCESS = 0,
GPT_ERROR_NO_VALID_KERNEL,
@@ -209,4 +213,8 @@ void SetEntrySuccessful(GptEntry *e, int successful);
void SetEntryPriority(GptEntry *e, int priority);
void SetEntryTries(GptEntry *e, int tries);
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif /* VBOOT_REFERENCE_CGPT_MISC_H_ */
diff --git a/firmware/include/tpm1_tss_constants.h b/firmware/include/tpm1_tss_constants.h
index 54642ba6..8d92bef2 100644
--- a/firmware/include/tpm1_tss_constants.h
+++ b/firmware/include/tpm1_tss_constants.h
@@ -11,6 +11,10 @@
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
#define TPM_MAX_COMMAND_SIZE 4096
#define TPM_LARGE_ENOUGH_COMMAND_SIZE 256 /* saves space in the firmware */
#define TPM_PUBEK_SIZE 256
@@ -251,4 +255,8 @@ typedef struct tdTPM_NV_AUTH_POLICY
#define TPM_ORD_Startup ((uint32_t) 0x00000099)
#define TPM_ORD_TakeOwnership ((uint32_t) 0x0000000D)
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif /* ! __VBOOT_REFERENCE_FIRMWARE_INCLUDE_TPM1_TSS_CONSTANTS_H */
diff --git a/firmware/include/tpm2_marshaling.h b/firmware/include/tpm2_marshaling.h
index 3ebea388..929f0fcd 100644
--- a/firmware/include/tpm2_marshaling.h
+++ b/firmware/include/tpm2_marshaling.h
@@ -8,6 +8,10 @@
#include "tss_constants.h"
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
/* The below functions are used to serialize/deserialize TPM2 commands. */
/**
@@ -86,4 +90,8 @@ void tpm_set_ph_disabled(int flag);
*/
int tpm_is_ph_disabled(void);
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif // __SRC_LIB_TPM2_MARSHALING_H
diff --git a/firmware/include/tpm2_tss_constants.h b/firmware/include/tpm2_tss_constants.h
index 84ad05b7..4249cf04 100644
--- a/firmware/include/tpm2_tss_constants.h
+++ b/firmware/include/tpm2_tss_constants.h
@@ -10,6 +10,10 @@
#ifndef __VBOOT_REFERENCE_FIRMWARE_INCLUDE_TPM2_TSS_CONSTANTS_H
#define __VBOOT_REFERENCE_FIRMWARE_INCLUDE_TPM2_TSS_CONSTANTS_H
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
#define TPM_BUFFER_SIZE 256
/* Tpm2 command tags. */
@@ -295,4 +299,8 @@ typedef struct tdTPM_IFX_FIELDUPGRADEINFO
#define TPM_MAX_COMMAND_SIZE 4096
#define TPM_PCR_DIGEST 32
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif /* ! __VBOOT_REFERENCE_FIRMWARE_INCLUDE_TPM2_TSS_CONSTANTS_H */
diff --git a/firmware/include/vboot_api.h b/firmware/include/vboot_api.h
index 55c3d02a..33b997f8 100644
--- a/firmware/include/vboot_api.h
+++ b/firmware/include/vboot_api.h
@@ -26,6 +26,10 @@
#include "gpt.h"
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
/*****************************************************************************/
/* Error codes */
@@ -985,4 +989,9 @@ uint8_t VbExOverrideGptEntryPriority(const GptEntry *e);
* @return VBERROR_... error, VBERROR_SUCCESS on success.
*/
VbError_t VbExGetLocalizationCount(uint32_t *count);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif /* VBOOT_REFERENCE_VBOOT_API_H_ */
diff --git a/firmware/include/vboot_struct.h b/firmware/include/vboot_struct.h
index c1afd8cd..fc993712 100644
--- a/firmware/include/vboot_struct.h
+++ b/firmware/include/vboot_struct.h
@@ -10,6 +10,10 @@
#define VBOOT_REFERENCE_VBOOT_STRUCT_H_
#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
/* Public key data */
typedef struct VbPublicKey {
/* Offset of key data from start of this struct */
@@ -495,4 +499,8 @@ typedef struct VbSharedDataHeader {
#define VB_SHARED_DATA_VERSION 2 /* Version for struct_version */
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif /* VBOOT_REFERENCE_VBOOT_STRUCT_H_ */
diff --git a/firmware/lib21/include/vb21_common.h b/firmware/lib21/include/vb21_common.h
index ec4f2aa2..e89eb6cc 100644
--- a/firmware/lib21/include/vb21_common.h
+++ b/firmware/lib21/include/vb21_common.h
@@ -13,6 +13,10 @@
#include "2struct.h"
#include "vb21_struct.h"
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
/**
* Return the description of an object starting with a vb21_struct_common
* header.
@@ -177,4 +181,8 @@ int vb21_verify_fw_preamble(struct vb21_fw_preamble *preamble,
const struct vb2_public_key *key,
const struct vb2_workbuf *wb);
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif /* VBOOT_REFERENCE_VB21_COMMON_H_ */
diff --git a/firmware/lib21/include/vb21_struct.h b/firmware/lib21/include/vb21_struct.h
index 937737f3..bd1273c0 100644
--- a/firmware/lib21/include/vb21_struct.h
+++ b/firmware/lib21/include/vb21_struct.h
@@ -14,6 +14,10 @@
#include "2id.h"
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
/*
* Magic numbers used by vb21_struct_common.magic.
*
@@ -339,4 +343,8 @@ struct vb21_fw_preamble {
#define EXPECTED_VB21_FW_PREAMBLE_SIZE (EXPECTED_VB21_STRUCT_COMMON_SIZE + 20)
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif /* VBOOT_REFERENCE_VB21_STRUCT_H_ */
diff --git a/host/include/cgpt_params.h b/host/include/cgpt_params.h
index 5bd1f76a..ffd071a2 100644
--- a/host/include/cgpt_params.h
+++ b/host/include/cgpt_params.h
@@ -5,10 +5,15 @@
#ifndef VBOOT_REFERENCE_CGPT_CGPT_PARAMS_H_
#define VBOOT_REFERENCE_CGPT_CGPT_PARAMS_H_
+
#include <stdint.h>
#include "gpt.h"
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
enum {
CGPT_OK = 0,
CGPT_FAILED,
@@ -128,4 +133,8 @@ typedef struct CgptLegacyParams {
int mode;
} CgptLegacyParams;
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif /* VBOOT_REFERENCE_CGPT_CGPT_PARAMS_H_ */
diff --git a/host/include/openssl_compat.h b/host/include/openssl_compat.h
index 7771f32a..35bb250b 100644
--- a/host/include/openssl_compat.h
+++ b/host/include/openssl_compat.h
@@ -6,6 +6,10 @@
#ifndef VBOOT_REFERENCE_OPENSSL_COMPAT_H_
#define VBOOT_REFERENCE_OPENSSL_COMPAT_H_
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
#include <openssl/rsa.h>
#if OPENSSL_VERSION_NUMBER < 0x10100000L
@@ -23,4 +27,8 @@ static inline void RSA_get0_key(const RSA *rsa, const BIGNUM **n,
#endif /* OPENSSL_VERSION_NUMBER < 0x10100000L */
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
#endif /* VBOOT_REFERENCE_OPENSSL_COMPAT_H_ */
diff --git a/host/include/vboot_host.h b/host/include/vboot_host.h
index cb0d0f3c..a8ad3154 100644
--- a/host/include/vboot_host.h
+++ b/host/include/vboot_host.h
@@ -16,6 +16,10 @@
#include "cgpt_params.h"
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
/* partition table manipulation */
int CgptCreate(CgptCreateParams *params);
int CgptAdd(CgptAddParams *params);
@@ -68,5 +72,8 @@ char *FindKernelConfig(const char *filename,
int ExtractVmlinuz(void *kpart_data, size_t kpart_size,
void **vmlinuz_out, size_t *vmlinuz_size);
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
#endif /* VBOOT_HOST_H_ */