Message ID | 20240221091154.3024118-1-gaosong@loongson.cn (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On Wed, 21 Feb 2024 at 09:11, Song Gao <gaosong@loongson.cn> wrote: > > The following changes since commit 760b4dcdddba4a40b9fa0eb78fdfc7eda7cb83d0: > > Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2024-02-20 10:11:08 +0000) > > are available in the Git repository at: > > https://gitlab.com/gaosong/qemu.git tags/pull-loongarch-20240221 > > for you to fetch changes up to be57fd1e526e70fd55f1e87b0b70fab3c6baf089: > > loongarch: Change the UEFI loading mode to loongarch (2024-02-21 17:06:23 +0800) > > ---------------------------------------------------------------- > pull-loongarch-20240221 > > ---------------------------------------------------------------- > Xianglai Li (1): > loongarch: Change the UEFI loading mode to loongarch Hi; this fails to build for mipsel: https://gitlab.com/qemu-project/qemu/-/jobs/6232698129 ../hw/loongarch/acpi-build.c: In function ‘build_flash_aml’: ../hw/loongarch/acpi-build.c:327:19: error: incompatible types when assigning to type ‘hwaddr’ {aka ‘long long unsigned int’} from type ‘Int128’ 327 | flash0_size = flash_mem->size; | ^~~~~~~~~ ../hw/loongarch/acpi-build.c:331:19: error: incompatible types when assigning to type ‘hwaddr’ {aka ‘long long unsigned int’} from type ‘Int128’ 331 | flash1_size = flash_mem->size; | ^~~~~~~~~ ../hw/loongarch/virt.c: In function ‘fdt_add_flash_node’: ../hw/loongarch/virt.c:131:19: error: incompatible types when assigning to type ‘hwaddr’ {aka ‘long long unsigned int’} from type ‘Int128’ 131 | flash0_size = flash_mem->size; | ^~~~~~~~~ ../hw/loongarch/virt.c:135:19: error: incompatible types when assigning to type ‘hwaddr’ {aka ‘long long unsigned int’} from type ‘Int128’ 135 | flash1_size = flash_mem->size; | ^~~~~~~~~ The value you get back from pflash_cfi01_get_memory() is a MemoryRegion -- this should be an opaque struct to you, not something you can reach in and get the 'size' field from. (The 'size' field is an Int128, which is not necessarily an integer type known to the compiler -- on some platforms it is a struct -- which is why this doesn't compile here.) Your board code created these memory regions so typically it should already know how big they are. If you really do need to get the size of a MemoryRegion, the function to use is memory_region_size(). thanks -- PMM
在 2024/2/22 下午8:42, Peter Maydell 写道: > On Wed, 21 Feb 2024 at 09:11, Song Gao <gaosong@loongson.cn> wrote: >> The following changes since commit 760b4dcdddba4a40b9fa0eb78fdfc7eda7cb83d0: >> >> Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2024-02-20 10:11:08 +0000) >> >> are available in the Git repository at: >> >> https://gitlab.com/gaosong/qemu.git tags/pull-loongarch-20240221 >> >> for you to fetch changes up to be57fd1e526e70fd55f1e87b0b70fab3c6baf089: >> >> loongarch: Change the UEFI loading mode to loongarch (2024-02-21 17:06:23 +0800) >> >> ---------------------------------------------------------------- >> pull-loongarch-20240221 >> >> ---------------------------------------------------------------- >> Xianglai Li (1): >> loongarch: Change the UEFI loading mode to loongarch > Hi; this fails to build for mipsel: > https://gitlab.com/qemu-project/qemu/-/jobs/6232698129 > > ../hw/loongarch/acpi-build.c: In function ‘build_flash_aml’: > ../hw/loongarch/acpi-build.c:327:19: error: incompatible types when > assigning to type ‘hwaddr’ {aka ‘long long unsigned int’} from type > ‘Int128’ > 327 | flash0_size = flash_mem->size; > | ^~~~~~~~~ > ../hw/loongarch/acpi-build.c:331:19: error: incompatible types when > assigning to type ‘hwaddr’ {aka ‘long long unsigned int’} from type > ‘Int128’ > 331 | flash1_size = flash_mem->size; > | ^~~~~~~~~ > > > ../hw/loongarch/virt.c: In function ‘fdt_add_flash_node’: > ../hw/loongarch/virt.c:131:19: error: incompatible types when > assigning to type ‘hwaddr’ {aka ‘long long unsigned int’} from type > ‘Int128’ > 131 | flash0_size = flash_mem->size; > | ^~~~~~~~~ > ../hw/loongarch/virt.c:135:19: error: incompatible types when > assigning to type ‘hwaddr’ {aka ‘long long unsigned int’} from type > ‘Int128’ > 135 | flash1_size = flash_mem->size; > | ^~~~~~~~~ > > > The value you get back from pflash_cfi01_get_memory() is a > MemoryRegion -- this should be an opaque struct to you, not > something you can reach in and get the 'size' field from. > (The 'size' field is an Int128, which is not necessarily an > integer type known to the compiler -- on some platforms it is > a struct -- which is why this doesn't compile here.) > > Your board code created these memory regions so typically it > should already know how big they are. If you really > do need to get the size of a MemoryRegion, the function > to use is memory_region_size( Got it , I will correct it. Thanks. Song Gao > thanks > -- PMM