1 /* 2 * Copyright (C) 2015-2017 Alibaba Group Holding Limited 3 */ 4 5 #ifndef AOS_INIT_H 6 #define AOS_INIT_H 7 8 #include <stdbool.h> 9 10 /** @defgroup init_aos_api init 11 * @{ 12 */ 13 14 /* aos_component_init初始化参数 */ 15 typedef struct { 16 int argc; /**< 参数个数 */ 17 char **argv; /**< 参数内容 */ 18 19 bool cli_enable; /**< cli是否初始化生效 */ 20 } kinit_t; 21 22 /** 23 * aos 基础模块初始化. 24 * 25 * @param[in] kinit kinit_t类型的初始化参数. 26 * 27 * @return 固定返回0. 28 */ 29 extern int aos_components_init(kinit_t *kinit); 30 31 #ifndef AOS_BINS 32 /** 33 * 定义了用户app的入口函数形式定义。该函数由用户在app内自定义实现。 34 * 35 * @param[in] argc aos_components_init时传入的参数数目. 36 * @param[in] argv aos_components_init时传入的参数内容. 37 * 38 * @return 用户自定义. 39 */ 40 extern int application_start(int argc, char **argv); 41 #endif 42 43 /** 44 * @} 45 */ 46 47 /** 48 * AOS_BINS是多bin功能,HAAS单板不使用。 49 */ 50 51 #ifdef AOS_BINS 52 #include <k_api.h> 53 54 struct app_info_t { 55 void (*app_entry)(void *ksyscall_tbl, void *fsyscall_tbl, int argc, char *argv[]); 56 unsigned int data_ram_start; 57 unsigned int data_ram_end; 58 unsigned int data_flash_begin; 59 unsigned int bss_start; 60 unsigned int bss_end; 61 unsigned int heap_start; 62 unsigned int heap_end; 63 }; 64 65 struct framework_info_t { 66 void (*framework_entry)(void *syscall_tbl, int argc, char *argv[]); 67 unsigned int data_ram_start; 68 unsigned int data_ram_end; 69 unsigned int data_flash_begin; 70 unsigned int bss_start; 71 unsigned int bss_end; 72 unsigned int heap_start; 73 unsigned int heap_end; 74 }; 75 76 struct m_app_info_t { 77 void (*app_entry)(void *ksyscall_tbl, int argc, char *argv[]); 78 unsigned int data_ram_start; 79 unsigned int data_ram_end; 80 unsigned int data_flash_begin; 81 unsigned int bss_start; 82 unsigned int bss_end; 83 unsigned int heap_start; 84 unsigned int heap_end; 85 /* reserve for other */ 86 unsigned int reserve0; 87 unsigned int reserve1; 88 /* this bin_type must be here, 0x28, uniform with single bin & kernel bin, 89 arm cortex not used */ 90 unsigned int bin_type; 91 unsigned int reserve2; 92 unsigned int reserve3; 93 unsigned int reserve4; 94 unsigned int reserve5; 95 unsigned int reserve6; 96 }; 97 98 #endif 99 100 #endif /* AOS_INIT_H */ 101