-
Notifications
You must be signed in to change notification settings - Fork 647
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create new header files with swap only definition as suggested in review. TO BE SQUASHED LATER Signed-off-by: Fabio Utzig <utzig@apache.org>
- Loading branch information
Showing
5 changed files
with
52 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
This comment has been minimized.
Sorry, something went wrong. |
||
* Copyright (c) 2019 JUUL Labs | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#include "mcuboot_config/mcuboot_config.h" | ||
|
||
#if defined(MCUBOOT_SWAP_USING_SCRATCH) || defined(MCUBOOT_SWAP_USING_MOVE) | ||
|
||
int boot_erase_trailer_sectors(const struct boot_loader_state *state, | ||
const struct flash_area *fap); | ||
int boot_copy_region(struct boot_loader_state *state, | ||
const struct flash_area *fap_src, | ||
const struct flash_area *fap_dst, | ||
uint32_t off_src, uint32_t off_dst, uint32_t sz); | ||
int boot_erase_region(const struct flash_area *fap, uint32_t off, uint32_t sz); | ||
int boot_status_init(const struct boot_loader_state *state, | ||
const struct flash_area *fap, | ||
const struct boot_status *bs); | ||
void boot_perform_swap(struct boot_loader_state *state, | ||
struct boot_status *bs, | ||
uint32_t copy_size); | ||
int boot_status_source(struct boot_loader_state *state); | ||
int boot_read_status_bytes(const struct flash_area *fap, | ||
struct boot_loader_state *state, | ||
struct boot_status *bs); | ||
|
||
#if MCUBOOT_SWAP_USING_SCRATCH | ||
#define BOOT_SCRATCH_AREA(state) ((state)->scratch.area) | ||
|
||
static inline size_t boot_scratch_area_size(const struct boot_loader_state *state) | ||
{ | ||
return BOOT_SCRATCH_AREA(state)->fa_size; | ||
} | ||
#endif | ||
|
||
#endif /* defined(MCUBOOT_SWAP_USING_SCRATCH) || defined(MCUBOOT_SWAP_USING_MOVE) */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thanks!
It would be VERY useful to have one sentence (or more) of docs in this file. And preferable one sentence (or more) for each function.