Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(bootloader_support): Add missing C linkage to some headers (IDFGH-12930) #13890

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
/*
* SPDX-FileCopyrightText: 2020-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2020-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/

#pragma once

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief Initialize console output (UART or USB)
*/
Expand All @@ -21,3 +25,7 @@ void bootloader_console_deinit(void);
* Only defined if USB CDC is used for console output.
*/
void bootloader_console_write_char_usb(char c);

#ifdef __cplusplus
}
#endif
10 changes: 9 additions & 1 deletion components/bootloader_support/private_include/bootloader_init.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -8,6 +8,10 @@
#include "esp_err.h"
#include "esp_image_format.h"

#ifdef __cplusplus
extern "C" {
#endif

/**@{*/
/**
* @brief labels from bootloader linker script: bootloader.ld
Expand Down Expand Up @@ -49,3 +53,7 @@ void bootloader_print_banner(void);
* ESP_FAIL - If the setting is not successful.
*/
esp_err_t bootloader_init(void);

#ifdef __cplusplus
}
#endif
10 changes: 9 additions & 1 deletion components/bootloader_support/private_include/bootloader_sha.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2017-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2017-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -16,10 +16,18 @@
#include <stdlib.h>
#include "esp_err.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef void *bootloader_sha256_handle_t;

bootloader_sha256_handle_t bootloader_sha256_start(void);

void bootloader_sha256_data(bootloader_sha256_handle_t handle, const void *data, size_t data_len);

void bootloader_sha256_finish(bootloader_sha256_handle_t handle, uint8_t *digest);

#ifdef __cplusplus
}
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand Down Expand Up @@ -27,6 +27,10 @@
#include "esp32p4/rom/secure_boot.h"
#endif

#ifdef __cplusplus
extern "C" {
#endif

#if !CONFIG_IDF_TARGET_ESP32 || CONFIG_ESP32_REV_MIN_FULL >= 300

#if CONFIG_SECURE_BOOT_V2_ENABLED || CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT
Expand Down Expand Up @@ -58,3 +62,7 @@ esp_err_t esp_secure_boot_verify_rsa_signature_block(const ets_secure_boot_signa
#endif /* CONFIG_SECURE_BOOT_V2_ENABLED || CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT */

#endif

#ifdef __cplusplus
}
#endif
11 changes: 10 additions & 1 deletion components/bootloader_support/private_include/bootloader_soc.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
/*
* SPDX-FileCopyrightText: 2015-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2015-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
#pragma once

#ifdef __cplusplus
extern "C"
{
#endif

/**
* @brief Configure analog super WDT reset
*
Expand All @@ -25,3 +30,7 @@ void bootloader_ana_bod_reset_config(bool enable);
* @param enable Boolean to enable or disable clock glitch reset
*/
void bootloader_ana_clock_glitch_reset_config(bool enable);

#ifdef __cplusplus
}
#endif
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: 2018-2021 Espressif Systems (Shanghai) CO LTD
* SPDX-FileCopyrightText: 2018-2024 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: Apache-2.0
*/
Expand All @@ -9,6 +9,11 @@
#include "esp_image_format.h"
#include "bootloader_config.h"

#ifdef __cplusplus
extern "C"
{
#endif

/**
* @brief Load partition table.
*
Expand Down Expand Up @@ -120,3 +125,7 @@ void bootloader_debug_buffer(const void *buffer, size_t length, const char *labe
* @return ESP_OK if secure boot digest is generated successfully.
*/
esp_err_t bootloader_sha256_flash_contents(uint32_t flash_offset, uint32_t len, uint8_t *digest);

#ifdef __cplusplus
}
#endif
Loading