diff --git a/src/common/boot_picobin_headers/include/boot/picobin.h b/src/common/boot_picobin_headers/include/boot/picobin.h index 40a058007..25308478b 100644 --- a/src/common/boot_picobin_headers/include/boot/picobin.h +++ b/src/common/boot_picobin_headers/include/boot/picobin.h @@ -52,6 +52,7 @@ // ---- +#define _PICOBIN_INDEX_TO_BITS(y, x) (y ## x << y ## _LSB) #define PICOBIN_INDEX_TO_BITS(y, x) (y ## _ ## x << y ## _LSB) #define PICOBIN_IMAGE_TYPE_IMAGE_TYPE_LSB _u(0) @@ -59,27 +60,27 @@ #define PICOBIN_IMAGE_TYPE_IMAGE_TYPE_INVALID _u(0x0) #define PICOBIN_IMAGE_TYPE_IMAGE_TYPE_EXE _u(0x1) #define PICOBIN_IMAGE_TYPE_IMAGE_TYPE_DATA _u(0x2) -#define PICOBIN_IMAGE_TYPE_IMAGE_TYPE_AS_BITS(x) PICOBIN_INDEX_TO_BITS(PICOBIN_IMAGE_TYPE_IMAGE_TYPE, x) +#define PICOBIN_IMAGE_TYPE_IMAGE_TYPE_AS_BITS(x) _PICOBIN_INDEX_TO_BITS(PICOBIN_IMAGE_TYPE_IMAGE_TYPE, _ ## x) #define PICOBIN_IMAGE_TYPE_EXE_SECURITY_LSB _u(4) #define PICOBIN_IMAGE_TYPE_EXE_SECURITY_BITS _u(0x0030) #define PICOBIN_IMAGE_TYPE_EXE_SECURITY_UNSPECIFIED _u(0x0) #define PICOBIN_IMAGE_TYPE_EXE_SECURITY_NS _u(0x1) #define PICOBIN_IMAGE_TYPE_EXE_SECURITY_S _u(0x2) -#define PICOBIN_IMAGE_TYPE_EXE_SECURITY_AS_BITS(x) PICOBIN_INDEX_TO_BITS(PICOBIN_IMAGE_TYPE_EXE_SECURITY, x) +#define PICOBIN_IMAGE_TYPE_EXE_SECURITY_AS_BITS(x) _PICOBIN_INDEX_TO_BITS(PICOBIN_IMAGE_TYPE_EXE_SECURITY, _ ## x) #define PICOBIN_IMAGE_TYPE_EXE_CPU_LSB _u(8) #define PICOBIN_IMAGE_TYPE_EXE_CPU_BITS _u(0x0700) #define PICOBIN_IMAGE_TYPE_EXE_CPU_ARM _u(0) #define PICOBIN_IMAGE_TYPE_EXE_CPU_RISCV _u(1) #define PICOBIN_IMAGE_TYPE_EXE_CPU_VARMULET _u(2) -#define PICOBIN_IMAGE_TYPE_EXE_CPU_AS_BITS(x) PICOBIN_INDEX_TO_BITS(PICOBIN_IMAGE_TYPE_EXE_CPU, x) +#define PICOBIN_IMAGE_TYPE_EXE_CPU_AS_BITS(x) _PICOBIN_INDEX_TO_BITS(PICOBIN_IMAGE_TYPE_EXE_CPU, _ ## x) #define PICOBIN_IMAGE_TYPE_EXE_CHIP_LSB _u(12) #define PICOBIN_IMAGE_TYPE_EXE_CHIP_BITS _u(0x7000) #define PICOBIN_IMAGE_TYPE_EXE_CHIP_RP2040 _u(0) #define PICOBIN_IMAGE_TYPE_EXE_CHIP_RP2350 _u(1) -#define PICOBIN_IMAGE_TYPE_EXE_CHIP_AS_BITS(x) PICOBIN_INDEX_TO_BITS(PICOBIN_IMAGE_TYPE_EXE_CHIP, x) +#define PICOBIN_IMAGE_TYPE_EXE_CHIP_AS_BITS(x) _PICOBIN_INDEX_TO_BITS(PICOBIN_IMAGE_TYPE_EXE_CHIP, _ ## x) #define PICOBIN_IMAGE_TYPE_EXE_TBYB_BITS _u(0x8000) @@ -135,7 +136,7 @@ #define PICOBIN_PARTITION_FLAGS_LINK_TYPE_NONE _u(0) #define PICOBIN_PARTITION_FLAGS_LINK_TYPE_A_PARTITION _u(1) #define PICOBIN_PARTITION_FLAGS_LINK_TYPE_OWNER_PARTITION _u(2) -#define PICOBIN_PARTITION_FLAGS_LINK_TYPE_AS_BITS(x) PICOBIN_INDEX_TO_BITS(PICOBIN_PARTITION_FLAGS_LINK_TYPE, x) +#define PICOBIN_PARTITION_FLAGS_LINK_TYPE_AS_BITS(x) _PICOBIN_INDEX_TO_BITS(PICOBIN_PARTITION_FLAGS_LINK_TYPE, _ ## x) #define PICOBIN_HASH_SHA256 _u(0x01)