diff options
author | Allen Webb <allenwebb@google.com> | 2018-11-09 09:42:53 -0800 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-11-15 13:16:06 -0800 |
commit | 1c95cff7463ef29bd0c6d087ce8c3d7e17f94c6a (patch) | |
tree | 90de208cb94b874a8fc3a8a1f1082116e908cc48 /include | |
parent | 268b07da45535033ae39240e958fc00386e37684 (diff) | |
download | chrome-ec-1c95cff7463ef29bd0c6d087ce8c3d7e17f94c6a.tar.gz |
cr50: Add extern "C" to headers used by future fuzzing target.
BRANCH=None
BUG=None
TEST=make -j buildall
Change-Id: Icf2cfb6a2657064c10721c0e527d24fbb3be6ab3
Signed-off-by: Allen Webb <allenwebb@google.com>
Reviewed-on: https://chromium-review.googlesource.com/1330102
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/crypto_api.h | 8 | ||||
-rw-r--r-- | include/nvmem.h | 8 | ||||
-rw-r--r-- | include/nvmem_vars.h | 8 | ||||
-rw-r--r-- | include/panic.h | 8 | ||||
-rw-r--r-- | include/pinweaver.h | 8 | ||||
-rw-r--r-- | include/pinweaver_tpm_imports.h | 8 | ||||
-rw-r--r-- | include/pinweaver_types.h | 8 | ||||
-rw-r--r-- | include/util.h | 8 |
8 files changed, 64 insertions, 0 deletions
diff --git a/include/crypto_api.h b/include/crypto_api.h index 2628e2bd7b..07bda7f5be 100644 --- a/include/crypto_api.h +++ b/include/crypto_api.h @@ -9,6 +9,10 @@ #include "util.h" +#ifdef __cplusplus +extern "C" { +#endif + /** * Calculate hash of an arbitrary data * @@ -52,4 +56,8 @@ void app_compute_hash(uint8_t *p_buf, size_t num_bytes, */ int app_cipher(const void *salt, void *out, const void *in, size_t size); +#ifdef __cplusplus +} +#endif + #endif /* __INCLUDE_CRYPTO_API_H */ diff --git a/include/nvmem.h b/include/nvmem.h index e9fae3d11d..1ca09fff38 100644 --- a/include/nvmem.h +++ b/include/nvmem.h @@ -8,6 +8,10 @@ #include "crypto_api.h" +#ifdef __cplusplus +extern "C" { +#endif + /* * In order to provide maximum robustness for NvMem operations, the NvMem space * is divided into two equal sized partitions. A partition contains a tag @@ -201,4 +205,8 @@ void nvmem_disable_commits(void); */ int nvmem_enable_commits(void); +#ifdef __cplusplus +} +#endif + #endif /* __CROS_EC_NVMEM_UTILS_H */ diff --git a/include/nvmem_vars.h b/include/nvmem_vars.h index 867ea32018..add14345e7 100644 --- a/include/nvmem_vars.h +++ b/include/nvmem_vars.h @@ -6,6 +6,10 @@ #ifndef __EC_INCLUDE_NVMEM_VARS_H #define __EC_INCLUDE_NVMEM_VARS_H +#ifdef __cplusplus +extern "C" { +#endif + /* * CONFIG_FLASH_NVMEM provides persistent, atomic-update storage in * flash. The storage is logically divided into one or more "user regions", as @@ -84,4 +88,8 @@ int setvar(const uint8_t *key, uint8_t key_len, */ int writevars(void); +#ifdef __cplusplus +} +#endif + #endif /* __EC_INCLUDE_NVMEM_VARS_H */ diff --git a/include/panic.h b/include/panic.h index 8a689c4b23..1984081dd7 100644 --- a/include/panic.h +++ b/include/panic.h @@ -13,6 +13,10 @@ #include <stdarg.h> +#ifdef __cplusplus +extern "C" { +#endif + /* ARM Cortex-Mx registers saved on panic */ struct cortex_panic_data { uint32_t regs[12]; /* psp, ipsr, msp, r4-r11, lr(=exc_return). @@ -181,4 +185,8 @@ struct panic_data *panic_get_data(void); */ void chip_panic_data_backup(void); +#ifdef __cplusplus +} +#endif + #endif /* __CROS_EC_PANIC_H */ diff --git a/include/pinweaver.h b/include/pinweaver.h index 1f373ba582..21571da7b0 100644 --- a/include/pinweaver.h +++ b/include/pinweaver.h @@ -13,6 +13,10 @@ #include <common.h> #include <pinweaver_types.h> +#ifdef __cplusplus +extern "C" { +#endif + #define PW_STORAGE_VERSION 0 #define BITS_PER_LEVEL_MIN 1 @@ -177,4 +181,8 @@ int log_remove_leaf(struct label_t label, const uint8_t root[PW_HASH_SIZE]); int log_auth(struct label_t label, const uint8_t root[PW_HASH_SIZE], int code, struct pw_timestamp_t timestamp); +#ifdef __cplusplus +} +#endif + #endif /* __CROS_EC_INCLUDE_PINWEAVER_H */ diff --git a/include/pinweaver_tpm_imports.h b/include/pinweaver_tpm_imports.h index 879bb6bbb8..f1ecd24202 100644 --- a/include/pinweaver_tpm_imports.h +++ b/include/pinweaver_tpm_imports.h @@ -16,6 +16,10 @@ #include <stddef.h> #include <stdint.h> +#ifdef __cplusplus +extern "C" { +#endif + /* This is used to get the storage seed from the TPM implementation so * TPM_Clear() will break the keys used by PinWeaver so that any metadata * that persists on the machine storage is unusable by attackers. @@ -28,4 +32,8 @@ void get_storage_seed(void *buf, size_t *len); uint8_t get_current_pcr_digest(const uint8_t bitmask[2], uint8_t sha256_of_selected_pcr[32]); +#ifdef __cplusplus +} +#endif + #endif /* __CROS_EC_INCLUDE_PINWEAVER_TPM_IMPORTS_H */ diff --git a/include/pinweaver_types.h b/include/pinweaver_types.h index cc4b5832b3..e8787eb29a 100644 --- a/include/pinweaver_types.h +++ b/include/pinweaver_types.h @@ -10,6 +10,10 @@ #include <stdint.h> +#ifdef __cplusplus +extern "C" { +#endif + #define PW_PACKED __packed #define PW_PROTOCOL_VERSION 1 @@ -409,4 +413,8 @@ struct PW_PACKED pw_response_t { */ #define PW_MAX_PATH_SIZE 1024 +#ifdef __cplusplus +} +#endif + #endif /* __CROS_EC_INCLUDE_PINWEAVER_TYPES_H */ diff --git a/include/util.h b/include/util.h index 9691669c19..39a07e4b1e 100644 --- a/include/util.h +++ b/include/util.h @@ -15,6 +15,10 @@ #include "builtin/assert.h" /* For ASSERT(). */ #include <stddef.h> +#ifdef __cplusplus +extern "C" { +#endif + /* Standard macros / definitions */ #ifndef MAX #define MAX(a, b) \ @@ -219,4 +223,8 @@ static inline uint64_t mulaa32(uint32_t a, uint32_t b, uint32_t c, uint32_t d) } #endif +#ifdef __cplusplus +} +#endif + #endif /* __CROS_EC_UTIL_H */ |