zephyr: replace zephyr integer types with C99 types

git grep -l 'u\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/u\(8\|16\|32\|64\)_t/uint\1_t/g"
	git grep -l 's\(8\|16\|32\|64\)_t' | \
		xargs sed -i "s/s\(8\|16\|32\|64\)_t/int\1_t/g"

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2020-05-27 11:26:57 -05:00 committed by Kumar Gala
commit a1b77fd589
2364 changed files with 32505 additions and 32505 deletions

View file

@ -41,19 +41,19 @@
* Raw (on-flash) representation of the v1 image header.
*/
struct mcuboot_v1_raw_header {
u32_t header_magic;
u32_t image_load_address;
u16_t header_size;
u16_t pad;
u32_t image_size;
u32_t image_flags;
uint32_t header_magic;
uint32_t image_load_address;
uint16_t header_size;
uint16_t pad;
uint32_t image_size;
uint32_t image_flags;
struct {
u8_t major;
u8_t minor;
u16_t revision;
u32_t build_num;
uint8_t major;
uint8_t minor;
uint16_t revision;
uint32_t build_num;
} version;
u32_t pad2;
uint32_t pad2;
} __packed;
/*
@ -97,7 +97,7 @@ struct mcuboot_v1_raw_header {
BOOT_MAX_ALIGN)
#define MAGIC_OFFS(bank_area) ((bank_area)->fa_size - BOOT_MAGIC_SZ)
static const u32_t boot_img_magic[4] = {
static const uint32_t boot_img_magic[4] = {
0xf395c277,
0x7fefd260,
0x0f505235,
@ -108,21 +108,21 @@ static const u32_t boot_img_magic[4] = {
struct boot_swap_table {
/** For each field, a value of 0 means "any". */
u8_t magic_primary_slot;
u8_t magic_secondary_slot;
u8_t image_ok_primary_slot;
u8_t image_ok_secondary_slot;
u8_t copy_done_primary_slot;
uint8_t magic_primary_slot;
uint8_t magic_secondary_slot;
uint8_t image_ok_primary_slot;
uint8_t image_ok_secondary_slot;
uint8_t copy_done_primary_slot;
u8_t swap_type;
uint8_t swap_type;
};
/** Represents the management state of a single image slot. */
struct boot_swap_state {
u8_t magic; /* One of the BOOT_MAGIC_[...] values. */
u8_t swap_type; /* One of the BOOT_SWAP_TYPE_[...] values. */
u8_t copy_done; /* One of the BOOT_FLAG_[...] values. */
u8_t image_ok; /* One of the BOOT_FLAG_[...] values. */
uint8_t magic; /* One of the BOOT_MAGIC_[...] values. */
uint8_t swap_type; /* One of the BOOT_SWAP_TYPE_[...] values. */
uint8_t copy_done; /* One of the BOOT_FLAG_[...] values. */
uint8_t image_ok; /* One of the BOOT_FLAG_[...] values. */
};
/**
@ -188,7 +188,7 @@ static const struct boot_swap_table boot_swap_tables[] = {
};
#define BOOT_SWAP_TABLES_COUNT (ARRAY_SIZE(boot_swap_tables))
static int boot_magic_decode(const u32_t *magic)
static int boot_magic_decode(const uint32_t *magic)
{
if (memcmp(magic, boot_img_magic, BOOT_MAGIC_SZ) == 0) {
return BOOT_MAGIC_GOOD;
@ -197,7 +197,7 @@ static int boot_magic_decode(const u32_t *magic)
return BOOT_MAGIC_BAD;
}
static int boot_flag_decode(u8_t flag)
static int boot_flag_decode(uint8_t flag)
{
if (flag != BOOT_FLAG_SET) {
return BOOT_FLAG_BAD;
@ -219,9 +219,9 @@ uint8_t flash_area_erased_val(const struct flash_area *fa)
int flash_area_read_is_empty(const struct flash_area *fa, uint32_t off,
void *dst, uint32_t len)
{
const u8_t erase_val = flash_area_erased_val(fa);
u8_t *u8dst;
u8_t i;
const uint8_t erase_val = flash_area_erased_val(fa);
uint8_t *u8dst;
uint8_t i;
int rc;
rc = flash_area_read(fa, off, dst, len);
@ -238,7 +238,7 @@ int flash_area_read_is_empty(const struct flash_area *fa, uint32_t off,
return 1;
}
static int erased_flag_val(u8_t bank_id)
static int erased_flag_val(uint8_t bank_id)
{
const struct flash_area *fa;
int rc;
@ -261,7 +261,7 @@ static int erased_flag_val(u8_t bank_id)
* @return 1 if the two values are compatible;
* 0 otherwise.
*/
int boot_magic_compatible_check(u8_t tbl_val, u8_t val)
int boot_magic_compatible_check(uint8_t tbl_val, uint8_t val)
{
switch (tbl_val) {
case BOOT_MAGIC_ANY:
@ -275,7 +275,7 @@ int boot_magic_compatible_check(u8_t tbl_val, u8_t val)
}
}
static int boot_flag_offs(int flag, const struct flash_area *fa, u32_t *offs)
static int boot_flag_offs(int flag, const struct flash_area *fa, uint32_t *offs)
{
switch (flag) {
case BOOT_FLAG_COPY_DONE:
@ -289,12 +289,12 @@ static int boot_flag_offs(int flag, const struct flash_area *fa, u32_t *offs)
}
}
static int boot_write_trailer_byte(const struct flash_area *fa, u32_t off,
u8_t val)
static int boot_write_trailer_byte(const struct flash_area *fa, uint32_t off,
uint8_t val)
{
u8_t buf[BOOT_MAX_ALIGN];
u8_t align;
u8_t erased_val;
uint8_t buf[BOOT_MAX_ALIGN];
uint8_t align;
uint8_t erased_val;
int rc;
align = flash_area_align(fa);
@ -311,10 +311,10 @@ static int boot_write_trailer_byte(const struct flash_area *fa, u32_t off,
return 0;
}
static int boot_flag_write(int flag, u8_t bank_id)
static int boot_flag_write(int flag, uint8_t bank_id)
{
const struct flash_area *fa;
u32_t offs;
uint32_t offs;
int rc;
rc = flash_area_open(bank_id, &fa);
@ -334,12 +334,12 @@ static int boot_flag_write(int flag, u8_t bank_id)
return rc;
}
static int boot_flag_read(int flag, u8_t bank_id)
static int boot_flag_read(int flag, uint8_t bank_id)
{
const struct flash_area *fa;
u32_t offs;
uint32_t offs;
int rc;
u8_t flag_val;
uint8_t flag_val;
rc = flash_area_open(bank_id, &fa);
if (rc) {
@ -360,20 +360,20 @@ static int boot_flag_read(int flag, u8_t bank_id)
return flag_val;
}
static int boot_image_ok_read(u8_t bank_id)
static int boot_image_ok_read(uint8_t bank_id)
{
return boot_flag_read(BOOT_FLAG_IMAGE_OK, bank_id);
}
static int boot_image_ok_write(u8_t bank_id)
static int boot_image_ok_write(uint8_t bank_id)
{
return boot_flag_write(BOOT_FLAG_IMAGE_OK, bank_id);
}
static int boot_magic_write(u8_t bank_id)
static int boot_magic_write(uint8_t bank_id)
{
const struct flash_area *fa;
u32_t offs;
uint32_t offs;
int rc;
rc = flash_area_open(bank_id, &fa);
@ -390,10 +390,10 @@ static int boot_magic_write(u8_t bank_id)
}
#ifdef CONFIG_MCUBOOT_TRAILER_SWAP_TYPE
static int boot_swap_type_write(u8_t bank_id, u8_t swap_type)
static int boot_swap_type_write(uint8_t bank_id, uint8_t swap_type)
{
const struct flash_area *fa;
u32_t offs;
uint32_t offs;
int rc;
rc = flash_area_open(bank_id, &fa);
@ -410,7 +410,7 @@ static int boot_swap_type_write(u8_t bank_id, u8_t swap_type)
}
#endif
static int boot_read_v1_header(u8_t area_id,
static int boot_read_v1_header(uint8_t area_id,
struct mcuboot_v1_raw_header *v1_raw)
{
const struct flash_area *fa;
@ -456,14 +456,14 @@ static int boot_read_v1_header(u8_t area_id,
return 0;
}
int boot_read_bank_header(u8_t area_id,
int boot_read_bank_header(uint8_t area_id,
struct mcuboot_img_header *header,
size_t header_size)
{
int rc;
struct mcuboot_v1_raw_header v1_raw;
struct mcuboot_img_sem_ver *sem_ver;
size_t v1_min_size = (sizeof(u32_t) +
size_t v1_min_size = (sizeof(uint32_t) +
sizeof(struct mcuboot_img_header_v1));
/*
@ -500,8 +500,8 @@ int boot_read_bank_header(u8_t area_id,
static int boot_read_swap_state(const struct flash_area *fa,
struct boot_swap_state *state)
{
u32_t magic[BOOT_MAGIC_ARR_SZ];
u32_t off;
uint32_t magic[BOOT_MAGIC_ARR_SZ];
uint32_t off;
int rc;
off = MAGIC_OFFS(fa);
@ -653,7 +653,7 @@ int mcuboot_swap_type(void)
int boot_request_upgrade(int permanent)
{
#ifdef CONFIG_MCUBOOT_TRAILER_SWAP_TYPE
u8_t swap_type;
uint8_t swap_type;
#endif
int rc;
@ -703,7 +703,7 @@ int boot_write_img_confirmed(void)
return rc;
}
int boot_erase_img_bank(u8_t area_id)
int boot_erase_img_bank(uint8_t area_id)
{
const struct flash_area *fa;
int rc;