boards: Change the linker generated symbols from uint32_t to uint8_t array

since the symbol generated by linker is always used as an address not a value.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao
2022-10-05 16:07:10 +08:00
committed by Petro Karashchenko
parent a7bca63b3b
commit 92f156c969
14 changed files with 52 additions and 81 deletions
@@ -75,14 +75,10 @@ __asm__ (
" .balign " STR(ROMFS_SECTOR_SIZE) "\n"
" .globl romfs_data_end \n"
"romfs_data_end: \n"
" .globl romfs_data_size \n"
"romfs_data_size: \n"
" .word romfs_data_end - romfs_data_begin \n"
);
extern const char romfs_data_begin;
extern const char romfs_data_end;
extern const int romfs_data_size;
extern const uint8_t romfs_data_begin[];
extern const uint8_t romfs_data_end[];
/****************************************************************************
* Public Functions
@@ -99,7 +95,7 @@ extern const int romfs_data_size;
* Zero (OK) on success, a negated errno value on error.
*
* Assumptions/Limitations:
* Memory addresses [&romfs_data_begin .. &romfs_data_begin) should contain
* Memory addresses [romfs_data_begin .. romfs_data_end) should contain
* ROMFS volume data, as included in the assembly snippet above.
*
****************************************************************************/
@@ -111,9 +107,9 @@ int gd32_romfs_initialize(void)
/* Create a ROM disk for the /etc filesystem */
romfs_data_len = (uintptr_t)&romfs_data_end - (uintptr_t)&romfs_data_begin;
romfs_data_len = romfs_data_end - romfs_data_begin;
ret = romdisk_register(CONFIG_GD32F4_ROMFS_DEV_MINOR, &romfs_data_begin,
ret = romdisk_register(CONFIG_GD32F4_ROMFS_DEV_MINOR, romfs_data_begin,
NSECTORS(romfs_data_len), ROMFS_SECTOR_SIZE);
if (ret < 0)
{
@@ -49,7 +49,7 @@
* Zero (OK) on success, a negated errno value on error.
*
* Assumptions/Limitations:
* Memory addresses [&romfs_data_begin .. &romfs_data_begin) should contain
* Memory addresses [romfs_data_begin .. romfs_data_end) should contain
* ROMFS volume data, as included in the assembly snippet in
* gd32f4xx_romfs.c.
*