cancel
Showing results for 
Search instead for 
Did you mean: 

OP-TEE version 3.19.0-stm32mp-r1.1 - enum/integer mismatch in core/mm/core_mmu.c

krotti42
Associate II

Hi!

 

I have tried to compile OP-TEE version 3.19.0-stm32mp-r1.1 for the STM32MP157F-DK2 board. With the official source on STMicroelectronics OP-TEE Github repo ,but I get the following error:

$ make CROSS_COMPILE=arm-none-eabi- PLATFORM=stm32mp1-157F_DK2 all
  GEN     out/arm-plat-stm32mp1/core/include/generated/arm32_sysreg.h
[...]
  CC      out/arm-plat-stm32mp1/core/mm/core_mmu.o
core/mm/core_mmu.c:1514:6: error: conflicting types for 'core_mmu_get_mem_by_type' due to enum/integer mismatch; have 'void(unsigned int,  vaddr_t *, vaddr_t *)' {aka 'void(unsigned int,  long unsigned int *, long unsigned int *)'} [-Werror=enum-int-mismatch]
 1514 | void core_mmu_get_mem_by_type(unsigned int type, vaddr_t *s, vaddr_t *e)
      |      ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from core/include/mm/tee_pager.h:13,
                 from core/include/mm/fobj.h:11,
                 from core/include/mm/sp_mem.h:10,
                 from core/arch/arm/include/kernel/secure_partition.h:14,
                 from core/include/kernel/user_mode_ctx.h:11,
                 from core/mm/core_mmu.c:19:
core/include/mm/core_mmu.h:535:6: note: previous declaration of 'core_mmu_get_mem_by_type' with type 'void(enum teecore_memtypes,  vaddr_t *, vaddr_t *)' {aka 'void(enum teecore_memtypes,  long unsigned int *, long unsigned int *)'}
  535 | void core_mmu_get_mem_by_type(enum teecore_memtypes type, vaddr_t *s,
      |      ^~~~~~~~~~~~~~~~~~~~~~~~
cc1: note: unrecognized command-line option '-Wno-c2x-extensions' may have been intended to silence earlier diagnostics
cc1: all warnings being treated as errors
make: *** [mk/compile.mk:163: out/arm-plat-stm32mp1/core/mm/core_mmu.o] Error 1
$ 

I have modified core/mm/core_mmu.c successfully, but currently not tested on the real board.

Patch:

diff -ruN STMicroelectronics_3.19.0-stm32mp-r1.1/core/mm/core_mmu.c STMicroelectronics_3.19.0-stm32mp-r1.1_fixed/core/mm/core_mmu.c
--- STMicroelectronics_3.19.0-stm32mp-r1.1/core/mm/core_mmu.c	2024-04-05 12:18:40.298370873 +0200
+++ STMicroelectronics_3.19.0-stm32mp-r1.1_fixed/core/mm/core_mmu.c	2024-04-05 12:20:44.152661288 +0200
@@ -1511,7 +1511,7 @@
 /*
  * teecore gets some memory area definitions
  */
-void core_mmu_get_mem_by_type(unsigned int type, vaddr_t *s, vaddr_t *e)
+void core_mmu_get_mem_by_type(enum teecore_memtypes type, vaddr_t *s, vaddr_t *e)
 {
 	struct tee_mmap_region *map = find_map_by_type(type);
 

 

Kind regards

0 REPLIES 0