From 0cc71d58629ae7e70310fe5d614e70ffd9a6af10 Mon Sep 17 00:00:00 2001 From: hexiao Date: Thu, 24 Jul 2025 19:11:54 +0800 Subject: [PATCH 1/2] [arm_compiler_v4/v5] define rt_packed as __packed --- components/drivers/block/partitions/efi.h | 6 +++--- components/drivers/include/drivers/nvme.h | 4 ++-- include/rtcompiler.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/components/drivers/block/partitions/efi.h b/components/drivers/block/partitions/efi.h index 6a10ec884f4..72300d69c18 100644 --- a/components/drivers/block/partitions/efi.h +++ b/components/drivers/block/partitions/efi.h @@ -30,14 +30,14 @@ #ifndef __UUID_H__ #define UUID_SIZE 16 -typedef struct +typedef rt_packed(struct { rt_uint8_t b[UUID_SIZE]; -} guid_t; +} guid_t); #endif /* __UUID_H__ */ #ifndef __EFI_H__ -typedef guid_t efi_guid_t rt_align(4); +typedef rt_packed(guid_t) efi_guid_t rt_align(4); #define EFI_GUID(a, b, c, d...) (efi_guid_t) \ {{ \ diff --git a/components/drivers/include/drivers/nvme.h b/components/drivers/include/drivers/nvme.h index 1eca5d9caa3..4df2c420f9e 100644 --- a/components/drivers/include/drivers/nvme.h +++ b/components/drivers/include/drivers/nvme.h @@ -717,12 +717,12 @@ enum RT_NVME_CTRL_CTRATT_UUID_LIST = 1 << 9, }; -struct rt_nvme_lba_format +rt_packed(struct rt_nvme_lba_format { rt_le16_t ms; /* Metadata size */ rt_uint8_t ds; /* Data size */ rt_uint8_t rp; /* Relative performance */ -}; +}); rt_packed(struct rt_nvme_id_ns { diff --git a/include/rtcompiler.h b/include/rtcompiler.h index 012c85cb608..27adcaef37e 100644 --- a/include/rtcompiler.h +++ b/include/rtcompiler.h @@ -19,7 +19,7 @@ #if __ARMCC_VERSION >= 6010050 #define rt_packed(declare) declare __attribute__((packed)) #else -#define rt_packed(declare) declare +#define rt_packed(declare) __packed declare #endif #define rt_weak __attribute__((weak)) #define rt_typeof __typeof From 767499cecdee6451f998ddaad16d6e3d80dd9925 Mon Sep 17 00:00:00 2001 From: hexiao Date: Fri, 25 Jul 2025 13:41:10 +0800 Subject: [PATCH 2/2] [bsp][hc32][tools][sdk_dist] add copy library condition: if rtconfig.BSP_LIBRARY_TYPE is not None --- bsp/hc32/tools/sdk_dist.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bsp/hc32/tools/sdk_dist.py b/bsp/hc32/tools/sdk_dist.py index 4bbeb459505..300e66ab528 100644 --- a/bsp/hc32/tools/sdk_dist.py +++ b/bsp/hc32/tools/sdk_dist.py @@ -13,8 +13,9 @@ def dist_do_building(BSP_ROOT, dist_dir): print("=> copy hc32 bsp library") library_dir = os.path.join(dist_dir, 'libraries') library_path = os.path.join(os.path.dirname(BSP_ROOT), 'libraries') - bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE), - os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE)) + if rtconfig.BSP_LIBRARY_TYPE is not None: + bsp_copy_files(os.path.join(library_path, rtconfig.BSP_LIBRARY_TYPE), + os.path.join(library_dir, rtconfig.BSP_LIBRARY_TYPE)) print("=> copy bsp drivers") bsp_copy_files(os.path.join(library_path, 'hc32_drivers'), os.path.join(library_dir, 'hc32_drivers'))