Skip to content

Commit

Permalink
prevent early macro expansion in PICOBIN_..._AS_BITS() macros
Browse files Browse the repository at this point in the history
  • Loading branch information
kilograham committed Nov 20, 2024
1 parent 482dd59 commit 5c722ec
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/common/boot_picobin_headers/include/boot/picobin.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,27 +59,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)

Expand Down Expand Up @@ -135,7 +135,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)
Expand Down

0 comments on commit 5c722ec

Please sign in to comment.