diff --git a/arch/arm/arm-v7a/common/include/tos_arm.h b/arch/arm/arm-v7a/common/include/tos_arm.h index 2c3dd1e2f7b9ea4edc1fe4b2e9e89c6dc360d1eb..734c33a681aa4433d6c0b117884d9d3b4758c4fe 100644 --- a/arch/arm/arm-v7a/common/include/tos_arm.h +++ b/arch/arm/arm-v7a/common/include/tos_arm.h @@ -41,3 +41,4 @@ }) #endif /* _TOS_ARM_H_ */ + diff --git a/board/TencentOS_tiny_EVB_MX_Plus/KEIL/elfloader_relocatable_object/TencentOS_tiny.uvoptx b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/elfloader_relocatable_object/TencentOS_tiny.uvoptx new file mode 100644 index 0000000000000000000000000000000000000000..2f1ba1a7c72ec7088fb1a6e19849507a5c48a71f --- /dev/null +++ b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/elfloader_relocatable_object/TencentOS_tiny.uvoptx @@ -0,0 +1,1466 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + TencentOS_tiny + 0x4 + ARM-ADS + + 80000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 18 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 6 + + + + + + + + + + + STLink\ST-LINKIII-KEIL_SWO.dll + + + + 0 + ARMRTXEVENTFLAGS + -L70 -Z18 -C0 -M0 -T1 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + (105=-1,-1,-1,-1,0) + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_256 -FS08000000 -FL040000 -FP0($$Device:STM32L431RCTx$CMSIS\Flash\STM32L4xx_256.FLM)) + + + 0 + ST-LINKIII-KEIL_SWO + -U303030303030303030303031 -O10446 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_256.FLM -FS08000000 -FL040000 -FP0($$Device:STM32L431RCTx$CMSIS\Flash\STM32L4xx_256.FLM) + + + + + 0 + 0 + 46 + 1 +
134239752
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\..\..\..\components\elfloader\common\tos_elfloader_relocate-arm.c + + \\TencentOS_tiny\../../../../components/elfloader/common/tos_elfloader_relocate-arm.c\46 +
+ + 1 + 0 + 64 + 1 +
134235520
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\..\..\..\examples\elfloader_relocatable_object\elfloader_relocatable_object.c + + \\TencentOS_tiny\../../../../examples/elfloader_relocatable_object/elfloader_relocatable_object.c\64 +
+ + 2 + 0 + 50 + 1 +
134235476
+ 0 + 0 + 0 + 0 + 0 + 1 + ..\..\..\..\examples\elfloader_relocatable_object\elfloader_relocatable_object.c + + \\TencentOS_tiny\../../../../examples/elfloader_relocatable_object/elfloader_relocatable_object.c\50 +
+
+ + + 0 + 1 + module + + + 1 + 1 + text + + + 2 + 1 + data + + + + + 1 + 0 + 0x20001d0e + 0 + + + + 0 + + + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + 1 + 1 + 0 + 2 + 10000000 + +
+
+ + + Application/MDK-ARM + 0 + 0 + 0 + 0 + + 1 + 1 + 2 + 0 + 0 + 0 + startup_stm32l431xx.s + startup_stm32l431xx.s + 0 + 0 + + + + + Application/User + 0 + 0 + 0 + 0 + + 2 + 2 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\gpio.c + gpio.c + 0 + 0 + + + 2 + 3 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\main.c + main.c + 0 + 0 + + + 2 + 4 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\mcu_init.c + mcu_init.c + 0 + 0 + + + 2 + 5 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\stm32l4xx_hal_msp.c + stm32l4xx_hal_msp.c + 0 + 0 + + + 2 + 6 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\stm32l4xx_it.c + stm32l4xx_it.c + 0 + 0 + + + 2 + 7 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\usart.c + usart.c + 0 + 0 + + + 2 + 8 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\adc.c + adc.c + 0 + 0 + + + 2 + 9 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\dac.c + dac.c + 0 + 0 + + + 2 + 10 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\i2c.c + i2c.c + 0 + 0 + + + 2 + 11 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\spi.c + spi.c + 0 + 0 + + + 2 + 12 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\tim.c + tim.c + 0 + 0 + + + 2 + 13 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\sdmmc.c + sdmmc.c + 0 + 0 + + + + + examples + 0 + 0 + 0 + 0 + + 3 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\examples\elfloader_relocatable_object\elfloader_relocatable_object.c + elfloader_relocatable_object.c + 0 + 0 + + + + + Drivers/STM32L4xx_HAL_Driver + 0 + 0 + 0 + 0 + + 4 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim.c + stm32l4xx_hal_tim.c + 0 + 0 + + + 4 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim_ex.c + stm32l4xx_hal_tim_ex.c + 0 + 0 + + + 4 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart.c + stm32l4xx_hal_uart.c + 0 + 0 + + + 4 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart_ex.c + stm32l4xx_hal_uart_ex.c + 0 + 0 + + + 4 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal.c + stm32l4xx_hal.c + 0 + 0 + + + 4 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c.c + stm32l4xx_hal_i2c.c + 0 + 0 + + + 4 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c_ex.c + stm32l4xx_hal_i2c_ex.c + 0 + 0 + + + 4 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc.c + stm32l4xx_hal_rcc.c + 0 + 0 + + + 4 + 23 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc_ex.c + stm32l4xx_hal_rcc_ex.c + 0 + 0 + + + 4 + 24 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash.c + stm32l4xx_hal_flash.c + 0 + 0 + + + 4 + 25 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ex.c + stm32l4xx_hal_flash_ex.c + 0 + 0 + + + 4 + 26 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ramfunc.c + stm32l4xx_hal_flash_ramfunc.c + 0 + 0 + + + 4 + 27 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_gpio.c + stm32l4xx_hal_gpio.c + 0 + 0 + + + 4 + 28 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma.c + stm32l4xx_hal_dma.c + 0 + 0 + + + 4 + 29 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma_ex.c + stm32l4xx_hal_dma_ex.c + 0 + 0 + + + 4 + 30 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr.c + stm32l4xx_hal_pwr.c + 0 + 0 + + + 4 + 31 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr_ex.c + stm32l4xx_hal_pwr_ex.c + 0 + 0 + + + 4 + 32 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cortex.c + stm32l4xx_hal_cortex.c + 0 + 0 + + + 4 + 33 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc_ex.c + stm32l4xx_hal_adc_ex.c + 0 + 0 + + + 4 + 34 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc.c + stm32l4xx_hal_adc.c + 0 + 0 + + + 4 + 35 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac.c + stm32l4xx_hal_dac.c + 0 + 0 + + + 4 + 36 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac_ex.c + stm32l4xx_hal_dac_ex.c + 0 + 0 + + + 4 + 37 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c + stm32l4xx_hal_spi.c + 0 + 0 + + + 4 + 38 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c + stm32l4xx_hal_spi_ex.c + 0 + 0 + + + 4 + 39 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_sdmmc.c + stm32l4xx_ll_sdmmc.c + 0 + 0 + + + 4 + 40 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd.c + stm32l4xx_hal_sd.c + 0 + 0 + + + 4 + 41 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd_ex.c + stm32l4xx_hal_sd_ex.c + 0 + 0 + + + + + Drivers/CMSIS + 0 + 0 + 0 + 0 + + 5 + 42 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\system_stm32l4xx.c + system_stm32l4xx.c + 0 + 0 + + + + + Hardware + 0 + 0 + 0 + 0 + + 6 + 43 + 1 + 0 + 0 + 0 + ..\..\BSP\Hardware\DHT11\DHT11_BUS.c + DHT11_BUS.c + 0 + 0 + + + 6 + 44 + 1 + 0 + 0 + 0 + ..\..\BSP\Hardware\OLED\oled.c + oled.c + 0 + 0 + + + + + kernel + 0 + 0 + 0 + 0 + + 7 + 45 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_binary_heap.c + tos_binary_heap.c + 0 + 0 + + + 7 + 46 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_char_fifo.c + tos_char_fifo.c + 0 + 0 + + + 7 + 47 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_completion.c + tos_completion.c + 0 + 0 + + + 7 + 48 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_countdownlatch.c + tos_countdownlatch.c + 0 + 0 + + + 7 + 49 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_event.c + tos_event.c + 0 + 0 + + + 7 + 50 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_global.c + tos_global.c + 0 + 0 + + + 7 + 51 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mail_queue.c + tos_mail_queue.c + 0 + 0 + + + 7 + 52 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_message_queue.c + tos_message_queue.c + 0 + 0 + + + 7 + 53 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mmblk.c + tos_mmblk.c + 0 + 0 + + + 7 + 54 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mmheap.c + tos_mmheap.c + 0 + 0 + + + 7 + 55 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mutex.c + tos_mutex.c + 0 + 0 + + + 7 + 56 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_pend.c + tos_pend.c + 0 + 0 + + + 7 + 57 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_mail_queue.c + tos_priority_mail_queue.c + 0 + 0 + + + 7 + 58 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_message_queue.c + tos_priority_message_queue.c + 0 + 0 + + + 7 + 59 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_queue.c + tos_priority_queue.c + 0 + 0 + + + 7 + 60 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_ring_queue.c + tos_ring_queue.c + 0 + 0 + + + 7 + 61 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_robin.c + tos_robin.c + 0 + 0 + + + 7 + 62 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sched.c + tos_sched.c + 0 + 0 + + + 7 + 63 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sem.c + tos_sem.c + 0 + 0 + + + 7 + 64 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sys.c + tos_sys.c + 0 + 0 + + + 7 + 65 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_task.c + tos_task.c + 0 + 0 + + + 7 + 66 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_tick.c + tos_tick.c + 0 + 0 + + + 7 + 67 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_time.c + tos_time.c + 0 + 0 + + + 7 + 68 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_timer.c + tos_timer.c + 0 + 0 + + + + + cpu + 0 + 0 + 0 + 0 + + 8 + 69 + 2 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_s.S + port_s.S + 0 + 0 + + + 8 + 70 + 1 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c + tos_cpu.c + 0 + 0 + + + 8 + 71 + 1 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_c.c + port_c.c + 0 + 0 + + + + + cmsis + 0 + 0 + 0 + 0 + + 9 + 72 + 1 + 0 + 0 + 0 + ..\..\..\..\osal\cmsis_os\cmsis_os.c + cmsis_os.c + 0 + 0 + + + + + config + 0 + 0 + 0 + 0 + + 10 + 73 + 5 + 0 + 0 + 0 + ..\..\TOS-CONFIG\tos_config.h + tos_config.h + 0 + 0 + + + + + fatfs + 0 + 0 + 0 + 0 + + 11 + 74 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_diskio.c + tos_diskio.c + 0 + 0 + + + 11 + 75 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_fatfs_drv.c + tos_fatfs_drv.c + 0 + 0 + + + 11 + 76 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_fatfs_vfs.c + tos_fatfs_vfs.c + 0 + 0 + + + 11 + 77 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ff.c + tos_ff.c + 0 + 0 + + + 11 + 78 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ffsystem.c + tos_ffsystem.c + 0 + 0 + + + 11 + 79 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ffunicode.c + tos_ffunicode.c + 0 + 0 + + + + + vfs + 0 + 0 + 0 + 0 + + 12 + 80 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\vfs\tos_vfs.c + tos_vfs.c + 0 + 0 + + + 12 + 81 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\vfs\tos_vfs_device.c + tos_vfs_device.c + 0 + 0 + + + 12 + 82 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\vfs\tos_vfs_file.c + tos_vfs_file.c + 0 + 0 + + + 12 + 83 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\vfs\tos_vfs_fs.c + tos_vfs_fs.c + 0 + 0 + + + 12 + 84 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\vfs\tos_vfs_inode.c + tos_vfs_inode.c + 0 + 0 + + + + + hal + 0 + 0 + 0 + 0 + + 13 + 85 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\hal\st\stm32l4xx\src\tos_hal_sd.c + tos_hal_sd.c + 0 + 0 + + + + + elfloader/relocatable_object + 0 + 0 + 0 + 0 + + 14 + 86 + 1 + 0 + 0 + 0 + ..\..\..\..\components\elfloader\relocatable_object\tos_elfloader_relocatable_object.c + tos_elfloader_relocatable_object.c + 0 + 0 + + + 14 + 87 + 1 + 0 + 0 + 0 + ..\..\..\..\components\elfloader\common\tos_elfloader_fd_read-vfs.c + tos_elfloader_fd_read-vfs.c + 0 + 0 + + + 14 + 88 + 1 + 0 + 0 + 0 + ..\..\..\..\components\elfloader\common\tos_elfloader_symtab.c + tos_elfloader_symtab.c + 0 + 0 + + + 14 + 89 + 1 + 0 + 0 + 0 + ..\..\..\..\components\elfloader\common\tos_elfloader_relocate-arm.c + tos_elfloader_relocate-arm.c + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/board/TencentOS_tiny_EVB_MX_Plus/KEIL/elfloader_relocatable_object/TencentOS_tiny.uvprojx b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/elfloader_relocatable_object/TencentOS_tiny.uvprojx new file mode 100644 index 0000000000000000000000000000000000000000..e9ee3f7e79a18be655a560a5f7fed8be71e4e357 --- /dev/null +++ b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/elfloader_relocatable_object/TencentOS_tiny.uvprojx @@ -0,0 +1,917 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + TencentOS_tiny + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + STM32L431RCTx + STMicroelectronics + Keil.STM32L4xx_DFP.2.0.0 + http://www.keil.com/pack + IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4") + + + + + + + + + + + + + + + $$Device:STM32L431RCTx$CMSIS\SVD\STM32L4x1.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\obj\ + TencentOS_tiny + 1 + 0 + 1 + 1 + 0 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 0 + + + SARMCM3.DLL + -REMAP -MPU + DCM.DLL + -pCM4 + SARMCM3.DLL + -MPU + TCM.DLL + -pCM4 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4107 + + 1 + STLink\ST-LINKIII-KEIL_SWO.dll + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M4" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 2 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x10000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x10000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + + USE_HAL_DRIVER,STM32L431xx,WITH_TOS_NET_ADAPTER,USE_ESP8266 + + ..\..\BSP\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Legacy;..\..\..\..\platform\vendor_bsp\st\CMSIS\Device\ST\STM32L4xx\Include;..\..\..\..\platform\vendor_bsp\st\CMSIS\Include;..\..\..\..\kernel\core\include;..\..\TOS-CONFIG;..\..\..\..\platform\arch\arm\cortex-m4\keil;..\..\..\..\kernel\pm\include;..\..\..\..\osal\cmsis_os;..\..\..\..\arch\arm\arm-v7m\common\include;..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc;..\..\BSP\Hardware\DHT11;..\..\BSP\Hardware\OLED;..\..\BSP\Hardware\BH1750;..\..\..\..\examples\helloworld;..\..\..\..\components\fs\vfs\include;..\..\..\..\components\fs\fatfs\wrapper\include;..\..\..\..\kernel\hal\include;..\..\..\..\components\fs\fatfs\3rdparty;..\..\..\..\components\elfloader\common\include + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x08000000 + 0x20000000 + + + + + + + + + + + + + Application/MDK-ARM + + + startup_stm32l431xx.s + 2 + startup_stm32l431xx.s + + + + + Application/User + + + gpio.c + 1 + ..\..\BSP\Src\gpio.c + + + main.c + 1 + ..\..\BSP\Src\main.c + + + mcu_init.c + 1 + ..\..\BSP\Src\mcu_init.c + + + stm32l4xx_hal_msp.c + 1 + ..\..\BSP\Src\stm32l4xx_hal_msp.c + + + stm32l4xx_it.c + 1 + ..\..\BSP\Src\stm32l4xx_it.c + + + usart.c + 1 + ..\..\BSP\Src\usart.c + + + adc.c + 1 + ..\..\BSP\Src\adc.c + + + dac.c + 1 + ..\..\BSP\Src\dac.c + + + i2c.c + 1 + ..\..\BSP\Src\i2c.c + + + spi.c + 1 + ..\..\BSP\Src\spi.c + + + tim.c + 1 + ..\..\BSP\Src\tim.c + + + sdmmc.c + 1 + ..\..\BSP\Src\sdmmc.c + + + + + examples + + + elfloader_relocatable_object.c + 1 + ..\..\..\..\examples\elfloader_relocatable_object\elfloader_relocatable_object.c + + + + + Drivers/STM32L4xx_HAL_Driver + + + stm32l4xx_hal_tim.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim.c + + + stm32l4xx_hal_tim_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim_ex.c + + + stm32l4xx_hal_uart.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart.c + + + stm32l4xx_hal_uart_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart_ex.c + + + stm32l4xx_hal.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal.c + + + stm32l4xx_hal_i2c.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c.c + + + stm32l4xx_hal_i2c_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c_ex.c + + + stm32l4xx_hal_rcc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc.c + + + stm32l4xx_hal_rcc_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc_ex.c + + + stm32l4xx_hal_flash.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash.c + + + stm32l4xx_hal_flash_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ex.c + + + stm32l4xx_hal_flash_ramfunc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ramfunc.c + + + stm32l4xx_hal_gpio.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_gpio.c + + + stm32l4xx_hal_dma.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma.c + + + stm32l4xx_hal_dma_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma_ex.c + + + stm32l4xx_hal_pwr.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr.c + + + stm32l4xx_hal_pwr_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr_ex.c + + + stm32l4xx_hal_cortex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cortex.c + + + stm32l4xx_hal_adc_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc_ex.c + + + stm32l4xx_hal_adc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc.c + + + stm32l4xx_hal_dac.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac.c + + + stm32l4xx_hal_dac_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac_ex.c + + + stm32l4xx_hal_spi.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c + + + stm32l4xx_hal_spi_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c + + + stm32l4xx_ll_sdmmc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_sdmmc.c + + + stm32l4xx_hal_sd.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd.c + + + stm32l4xx_hal_sd_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd_ex.c + + + + + Drivers/CMSIS + + + system_stm32l4xx.c + 1 + ..\..\BSP\Src\system_stm32l4xx.c + + + + + Hardware + + + DHT11_BUS.c + 1 + ..\..\BSP\Hardware\DHT11\DHT11_BUS.c + + + oled.c + 1 + ..\..\BSP\Hardware\OLED\oled.c + + + + + kernel + + + tos_binary_heap.c + 1 + ..\..\..\..\kernel\core\tos_binary_heap.c + + + tos_char_fifo.c + 1 + ..\..\..\..\kernel\core\tos_char_fifo.c + + + tos_completion.c + 1 + ..\..\..\..\kernel\core\tos_completion.c + + + tos_countdownlatch.c + 1 + ..\..\..\..\kernel\core\tos_countdownlatch.c + + + tos_event.c + 1 + ..\..\..\..\kernel\core\tos_event.c + + + tos_global.c + 1 + ..\..\..\..\kernel\core\tos_global.c + + + tos_mail_queue.c + 1 + ..\..\..\..\kernel\core\tos_mail_queue.c + + + tos_message_queue.c + 1 + ..\..\..\..\kernel\core\tos_message_queue.c + + + tos_mmblk.c + 1 + ..\..\..\..\kernel\core\tos_mmblk.c + + + tos_mmheap.c + 1 + ..\..\..\..\kernel\core\tos_mmheap.c + + + tos_mutex.c + 1 + ..\..\..\..\kernel\core\tos_mutex.c + + + tos_pend.c + 1 + ..\..\..\..\kernel\core\tos_pend.c + + + tos_priority_mail_queue.c + 1 + ..\..\..\..\kernel\core\tos_priority_mail_queue.c + + + tos_priority_message_queue.c + 1 + ..\..\..\..\kernel\core\tos_priority_message_queue.c + + + tos_priority_queue.c + 1 + ..\..\..\..\kernel\core\tos_priority_queue.c + + + tos_ring_queue.c + 1 + ..\..\..\..\kernel\core\tos_ring_queue.c + + + tos_robin.c + 1 + ..\..\..\..\kernel\core\tos_robin.c + + + tos_sched.c + 1 + ..\..\..\..\kernel\core\tos_sched.c + + + tos_sem.c + 1 + ..\..\..\..\kernel\core\tos_sem.c + + + tos_sys.c + 1 + ..\..\..\..\kernel\core\tos_sys.c + + + tos_task.c + 1 + ..\..\..\..\kernel\core\tos_task.c + + + tos_tick.c + 1 + ..\..\..\..\kernel\core\tos_tick.c + + + tos_time.c + 1 + ..\..\..\..\kernel\core\tos_time.c + + + tos_timer.c + 1 + ..\..\..\..\kernel\core\tos_timer.c + + + + + cpu + + + port_s.S + 2 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_s.S + + + tos_cpu.c + 1 + ..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c + + + port_c.c + 1 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_c.c + + + + + cmsis + + + cmsis_os.c + 1 + ..\..\..\..\osal\cmsis_os\cmsis_os.c + + + + + config + + + tos_config.h + 5 + ..\..\TOS-CONFIG\tos_config.h + + + + + fatfs + + + tos_diskio.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_diskio.c + + + tos_fatfs_drv.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_fatfs_drv.c + + + tos_fatfs_vfs.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_fatfs_vfs.c + + + tos_ff.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ff.c + + + tos_ffsystem.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ffsystem.c + + + tos_ffunicode.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ffunicode.c + + + + + vfs + + + tos_vfs.c + 1 + ..\..\..\..\components\fs\vfs\tos_vfs.c + + + tos_vfs_device.c + 1 + ..\..\..\..\components\fs\vfs\tos_vfs_device.c + + + tos_vfs_file.c + 1 + ..\..\..\..\components\fs\vfs\tos_vfs_file.c + + + tos_vfs_fs.c + 1 + ..\..\..\..\components\fs\vfs\tos_vfs_fs.c + + + tos_vfs_inode.c + 1 + ..\..\..\..\components\fs\vfs\tos_vfs_inode.c + + + + + hal + + + tos_hal_sd.c + 1 + ..\..\..\..\platform\hal\st\stm32l4xx\src\tos_hal_sd.c + + + + + elfloader/relocatable_object + + + tos_elfloader_relocatable_object.c + 1 + ..\..\..\..\components\elfloader\relocatable_object\tos_elfloader_relocatable_object.c + + + tos_elfloader_fd_read-vfs.c + 1 + ..\..\..\..\components\elfloader\common\tos_elfloader_fd_read-vfs.c + + + tos_elfloader_symtab.c + 1 + ..\..\..\..\components\elfloader\common\tos_elfloader_symtab.c + + + tos_elfloader_relocate-arm.c + 1 + ..\..\..\..\components\elfloader\common\tos_elfloader_relocate-arm.c + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/board/TencentOS_tiny_EVB_MX_Plus/KEIL/elfloader_relocatable_object/startup_stm32l431xx.s b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/elfloader_relocatable_object/startup_stm32l431xx.s new file mode 100644 index 0000000000000000000000000000000000000000..6a5c15a58c6531f3465927946b8c37db41a841fb --- /dev/null +++ b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/elfloader_relocatable_object/startup_stm32l431xx.s @@ -0,0 +1,404 @@ +;********************** COPYRIGHT(c) 2017 STMicroelectronics ****************** +;* File Name : startup_stm32l431xx.s +;* Author : MCD Application Team +;* Description : STM32L431xx Ultra Low Power devices vector table for MDK-ARM toolchain. +;* This module performs: +;* - Set the initial SP +;* - Set the initial PC == Reset_Handler +;* - Set the vector table entries with the exceptions ISR address +;* - Branches to __main in the C library (which eventually +;* calls main()). +;* After Reset the Cortex-M4 processor is in Thread mode, +;* priority is Privileged, and the Stack is set to Main. +;* <<< Use Configuration Wizard in Context Menu >>> +;******************************************************************************* +;* +;* Redistribution and use in source and binary forms, with or without modification, +;* are permitted provided that the following conditions are met: +;* 1. Redistributions of source code must retain the above copyright notice, +;* this list of conditions and the following disclaimer. +;* 2. Redistributions in binary form must reproduce the above copyright notice, +;* this list of conditions and the following disclaimer in the documentation +;* and/or other materials provided with the distribution. +;* 3. Neither the name of STMicroelectronics nor the names of its contributors +;* may be used to endorse or promote products derived from this software +;* without specific prior written permission. +;* +;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;* +;******************************************************************************* +; +; Amount of memory (in bytes) allocated for Stack +; Tailor this value to your application needs +; Stack Configuration +; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Stack_Size EQU 0x100 + + AREA STACK, NOINIT, READWRITE, ALIGN=3 +Stack_Mem SPACE Stack_Size +__initial_sp + + +; Heap Configuration +; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Heap_Size EQU 0x100 + + AREA HEAP, NOINIT, READWRITE, ALIGN=3 +__heap_base +Heap_Mem SPACE Heap_Size +__heap_limit + + PRESERVE8 + THUMB + + +; Vector Table Mapped to Address 0 at Reset + AREA RESET, DATA, READONLY + EXPORT __Vectors + EXPORT __Vectors_End + EXPORT __Vectors_Size + +__Vectors DCD __initial_sp ; Top of Stack + DCD Reset_Handler ; Reset Handler + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD MemManage_Handler ; MPU Fault Handler + DCD BusFault_Handler ; Bus Fault Handler + DCD UsageFault_Handler ; Usage Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD DebugMon_Handler ; Debug Monitor Handler + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler + + ; External Interrupts + DCD WWDG_IRQHandler ; Window WatchDog + DCD PVD_PVM_IRQHandler ; PVD/PVM1/PVM2/PVM3/PVM4 through EXTI Line detection + DCD TAMP_STAMP_IRQHandler ; Tamper and TimeStamps through the EXTI line + DCD RTC_WKUP_IRQHandler ; RTC Wakeup through the EXTI line + DCD FLASH_IRQHandler ; FLASH + DCD RCC_IRQHandler ; RCC + DCD EXTI0_IRQHandler ; EXTI Line0 + DCD EXTI1_IRQHandler ; EXTI Line1 + DCD EXTI2_IRQHandler ; EXTI Line2 + DCD EXTI3_IRQHandler ; EXTI Line3 + DCD EXTI4_IRQHandler ; EXTI Line4 + DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 + DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 + DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 + DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 + DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 + DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 + DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 + DCD ADC1_IRQHandler ; ADC1 + DCD CAN1_TX_IRQHandler ; CAN1 TX + DCD CAN1_RX0_IRQHandler ; CAN1 RX0 + DCD CAN1_RX1_IRQHandler ; CAN1 RX1 + DCD CAN1_SCE_IRQHandler ; CAN1 SCE + DCD EXTI9_5_IRQHandler ; External Line[9:5]s + DCD TIM1_BRK_TIM15_IRQHandler ; TIM1 Break and TIM15 + DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 + DCD TIM1_TRG_COM_IRQHandler ; TIM1 Trigger and Commutation + DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare + DCD TIM2_IRQHandler ; TIM2 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD I2C1_EV_IRQHandler ; I2C1 Event + DCD I2C1_ER_IRQHandler ; I2C1 Error + DCD I2C2_EV_IRQHandler ; I2C2 Event + DCD I2C2_ER_IRQHandler ; I2C2 Error + DCD SPI1_IRQHandler ; SPI1 + DCD SPI2_IRQHandler ; SPI2 + DCD USART1_IRQHandler ; USART1 + DCD USART2_IRQHandler ; USART2 + DCD USART3_IRQHandler ; USART3 + DCD EXTI15_10_IRQHandler ; External Line[15:10] + DCD RTC_Alarm_IRQHandler ; RTC Alarm (A and B) through EXTI Line + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SDMMC1_IRQHandler ; SDMMC1 + DCD 0 ; Reserved + DCD SPI3_IRQHandler ; SPI3 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD TIM6_DAC_IRQHandler ; TIM6 and DAC1&2 underrun errors + DCD TIM7_IRQHandler ; TIM7 + DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1 + DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2 + DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3 + DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4 + DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD COMP_IRQHandler ; COMP Interrupt + DCD LPTIM1_IRQHandler ; LP TIM1 interrupt + DCD LPTIM2_IRQHandler ; LP TIM2 interrupt + DCD 0 ; Reserved + DCD DMA2_Channel6_IRQHandler ; DMA2 Channel 6 + DCD DMA2_Channel7_IRQHandler ; DMA2 Channel 7 + DCD LPUART1_IRQHandler ; LP UART1 interrupt + DCD QUADSPI_IRQHandler ; Quad SPI global interrupt + DCD I2C3_EV_IRQHandler ; I2C3 event + DCD I2C3_ER_IRQHandler ; I2C3 error + DCD SAI1_IRQHandler ; Serial Audio Interface 1 global interrupt + DCD 0 ; Reserved + DCD SWPMI1_IRQHandler ; Serial Wire Interface 1 global interrupt + DCD TSC_IRQHandler ; Touch Sense Controller global interrupt + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD RNG_IRQHandler ; RNG global interrupt + DCD FPU_IRQHandler ; FPU + DCD CRS_IRQHandler ; CRS interrupt + +__Vectors_End + +__Vectors_Size EQU __Vectors_End - __Vectors + + AREA |.text|, CODE, READONLY + +; Reset handler +Reset_Handler PROC + EXPORT Reset_Handler [WEAK] + IMPORT SystemInit + IMPORT __main + + LDR R0, =SystemInit + BLX R0 + LDR R0, =__main + BX R0 + ENDP + +; Dummy Exception Handlers (infinite loops which can be modified) + +NMI_Handler PROC + EXPORT NMI_Handler [WEAK] + B . + ENDP +HardFault_Handler\ + PROC + EXPORT HardFault_Handler [WEAK] + B . + ENDP +MemManage_Handler\ + PROC + EXPORT MemManage_Handler [WEAK] + B . + ENDP +BusFault_Handler\ + PROC + EXPORT BusFault_Handler [WEAK] + B . + ENDP +UsageFault_Handler\ + PROC + EXPORT UsageFault_Handler [WEAK] + B . + ENDP +SVC_Handler PROC + EXPORT SVC_Handler [WEAK] + B . + ENDP +DebugMon_Handler\ + PROC + EXPORT DebugMon_Handler [WEAK] + B . + ENDP +PendSV_Handler PROC + EXPORT PendSV_Handler [WEAK] + B . + ENDP +SysTick_Handler PROC + EXPORT SysTick_Handler [WEAK] + B . + ENDP + +Default_Handler PROC + + EXPORT WWDG_IRQHandler [WEAK] + EXPORT PVD_PVM_IRQHandler [WEAK] + EXPORT TAMP_STAMP_IRQHandler [WEAK] + EXPORT RTC_WKUP_IRQHandler [WEAK] + EXPORT FLASH_IRQHandler [WEAK] + EXPORT RCC_IRQHandler [WEAK] + EXPORT EXTI0_IRQHandler [WEAK] + EXPORT EXTI1_IRQHandler [WEAK] + EXPORT EXTI2_IRQHandler [WEAK] + EXPORT EXTI3_IRQHandler [WEAK] + EXPORT EXTI4_IRQHandler [WEAK] + EXPORT DMA1_Channel1_IRQHandler [WEAK] + EXPORT DMA1_Channel2_IRQHandler [WEAK] + EXPORT DMA1_Channel3_IRQHandler [WEAK] + EXPORT DMA1_Channel4_IRQHandler [WEAK] + EXPORT DMA1_Channel5_IRQHandler [WEAK] + EXPORT DMA1_Channel6_IRQHandler [WEAK] + EXPORT DMA1_Channel7_IRQHandler [WEAK] + EXPORT ADC1_IRQHandler [WEAK] + EXPORT CAN1_TX_IRQHandler [WEAK] + EXPORT CAN1_RX0_IRQHandler [WEAK] + EXPORT CAN1_RX1_IRQHandler [WEAK] + EXPORT CAN1_SCE_IRQHandler [WEAK] + EXPORT EXTI9_5_IRQHandler [WEAK] + EXPORT TIM1_BRK_TIM15_IRQHandler [WEAK] + EXPORT TIM1_UP_TIM16_IRQHandler [WEAK] + EXPORT TIM1_TRG_COM_IRQHandler [WEAK] + EXPORT TIM1_CC_IRQHandler [WEAK] + EXPORT TIM2_IRQHandler [WEAK] + EXPORT I2C1_EV_IRQHandler [WEAK] + EXPORT I2C1_ER_IRQHandler [WEAK] + EXPORT I2C2_EV_IRQHandler [WEAK] + EXPORT I2C2_ER_IRQHandler [WEAK] + EXPORT SPI1_IRQHandler [WEAK] + EXPORT SPI2_IRQHandler [WEAK] + EXPORT USART1_IRQHandler [WEAK] + EXPORT USART2_IRQHandler [WEAK] + EXPORT USART3_IRQHandler [WEAK] + EXPORT EXTI15_10_IRQHandler [WEAK] + EXPORT RTC_Alarm_IRQHandler [WEAK] + EXPORT SDMMC1_IRQHandler [WEAK] + EXPORT SPI3_IRQHandler [WEAK] + EXPORT TIM6_DAC_IRQHandler [WEAK] + EXPORT TIM7_IRQHandler [WEAK] + EXPORT DMA2_Channel1_IRQHandler [WEAK] + EXPORT DMA2_Channel2_IRQHandler [WEAK] + EXPORT DMA2_Channel3_IRQHandler [WEAK] + EXPORT DMA2_Channel4_IRQHandler [WEAK] + EXPORT DMA2_Channel5_IRQHandler [WEAK] + EXPORT COMP_IRQHandler [WEAK] + EXPORT LPTIM1_IRQHandler [WEAK] + EXPORT LPTIM2_IRQHandler [WEAK] + EXPORT DMA2_Channel6_IRQHandler [WEAK] + EXPORT DMA2_Channel7_IRQHandler [WEAK] + EXPORT LPUART1_IRQHandler [WEAK] + EXPORT QUADSPI_IRQHandler [WEAK] + EXPORT I2C3_EV_IRQHandler [WEAK] + EXPORT I2C3_ER_IRQHandler [WEAK] + EXPORT SAI1_IRQHandler [WEAK] + EXPORT SWPMI1_IRQHandler [WEAK] + EXPORT TSC_IRQHandler [WEAK] + EXPORT RNG_IRQHandler [WEAK] + EXPORT FPU_IRQHandler [WEAK] + EXPORT CRS_IRQHandler [WEAK] + +WWDG_IRQHandler +PVD_PVM_IRQHandler +TAMP_STAMP_IRQHandler +RTC_WKUP_IRQHandler +FLASH_IRQHandler +RCC_IRQHandler +EXTI0_IRQHandler +EXTI1_IRQHandler +EXTI2_IRQHandler +EXTI3_IRQHandler +EXTI4_IRQHandler +DMA1_Channel1_IRQHandler +DMA1_Channel2_IRQHandler +DMA1_Channel3_IRQHandler +DMA1_Channel4_IRQHandler +DMA1_Channel5_IRQHandler +DMA1_Channel6_IRQHandler +DMA1_Channel7_IRQHandler +ADC1_IRQHandler +CAN1_TX_IRQHandler +CAN1_RX0_IRQHandler +CAN1_RX1_IRQHandler +CAN1_SCE_IRQHandler +EXTI9_5_IRQHandler +TIM1_BRK_TIM15_IRQHandler +TIM1_UP_TIM16_IRQHandler +TIM1_TRG_COM_IRQHandler +TIM1_CC_IRQHandler +TIM2_IRQHandler +I2C1_EV_IRQHandler +I2C1_ER_IRQHandler +I2C2_EV_IRQHandler +I2C2_ER_IRQHandler +SPI1_IRQHandler +SPI2_IRQHandler +USART1_IRQHandler +USART2_IRQHandler +USART3_IRQHandler +EXTI15_10_IRQHandler +RTC_Alarm_IRQHandler +SDMMC1_IRQHandler +SPI3_IRQHandler +TIM6_DAC_IRQHandler +TIM7_IRQHandler +DMA2_Channel1_IRQHandler +DMA2_Channel2_IRQHandler +DMA2_Channel3_IRQHandler +DMA2_Channel4_IRQHandler +DMA2_Channel5_IRQHandler +COMP_IRQHandler +LPTIM1_IRQHandler +LPTIM2_IRQHandler +DMA2_Channel6_IRQHandler +DMA2_Channel7_IRQHandler +LPUART1_IRQHandler +QUADSPI_IRQHandler +I2C3_EV_IRQHandler +I2C3_ER_IRQHandler +SAI1_IRQHandler +SWPMI1_IRQHandler +TSC_IRQHandler +RNG_IRQHandler +FPU_IRQHandler +CRS_IRQHandler + + B . + + ENDP + + ALIGN + +;******************************************************************************* +; User Stack and Heap initialization +;******************************************************************************* + IF :DEF:__MICROLIB + + EXPORT __initial_sp + EXPORT __heap_base + EXPORT __heap_limit + + ELSE + + IMPORT __use_two_region_memory + EXPORT __user_initial_stackheap + +__user_initial_stackheap + + LDR R0, = Heap_Mem + LDR R1, =(Stack_Mem + Stack_Size) + LDR R2, = (Heap_Mem + Heap_Size) + LDR R3, = Stack_Mem + BX LR + + ALIGN + + ENDIF + + END + +;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** diff --git a/board/TencentOS_tiny_EVB_MX_Plus/KEIL/elfloader_shared_object/TencentOS_tiny.uvoptx b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/elfloader_shared_object/TencentOS_tiny.uvoptx new file mode 100644 index 0000000000000000000000000000000000000000..cf470b80ae7038f431f7c99958c6ab88cc075f9d --- /dev/null +++ b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/elfloader_shared_object/TencentOS_tiny.uvoptx @@ -0,0 +1,1460 @@ + + + + 1.0 + +
### uVision Project, (C) Keil Software
+ + + *.c + *.s*; *.src; *.a* + *.obj; *.o + *.lib + *.txt; *.h; *.inc + *.plm + *.cpp + 0 + + + + 0 + 0 + + + + TencentOS_tiny + 0x4 + ARM-ADS + + 80000000 + + 1 + 1 + 0 + 1 + 0 + + + 1 + 65535 + 0 + 0 + 0 + + + 79 + 66 + 8 + .\list\ + + + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 0 + 0 + 0 + 0 + + + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + + + 1 + 0 + 1 + + 18 + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 6 + + + + + + + + + + + STLink\ST-LINKIII-KEIL_SWO.dll + + + + 0 + ARMRTXEVENTFLAGS + -L70 -Z18 -C0 -M0 -T1 + + + 0 + DLGTARM + (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0) + + + 0 + ARMDBGFLAGS + + + + 0 + DLGUARM + (105=-1,-1,-1,-1,0) + + + 0 + UL2CM3 + UL2CM3(-S0 -C0 -P0 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_256 -FS08000000 -FL040000 -FP0($$Device:STM32L431RCTx$CMSIS\Flash\STM32L4xx_256.FLM)) + + + 0 + ST-LINKIII-KEIL_SWO + -U303030303030303030303031 -O10446 -SF4000 -C0 -A0 -I0 -HNlocalhost -HP7184 -P1 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO18 -TC10000000 -TP21 -TDS8007 -TDT0 -TDC1F -TIEFFFFFFFF -TIP8 -FO15 -FD20000000 -FC1000 -FN1 -FF0STM32L4xx_256.FLM -FS08000000 -FL040000 -FP0($$Device:STM32L431RCTx$CMSIS\Flash\STM32L4xx_256.FLM) + + + + + 0 + 0 + 75 + 1 +
134235542
+ 0 + 0 + 0 + 0 + 0 + 1 + D:\TOS\TencentOS-tiny\examples\elfloader_pic\elfloader_pic.c + + \\TencentOS_tiny\../../../../examples/elfloader_pic/elfloader_pic.c\75 +
+ + 1 + 0 + 76 + 1 +
134235544
+ 0 + 0 + 0 + 0 + 0 + 1 + D:\TOS\TencentOS-tiny\examples\elfloader_pic\elfloader_pic.c + + \\TencentOS_tiny\../../../../examples/elfloader_pic/elfloader_pic.c\76 +
+
+ + + 0 + 1 + sym + + + 1 + 1 + module + + + 2 + 1 + addr + + + 3 + 1 + &d_e_a + + + 4 + 1 + f_e_a + + + + + 1 + 0 + 0x20001e84 + 0 + + + + 0 + + + 0 + 1 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + 0 + 0 + 0 + + + + + + + + + + 1 + 1 + 0 + 2 + 10000000 + +
+
+ + + Application/MDK-ARM + 0 + 0 + 0 + 0 + + 1 + 1 + 2 + 0 + 0 + 0 + startup_stm32l431xx.s + startup_stm32l431xx.s + 0 + 0 + + + + + Application/User + 0 + 0 + 0 + 0 + + 2 + 2 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\gpio.c + gpio.c + 0 + 0 + + + 2 + 3 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\main.c + main.c + 0 + 0 + + + 2 + 4 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\mcu_init.c + mcu_init.c + 0 + 0 + + + 2 + 5 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\stm32l4xx_hal_msp.c + stm32l4xx_hal_msp.c + 0 + 0 + + + 2 + 6 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\stm32l4xx_it.c + stm32l4xx_it.c + 0 + 0 + + + 2 + 7 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\usart.c + usart.c + 0 + 0 + + + 2 + 8 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\adc.c + adc.c + 0 + 0 + + + 2 + 9 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\dac.c + dac.c + 0 + 0 + + + 2 + 10 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\i2c.c + i2c.c + 0 + 0 + + + 2 + 11 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\spi.c + spi.c + 0 + 0 + + + 2 + 12 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\tim.c + tim.c + 0 + 0 + + + 2 + 13 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\sdmmc.c + sdmmc.c + 0 + 0 + + + + + examples + 0 + 0 + 0 + 0 + + 3 + 14 + 1 + 0 + 0 + 0 + ..\..\..\..\examples\elfloader_shared_object\elfloader_shared_object.c + elfloader_shared_object.c + 0 + 0 + + + + + Drivers/STM32L4xx_HAL_Driver + 0 + 0 + 0 + 0 + + 4 + 15 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim.c + stm32l4xx_hal_tim.c + 0 + 0 + + + 4 + 16 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim_ex.c + stm32l4xx_hal_tim_ex.c + 0 + 0 + + + 4 + 17 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart.c + stm32l4xx_hal_uart.c + 0 + 0 + + + 4 + 18 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart_ex.c + stm32l4xx_hal_uart_ex.c + 0 + 0 + + + 4 + 19 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal.c + stm32l4xx_hal.c + 0 + 0 + + + 4 + 20 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c.c + stm32l4xx_hal_i2c.c + 0 + 0 + + + 4 + 21 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c_ex.c + stm32l4xx_hal_i2c_ex.c + 0 + 0 + + + 4 + 22 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc.c + stm32l4xx_hal_rcc.c + 0 + 0 + + + 4 + 23 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc_ex.c + stm32l4xx_hal_rcc_ex.c + 0 + 0 + + + 4 + 24 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash.c + stm32l4xx_hal_flash.c + 0 + 0 + + + 4 + 25 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ex.c + stm32l4xx_hal_flash_ex.c + 0 + 0 + + + 4 + 26 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ramfunc.c + stm32l4xx_hal_flash_ramfunc.c + 0 + 0 + + + 4 + 27 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_gpio.c + stm32l4xx_hal_gpio.c + 0 + 0 + + + 4 + 28 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma.c + stm32l4xx_hal_dma.c + 0 + 0 + + + 4 + 29 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma_ex.c + stm32l4xx_hal_dma_ex.c + 0 + 0 + + + 4 + 30 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr.c + stm32l4xx_hal_pwr.c + 0 + 0 + + + 4 + 31 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr_ex.c + stm32l4xx_hal_pwr_ex.c + 0 + 0 + + + 4 + 32 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cortex.c + stm32l4xx_hal_cortex.c + 0 + 0 + + + 4 + 33 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc_ex.c + stm32l4xx_hal_adc_ex.c + 0 + 0 + + + 4 + 34 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc.c + stm32l4xx_hal_adc.c + 0 + 0 + + + 4 + 35 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac.c + stm32l4xx_hal_dac.c + 0 + 0 + + + 4 + 36 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac_ex.c + stm32l4xx_hal_dac_ex.c + 0 + 0 + + + 4 + 37 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c + stm32l4xx_hal_spi.c + 0 + 0 + + + 4 + 38 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c + stm32l4xx_hal_spi_ex.c + 0 + 0 + + + 4 + 39 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_sdmmc.c + stm32l4xx_ll_sdmmc.c + 0 + 0 + + + 4 + 40 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd.c + stm32l4xx_hal_sd.c + 0 + 0 + + + 4 + 41 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd_ex.c + stm32l4xx_hal_sd_ex.c + 0 + 0 + + + + + Drivers/CMSIS + 0 + 0 + 0 + 0 + + 5 + 42 + 1 + 0 + 0 + 0 + ..\..\BSP\Src\system_stm32l4xx.c + system_stm32l4xx.c + 0 + 0 + + + + + Hardware + 0 + 0 + 0 + 0 + + 6 + 43 + 1 + 0 + 0 + 0 + ..\..\BSP\Hardware\DHT11\DHT11_BUS.c + DHT11_BUS.c + 0 + 0 + + + 6 + 44 + 1 + 0 + 0 + 0 + ..\..\BSP\Hardware\OLED\oled.c + oled.c + 0 + 0 + + + + + kernel + 0 + 0 + 0 + 0 + + 7 + 45 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_binary_heap.c + tos_binary_heap.c + 0 + 0 + + + 7 + 46 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_char_fifo.c + tos_char_fifo.c + 0 + 0 + + + 7 + 47 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_completion.c + tos_completion.c + 0 + 0 + + + 7 + 48 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_countdownlatch.c + tos_countdownlatch.c + 0 + 0 + + + 7 + 49 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_event.c + tos_event.c + 0 + 0 + + + 7 + 50 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_global.c + tos_global.c + 0 + 0 + + + 7 + 51 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mail_queue.c + tos_mail_queue.c + 0 + 0 + + + 7 + 52 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_message_queue.c + tos_message_queue.c + 0 + 0 + + + 7 + 53 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mmblk.c + tos_mmblk.c + 0 + 0 + + + 7 + 54 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mmheap.c + tos_mmheap.c + 0 + 0 + + + 7 + 55 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_mutex.c + tos_mutex.c + 0 + 0 + + + 7 + 56 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_pend.c + tos_pend.c + 0 + 0 + + + 7 + 57 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_mail_queue.c + tos_priority_mail_queue.c + 0 + 0 + + + 7 + 58 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_message_queue.c + tos_priority_message_queue.c + 0 + 0 + + + 7 + 59 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_priority_queue.c + tos_priority_queue.c + 0 + 0 + + + 7 + 60 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_ring_queue.c + tos_ring_queue.c + 0 + 0 + + + 7 + 61 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_robin.c + tos_robin.c + 0 + 0 + + + 7 + 62 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sched.c + tos_sched.c + 0 + 0 + + + 7 + 63 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sem.c + tos_sem.c + 0 + 0 + + + 7 + 64 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_sys.c + tos_sys.c + 0 + 0 + + + 7 + 65 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_task.c + tos_task.c + 0 + 0 + + + 7 + 66 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_tick.c + tos_tick.c + 0 + 0 + + + 7 + 67 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_time.c + tos_time.c + 0 + 0 + + + 7 + 68 + 1 + 0 + 0 + 0 + ..\..\..\..\kernel\core\tos_timer.c + tos_timer.c + 0 + 0 + + + + + cpu + 0 + 0 + 0 + 0 + + 8 + 69 + 2 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_s.S + port_s.S + 0 + 0 + + + 8 + 70 + 1 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c + tos_cpu.c + 0 + 0 + + + 8 + 71 + 1 + 0 + 0 + 0 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_c.c + port_c.c + 0 + 0 + + + + + cmsis + 0 + 0 + 0 + 0 + + 9 + 72 + 1 + 0 + 0 + 0 + ..\..\..\..\osal\cmsis_os\cmsis_os.c + cmsis_os.c + 0 + 0 + + + + + config + 0 + 0 + 0 + 0 + + 10 + 73 + 5 + 0 + 0 + 0 + ..\..\TOS-CONFIG\tos_config.h + tos_config.h + 0 + 0 + + + + + fatfs + 0 + 0 + 0 + 0 + + 11 + 74 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_diskio.c + tos_diskio.c + 0 + 0 + + + 11 + 75 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_fatfs_drv.c + tos_fatfs_drv.c + 0 + 0 + + + 11 + 76 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_fatfs_vfs.c + tos_fatfs_vfs.c + 0 + 0 + + + 11 + 77 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ff.c + tos_ff.c + 0 + 0 + + + 11 + 78 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ffsystem.c + tos_ffsystem.c + 0 + 0 + + + 11 + 79 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ffunicode.c + tos_ffunicode.c + 0 + 0 + + + + + vfs + 0 + 0 + 0 + 0 + + 12 + 80 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\vfs\tos_vfs.c + tos_vfs.c + 0 + 0 + + + 12 + 81 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\vfs\tos_vfs_device.c + tos_vfs_device.c + 0 + 0 + + + 12 + 82 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\vfs\tos_vfs_file.c + tos_vfs_file.c + 0 + 0 + + + 12 + 83 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\vfs\tos_vfs_fs.c + tos_vfs_fs.c + 0 + 0 + + + 12 + 84 + 1 + 0 + 0 + 0 + ..\..\..\..\components\fs\vfs\tos_vfs_inode.c + tos_vfs_inode.c + 0 + 0 + + + + + hal + 0 + 0 + 0 + 0 + + 13 + 85 + 1 + 0 + 0 + 0 + ..\..\..\..\platform\hal\st\stm32l4xx\src\tos_hal_sd.c + tos_hal_sd.c + 0 + 0 + + + + + elfloader/shared_object + 0 + 0 + 0 + 0 + + 14 + 86 + 1 + 0 + 0 + 0 + ..\..\..\..\components\elfloader\shared_object\tos_elfloader_shared_object.c + tos_elfloader_shared_object.c + 0 + 0 + + + 14 + 87 + 1 + 0 + 0 + 0 + ..\..\..\..\components\elfloader\common\tos_elfloader_fd_read-vfs.c + tos_elfloader_fd_read-vfs.c + 0 + 0 + + + 14 + 88 + 1 + 0 + 0 + 0 + ..\..\..\..\components\elfloader\common\tos_elfloader_symtab.c + tos_elfloader_symtab.c + 0 + 0 + + + 14 + 89 + 1 + 0 + 0 + 0 + ..\..\..\..\components\elfloader\common\tos_elfloader_relocate-arm.c + tos_elfloader_relocate-arm.c + 0 + 0 + + + + + ::CMSIS + 0 + 0 + 0 + 1 + + +
diff --git a/board/TencentOS_tiny_EVB_MX_Plus/KEIL/elfloader_shared_object/TencentOS_tiny.uvprojx b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/elfloader_shared_object/TencentOS_tiny.uvprojx new file mode 100644 index 0000000000000000000000000000000000000000..71d65865d3d030680ad84b68df97e50c90d38d39 --- /dev/null +++ b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/elfloader_shared_object/TencentOS_tiny.uvprojx @@ -0,0 +1,917 @@ + + + + 2.1 + +
### uVision Project, (C) Keil Software
+ + + + TencentOS_tiny + 0x4 + ARM-ADS + 5060750::V5.06 update 6 (build 750)::ARMCC + 0 + + + STM32L431RCTx + STMicroelectronics + Keil.STM32L4xx_DFP.2.0.0 + http://www.keil.com/pack + IRAM(0x20000000-0x2000FFFF) IROM(0x8000000-0x803FFFF) CLOCK(8000000) FPU2 CPUTYPE("Cortex-M4") + + + + + + + + + + + + + + + $$Device:STM32L431RCTx$CMSIS\SVD\STM32L4x1.svd + 0 + 0 + + + + + + + 0 + 0 + 0 + 0 + 1 + + .\obj\ + TencentOS_tiny + 1 + 0 + 1 + 1 + 0 + .\list\ + 1 + 0 + 0 + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + + 0 + 0 + + + 0 + 0 + 0 + 0 + + 0 + + + + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 3 + + + 0 + + + SARMCM3.DLL + -REMAP -MPU + DCM.DLL + -pCM4 + SARMCM3.DLL + -MPU + TCM.DLL + -pCM4 + + + + 1 + 0 + 0 + 0 + 16 + + + + + 1 + 0 + 0 + 1 + 1 + 4107 + + 1 + STLink\ST-LINKIII-KEIL_SWO.dll + + + + + + 0 + + + + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 1 + 1 + 0 + 1 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 0 + 0 + "Cortex-M4" + + 0 + 0 + 0 + 1 + 1 + 0 + 0 + 2 + 0 + 0 + 0 + 8 + 1 + 0 + 0 + 0 + 3 + 3 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 1 + 0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x10000 + + + 1 + 0x8000000 + 0x40000 + + + 0 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x0 + 0x0 + + + 1 + 0x8000000 + 0x40000 + + + 1 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x0 + 0x0 + + + 0 + 0x20000000 + 0x10000 + + + 0 + 0x0 + 0x0 + + + + + + 1 + 1 + 0 + 0 + 1 + 0 + 0 + 0 + 0 + 0 + 2 + 0 + 0 + 1 + 0 + 0 + 1 + 1 + 1 + 1 + 0 + 0 + 0 + + + USE_HAL_DRIVER,STM32L431xx,WITH_TOS_NET_ADAPTER,USE_ESP8266 + + ..\..\BSP\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Inc;..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Legacy;..\..\..\..\platform\vendor_bsp\st\CMSIS\Device\ST\STM32L4xx\Include;..\..\..\..\platform\vendor_bsp\st\CMSIS\Include;..\..\..\..\kernel\core\include;..\..\TOS-CONFIG;..\..\..\..\platform\arch\arm\cortex-m4\keil;..\..\..\..\kernel\pm\include;..\..\..\..\osal\cmsis_os;..\..\..\..\arch\arm\arm-v7m\common\include;..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc;..\..\BSP\Hardware\DHT11;..\..\BSP\Hardware\OLED;..\..\BSP\Hardware\BH1750;..\..\..\..\examples\helloworld;..\..\..\..\components\fs\vfs\include;..\..\..\..\components\fs\fatfs\wrapper\include;..\..\..\..\kernel\hal\include;..\..\..\..\components\fs\fatfs\3rdparty;..\..\..\..\components\elfloader\common\include + + + + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + + + + + + + + + 1 + 0 + 0 + 0 + 1 + 0 + 0x08000000 + 0x20000000 + + + + + + + + + + + + + Application/MDK-ARM + + + startup_stm32l431xx.s + 2 + startup_stm32l431xx.s + + + + + Application/User + + + gpio.c + 1 + ..\..\BSP\Src\gpio.c + + + main.c + 1 + ..\..\BSP\Src\main.c + + + mcu_init.c + 1 + ..\..\BSP\Src\mcu_init.c + + + stm32l4xx_hal_msp.c + 1 + ..\..\BSP\Src\stm32l4xx_hal_msp.c + + + stm32l4xx_it.c + 1 + ..\..\BSP\Src\stm32l4xx_it.c + + + usart.c + 1 + ..\..\BSP\Src\usart.c + + + adc.c + 1 + ..\..\BSP\Src\adc.c + + + dac.c + 1 + ..\..\BSP\Src\dac.c + + + i2c.c + 1 + ..\..\BSP\Src\i2c.c + + + spi.c + 1 + ..\..\BSP\Src\spi.c + + + tim.c + 1 + ..\..\BSP\Src\tim.c + + + sdmmc.c + 1 + ..\..\BSP\Src\sdmmc.c + + + + + examples + + + elfloader_shared_object.c + 1 + ..\..\..\..\examples\elfloader_shared_object\elfloader_shared_object.c + + + + + Drivers/STM32L4xx_HAL_Driver + + + stm32l4xx_hal_tim.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim.c + + + stm32l4xx_hal_tim_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_tim_ex.c + + + stm32l4xx_hal_uart.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart.c + + + stm32l4xx_hal_uart_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_uart_ex.c + + + stm32l4xx_hal.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal.c + + + stm32l4xx_hal_i2c.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c.c + + + stm32l4xx_hal_i2c_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_i2c_ex.c + + + stm32l4xx_hal_rcc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc.c + + + stm32l4xx_hal_rcc_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_rcc_ex.c + + + stm32l4xx_hal_flash.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash.c + + + stm32l4xx_hal_flash_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ex.c + + + stm32l4xx_hal_flash_ramfunc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_flash_ramfunc.c + + + stm32l4xx_hal_gpio.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_gpio.c + + + stm32l4xx_hal_dma.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma.c + + + stm32l4xx_hal_dma_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dma_ex.c + + + stm32l4xx_hal_pwr.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr.c + + + stm32l4xx_hal_pwr_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_pwr_ex.c + + + stm32l4xx_hal_cortex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_cortex.c + + + stm32l4xx_hal_adc_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc_ex.c + + + stm32l4xx_hal_adc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_adc.c + + + stm32l4xx_hal_dac.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac.c + + + stm32l4xx_hal_dac_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_dac_ex.c + + + stm32l4xx_hal_spi.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi.c + + + stm32l4xx_hal_spi_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_spi_ex.c + + + stm32l4xx_ll_sdmmc.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_ll_sdmmc.c + + + stm32l4xx_hal_sd.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd.c + + + stm32l4xx_hal_sd_ex.c + 1 + ..\..\..\..\platform\vendor_bsp\st\STM32L4xx_HAL_Driver\Src\stm32l4xx_hal_sd_ex.c + + + + + Drivers/CMSIS + + + system_stm32l4xx.c + 1 + ..\..\BSP\Src\system_stm32l4xx.c + + + + + Hardware + + + DHT11_BUS.c + 1 + ..\..\BSP\Hardware\DHT11\DHT11_BUS.c + + + oled.c + 1 + ..\..\BSP\Hardware\OLED\oled.c + + + + + kernel + + + tos_binary_heap.c + 1 + ..\..\..\..\kernel\core\tos_binary_heap.c + + + tos_char_fifo.c + 1 + ..\..\..\..\kernel\core\tos_char_fifo.c + + + tos_completion.c + 1 + ..\..\..\..\kernel\core\tos_completion.c + + + tos_countdownlatch.c + 1 + ..\..\..\..\kernel\core\tos_countdownlatch.c + + + tos_event.c + 1 + ..\..\..\..\kernel\core\tos_event.c + + + tos_global.c + 1 + ..\..\..\..\kernel\core\tos_global.c + + + tos_mail_queue.c + 1 + ..\..\..\..\kernel\core\tos_mail_queue.c + + + tos_message_queue.c + 1 + ..\..\..\..\kernel\core\tos_message_queue.c + + + tos_mmblk.c + 1 + ..\..\..\..\kernel\core\tos_mmblk.c + + + tos_mmheap.c + 1 + ..\..\..\..\kernel\core\tos_mmheap.c + + + tos_mutex.c + 1 + ..\..\..\..\kernel\core\tos_mutex.c + + + tos_pend.c + 1 + ..\..\..\..\kernel\core\tos_pend.c + + + tos_priority_mail_queue.c + 1 + ..\..\..\..\kernel\core\tos_priority_mail_queue.c + + + tos_priority_message_queue.c + 1 + ..\..\..\..\kernel\core\tos_priority_message_queue.c + + + tos_priority_queue.c + 1 + ..\..\..\..\kernel\core\tos_priority_queue.c + + + tos_ring_queue.c + 1 + ..\..\..\..\kernel\core\tos_ring_queue.c + + + tos_robin.c + 1 + ..\..\..\..\kernel\core\tos_robin.c + + + tos_sched.c + 1 + ..\..\..\..\kernel\core\tos_sched.c + + + tos_sem.c + 1 + ..\..\..\..\kernel\core\tos_sem.c + + + tos_sys.c + 1 + ..\..\..\..\kernel\core\tos_sys.c + + + tos_task.c + 1 + ..\..\..\..\kernel\core\tos_task.c + + + tos_tick.c + 1 + ..\..\..\..\kernel\core\tos_tick.c + + + tos_time.c + 1 + ..\..\..\..\kernel\core\tos_time.c + + + tos_timer.c + 1 + ..\..\..\..\kernel\core\tos_timer.c + + + + + cpu + + + port_s.S + 2 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_s.S + + + tos_cpu.c + 1 + ..\..\..\..\arch\arm\arm-v7m\common\tos_cpu.c + + + port_c.c + 1 + ..\..\..\..\arch\arm\arm-v7m\cortex-m4\armcc\port_c.c + + + + + cmsis + + + cmsis_os.c + 1 + ..\..\..\..\osal\cmsis_os\cmsis_os.c + + + + + config + + + tos_config.h + 5 + ..\..\TOS-CONFIG\tos_config.h + + + + + fatfs + + + tos_diskio.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_diskio.c + + + tos_fatfs_drv.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_fatfs_drv.c + + + tos_fatfs_vfs.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_fatfs_vfs.c + + + tos_ff.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ff.c + + + tos_ffsystem.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ffsystem.c + + + tos_ffunicode.c + 1 + ..\..\..\..\components\fs\fatfs\wrapper\tos_ffunicode.c + + + + + vfs + + + tos_vfs.c + 1 + ..\..\..\..\components\fs\vfs\tos_vfs.c + + + tos_vfs_device.c + 1 + ..\..\..\..\components\fs\vfs\tos_vfs_device.c + + + tos_vfs_file.c + 1 + ..\..\..\..\components\fs\vfs\tos_vfs_file.c + + + tos_vfs_fs.c + 1 + ..\..\..\..\components\fs\vfs\tos_vfs_fs.c + + + tos_vfs_inode.c + 1 + ..\..\..\..\components\fs\vfs\tos_vfs_inode.c + + + + + hal + + + tos_hal_sd.c + 1 + ..\..\..\..\platform\hal\st\stm32l4xx\src\tos_hal_sd.c + + + + + elfloader/shared_object + + + tos_elfloader_shared_object.c + 1 + ..\..\..\..\components\elfloader\shared_object\tos_elfloader_shared_object.c + + + tos_elfloader_fd_read-vfs.c + 1 + ..\..\..\..\components\elfloader\common\tos_elfloader_fd_read-vfs.c + + + tos_elfloader_symtab.c + 1 + ..\..\..\..\components\elfloader\common\tos_elfloader_symtab.c + + + tos_elfloader_relocate-arm.c + 1 + ..\..\..\..\components\elfloader\common\tos_elfloader_relocate-arm.c + + + + + ::CMSIS + + + + + + + + + + + + + + + + + + +
diff --git a/board/TencentOS_tiny_EVB_MX_Plus/KEIL/elfloader_shared_object/startup_stm32l431xx.s b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/elfloader_shared_object/startup_stm32l431xx.s new file mode 100644 index 0000000000000000000000000000000000000000..6a5c15a58c6531f3465927946b8c37db41a841fb --- /dev/null +++ b/board/TencentOS_tiny_EVB_MX_Plus/KEIL/elfloader_shared_object/startup_stm32l431xx.s @@ -0,0 +1,404 @@ +;********************** COPYRIGHT(c) 2017 STMicroelectronics ****************** +;* File Name : startup_stm32l431xx.s +;* Author : MCD Application Team +;* Description : STM32L431xx Ultra Low Power devices vector table for MDK-ARM toolchain. +;* This module performs: +;* - Set the initial SP +;* - Set the initial PC == Reset_Handler +;* - Set the vector table entries with the exceptions ISR address +;* - Branches to __main in the C library (which eventually +;* calls main()). +;* After Reset the Cortex-M4 processor is in Thread mode, +;* priority is Privileged, and the Stack is set to Main. +;* <<< Use Configuration Wizard in Context Menu >>> +;******************************************************************************* +;* +;* Redistribution and use in source and binary forms, with or without modification, +;* are permitted provided that the following conditions are met: +;* 1. Redistributions of source code must retain the above copyright notice, +;* this list of conditions and the following disclaimer. +;* 2. Redistributions in binary form must reproduce the above copyright notice, +;* this list of conditions and the following disclaimer in the documentation +;* and/or other materials provided with the distribution. +;* 3. Neither the name of STMicroelectronics nor the names of its contributors +;* may be used to endorse or promote products derived from this software +;* without specific prior written permission. +;* +;* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +;* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +;* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +;* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE +;* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +;* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +;* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER +;* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +;* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +;* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +;* +;******************************************************************************* +; +; Amount of memory (in bytes) allocated for Stack +; Tailor this value to your application needs +; Stack Configuration +; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Stack_Size EQU 0x100 + + AREA STACK, NOINIT, READWRITE, ALIGN=3 +Stack_Mem SPACE Stack_Size +__initial_sp + + +; Heap Configuration +; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> +; + +Heap_Size EQU 0x100 + + AREA HEAP, NOINIT, READWRITE, ALIGN=3 +__heap_base +Heap_Mem SPACE Heap_Size +__heap_limit + + PRESERVE8 + THUMB + + +; Vector Table Mapped to Address 0 at Reset + AREA RESET, DATA, READONLY + EXPORT __Vectors + EXPORT __Vectors_End + EXPORT __Vectors_Size + +__Vectors DCD __initial_sp ; Top of Stack + DCD Reset_Handler ; Reset Handler + DCD NMI_Handler ; NMI Handler + DCD HardFault_Handler ; Hard Fault Handler + DCD MemManage_Handler ; MPU Fault Handler + DCD BusFault_Handler ; Bus Fault Handler + DCD UsageFault_Handler ; Usage Fault Handler + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SVC_Handler ; SVCall Handler + DCD DebugMon_Handler ; Debug Monitor Handler + DCD 0 ; Reserved + DCD PendSV_Handler ; PendSV Handler + DCD SysTick_Handler ; SysTick Handler + + ; External Interrupts + DCD WWDG_IRQHandler ; Window WatchDog + DCD PVD_PVM_IRQHandler ; PVD/PVM1/PVM2/PVM3/PVM4 through EXTI Line detection + DCD TAMP_STAMP_IRQHandler ; Tamper and TimeStamps through the EXTI line + DCD RTC_WKUP_IRQHandler ; RTC Wakeup through the EXTI line + DCD FLASH_IRQHandler ; FLASH + DCD RCC_IRQHandler ; RCC + DCD EXTI0_IRQHandler ; EXTI Line0 + DCD EXTI1_IRQHandler ; EXTI Line1 + DCD EXTI2_IRQHandler ; EXTI Line2 + DCD EXTI3_IRQHandler ; EXTI Line3 + DCD EXTI4_IRQHandler ; EXTI Line4 + DCD DMA1_Channel1_IRQHandler ; DMA1 Channel 1 + DCD DMA1_Channel2_IRQHandler ; DMA1 Channel 2 + DCD DMA1_Channel3_IRQHandler ; DMA1 Channel 3 + DCD DMA1_Channel4_IRQHandler ; DMA1 Channel 4 + DCD DMA1_Channel5_IRQHandler ; DMA1 Channel 5 + DCD DMA1_Channel6_IRQHandler ; DMA1 Channel 6 + DCD DMA1_Channel7_IRQHandler ; DMA1 Channel 7 + DCD ADC1_IRQHandler ; ADC1 + DCD CAN1_TX_IRQHandler ; CAN1 TX + DCD CAN1_RX0_IRQHandler ; CAN1 RX0 + DCD CAN1_RX1_IRQHandler ; CAN1 RX1 + DCD CAN1_SCE_IRQHandler ; CAN1 SCE + DCD EXTI9_5_IRQHandler ; External Line[9:5]s + DCD TIM1_BRK_TIM15_IRQHandler ; TIM1 Break and TIM15 + DCD TIM1_UP_TIM16_IRQHandler ; TIM1 Update and TIM16 + DCD TIM1_TRG_COM_IRQHandler ; TIM1 Trigger and Commutation + DCD TIM1_CC_IRQHandler ; TIM1 Capture Compare + DCD TIM2_IRQHandler ; TIM2 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD I2C1_EV_IRQHandler ; I2C1 Event + DCD I2C1_ER_IRQHandler ; I2C1 Error + DCD I2C2_EV_IRQHandler ; I2C2 Event + DCD I2C2_ER_IRQHandler ; I2C2 Error + DCD SPI1_IRQHandler ; SPI1 + DCD SPI2_IRQHandler ; SPI2 + DCD USART1_IRQHandler ; USART1 + DCD USART2_IRQHandler ; USART2 + DCD USART3_IRQHandler ; USART3 + DCD EXTI15_10_IRQHandler ; External Line[15:10] + DCD RTC_Alarm_IRQHandler ; RTC Alarm (A and B) through EXTI Line + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD SDMMC1_IRQHandler ; SDMMC1 + DCD 0 ; Reserved + DCD SPI3_IRQHandler ; SPI3 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD TIM6_DAC_IRQHandler ; TIM6 and DAC1&2 underrun errors + DCD TIM7_IRQHandler ; TIM7 + DCD DMA2_Channel1_IRQHandler ; DMA2 Channel 1 + DCD DMA2_Channel2_IRQHandler ; DMA2 Channel 2 + DCD DMA2_Channel3_IRQHandler ; DMA2 Channel 3 + DCD DMA2_Channel4_IRQHandler ; DMA2 Channel 4 + DCD DMA2_Channel5_IRQHandler ; DMA2 Channel 5 + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD COMP_IRQHandler ; COMP Interrupt + DCD LPTIM1_IRQHandler ; LP TIM1 interrupt + DCD LPTIM2_IRQHandler ; LP TIM2 interrupt + DCD 0 ; Reserved + DCD DMA2_Channel6_IRQHandler ; DMA2 Channel 6 + DCD DMA2_Channel7_IRQHandler ; DMA2 Channel 7 + DCD LPUART1_IRQHandler ; LP UART1 interrupt + DCD QUADSPI_IRQHandler ; Quad SPI global interrupt + DCD I2C3_EV_IRQHandler ; I2C3 event + DCD I2C3_ER_IRQHandler ; I2C3 error + DCD SAI1_IRQHandler ; Serial Audio Interface 1 global interrupt + DCD 0 ; Reserved + DCD SWPMI1_IRQHandler ; Serial Wire Interface 1 global interrupt + DCD TSC_IRQHandler ; Touch Sense Controller global interrupt + DCD 0 ; Reserved + DCD 0 ; Reserved + DCD RNG_IRQHandler ; RNG global interrupt + DCD FPU_IRQHandler ; FPU + DCD CRS_IRQHandler ; CRS interrupt + +__Vectors_End + +__Vectors_Size EQU __Vectors_End - __Vectors + + AREA |.text|, CODE, READONLY + +; Reset handler +Reset_Handler PROC + EXPORT Reset_Handler [WEAK] + IMPORT SystemInit + IMPORT __main + + LDR R0, =SystemInit + BLX R0 + LDR R0, =__main + BX R0 + ENDP + +; Dummy Exception Handlers (infinite loops which can be modified) + +NMI_Handler PROC + EXPORT NMI_Handler [WEAK] + B . + ENDP +HardFault_Handler\ + PROC + EXPORT HardFault_Handler [WEAK] + B . + ENDP +MemManage_Handler\ + PROC + EXPORT MemManage_Handler [WEAK] + B . + ENDP +BusFault_Handler\ + PROC + EXPORT BusFault_Handler [WEAK] + B . + ENDP +UsageFault_Handler\ + PROC + EXPORT UsageFault_Handler [WEAK] + B . + ENDP +SVC_Handler PROC + EXPORT SVC_Handler [WEAK] + B . + ENDP +DebugMon_Handler\ + PROC + EXPORT DebugMon_Handler [WEAK] + B . + ENDP +PendSV_Handler PROC + EXPORT PendSV_Handler [WEAK] + B . + ENDP +SysTick_Handler PROC + EXPORT SysTick_Handler [WEAK] + B . + ENDP + +Default_Handler PROC + + EXPORT WWDG_IRQHandler [WEAK] + EXPORT PVD_PVM_IRQHandler [WEAK] + EXPORT TAMP_STAMP_IRQHandler [WEAK] + EXPORT RTC_WKUP_IRQHandler [WEAK] + EXPORT FLASH_IRQHandler [WEAK] + EXPORT RCC_IRQHandler [WEAK] + EXPORT EXTI0_IRQHandler [WEAK] + EXPORT EXTI1_IRQHandler [WEAK] + EXPORT EXTI2_IRQHandler [WEAK] + EXPORT EXTI3_IRQHandler [WEAK] + EXPORT EXTI4_IRQHandler [WEAK] + EXPORT DMA1_Channel1_IRQHandler [WEAK] + EXPORT DMA1_Channel2_IRQHandler [WEAK] + EXPORT DMA1_Channel3_IRQHandler [WEAK] + EXPORT DMA1_Channel4_IRQHandler [WEAK] + EXPORT DMA1_Channel5_IRQHandler [WEAK] + EXPORT DMA1_Channel6_IRQHandler [WEAK] + EXPORT DMA1_Channel7_IRQHandler [WEAK] + EXPORT ADC1_IRQHandler [WEAK] + EXPORT CAN1_TX_IRQHandler [WEAK] + EXPORT CAN1_RX0_IRQHandler [WEAK] + EXPORT CAN1_RX1_IRQHandler [WEAK] + EXPORT CAN1_SCE_IRQHandler [WEAK] + EXPORT EXTI9_5_IRQHandler [WEAK] + EXPORT TIM1_BRK_TIM15_IRQHandler [WEAK] + EXPORT TIM1_UP_TIM16_IRQHandler [WEAK] + EXPORT TIM1_TRG_COM_IRQHandler [WEAK] + EXPORT TIM1_CC_IRQHandler [WEAK] + EXPORT TIM2_IRQHandler [WEAK] + EXPORT I2C1_EV_IRQHandler [WEAK] + EXPORT I2C1_ER_IRQHandler [WEAK] + EXPORT I2C2_EV_IRQHandler [WEAK] + EXPORT I2C2_ER_IRQHandler [WEAK] + EXPORT SPI1_IRQHandler [WEAK] + EXPORT SPI2_IRQHandler [WEAK] + EXPORT USART1_IRQHandler [WEAK] + EXPORT USART2_IRQHandler [WEAK] + EXPORT USART3_IRQHandler [WEAK] + EXPORT EXTI15_10_IRQHandler [WEAK] + EXPORT RTC_Alarm_IRQHandler [WEAK] + EXPORT SDMMC1_IRQHandler [WEAK] + EXPORT SPI3_IRQHandler [WEAK] + EXPORT TIM6_DAC_IRQHandler [WEAK] + EXPORT TIM7_IRQHandler [WEAK] + EXPORT DMA2_Channel1_IRQHandler [WEAK] + EXPORT DMA2_Channel2_IRQHandler [WEAK] + EXPORT DMA2_Channel3_IRQHandler [WEAK] + EXPORT DMA2_Channel4_IRQHandler [WEAK] + EXPORT DMA2_Channel5_IRQHandler [WEAK] + EXPORT COMP_IRQHandler [WEAK] + EXPORT LPTIM1_IRQHandler [WEAK] + EXPORT LPTIM2_IRQHandler [WEAK] + EXPORT DMA2_Channel6_IRQHandler [WEAK] + EXPORT DMA2_Channel7_IRQHandler [WEAK] + EXPORT LPUART1_IRQHandler [WEAK] + EXPORT QUADSPI_IRQHandler [WEAK] + EXPORT I2C3_EV_IRQHandler [WEAK] + EXPORT I2C3_ER_IRQHandler [WEAK] + EXPORT SAI1_IRQHandler [WEAK] + EXPORT SWPMI1_IRQHandler [WEAK] + EXPORT TSC_IRQHandler [WEAK] + EXPORT RNG_IRQHandler [WEAK] + EXPORT FPU_IRQHandler [WEAK] + EXPORT CRS_IRQHandler [WEAK] + +WWDG_IRQHandler +PVD_PVM_IRQHandler +TAMP_STAMP_IRQHandler +RTC_WKUP_IRQHandler +FLASH_IRQHandler +RCC_IRQHandler +EXTI0_IRQHandler +EXTI1_IRQHandler +EXTI2_IRQHandler +EXTI3_IRQHandler +EXTI4_IRQHandler +DMA1_Channel1_IRQHandler +DMA1_Channel2_IRQHandler +DMA1_Channel3_IRQHandler +DMA1_Channel4_IRQHandler +DMA1_Channel5_IRQHandler +DMA1_Channel6_IRQHandler +DMA1_Channel7_IRQHandler +ADC1_IRQHandler +CAN1_TX_IRQHandler +CAN1_RX0_IRQHandler +CAN1_RX1_IRQHandler +CAN1_SCE_IRQHandler +EXTI9_5_IRQHandler +TIM1_BRK_TIM15_IRQHandler +TIM1_UP_TIM16_IRQHandler +TIM1_TRG_COM_IRQHandler +TIM1_CC_IRQHandler +TIM2_IRQHandler +I2C1_EV_IRQHandler +I2C1_ER_IRQHandler +I2C2_EV_IRQHandler +I2C2_ER_IRQHandler +SPI1_IRQHandler +SPI2_IRQHandler +USART1_IRQHandler +USART2_IRQHandler +USART3_IRQHandler +EXTI15_10_IRQHandler +RTC_Alarm_IRQHandler +SDMMC1_IRQHandler +SPI3_IRQHandler +TIM6_DAC_IRQHandler +TIM7_IRQHandler +DMA2_Channel1_IRQHandler +DMA2_Channel2_IRQHandler +DMA2_Channel3_IRQHandler +DMA2_Channel4_IRQHandler +DMA2_Channel5_IRQHandler +COMP_IRQHandler +LPTIM1_IRQHandler +LPTIM2_IRQHandler +DMA2_Channel6_IRQHandler +DMA2_Channel7_IRQHandler +LPUART1_IRQHandler +QUADSPI_IRQHandler +I2C3_EV_IRQHandler +I2C3_ER_IRQHandler +SAI1_IRQHandler +SWPMI1_IRQHandler +TSC_IRQHandler +RNG_IRQHandler +FPU_IRQHandler +CRS_IRQHandler + + B . + + ENDP + + ALIGN + +;******************************************************************************* +; User Stack and Heap initialization +;******************************************************************************* + IF :DEF:__MICROLIB + + EXPORT __initial_sp + EXPORT __heap_base + EXPORT __heap_limit + + ELSE + + IMPORT __use_two_region_memory + EXPORT __user_initial_stackheap + +__user_initial_stackheap + + LDR R0, = Heap_Mem + LDR R1, =(Stack_Mem + Stack_Size) + LDR R2, = (Heap_Mem + Heap_Size) + LDR R3, = Stack_Mem + BX LR + + ALIGN + + ENDIF + + END + +;************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE***** diff --git a/components/elfloader/common/include/elf/elf32.h b/components/elfloader/common/include/elf/elf32.h new file mode 100644 index 0000000000000000000000000000000000000000..915a2fa0cbc658ce64fd2b33e9fa6e743a9da86f --- /dev/null +++ b/components/elfloader/common/include/elf/elf32.h @@ -0,0 +1,183 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + +#ifndef _ELF32_H_ +#define _ELF32_H_ + +#define EI_NIDENT 16 + +typedef int32_t elf32_sword; +typedef uint32_t elf32_word; +typedef uint16_t elf32_half; +typedef uint32_t elf32_off; +typedef uint32_t elf32_addr; + +/* elf header */ +typedef struct elf32_ehdr { + unsigned char e_ident[EI_NIDENT]; /* ident bytes */ + elf32_half e_type; /* file type */ + elf32_half e_machine; /* target machine */ + elf32_word e_version; /* file version */ + elf32_addr e_entry; /* start address */ + elf32_off e_phoff; /* phdr file offset */ + elf32_off e_shoff; /* shdr file offset */ + elf32_word e_flags; /* file flags */ + elf32_half e_ehsize; /* sizeof ehdr */ + elf32_half e_phentsize; /* sizeof phdr */ + elf32_half e_phnum; /* number phdrs */ + elf32_half e_shentsize; /* sizeof shdr */ + elf32_half e_shnum; /* number shdrs */ + elf32_half e_shstrndx; /* shdr string index */ +} elf32_ehdr_t; + +/* values for e_type. */ +#define ET_NONE 0 /* unknown type. */ +#define ET_REL 1 /* relocatable. */ +#define ET_EXEC 2 /* executable. */ +#define ET_DYN 3 /* shared object. */ + +/* section header */ +typedef struct elf32_shdr { + elf32_word sh_name; /* section name */ + elf32_word sh_type; /* SHT_... */ + elf32_word sh_flags; /* SHF_... */ + elf32_addr sh_addr; /* virtual address */ + elf32_off sh_offset; /* file offset */ + elf32_word sh_size; /* section size */ + elf32_word sh_link; /* misc info */ + elf32_word sh_info; /* misc info */ + elf32_word sh_addralign; /* memory alignment */ + elf32_word sh_entsize; /* entry size if table */ +} elf32_shdr_t; + +/* values for sh_type */ +#define SHT_NULL 0 /* inactive */ +#define SHT_PROGBITS 1 /* program defined information */ +#define SHT_SYMTAB 2 /* symbol table section */ +#define SHT_STRTAB 3 /* string table section */ +#define SHT_RELA 4 /* relocation section with addends*/ +#define SHT_HASH 5 /* symbol hash table section */ +#define SHT_DYNAMIC 6 /* dynamic section */ +#define SHT_NOTE 7 /* note section */ +#define SHT_NOBITS 8 /* no space section */ +#define SHT_REL 9 /* relation section without addends */ +#define SHT_SHLIB 10 /* reserved - purpose unknown */ +#define SHT_DYNSYM 11 /* dynamic symbol table section */ +#define SHT_LOPROC 0x70000000 /* reserved range for processor */ +#define SHT_HIPROC 0x7fffffff /* specific section header types */ +#define SHT_LOUSER 0x80000000 /* reserved range for application */ +#define SHT_HIUSER 0xffffffff /* specific indexes */ + +/* values for sh_flags */ +#define SHF_WRITE 1 /* writable */ +#define SHF_ALLOC 2 /* occupies memory */ +#define SHF_EXECINSTR 4 /* executable */ + +typedef struct elf32_rel { + elf32_addr r_offset; /* location to be relocated. */ + elf32_word r_info; /* relocation type and symbol index. */ +} elf32_rel_t; + +typedef struct elf32_rela { + elf32_addr r_offset; /* location to be relocated. */ + elf32_word r_info; /* relocation type and symbol index. */ + elf32_sword r_addend; /* addend. */ +} elf32_rela_t; + +typedef struct elf32_sym { + elf32_word st_name; /* string table index of name. */ + elf32_addr st_value; /* symbol value. */ + elf32_word st_size; /* size of associated object. */ + unsigned char st_info; /* type and binding information. */ + unsigned char st_other; /* reserved (not used). */ + elf32_half st_shndx; /* section index of symbol. */ +} elf32_sym_t; + +/* values for st_info(binding) */ +#define STB_LOCAL 0 +#define STB_GLOBAL 1 +#define STB_WEAK 2 + +/* values for st_info(type) */ +#define STT_NOTYPE 0 +#define STT_OBJECT 1 +#define STT_FUNC 2 +#define STT_SECTION 3 +#define STT_FILE 4 + +/* values for st_shndx */ +#define SHN_ABS 0xFFF1 +#define SHN_COMMON 0xFFF2 +#define SHN_UNDEF 0x0000 + +#define ELF32_SYM_BINDING(info) ((info) >> 4) +#define ELF32_SYM_TYPE(info) ((info) & 0x0F) + +typedef struct elf32_dyn { + elf32_sword d_tag; /* DT_... */ + union { + elf32_word d_val; + elf32_addr d_ptr; + } d_un; +} elf32_dyn_t; + +/* values for d_tag */ +#define DT_NULL 0x00 +#define DT_PLTRELSZ 0x02 +#define DT_PLTGOT 0x03 +#define DT_HASH 0x04 +#define DT_STRTAB 0x05 +#define DT_SYMTAB 0x06 +#define DT_STRSZ 0x0a +#define DT_SYMENT 0x0b +#define DT_REL 0x11 +#define DT_RELSZ 0x12 +#define DT_RELENT 0x13 +#define DT_PLTREL 0x14 +#define DT_JMPREL 0x17 + +/* program header */ +typedef struct elf32_phdr { + elf32_word p_type; /* PHT_... */ + elf32_off p_offset; /* file offset */ + elf32_addr p_vaddr; /* virtual address */ + elf32_addr p_paddr; /* physical address */ + elf32_word p_filesz; /* file size */ + elf32_word p_memsz; /* memory size */ + elf32_word p_flags; /* read write properties */ + elf32_word p_align; /* alignment attribute, 2 ^ p_align */ +} elf32_phdr_t; + +/* values for p_type */ +#define PHT_LOAD 0x01 +#define PHT_DYNAMIC 0x02 + +#define ELF32_R_SYM(info) ((info) >> 8) +#define ELF32_R_TYPE(info) ((unsigned char)(info)) + +#define ELF_MAGIC_HEADER "\177ELF\001\001\001" +#define ELF_MAGIC_HEADER_SIZE 7 + +static const unsigned char elf_header_magic[] = { + 0x7f, 0x45, 0x4c, 0x46, /* Magic: 0x7f, 'E', 'L', 'F' */ + 0x01, /* Class: ELF32 */ + 0x01, /* Data: 2's complement, 'little endian */ + 0x01, /* Version: 1(current) */ +}; + +#endif /* _ELF32_H_ */ + diff --git a/components/elfloader/common/include/tos_elfloader.h b/components/elfloader/common/include/tos_elfloader.h new file mode 100644 index 0000000000000000000000000000000000000000..a8a7928655fba9b263f0cf163adaf3f901e1c4d4 --- /dev/null +++ b/components/elfloader/common/include/tos_elfloader.h @@ -0,0 +1,74 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + +#ifndef _TOS_ELFLOADER_H_ +#define _TOS_ELFLOADER_H_ + +#include "tos_k.h" + +#include "elf/elf32.h" + +#include "tos_elfloader_err.h" +#include "tos_elfloader_fd_read.h" +#include "tos_elfloader_symbol.h" +#include "tos_elfloader_symtab.h" +#include "tos_elfloader_relocate.h" + +typedef struct el_section_st { + uint8_t shndx; + void *address; +} el_section_t; + +typedef struct el_obj_info_st { + el_section_t bss; + el_section_t data; + el_section_t rodata; + el_section_t text; +} el_obj_info_t; + +typedef struct el_so_info_st { + int32_t load_bias; +} el_so_info_t; + +typedef union el_info_un { + el_obj_info_t obj; + el_so_info_t so; +} el_info_t; + +typedef struct el_module_st { + int fd; + + void *base; + + el_info_t info; + + uint32_t symtab_offset; + uint32_t symtab_size; + uint32_t symtab_entsize; + + uint32_t strtab_offset; +} el_module_t; + +__API__ el_err_t tos_elfloader_load(el_module_t *module, int fd); + +__API__ el_err_t tos_elfloader_unload(el_module_t *module); + +__API__ void *tos_elfloader_find_symbol(el_module_t *module, char *symbol); + + +#endif /* _TOS_ELFLOADER_H_ */ + diff --git a/components/elfloader/common/include/tos_elfloader_err.h b/components/elfloader/common/include/tos_elfloader_err.h new file mode 100644 index 0000000000000000000000000000000000000000..2778b67d40e33dd4036770f6bc9a6d9da4ade32a --- /dev/null +++ b/components/elfloader/common/include/tos_elfloader_err.h @@ -0,0 +1,38 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + +#ifndef _TOS_ELFLOADER_ERR_H_ +#define _TOS_ELFLOADER_ERR_H_ + +typedef enum elfloader_err_en { + ELFLOADER_ERR_NONE, + ELFLOADER_ERR_HEADER_INVALID, + ELFLOADER_ERR_TYPE_INVALID, + ELFLOADER_ERR_NO_DYN, + ELFLOADER_ERR_NO_SYMTAB, + ELFLOADER_ERR_NO_STRTAB, + ELFLOADER_ERR_NO_TEXT, + ELFLOADER_ERR_NO_LOAD_SEGMENTS, + ELFLOADER_ERR_FD_READ_FAILED, + ELFLOADER_ERR_SECTION_NOT_FOUND, + ELFLOADER_ERR_SYM_NOT_FOUND, + ELFLOADER_ERR_OUT_OF_MEMORY, + ELFLOADER_ERR_PTR_NULL, +} el_err_t; + +#endif /* _TOS_ELFLOADER_ERR_H_ */ + diff --git a/components/elfloader/common/include/tos_elfloader_fd_read.h b/components/elfloader/common/include/tos_elfloader_fd_read.h new file mode 100644 index 0000000000000000000000000000000000000000..d504768aab6205e5c0cd2d42cd650bfff9dd2b4e --- /dev/null +++ b/components/elfloader/common/include/tos_elfloader_fd_read.h @@ -0,0 +1,24 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + +#ifndef _TOS_ELFLOADER_FD_READ_H_ +#define _TOS_ELFLOADER_FD_READ_H_ + +__KNL__ el_err_t elfloader_fd_read(int fd, uint32_t offset, void *buf, size_t len); + +#endif /* _TOS_ELFLOADER_FD_READ_H_ */ + diff --git a/components/elfloader/common/include/tos_elfloader_relocate.h b/components/elfloader/common/include/tos_elfloader_relocate.h new file mode 100644 index 0000000000000000000000000000000000000000..63825d261944b9c35ccae3407a0e1b545b3aff1e --- /dev/null +++ b/components/elfloader/common/include/tos_elfloader_relocate.h @@ -0,0 +1,24 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + +#ifndef _TOS_ELFLOADER_RELOCATE_H_ +#define _TOS_ELFLOADER_RELOCATE_H_ + +__KNL__ void elfloader_arch_relocate(uint32_t reloc_addr, int32_t load_bias, uint32_t addr, elf32_rela_t *rela, int is_rela); + +#endif /* _TOS_ELFLOADER_RELOCATE_H_ */ + diff --git a/components/elfloader/common/include/tos_elfloader_symbol.h b/components/elfloader/common/include/tos_elfloader_symbol.h new file mode 100644 index 0000000000000000000000000000000000000000..bc61c43b44ba67d15ff4f12526d9b6d7382e5492 --- /dev/null +++ b/components/elfloader/common/include/tos_elfloader_symbol.h @@ -0,0 +1,29 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + +#ifndef _TOS_ELFLOADER_SYMBOL_H_ +#define _TOS_ELFLOADER_SYMBOL_H_ + +typedef struct el_symbol_st { + const char *name; + void *value; +} el_symbol_t; + +extern const el_symbol_t el_symbols[]; + +#endif /* _TOS_ELFLOADER_SYMBOL_H_ */ + diff --git a/components/elfloader/common/include/tos_elfloader_symtab.h b/components/elfloader/common/include/tos_elfloader_symtab.h new file mode 100644 index 0000000000000000000000000000000000000000..2bdf478b26af9b34d394d942330a37c55dc17f54 --- /dev/null +++ b/components/elfloader/common/include/tos_elfloader_symtab.h @@ -0,0 +1,24 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + +#ifndef _TOS_ELFLOADER_SYMTAB_H_ +#define _TOS_ELFLOADER_SYMTAB_H_ + +__KNL__ void *elfloader_symtab_lookup(char *name); + +#endif /* _TOS_ELFLOADER_SYMTAB_H_ */ + diff --git a/components/elfloader/common/tos_elfloader_fd_read-vfs.c b/components/elfloader/common/tos_elfloader_fd_read-vfs.c new file mode 100644 index 0000000000000000000000000000000000000000..8ac9a7c0de1537b9f64d4b5b4c92451e88f8a183 --- /dev/null +++ b/components/elfloader/common/tos_elfloader_fd_read-vfs.c @@ -0,0 +1,40 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + +#include "tos_vfs.h" +#include "tos_elfloader.h" + +/* + ATTENTION: + if you wanna load the so/obj laying on your flash, you should implement "elfloader_fd_read" + with flash driver read/write operation. + + very easy to use whether your module is on a file system or raw flash. + */ +__KNL__ __WEAK__ el_err_t elfloader_fd_read(int fd, uint32_t offset, void *buf, size_t len) +{ + if (tos_vfs_lseek(fd, (vfs_off_t)offset, VFS_SEEK_SET) < 0) { + return ELFLOADER_ERR_FD_READ_FAILED; + } + + if (tos_vfs_read(fd, buf, len) < 0) { + return ELFLOADER_ERR_FD_READ_FAILED; + } + + return ELFLOADER_ERR_NONE; +} + diff --git a/components/elfloader/common/tos_elfloader_relocate-arm.c b/components/elfloader/common/tos_elfloader_relocate-arm.c new file mode 100644 index 0000000000000000000000000000000000000000..fe5ee98e745b3831d654e95b794fd21691ff555c --- /dev/null +++ b/components/elfloader/common/tos_elfloader_relocate-arm.c @@ -0,0 +1,70 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + +#include "tos_elfloader.h" + +/* values for ELF32_R_TYPE(info) */ +#define R_ARM_ABS32 2 +#define R_ARM_THM_CALL 10 +#define R_ARM_GLOB_DAT 21 +#define R_ARM_JUMP_SLOT 22 +#define R_ARM_RELATIVE 23 + +/* + - S (when used on its own) is the address of the symbol. + - A is the addend for the relocation. + - P is the address of the place being relocated (derived from r_offset). + - Pa is the adjusted address of the place being relocated, defined as (P & 0xFFFFFFFC). + - T is 1 if the target symbol S has type STT_FUNC and the symbol addresses a Thumb instruction; it is 0 +otherwise. + - B(S) is the addressing origin of the output segment defining the symbol S. The origin is not required to be the +base address of the segment. This value must always be word-aligned. + - GOT_ORG is the addressing origin of the Global Offset Table (the indirection table for imported data +addresses). This value must always be word-aligned. See ยง4.6.1.8, Proxy generating relocations. + - GOT(S) is the address of the GOT entry for the symbol S. +*/ + +// TODO: support more relocation type +__KNL__ void elfloader_arch_relocate(uint32_t reloc_addr, int32_t load_bias, uint32_t addr, elf32_rela_t *rela, int is_rela) +{ + /* ATTENTION: + different reloc_addr calculation algorithm for relocatable object and shared object + */ + + switch (ELF32_R_TYPE(rela->r_info)) { + case R_ARM_GLOB_DAT: + case R_ARM_JUMP_SLOT: + /* (S + A) | T */ + *(uint32_t *)reloc_addr = addr; + break; + + case R_ARM_RELATIVE: + /* B(S) + A */ + *(uint32_t *)reloc_addr += load_bias; + break; + + case R_ARM_ABS32: + /* (S + A) | T */ + *(uint32_t *)reloc_addr += addr; + break; + + default: + printf("Unsupported Relocation Type: %d\n", ELF32_R_TYPE(rela->r_info)); + break; + } +} + diff --git a/components/elfloader/common/tos_elfloader_symtab.c b/components/elfloader/common/tos_elfloader_symtab.c new file mode 100644 index 0000000000000000000000000000000000000000..e6b1f93efe43d883ee4044f919a92e39d41ef398 --- /dev/null +++ b/components/elfloader/common/tos_elfloader_symtab.c @@ -0,0 +1,32 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + +#include "tos_elfloader.h" + +__KNL__ void *elfloader_symtab_lookup(char *name) +{ + const el_symbol_t *symbol; + + for (symbol = &el_symbols[0]; symbol; ++symbol) { + if (strcmp(name, symbol->name) == 0) { + return symbol->value; + } + } + + return K_NULL; +} + diff --git a/components/elfloader/relocatable_object/tos_elfloader_relocatable_object.c b/components/elfloader/relocatable_object/tos_elfloader_relocatable_object.c new file mode 100644 index 0000000000000000000000000000000000000000..05bf7038f322c0a5f59e0f91a9620858da310740 --- /dev/null +++ b/components/elfloader/relocatable_object/tos_elfloader_relocatable_object.c @@ -0,0 +1,464 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + +#include "tos_elfloader.h" + +__STATIC__ void *local_symtab_lookup(int fd, char *sym_name, + el_section_t bss, el_section_t data, el_section_t rodata, el_section_t text, + uint32_t symtab_offset, uint32_t symtab_size, uint32_t symtab_entsize, + uint32_t strtab_offset) +{ + int i = 0; + + elf32_sym_t sym; +#define SYMBOL_NAME_MAX 30 + static char name[SYMBOL_NAME_MAX]; + + for (i = 0; i < symtab_size / symtab_entsize; ++i) { + if (elfloader_fd_read(fd, symtab_offset, &sym, sizeof(elf32_sym_t)) != ELFLOADER_ERR_NONE) { + return K_NULL; + } + + if (sym.st_name) { + if (elfloader_fd_read(fd, strtab_offset + sym.st_name, name, sizeof(name)) != ELFLOADER_ERR_NONE) { + return K_NULL; + } + + if (strcmp(name, sym_name) == 0) { + if (sym.st_shndx == bss.shndx && bss.address) { + return (void *)((uint32_t)bss.address + sym.st_value); + } else if (sym.st_shndx == data.shndx && data.address) { + return (void *)((uint32_t)data.address + sym.st_value); + } else if (sym.st_shndx == rodata.shndx && rodata.address) { + return (void *)((uint32_t)rodata.address + sym.st_value); + } else if (sym.st_shndx == text.shndx && text.address) { + return (void *)((uint32_t)text.address + sym.st_value); + } else { + return K_NULL; + } + } + } + + symtab_offset += symtab_entsize; + } + + return K_NULL; +} + +__STATIC__ el_err_t elfloader_relocate(int fd, void *address, + el_section_t bss, el_section_t data, el_section_t rodata, el_section_t text, + uint32_t rel_offset, uint32_t rel_size, uint32_t rel_entsize, + uint32_t symtab_offset, uint32_t symtab_size, uint32_t symtab_entsize, + uint32_t strtab_offset, uint32_t strtab_size) +{ + int i = 0; + elf32_rela_t rela; + + elf32_sym_t sym; + void *addr; +#define SYMBOL_NAME_MAX 30 + static char name[SYMBOL_NAME_MAX]; + + int is_rela = (rel_entsize == sizeof(elf32_rela_t) ? K_TRUE : K_FALSE); + + for (i = 0; i < rel_size / rel_entsize; ++i) { + addr = K_NULL; + + if (elfloader_fd_read(fd, rel_offset, &rela, rel_entsize) != ELFLOADER_ERR_NONE) { + return ELFLOADER_ERR_FD_READ_FAILED; + } + + if (elfloader_fd_read(fd, + symtab_offset + ELF32_R_SYM(rela.r_info) * symtab_entsize, + &sym, + symtab_entsize) != ELFLOADER_ERR_NONE) { + return ELFLOADER_ERR_FD_READ_FAILED; + } + + if (sym.st_name) { + /* load the symbol's name */ + if (elfloader_fd_read(fd, + strtab_offset + sym.st_name, + name, + sizeof(name)) != ELFLOADER_ERR_NONE) { + return ELFLOADER_ERR_FD_READ_FAILED; + } + + /* an external symbol, or a weak one */ + if (sym.st_shndx == SHN_UNDEF || + ELF32_SYM_TYPE(sym.st_info) == STB_WEAK) { + /* look up in the global symbol table */ + addr = elfloader_symtab_lookup(name); + } + + /* an external symbol but not found in the global symbol table */ + if (sym.st_shndx == SHN_UNDEF && !addr) { + return ELFLOADER_ERR_SYM_NOT_FOUND; + } + + /* an internal symbol, or a weak symbol without STRONG one in global symbol table */ + if (!addr) { + addr = local_symtab_lookup(fd, name, + bss, data, rodata, text, + symtab_offset, symtab_size, symtab_entsize, + strtab_offset); + } + } else { + if (sym.st_shndx == bss.shndx) { + addr = bss.address; + } else if (sym.st_shndx == data.shndx) { + addr = data.address; + } else if (sym.st_shndx == rodata.shndx) { + addr = rodata.address; + } else if (sym.st_shndx == text.shndx) { + addr = text.address; + } else { + return ELFLOADER_ERR_SECTION_NOT_FOUND; + } + } + + /* still not found */ + if (!addr) { + return ELFLOADER_ERR_SYM_NOT_FOUND; + } + + elfloader_arch_relocate(rela.r_offset + (uint32_t)address, 0, (uint32_t)addr, &rela, is_rela); + + rel_offset += rel_entsize; + } + + return ELFLOADER_ERR_NONE; +} + +__API__ el_err_t tos_elfloader_load(el_module_t *module, int fd) +{ + int i = 0; + el_err_t err; + elf32_ehdr_t ehdr; + elf32_shdr_t shdr; + elf32_shdr_t shstrtab; + + static el_section_t bss, data, rodata, text; + +#define SECTION_NAME_MAX 20 + static char section_name[SECTION_NAME_MAX]; + + void *base = K_NULL, *addr_sec2cp; /* ram base for LOAD sections */ + + uint32_t shdr_offset; + + uint32_t shstrtab_offset; + + uint32_t strtab_offset, strtab_size = 0; + uint32_t symtab_offset, symtab_size = 0, symtab_entsize; + + uint32_t text_offset = 0, text_size = 0; + uint32_t data_offset = 0, data_size = 0; + uint32_t rodata_offset = 0, rodata_size = 0; + uint32_t bss_size = 0; + + uint32_t rel_text_offset, rel_text_size = 0, rel_text_entsize; + uint32_t rel_data_offset, rel_data_size = 0, rel_data_entsize; + uint32_t rel_rodata_offset, rel_rodata_size = 0, rel_rodata_entsize; + + uint32_t rela_text_offset, rela_text_size = 0, rela_text_entsize; + uint32_t rela_data_offset, rela_data_size = 0, rela_data_entsize; + uint32_t rela_rodata_offset, rela_rodata_size = 0, rela_rodata_entsize; + + if (!module) { + return ELFLOADER_ERR_PTR_NULL; + } + + memset(module, 0, sizeof(el_module_t)); + + /* read the elf header */ + if (elfloader_fd_read(fd, 0, &ehdr, sizeof(elf32_ehdr_t)) != ELFLOADER_ERR_NONE) { + return ELFLOADER_ERR_FD_READ_FAILED; + } + + /* sanity check, magic verify */ + if (memcmp(ehdr.e_ident, elf_header_magic, sizeof(elf_header_magic)) != 0) { + return ELFLOADER_ERR_HEADER_INVALID; + } + + /* it should be a relocatable object */ + if (ehdr.e_type != ET_REL) { + return ELFLOADER_ERR_TYPE_INVALID; + } + + if (elfloader_fd_read(fd, ehdr.e_shoff + ehdr.e_shentsize * ehdr.e_shstrndx, + &shstrtab, ehdr.e_shentsize) != ELFLOADER_ERR_NONE) { + return ELFLOADER_ERR_FD_READ_FAILED; + } + + shstrtab_offset = shstrtab.sh_offset; + + shdr_offset = ehdr.e_shoff; + + for (i = 0; i < ehdr.e_shnum; ++i) { + if (elfloader_fd_read(fd, shdr_offset, &shdr, sizeof(elf32_shdr_t)) != ELFLOADER_ERR_NONE) { + return ELFLOADER_ERR_FD_READ_FAILED; + } + + if (elfloader_fd_read(fd, shstrtab_offset + shdr.sh_name, section_name, sizeof(section_name)) != ELFLOADER_ERR_NONE) { + return ELFLOADER_ERR_FD_READ_FAILED; + } + + /* + |-----------------------------------------------------| + | Name | sh_type | sh_flag | + |----------|--------------|---------------------------| + | .bss | SHT_NOBITS | SHF_ALLOC + SHF_WRITE | + | .data | SHT_PROGBITS | SHF_ALLOC + SHF_WRITE | + | .rodata | SHT_PROGBITS | SHF_ALLOC | + | .text | SHT_PROGBITS | SHF_ALLOC + SHF_EXECINSTR | + |-----------------------------------------------------| + */ + if (shdr.sh_type == SHT_NULL) { + ; + } else if (shdr.sh_type == SHT_STRTAB) { + strtab_offset = shdr.sh_offset; + strtab_size = shdr.sh_size; + } else if (shdr.sh_type == SHT_SYMTAB) { + symtab_offset = shdr.sh_offset; + symtab_size = shdr.sh_size; + symtab_entsize = shdr.sh_entsize; + } else if (shdr.sh_type == SHT_NOBITS && shdr.sh_flags == (SHF_ALLOC | SHF_WRITE)) { + bss_size = shdr.sh_size; + + bss.shndx = i; + } else if (shdr.sh_type == SHT_PROGBITS && shdr.sh_flags == (SHF_ALLOC | SHF_WRITE)) { + data_offset = shdr.sh_offset; + data_size = shdr.sh_size; + + data.shndx = i; + } else if (shdr.sh_type == SHT_PROGBITS && shdr.sh_flags == SHF_ALLOC) { + rodata_offset = shdr.sh_offset; + rodata_size = shdr.sh_size; + + rodata.shndx = i; + } else if (shdr.sh_type == SHT_PROGBITS && shdr.sh_flags == (SHF_ALLOC | SHF_EXECINSTR)) { + text_offset = shdr.sh_offset; + text_size = shdr.sh_size; + + text.shndx = i; + } else if (shdr.sh_type == SHT_REL && + strncmp(".rel.data", section_name, 9) == 0) { + rel_data_offset = shdr.sh_offset; + rel_data_size = shdr.sh_size; + rel_data_entsize = shdr.sh_entsize; + } else if (shdr.sh_type == SHT_RELA && + strncmp(".rela.data", section_name, 10) == 0) { + rela_data_offset = shdr.sh_offset; + rela_data_size = shdr.sh_size; + rela_data_entsize = shdr.sh_entsize; + } else if (shdr.sh_type == SHT_REL && + (strncmp(".rel.rodata", section_name, 11) == 0 || + strncmp(".rel.constdata", section_name, 14) == 0)) { + rel_rodata_offset = shdr.sh_offset; + rel_rodata_size = shdr.sh_size; + rel_rodata_entsize = shdr.sh_entsize; + } else if (shdr.sh_type == SHT_RELA && + (strncmp(".rela.rodata", section_name, 12) == 0 || + strncmp(".rela.constdata", section_name, 15) == 0)) { + rela_rodata_offset = shdr.sh_offset; + rela_rodata_size = shdr.sh_size; + rela_rodata_entsize = shdr.sh_entsize; + } else if (shdr.sh_type == SHT_REL && + strncmp(".rel.text", section_name, 9) == 0) { + rel_text_offset = shdr.sh_offset; + rel_text_size = shdr.sh_size; + rel_text_entsize = shdr.sh_entsize; + } else if (shdr.sh_type == SHT_RELA && + strncmp(".rela.text", section_name, 10) == 0) { + rela_text_offset = shdr.sh_offset; + rela_text_size = shdr.sh_size; + rela_text_entsize = shdr.sh_entsize; + } + + shdr_offset += ehdr.e_shentsize; + } + + if (symtab_size == 0) { + return ELFLOADER_ERR_NO_SYMTAB; + } + if (strtab_size == 0) { + return ELFLOADER_ERR_NO_STRTAB; + } + if (text_size == 0) { + return ELFLOADER_ERR_NO_TEXT; + } + + base = tos_mmheap_alloc(text_size + data_size + rodata_size + bss_size); + if (!base) { + return ELFLOADER_ERR_OUT_OF_MEMORY; + } + + /* do sections load */ + addr_sec2cp = base; + + if (text_size > 0) { + if (elfloader_fd_read(fd, text_offset, addr_sec2cp, text_size) != ELFLOADER_ERR_NONE) { + err = ELFLOADER_ERR_FD_READ_FAILED; + goto OUT; + } + text.address = addr_sec2cp; + + addr_sec2cp = (void *)((uint32_t)addr_sec2cp + text_size); + } + + if (rodata_size > 0) { + if (elfloader_fd_read(fd, rodata_offset, addr_sec2cp, rodata_size) != ELFLOADER_ERR_NONE) { + err = ELFLOADER_ERR_FD_READ_FAILED; + goto OUT; + } + rodata.address = addr_sec2cp; + + addr_sec2cp = (void *)((uint32_t)addr_sec2cp + rodata_size); + } + + if (data_size > 0) { + if (elfloader_fd_read(fd, data_offset, addr_sec2cp, data_size) != ELFLOADER_ERR_NONE) { + err = ELFLOADER_ERR_FD_READ_FAILED; + goto OUT; + } + data.address = addr_sec2cp; + + addr_sec2cp = (void *)((uint32_t)addr_sec2cp + data_size); + } + + if (bss_size > 0) { + bss.address = addr_sec2cp; + memset(bss.address, 0, bss_size); + } + + if (rel_data_size > 0) { + err = elfloader_relocate(fd, data.address, + bss, data, rodata, text, + rel_data_offset, rel_data_size, rel_data_entsize, + symtab_offset, symtab_size, symtab_entsize, + strtab_offset, strtab_size); + if (err != ELFLOADER_ERR_NONE) { + goto OUT; + } + } + + if (rela_data_size > 0) { + err = elfloader_relocate(fd, data.address, + bss, data, rodata, text, + rela_data_offset, rela_data_size, rela_data_entsize, + symtab_offset, symtab_size, symtab_entsize, + strtab_offset, strtab_size); + if (err != ELFLOADER_ERR_NONE) { + goto OUT; + } + } + + if (rel_rodata_size > 0) { + err = elfloader_relocate(fd, rodata.address, + bss, data, rodata, text, + rel_rodata_offset, rel_rodata_size, rel_rodata_entsize, + symtab_offset, symtab_size, symtab_entsize, + strtab_offset, strtab_size); + if (err != ELFLOADER_ERR_NONE) { + goto OUT; + } + } + + if (rela_rodata_size > 0) { + err = elfloader_relocate(fd, rodata.address, + bss, data, rodata, text, + rela_rodata_offset, rela_rodata_size, rela_rodata_entsize, + symtab_offset, symtab_size, symtab_entsize, + strtab_offset, strtab_size); + if (err != ELFLOADER_ERR_NONE) { + goto OUT; + } + } + + if (rel_text_size > 0) { + err = elfloader_relocate(fd, text.address, + bss, data, rodata, text, + rel_text_offset, rel_text_size, rel_text_entsize, + symtab_offset, symtab_size, symtab_entsize, + strtab_offset, strtab_size); + if (err != ELFLOADER_ERR_NONE) { + goto OUT; + } + } + + if (rela_text_size > 0) { + err = elfloader_relocate(fd, text.address, + bss, data, rodata, text, + rela_text_offset, rela_text_size, rela_text_entsize, + symtab_offset, symtab_size, symtab_entsize, + strtab_offset, strtab_size); + if (err != ELFLOADER_ERR_NONE) { + goto OUT; + } + } + + /* TODO: should do icache/dcahe flush here, sth. like: + + dcache_flush(); + icache_flush(); + + */ + + module->fd = fd; + module->base = base; + + module->info.obj.bss = bss; + module->info.obj.data = data; + module->info.obj.rodata = rodata; + module->info.obj.text = text; + + module->symtab_offset = symtab_offset; + module->symtab_size = symtab_size; + module->symtab_entsize = symtab_entsize; + module->strtab_offset = strtab_offset; + + return ELFLOADER_ERR_NONE; + +OUT: + if (base) { + tos_mmheap_free(base); + } + + return err; +} + +__API__ el_err_t tos_elfloader_unload(el_module_t *module) +{ + if (!module || !module->base) { + return ELFLOADER_ERR_PTR_NULL; + } + + tos_mmheap_free(module->base); + module->base = K_NULL; + + return ELFLOADER_ERR_NONE; +} + +__API__ void *tos_elfloader_find_symbol(el_module_t *module, char *symbol) +{ + return local_symtab_lookup(module->fd, symbol, + module->info.obj.bss, module->info.obj.data, module->info.obj.rodata, module->info.obj.text, + module->symtab_offset, module->symtab_size, module->symtab_entsize, + module->strtab_offset); +} + diff --git a/components/elfloader/shared_object/tos_elfloader_shared_object.c b/components/elfloader/shared_object/tos_elfloader_shared_object.c new file mode 100644 index 0000000000000000000000000000000000000000..57029bf89f89d425eee550e65b4d717d713f7365 --- /dev/null +++ b/components/elfloader/shared_object/tos_elfloader_shared_object.c @@ -0,0 +1,353 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + +#include "tos_elfloader.h" + +__STATIC__ void *local_symtab_lookup(int fd, int32_t load_bias, char *sym_name, + uint32_t symtab_offset, uint32_t symtab_size, uint32_t symtab_entsize, + uint32_t strtab_offset) +{ + int i = 0; + + elf32_sym_t sym; +#define SYMBOL_NAME_MAX 30 + static char name[SYMBOL_NAME_MAX]; + + for (i = 0; i < symtab_size / symtab_entsize; ++i) { + if (elfloader_fd_read(fd, symtab_offset, &sym, sizeof(elf32_sym_t)) != ELFLOADER_ERR_NONE) { + return K_NULL; + } + + if (sym.st_name) { + if (elfloader_fd_read(fd, strtab_offset + sym.st_name, name, sizeof(name)) != ELFLOADER_ERR_NONE) { + return K_NULL; + } + + if (strcmp(name, sym_name) == 0) { + return (void *)(sym.st_value + load_bias); + } + } + + symtab_offset += symtab_entsize; + } + + return K_NULL; +} + +__STATIC__ el_err_t elfloader_relocate(int fd, int32_t load_bias, + uint32_t rel_offset, uint32_t rel_size, uint32_t rel_entsize, + uint32_t symtab_offset, uint32_t symtab_size, uint32_t symtab_entsize, + uint32_t strtab_offset, uint32_t strtab_size) +{ + int i = 0; + elf32_rela_t rela; + + elf32_sym_t sym; + void *addr; +#define SYMBOL_NAME_MAX 30 + static char name[SYMBOL_NAME_MAX]; + + int is_rela = (rel_entsize == sizeof(elf32_rela_t) ? K_TRUE : K_FALSE); + + for (i = 0; i < rel_size / rel_entsize; ++i) { + addr = K_NULL; + + if (elfloader_fd_read(fd, rel_offset, &rela, rel_entsize) != ELFLOADER_ERR_NONE) { + return ELFLOADER_ERR_FD_READ_FAILED; + } + + if (elfloader_fd_read(fd, + symtab_offset + ELF32_R_SYM(rela.r_info) * symtab_entsize, + &sym, + symtab_entsize) != ELFLOADER_ERR_NONE) { + return ELFLOADER_ERR_FD_READ_FAILED; + } + + /* load the symbol's name */ + if (elfloader_fd_read(fd, + strtab_offset + sym.st_name, + name, + sizeof(name)) != ELFLOADER_ERR_NONE) { + return ELFLOADER_ERR_FD_READ_FAILED; + } + + /* an external symbol, or a weak one */ + if (sym.st_shndx == SHN_UNDEF || + ELF32_SYM_TYPE(sym.st_info) == STB_WEAK) { + /* look up in the global symbol table */ + addr = elfloader_symtab_lookup(name); + } + + /* an external symbol but not found in the global symbol table */ + if (sym.st_shndx == SHN_UNDEF && !addr) { + return ELFLOADER_ERR_SYM_NOT_FOUND; + } + + /* an internal symbol, or a weak symbol without STRONG one in global symbol table */ + if (!addr) { + addr = local_symtab_lookup(fd, load_bias, name, + symtab_offset, symtab_size, symtab_entsize, + strtab_offset); + } + + /* still not found */ + if (!addr) { + return ELFLOADER_ERR_SYM_NOT_FOUND; + } + + elfloader_arch_relocate(rela.r_offset + load_bias, load_bias, (uint32_t)addr, &rela, is_rela); + + rel_offset += rel_entsize; + } + + return ELFLOADER_ERR_NONE; +} + +__API__ el_err_t tos_elfloader_load(el_module_t *module, int fd) +{ + int i = 0; + el_err_t err; + elf32_ehdr_t ehdr; + elf32_shdr_t shdr; + elf32_dyn_t dyn; + elf32_phdr_t phdr; + + void *base = K_NULL, *addr_seg2cp; /* ram base for LOAD segments */ + + int32_t load_bias; + + uint32_t shdr_offset, phdr_offset; + + uint32_t vaddr_start = (uint32_t)-1, vaddr_end = 0; + + uint32_t dyn_offset, dyn_size = 0, dyn_entsize; + + uint32_t strtab_offset, strtab_size = 0; + uint32_t symtab_offset, symtab_size = 0, symtab_entsize; + + uint32_t rel_entsize; + uint32_t rel_dyn_offset, rel_dyn_size = 0; + uint32_t rel_plt_offset, rel_plt_size = 0; + + if (!module) { + return ELFLOADER_ERR_PTR_NULL; + } + + memset(module, 0, sizeof(el_module_t)); + + /* read the elf header */ + if (elfloader_fd_read(fd, 0, &ehdr, sizeof(elf32_ehdr_t)) != ELFLOADER_ERR_NONE) { + return ELFLOADER_ERR_FD_READ_FAILED; + } + + /* sanity check, magic verify */ + if (memcmp(ehdr.e_ident, elf_header_magic, sizeof(elf_header_magic)) != 0) { + return ELFLOADER_ERR_HEADER_INVALID; + } + + /* it should be a shared object */ + if (ehdr.e_type != ET_DYN) { + return ELFLOADER_ERR_TYPE_INVALID; + } + + shdr_offset = ehdr.e_shoff; + + for (i = 0; i < ehdr.e_shnum; ++i) { + if (elfloader_fd_read(fd, shdr_offset, &shdr, sizeof(elf32_shdr_t)) != ELFLOADER_ERR_NONE) { + return ELFLOADER_ERR_FD_READ_FAILED; + } + + if (shdr.sh_type == SHT_DYNAMIC) { /* dynamic section, .dynamic */ + dyn_offset = shdr.sh_offset; + dyn_size = shdr.sh_size; + dyn_entsize = shdr.sh_entsize; + } else if (shdr.sh_type == SHT_DYNSYM) { /* .dynsym */ + symtab_size = shdr.sh_size; + } + + shdr_offset += ehdr.e_shentsize; + } + + if (dyn_size == 0) { + return ELFLOADER_ERR_NO_DYN; + } + + if (symtab_size == 0) { + return ELFLOADER_ERR_NO_SYMTAB; + } + + for (i = 0; i < dyn_size / dyn_entsize; ++i) { + if (elfloader_fd_read(fd, dyn_offset, &dyn, sizeof(elf32_dyn_t)) != ELFLOADER_ERR_NONE) { + return ELFLOADER_ERR_FD_READ_FAILED; + } + + if (dyn.d_tag == DT_NULL) { + break; + } else if (dyn.d_tag == DT_SYMTAB) { /* dynamic symbol table */ + symtab_offset = dyn.d_un.d_ptr; + } else if (dyn.d_tag == DT_SYMENT) { /* entry size of symbol table */ + symtab_entsize = dyn.d_un.d_val; + } else if (dyn.d_tag == DT_STRTAB) { /* dynamic string table */ + strtab_offset = dyn.d_un.d_ptr; + } else if (dyn.d_tag == DT_STRSZ) { /* size of dynamic string table */ + strtab_size = dyn.d_un.d_val; + } else if (dyn.d_tag == DT_REL) { /* dynamic relocation table */ + rel_dyn_offset = dyn.d_un.d_ptr; + } else if (dyn.d_tag == DT_RELSZ) { /* size of rel.dyn */ + rel_dyn_size = dyn.d_un.d_val; + } else if (dyn.d_tag == DT_RELENT) { /* entry size of rel.dyn */ + rel_entsize = dyn.d_un.d_val; + } else if (dyn.d_tag == DT_JMPREL) { /* plt relocation table. why NOT DT_PLTREL, confusing */ + rel_plt_offset = dyn.d_un.d_ptr; + } else if (dyn.d_tag == DT_PLTRELSZ) { /* size of rel.plt */ + rel_plt_size = dyn.d_un.d_val; + } + + dyn_offset += dyn_entsize; + } + + if (strtab_size == 0) { + return ELFLOADER_ERR_NO_STRTAB; + } + + phdr_offset = ehdr.e_phoff; + + for (i = 0; i < ehdr.e_phnum; ++i) { + if (elfloader_fd_read(fd, phdr_offset, &phdr, sizeof(elf32_phdr_t)) != ELFLOADER_ERR_NONE) { + return ELFLOADER_ERR_FD_READ_FAILED; + } + + if (phdr.p_type == PHT_LOAD) { + if (phdr.p_vaddr < vaddr_start) { + vaddr_start = phdr.p_vaddr; + } + + if (phdr.p_vaddr + phdr.p_memsz > vaddr_end) { + vaddr_end = phdr.p_vaddr + phdr.p_memsz; + } + } + + phdr_offset += ehdr.e_phentsize; + } + + if (vaddr_start == (uint32_t)-1 || vaddr_end == 0) { + return ELFLOADER_ERR_NO_LOAD_SEGMENTS; + } + + /* reserving memory for LOAD segments */ + base = tos_mmheap_aligned_alloc(vaddr_end - vaddr_start, 64); + if (!base) { + return ELFLOADER_ERR_OUT_OF_MEMORY; + } + + load_bias = (uint32_t)base - vaddr_start; + + /* do segments load */ + phdr_offset = ehdr.e_phoff; + + for (i = 0; i < ehdr.e_phnum; ++i) { + if (elfloader_fd_read(fd, phdr_offset, &phdr, sizeof(elf32_phdr_t)) != ELFLOADER_ERR_NONE) { + err = ELFLOADER_ERR_FD_READ_FAILED; + goto OUT; + } + + if (phdr.p_type == PHT_LOAD) { + addr_seg2cp = (void *)(load_bias + phdr.p_vaddr); + + if (elfloader_fd_read(fd, + phdr.p_offset, + addr_seg2cp, + phdr.p_filesz) != ELFLOADER_ERR_NONE) { + err = ELFLOADER_ERR_FD_READ_FAILED; + goto OUT; + } + + if (phdr.p_memsz > phdr.p_filesz) { + /* clear bss */ + memset((void *)((uint8_t *)addr_seg2cp + phdr.p_filesz), + 0, + phdr.p_memsz - phdr.p_filesz); + } + } + + phdr_offset += ehdr.e_phentsize; + } + + if (rel_dyn_size > 0) { + err = elfloader_relocate(fd, load_bias, + rel_dyn_offset, rel_dyn_size, rel_entsize, + symtab_offset, symtab_size, symtab_entsize, + strtab_offset, strtab_size); + if (err != ELFLOADER_ERR_NONE) { + goto OUT; + } + } + + if (rel_plt_size > 0) { + err = elfloader_relocate(fd, load_bias, + rel_plt_offset, rel_plt_size, rel_entsize, + symtab_offset, symtab_size, symtab_entsize, + strtab_offset, strtab_size); + if (err != ELFLOADER_ERR_NONE) { + goto OUT; + } + } + + /* TODO: should do icache/dcahe flush here, sth. like: + + dcache_flush(); + icache_flush(); + + */ + + module->fd = fd; + module->base = base; + module->info.so.load_bias = load_bias; + module->symtab_offset = symtab_offset; + module->symtab_size = symtab_size; + module->symtab_entsize = symtab_entsize; + module->strtab_offset = strtab_offset; + + return ELFLOADER_ERR_NONE; + +OUT: + if (base) { + tos_mmheap_free(base); + } + + return err; +} + +__API__ el_err_t tos_elfloader_unload(el_module_t *module) +{ + if (!module || !module->base) { + return ELFLOADER_ERR_PTR_NULL; + } + + tos_mmheap_free(module->base); + module->base = K_NULL; + + return ELFLOADER_ERR_NONE; +} + +__API__ void *tos_elfloader_find_symbol(el_module_t *module, char *symbol) +{ + return local_symtab_lookup(module->fd, module->info.so.load_bias, symbol, + module->symtab_offset, module->symtab_size, module->symtab_entsize, + module->strtab_offset); +} + diff --git a/components/fs/vfs/include/tos_vfs.h b/components/fs/vfs/include/tos_vfs.h index 1b99a373cd6e6ce733462f2b7964030c09f2919b..555b6179c11180fee16978061867d7263c5b64d3 100644 --- a/components/fs/vfs/include/tos_vfs.h +++ b/components/fs/vfs/include/tos_vfs.h @@ -1,3 +1,20 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + #ifndef _TOS_VFS_H_ #define _TOS_VFS_H_ diff --git a/components/fs/vfs/include/tos_vfs_device.h b/components/fs/vfs/include/tos_vfs_device.h index 751e5363c774be0689f2815ef804c37207407c13..15d62f4e35a641df99e1914481d685c03160ca69 100644 --- a/components/fs/vfs/include/tos_vfs_device.h +++ b/components/fs/vfs/include/tos_vfs_device.h @@ -1,3 +1,20 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + #ifndef _TOS_VFS_DEVICE_H_ #define _TOS_VFS_DEVICE_H_ diff --git a/components/fs/vfs/include/tos_vfs_err.h b/components/fs/vfs/include/tos_vfs_err.h index 906b222a4f6d9d1b0647f33ceadb42e89b4cd14d..028f5b479cfaffb7ad480b92deaadd786e08aaa5 100644 --- a/components/fs/vfs/include/tos_vfs_err.h +++ b/components/fs/vfs/include/tos_vfs_err.h @@ -1,3 +1,20 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + #ifndef _TOS_VFS_ERR_H_ #define _TOS_VFS_ERR_H_ diff --git a/components/fs/vfs/include/tos_vfs_file.h b/components/fs/vfs/include/tos_vfs_file.h index a267720118e47f6c00fe30d3b175417f0d5e408f..85399d2e28242f242b5dd04c833a109427779f7c 100644 --- a/components/fs/vfs/include/tos_vfs_file.h +++ b/components/fs/vfs/include/tos_vfs_file.h @@ -1,3 +1,20 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + #ifndef _TOS_VFS_FILE_H_ #define _TOS_VFS_FILE_H_ @@ -10,13 +27,13 @@ typedef struct vfs_inode_st vfs_inode_t; #define VFS_PATH_MAX 31 // open flags(vfs_oflag_t): open method flags (3rd argument of tos_vfs_open) -#define VFS_OFLAG_READ 0x01 -#define VFS_OFLAG_WRITE 0x02 -#define VFS_OFLAG_EXISTING 0x00 -#define VFS_OFLAG_CREATE_NEW 0x04 -#define VFS_OFLAG_CREATE_ALWAYS 0x08 -#define VFS_OFLAG_OPEN_ALWAYS 0x10 -#define VFS_OFLAG_OPEN_APPEND 0x30 +#define VFS_OFLAG_READ 0x01 +#define VFS_OFLAG_WRITE 0x02 +#define VFS_OFLAG_EXISTING 0x00 +#define VFS_OFLAG_CREATE_NEW 0x04 +#define VFS_OFLAG_CREATE_ALWAYS 0x08 +#define VFS_OFLAG_OPEN_ALWAYS 0x10 +#define VFS_OFLAG_OPEN_APPEND 0x30 typedef enum vfs_whence_en { VFS_SEEK_SET, /* the offset is set to offset bytes */ diff --git a/components/fs/vfs/include/tos_vfs_fs.h b/components/fs/vfs/include/tos_vfs_fs.h index 7e20942c3e642993042531aa2810fa991a584846..4c0c3e0751bcb57f877047489b29e7da4d5f9353 100644 --- a/components/fs/vfs/include/tos_vfs_fs.h +++ b/components/fs/vfs/include/tos_vfs_fs.h @@ -1,3 +1,20 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + #ifndef _TOS_VFS_FS_H_ #define _TOS_VFS_FS_H_ diff --git a/components/fs/vfs/include/tos_vfs_inode.h b/components/fs/vfs/include/tos_vfs_inode.h index 1934207e8ac550c244bfc99d7c0f85deb5b403ad..e0a9270a5b942b408c881490bda3fcb7c62dcd71 100644 --- a/components/fs/vfs/include/tos_vfs_inode.h +++ b/components/fs/vfs/include/tos_vfs_inode.h @@ -1,3 +1,20 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + #ifndef _TOS_VFS_INODE_H_ #define _TOS_VFS_INODE_H_ diff --git a/components/fs/vfs/include/tos_vfs_types.h b/components/fs/vfs/include/tos_vfs_types.h index bd02ce9f49e06b67764ca54dfa94b8257c13aa21..9982e5e0d97f7d1476f42e9191fbd7853347d8d7 100644 --- a/components/fs/vfs/include/tos_vfs_types.h +++ b/components/fs/vfs/include/tos_vfs_types.h @@ -1,7 +1,24 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + #ifndef _TOS_VFS_TYPES_H_ #define _TOS_VFS_TYPES_H_ -typedef void VFS_DIR; +typedef void VFS_DIR; typedef int32_t vfs_off_t; typedef uint32_t vfs_oflag_t; @@ -10,4 +27,5 @@ typedef uint32_t vfs_oflag_t; #define ssize_t int #endif -#endif +#endif /* _TOS_VFS_TYPES_H_ */ + diff --git a/components/fs/vfs/tos_vfs.c b/components/fs/vfs/tos_vfs.c index 972462fe822fd50a934ddcd79cd55d606d0da996..01352c25550ce0aaedf3fd6bcb847cf4516461e9 100644 --- a/components/fs/vfs/tos_vfs.c +++ b/components/fs/vfs/tos_vfs.c @@ -1,3 +1,20 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + #include "tos_vfs.h" __API__ int tos_vfs_open(const char *pathname, vfs_oflag_t flags) diff --git a/components/fs/vfs/tos_vfs_device.c b/components/fs/vfs/tos_vfs_device.c index 320d29afd7248258ff53741944673b31a46576b3..35de3609f005642a8185356f316457d06163fa1b 100644 --- a/components/fs/vfs/tos_vfs_device.c +++ b/components/fs/vfs/tos_vfs_device.c @@ -1,3 +1,20 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + #include "tos_vfs.h" vfs_err_t tos_vfs_block_device_register(const char *device_name, vfs_blkdev_ops_t *ops) diff --git a/components/fs/vfs/tos_vfs_file.c b/components/fs/vfs/tos_vfs_file.c index 89cb8a0049bde57eb517b29200de19c644907c53..ce45e627f3e9b6aa460e257d5a5166a2e3565000 100644 --- a/components/fs/vfs/tos_vfs_file.c +++ b/components/fs/vfs/tos_vfs_file.c @@ -1,3 +1,20 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + #include "tos_vfs.h" __STATIC__ vfs_file_t vfs_file_pool[VFS_FILE_OPEN_MAX] = { { K_NULL, 0 } }; diff --git a/components/fs/vfs/tos_vfs_fs.c b/components/fs/vfs/tos_vfs_fs.c index 524037ca521cf40e158b75a016f2e524fbc7d4dc..bad11afa9a545d0de5948f650bed86c643295283 100644 --- a/components/fs/vfs/tos_vfs_fs.c +++ b/components/fs/vfs/tos_vfs_fs.c @@ -1,3 +1,20 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + #include "tos_vfs.h" extern k_list_t k_vfs_fsmap_list; diff --git a/components/fs/vfs/tos_vfs_inode.c b/components/fs/vfs/tos_vfs_inode.c index 4051c099cc374c3af906f7fc6777c736b186dd38..24e4fad3d8596f623676d79020c77d01b79ce1c3 100644 --- a/components/fs/vfs/tos_vfs_inode.c +++ b/components/fs/vfs/tos_vfs_inode.c @@ -1,3 +1,20 @@ +/*---------------------------------------------------------------------------- + * Tencent is pleased to support the open source community by making TencentOS + * available. + * + * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. + * If you have downloaded a copy of the TencentOS binary from Tencent, please + * note that the TencentOS binary is licensed under the BSD 3-Clause License. + * + * If you have downloaded a copy of the TencentOS source code from Tencent, + * please note that TencentOS source code is licensed under the BSD 3-Clause + * License, except for the third-party components listed below which are + * subject to different license terms. Your integration of TencentOS into your + * own projects may require compliance with the BSD 3-Clause License, as well + * as the other licenses applicable to the third-party components included + * within TencentOS. + *---------------------------------------------------------------------------*/ + #include "tos_vfs.h" __STATIC__ TOS_LIST_DEFINE(k_vfs_inode_list); diff --git a/examples/elfloader_relocatable_object/elfloader_relocatable_object.c b/examples/elfloader_relocatable_object/elfloader_relocatable_object.c new file mode 100644 index 0000000000000000000000000000000000000000..152a86bca52002a39953fadae4514e44d2a483c7 --- /dev/null +++ b/examples/elfloader_relocatable_object/elfloader_relocatable_object.c @@ -0,0 +1,100 @@ +#include "tos_k.h" +#include "tos_hal.h" +#include "ff.h" +#include "tos_vfs.h" +#include "tos_fatfs_drv.h" +#include "tos_fatfs_vfs.h" + +#include "tos_elfloader.h" + +int d_e_a = 9; + +int f_e_a(int a) +{ + /* a = d_e_a + d_g_a = d_e_a + 15 = 24 */ + printf("f_e_a: %d\n", a); + return 0; +} + +const el_symbol_t el_symbols[] = { + { "d_e_a", &d_e_a }, + { "f_e_a", f_e_a }, + { K_NULL, K_NULL }, +}; + +/* + step1: create 1.c + + extern int d_e_a; + + int d_g_a = 3; + + static int d_s_a = 5; + + extern int f_e_a(int); + + static int f_s_a(void) { + d_s_a += 7; // d_s_a = 12 + } + + int f_g_a(void) { + f_s_a(); + + d_g_a += d_s_a; // d_g_a = 15 + + d_e_a += d_g_a; // + 15 + + f_e_a(d_e_a); + } + + step2: compile 1.c to 1.o + arm-linux-gnueabihf-gcc -fno-builtin -nostdlib -mthumb -mthumb-interwork -mcpu=cortex-m4 -c 1.c -o 1.o + */ + +void application_entry(void *arg) +{ + int fd; + el_module_t module; + + extern vfs_blkdev_ops_t sd_dev; + extern vfs_fs_ops_t fatfs_ops; + + if (tos_vfs_block_device_register("/dev/sd", &sd_dev) != VFS_ERR_NONE) { + return; + } + + if (tos_vfs_fs_register("fatfs_sd", &fatfs_ops) != VFS_ERR_NONE) { + return; + } + + if (tos_vfs_fs_mount("/dev/sd", "/fs/fatfs_sd", "fatfs_sd") != VFS_ERR_NONE) { + printf("mount failed!\n"); + return; + } + + fd = tos_vfs_open("/fs/fatfs_sd/1.o", VFS_OFLAG_READ | VFS_OFLAG_EXISTING); + if (fd < 0) { + return; + } + + if (tos_elfloader_load(&module, fd) != ELFLOADER_ERR_NONE) { + return; + } + + void *addr = tos_elfloader_find_symbol(&module, "f_g_a"); + if (!addr) { + printf("symbol NOT FOUND: %s\n", "f_g_a"); + return; + } + + printf("addr: %x\n", addr); + + typedef int (*fp_t)(void); + /* call f_g_a in 1.o */ + ((fp_t)addr)(); + + tos_elfloader_unload(&module); + + tos_vfs_close(fd); +} + diff --git a/examples/elfloader_shared_object/elfloader_shared_object.c b/examples/elfloader_shared_object/elfloader_shared_object.c new file mode 100644 index 0000000000000000000000000000000000000000..f42724258ebdb2aa0767cd2f5d1430b816dcef4e --- /dev/null +++ b/examples/elfloader_shared_object/elfloader_shared_object.c @@ -0,0 +1,103 @@ +#include "tos_k.h" +#include "tos_hal.h" +#include "ff.h" +#include "tos_vfs.h" +#include "tos_fatfs_drv.h" +#include "tos_fatfs_vfs.h" + +#include "tos_elfloader.h" + +int d_e_a = 9; + +int f_e_a(int a) +{ + /* a = d_e_a + d_g_a = d_e_a + 15 = 24 */ + printf("f_e_a: %d\n", a); + return 0; +} + +const el_symbol_t el_symbols[] = { + { "d_e_a", &d_e_a }, + { "f_e_a", f_e_a }, + { K_NULL, K_NULL }, +}; + +/* + step1: create 1.c + + extern int d_e_a; + + int d_g_a = 3; + + static int d_s_a = 5; + + extern int f_e_a(int); + + static int f_s_a(void) { + d_s_a += 7; // d_s_a = 12 + } + + int f_g_a(void) { + f_s_a(); + + d_g_a += d_s_a; // d_g_a = 15 + + d_e_a += d_g_a; // + 15 + + f_e_a(d_e_a); + } + + step2: compile 1.c to 1.o + arm-linux-gnueabihf-gcc -fno-builtin -nostdlib -mthumb -mthumb-interwork -fPIC -mcpu=cortex-m4 -c 1.c -o 1.o + + step3: ld 1.o to 1.so + arm-linux-gnueabihf-ld -fno-builtin -nostdlib -fPIC -shared -z max-page-size=0x4 1.o -o 1.so + */ + +void application_entry(void *arg) +{ + int fd; + el_module_t module; + + extern vfs_blkdev_ops_t sd_dev; + extern vfs_fs_ops_t fatfs_ops; + + if (tos_vfs_block_device_register("/dev/sd", &sd_dev) != VFS_ERR_NONE) { + return; + } + + if (tos_vfs_fs_register("fatfs_sd", &fatfs_ops) != VFS_ERR_NONE) { + return; + } + + if (tos_vfs_fs_mount("/dev/sd", "/fs/fatfs_sd", "fatfs_sd") != VFS_ERR_NONE) { + printf("mount failed!\n"); + return; + } + + fd = tos_vfs_open("/fs/fatfs_sd/1.so", VFS_OFLAG_READ | VFS_OFLAG_EXISTING); + if (fd < 0) { + return; + } + + if (tos_elfloader_load(&module, fd) != ELFLOADER_ERR_NONE) { + return; + } + + void *addr = tos_elfloader_find_symbol(&module, "f_g_a"); + if (!addr) { + printf("symbol NOT FOUND: %s\n", "f_g_a"); + return; + } + + printf("addr: %x\n", addr); + + typedef int (*fp_t)(void); + /* call f_g_a in 1.so */ + ((fp_t)addr)(); + + tos_elfloader_unload(&module); + + tos_vfs_close(fd); +} + diff --git a/kernel/core/include/tos_k.h b/kernel/core/include/tos_k.h index 1de7f7516ae7287a7e9f574d9d269c391d3cd5d4..38249227e6b1dbbbd7dc25aea14c9f66173907da 100644 --- a/kernel/core/include/tos_k.h +++ b/kernel/core/include/tos_k.h @@ -19,7 +19,7 @@ #define _TOS_K_H_ #include -#include +#include #include #include #include diff --git a/kernel/core/include/tos_err.h b/kernel/core/include/tos_kerr.h similarity index 100% rename from kernel/core/include/tos_err.h rename to kernel/core/include/tos_kerr.h