!33 OpenHarmony LiteOS-A QEMU support
Merge pull request !33 from WojciechZmuda/qemu-arm-dev
This commit is contained in:
commit
58da2cb0c2
6
Kconfig
6
Kconfig
|
@ -42,11 +42,11 @@ choice
|
|||
|
||||
config COMPILER_HIMIX_32
|
||||
bool "arm-linux-ohoseabi"
|
||||
depends on PLATFORM_HI3518EV300 || PLATFORM_HI3516DV300
|
||||
depends on PLATFORM_HI3518EV300 || PLATFORM_HI3516DV300 || PLATFORM_QEMU_ARM_VIRT_CA7
|
||||
|
||||
config COMPILER_CLANG_LLVM
|
||||
bool "clang-llvm"
|
||||
depends on PLATFORM_HI3518EV300 || PLATFORM_HI3516DV300
|
||||
depends on PLATFORM_HI3518EV300 || PLATFORM_HI3516DV300 || PLATFORM_QEMU_ARM_VIRT_CA7
|
||||
|
||||
endchoice
|
||||
endmenu
|
||||
|
@ -274,7 +274,7 @@ config VM_OVERLAP_CHECK
|
|||
config NULL_ADDRESS_PROTECT
|
||||
bool "Enable NULL Address protect"
|
||||
default n
|
||||
depends on (PLATFORM_HI3518EV200 || PLATFORM_HI3516CV300 || PLATFORM_HI3518EV300 || PLATFORM_HI3516DV300) && DEBUG_VERSION
|
||||
depends on (PLATFORM_HI3518EV200 || PLATFORM_HI3516CV300 || PLATFORM_HI3518EV300 || PLATFORM_HI3516DV300 || PLATFORM_QEMU_ARM_VIRT_CA7) && DEBUG_VERSION
|
||||
help
|
||||
Answer Y to set mem address 0~1M prohibit to access, read or write will trigger exception.
|
||||
|
||||
|
|
13
Makefile
13
Makefile
|
@ -59,6 +59,9 @@ endif
|
|||
ifeq ($(LOSCFG_PLATFORM_HI3516DV300), y)
|
||||
FSTYPE = vfat
|
||||
endif
|
||||
ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y)
|
||||
FSTYPE = vfat
|
||||
endif
|
||||
ROOTFS_DIR = $(OUT)/rootfs
|
||||
ROOTFS_ZIP = $(OUT)/rootfs.zip
|
||||
VERSION =
|
||||
|
@ -97,13 +100,20 @@ endif
|
|||
##### make dynload #####
|
||||
-include $(LITEOS_MK_PATH)/dynload.mk
|
||||
|
||||
ifeq ($(findstring y, $(LOSCFG_PLATFORM_HI3518EV300)$(LOSCFG_PLATFORM_HI3516DV300)), y)
|
||||
VENDOR_BOARD_INCLUDE := $(LITEOSTOPDIR)/../../vendor/hisi/hi35xx/$(LITEOS_PLATFORM)/config/board
|
||||
else ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y)
|
||||
VENDOR_BOARD_INCLUDE := $(LITEOSTOPDIR)/../../device/qemu/arm/$(LITEOS_PLATFORM)/config/board
|
||||
else
|
||||
$(error "No VENDOR_BOARD_INCLUDE defined")
|
||||
endif
|
||||
#-----need move when make version-----#
|
||||
##### make lib #####
|
||||
$(__LIBS): $(OUT) $(CXX_INCLUDE)
|
||||
|
||||
$(OUT): $(LITEOS_MENUCONFIG_H)
|
||||
$(HIDE)mkdir -p $(OUT)/lib
|
||||
$(HIDE)$(CC) -I$(LITEOS_PLATFORM_BASE)/include -I$(LITEOSTOPDIR)/../../vendor/hisi/hi35xx/$(LITEOS_PLATFORM)/config/board \
|
||||
$(HIDE)$(CC) -I$(LITEOS_PLATFORM_BASE)/include -I$(VENDOR_BOARD_INCLUDE) \
|
||||
-E $(LITEOS_PLATFORM_BASE)/board.ld.S \
|
||||
-o $(LITEOS_PLATFORM_BASE)/board.ld -P
|
||||
|
||||
|
@ -126,6 +136,7 @@ menuconfig:$(MENUCONFIG_PATH)/mconf
|
|||
|
||||
genconfig:$(MENUCONFIG_PATH)/conf
|
||||
$(HIDE)mkdir -p include/config include/generated
|
||||
$< --olddefconfig $(KCONFIG_FILE_PATH)
|
||||
$< --silentoldconfig $(KCONFIG_FILE_PATH)
|
||||
-mv -f $(LITEOS_MENUCONFIG_H) $(LITEOS_PLATFORM_MENUCONFIG_H)
|
||||
##### menuconfig end #######
|
||||
|
|
|
@ -35,6 +35,7 @@ LOCAL_SRCS := $(wildcard src/*.c) $(wildcard src/*.S)
|
|||
LOCAL_INCLUDE := \
|
||||
-I $(LITEOSTOPDIR)/kernel/base/include \
|
||||
-I $(LITEOSTOPDIR)/kernel/extended/include \
|
||||
-I $(LITEOSTOPDIR)/kernel/extended/dynload/include \
|
||||
-I $(LITEOSTOPDIR)/arch/arm/arm/include \
|
||||
|
||||
ifeq ($(LITEOS_ARM_ARCH), -march=armv7-a)
|
||||
|
|
|
@ -57,7 +57,11 @@
|
|||
.global _osExceptPrefetchAbortHdl
|
||||
.global _osExceptSwiHdl
|
||||
.global _osExceptUndefInstrHdl
|
||||
#if defined(LOSCFG_CC_STACKPROTECTOR_ALL) || \
|
||||
defined(LOSCFG_CC_STACKPROTECTOR_STRONG) || \
|
||||
defined(LOSCFG_CC_STACKPROTECTOR)
|
||||
.global __stack_chk_guard_setup
|
||||
#endif
|
||||
|
||||
|
||||
.fpu vfpv4
|
||||
|
@ -147,15 +151,22 @@
|
|||
.endm
|
||||
#endif
|
||||
|
||||
#if defined(LOSCFG_CC_STACKPROTECTOR_ALL) || \
|
||||
defined(LOSCFG_CC_STACKPROTECTOR_STRONG) || \
|
||||
defined(LOSCFG_CC_STACKPROTECTOR)
|
||||
@ Description: Stack-Protector Init
|
||||
__stack_chk_guard_setup:
|
||||
PUSH {FP, LR}
|
||||
#if defined(LOSCFG_PLATFORM_HI3516DV300) || defined(LOSCFG_PLATFORM_HI3518EV300)
|
||||
/* Randomize __stack_chk_quard using platform-specific function. */
|
||||
BL OsRandomStackGuard
|
||||
LDR R1, =__stack_chk_guard
|
||||
MOV R3, R0
|
||||
ORR R2, R3, #0X80000000
|
||||
STR R2, [R1]
|
||||
#endif
|
||||
POP {FP, PC}
|
||||
#endif
|
||||
|
||||
@ Description: Undefined instruction exception handler
|
||||
_osExceptUndefInstrHdl:
|
||||
|
|
|
@ -33,6 +33,10 @@ MODULE_NAME := $(notdir $(shell pwd))
|
|||
|
||||
LOCAL_SRCS := $(wildcard src/*.c)
|
||||
|
||||
ifneq ($(LOSCFG_HRTIMER_ENABLE), y)
|
||||
LOCAL_SRCS := $(filter-out src/linux_hrtimer.c, $(LOCAL_SRCS))
|
||||
endif
|
||||
|
||||
LOCAL_INCLUDE := \
|
||||
-I $(LITEOSTOPDIR)/kernel/base/include \
|
||||
-I $(LITEOSTOPDIR)/bsd/compat/linuxkpi/include
|
||||
|
|
|
@ -47,6 +47,8 @@
|
|||
|
||||
#endif
|
||||
|
||||
#include "pthread.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
#if __cplusplus
|
||||
extern "C" {
|
||||
|
|
|
@ -34,7 +34,6 @@
|
|||
#include "stdlib.h"
|
||||
#include "unistd.h"
|
||||
#include "sys/mount.h"
|
||||
#include "pthread.h"
|
||||
#include "linux/spinlock.h"
|
||||
#include "inode/inode.h"
|
||||
|
||||
|
|
|
@ -46,8 +46,8 @@ enum DmaMemType {
|
|||
DMA_NOCACHE
|
||||
};
|
||||
|
||||
#define IS_PERIPH_ADDR(addr) ((addr >= PERIPH_PMM_BASE) && (addr <= PERIPH_PMM_BASE + PERIPH_PMM_SIZE))
|
||||
#define IS_MEMORY_ADDR(addr) ((addr >= DDR_MEM_ADDR) && (addr <= DDR_MEM_ADDR + DDR_MEM_SIZE))
|
||||
#define IS_PERIPH_ADDR(addr) (((addr) >= U32_C(PERIPH_PMM_BASE)) && ((addr) <= U32_C(PERIPH_PMM_BASE) + U32_C(PERIPH_PMM_SIZE)))
|
||||
#define IS_MEMORY_ADDR(addr) (((addr) >= U32_C(DDR_MEM_ADDR)) && ((addr) <= U32_C(DDR_MEM_ADDR) + U32_C(DDR_MEM_SIZE)))
|
||||
|
||||
/* thread safety */
|
||||
VOID *LOS_DmaMemAlloc(DMA_ADDR_T *dmaAddr, size_t size, size_t align, enum DmaMemType type);
|
||||
|
|
|
@ -40,11 +40,11 @@ extern "C" {
|
|||
#endif /* __cplusplus */
|
||||
#endif /* __cplusplus */
|
||||
|
||||
#define DEFINE_(X) X##U
|
||||
#define DEFINE(X) DEFINE_(X)
|
||||
#define _U32_C(X) X##U
|
||||
#define U32_C(X) _U32_C(X)
|
||||
|
||||
#define KERNEL_VMM_BASE DEFINE(KERNEL_VADDR_BASE)
|
||||
#define KERNEL_VMM_SIZE DEFINE(KERNEL_VADDR_SIZE)
|
||||
#define KERNEL_VMM_BASE U32_C(KERNEL_VADDR_BASE)
|
||||
#define KERNEL_VMM_SIZE U32_C(KERNEL_VADDR_SIZE)
|
||||
|
||||
#define KERNEL_ASPACE_BASE KERNEL_VMM_BASE
|
||||
#define KERNEL_ASPACE_SIZE KERNEL_VMM_SIZE
|
||||
|
@ -57,11 +57,11 @@ extern "C" {
|
|||
#define VMALLOC_SIZE 0x08000000
|
||||
|
||||
#define PERIPH_DEVICE_BASE (VMALLOC_START + VMALLOC_SIZE)
|
||||
#define PERIPH_DEVICE_SIZE PERIPH_PMM_SIZE
|
||||
#define PERIPH_DEVICE_SIZE U32_C(PERIPH_PMM_SIZE)
|
||||
#define PERIPH_CACHED_BASE (PERIPH_DEVICE_BASE + PERIPH_DEVICE_SIZE)
|
||||
#define PERIPH_CACHED_SIZE PERIPH_PMM_SIZE
|
||||
#define PERIPH_CACHED_SIZE U32_C(PERIPH_PMM_SIZE)
|
||||
#define PERIPH_UNCACHED_BASE (PERIPH_CACHED_BASE + PERIPH_CACHED_SIZE)
|
||||
#define PERIPH_UNCACHED_SIZE PERIPH_PMM_SIZE
|
||||
#define PERIPH_UNCACHED_SIZE U32_C(PERIPH_PMM_SIZE)
|
||||
|
||||
#define IO_DEVICE_ADDR(paddr) (paddr - PERIPH_PMM_BASE + PERIPH_DEVICE_BASE)
|
||||
#define IO_CACHED_ADDR(paddr) (paddr - PERIPH_PMM_BASE + PERIPH_CACHED_BASE)
|
||||
|
|
|
@ -35,7 +35,14 @@
|
|||
#include "los_printf.h"
|
||||
#include "los_task_pri.h"
|
||||
#include "los_process_pri.h"
|
||||
|
||||
#ifdef LOSCFG_BASE_CORE_HILOG
|
||||
#include "log.h"
|
||||
#else
|
||||
#define HILOG_INFO(type, fmt, ...) PRINT_INFO(fmt, __VA_ARGS__)
|
||||
#define HILOG_ERROR(type, fmt, ...) PRINT_ERR(fmt, __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#ifdef LOSCFG_SHELL
|
||||
#include "shcmd.h"
|
||||
#include "shell.h"
|
||||
|
|
|
@ -132,6 +132,11 @@ extern "C" {
|
|||
extern UINT32 OsSystemInit(VOID);
|
||||
extern VOID SystemInit(VOID);
|
||||
|
||||
VOID __attribute__((weak)) SystemInit(VOID)
|
||||
{
|
||||
PRINT_WARN("Function not implemented. Using weak reference stub\n");
|
||||
}
|
||||
|
||||
LITE_OS_SEC_TEXT_INIT VOID osRegister(VOID)
|
||||
{
|
||||
g_sysClock = OS_SYS_CLOCK;
|
||||
|
@ -205,7 +210,17 @@ LITE_OS_SEC_TEXT_INIT STATIC VOID OsDriverHiEventInit(VOID)
|
|||
extern void configure (void);
|
||||
LITE_OS_SEC_TEXT_INIT STATIC INT32 OsBsdInit(VOID)
|
||||
{
|
||||
/*
|
||||
* WORKAROUND: Inside configure(), nexus_init() function calls
|
||||
* HiSi-specific, library procedure - machine_resource_init().
|
||||
* The latter one is defined in libhi35xx_bsp.a which is only
|
||||
* available for Hi3516 and Hi3518.
|
||||
* Temporarily ifdef configure until this routine is implemented
|
||||
* by other platforms.
|
||||
*/
|
||||
#if defined(LOSCFG_PLATFORM_HI3516DV300) || defined(LOSCFG_PLATFORM_HI3518EV300)
|
||||
configure();
|
||||
#endif
|
||||
mi_startup(SI_SUB_ARCH_INIT);
|
||||
return LOS_OK;
|
||||
}
|
||||
|
|
|
@ -232,6 +232,17 @@ STATIC INT32 GetArgs(CHAR **args)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7
|
||||
/*
|
||||
* TODO: Implement method of fetching bootargs for
|
||||
* Qemu ARM virtual platform. If used without
|
||||
* bootloader it will pass DTB by default.
|
||||
*/
|
||||
(void)ret;
|
||||
PRINT_ERR("Fetching bootargs unimplemented.\n");
|
||||
goto ERROUT;
|
||||
#endif
|
||||
|
||||
for (i = 0; i < COMMAND_LINE_SIZE; i += len + 1) {
|
||||
len = strlen(cmdLine + i);
|
||||
tmp = strstr(cmdLine + i, bootargName);
|
||||
|
|
|
@ -30,13 +30,13 @@
|
|||
*/
|
||||
|
||||
#include "los_user_init.h"
|
||||
|
||||
#ifdef LOSCFG_KERNEL_DYNLOAD
|
||||
#include "los_syscall.h"
|
||||
|
||||
#define SYS_CALL_VALUE 0x900001
|
||||
|
||||
#ifdef LOSCFG_KERNEL_DYNLOAD
|
||||
LITE_USER_SEC_RODATA STATIC CHAR *g_initPath = "/bin/init";
|
||||
#endif
|
||||
|
||||
LITE_USER_SEC_TEXT STATIC UINT32 sys_call3(UINT32 nbr, UINT32 parm1, UINT32 parm2, UINT32 parm3)
|
||||
{
|
||||
|
@ -55,6 +55,7 @@ LITE_USER_SEC_TEXT STATIC UINT32 sys_call3(UINT32 nbr, UINT32 parm1, UINT32 parm
|
|||
|
||||
return reg0;
|
||||
}
|
||||
#endif
|
||||
|
||||
LITE_USER_SEC_ENTRY VOID OsUserInit(VOID *args)
|
||||
{
|
||||
|
|
|
@ -2,6 +2,7 @@ config PLATFORM
|
|||
string
|
||||
default "hi3516dv300" if PLATFORM_HI3516DV300
|
||||
default "hi3518ev300" if PLATFORM_HI3518EV300
|
||||
default "virt" if PLATFORM_QEMU_ARM_VIRT_CA7
|
||||
|
||||
choice
|
||||
prompt "Board"
|
||||
|
@ -10,6 +11,8 @@ choice
|
|||
IPC has several chips:
|
||||
hi3516dv300
|
||||
hi3518ev300
|
||||
Qemu ARM Virt variants (based on different CPU types):
|
||||
qemu_arm_virt_ca7
|
||||
|
||||
config PLATFORM_HI3516DV300
|
||||
bool "hi3516dv300"
|
||||
|
@ -19,6 +22,12 @@ config PLATFORM_HI3518EV300
|
|||
bool "hi3518ev300"
|
||||
select ARCH_CORTEX_A7
|
||||
|
||||
config PLATFORM_QEMU_ARM_VIRT_CA7
|
||||
bool "qemu_arm_virt_ca7"
|
||||
select ARCH_CORTEX_A7
|
||||
help
|
||||
QEMU ARM Virtual Platform using Cortex-A7 CPU.
|
||||
|
||||
endchoice
|
||||
|
||||
config TEE_ENABLE
|
||||
|
@ -47,3 +56,10 @@ config PLATFORM_BSP_GIC_V3
|
|||
General Interrupt Controller version 3.
|
||||
|
||||
endchoice
|
||||
|
||||
config HRTIMER_ENABLE
|
||||
bool "HR TIMER enable"
|
||||
default y
|
||||
help
|
||||
Enable High-resolution timer support
|
||||
|
||||
|
|
|
@ -33,19 +33,28 @@ MODULE_NAME := bsp
|
|||
|
||||
LOCAL_SRCS = $(wildcard $(HWI_SRC)/*.c) \
|
||||
$(wildcard $(TIMER_SRC)/*.c) \
|
||||
$(wildcard $(HRTIMER_SRC)/*.c) \
|
||||
$(wildcard $(UART_SRC)/*.c) \
|
||||
$(wildcard ./main.c)
|
||||
|
||||
ifeq ($(LOSCFG_HRTIMER_ENABLE), y)
|
||||
LOCAL_SRCS += $(wildcard $(HRTIMER_SRC)/*.c)
|
||||
endif
|
||||
|
||||
LOCAL_INCLUDE += -I $(LITEOSTOPDIR)/compat/posix/src \
|
||||
-I $(LITEOSTOPDIR)/bsd/dev/random
|
||||
|
||||
ifeq ($(findstring y, $(LOSCFG_PLATFORM_HI3518EV300)$(LOSCFG_PLATFORM_HI3516DV300)), y)
|
||||
MAIN_PLATFORMS := $(LOSCFG_PLATFORM_HI3518EV300) \
|
||||
$(LOSCFG_PLATFORM_HI3516DV300) \
|
||||
$(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7)
|
||||
ifeq ($(findstring y, $(MAIN_PLATFORMS)), y)
|
||||
LOCAL_SRCS += $(wildcard ../kernel/common/*.c)
|
||||
LOCAL_SRCS := $(filter-out ../kernel/common/los_rootfs.c, $(LOCAL_SRCS))
|
||||
ifneq ($(LOSCFG_FS_VFS), y)
|
||||
LOCAL_SRCS := $(filter-out ../kernel/common/console.c ../kernel/common/virtual_serial.c, $(LOCAL_SRCS))
|
||||
endif
|
||||
ifneq ($(LOSCFG_BASE_CORE_HILOG), y)
|
||||
LOCAL_SRCS := $(filter-out ../kernel/common/los_hilog.c, $(LOCAL_SRCS))
|
||||
endif
|
||||
else
|
||||
LOCAL_SRCS += $(wildcard ../kernel/common/los_config.c)
|
||||
LOCAL_SRCS += $(wildcard ../kernel/common/los_printf.c)
|
||||
|
|
|
@ -56,11 +56,19 @@ else ifeq ($(LOSCFG_PLATFORM_HI3518EV300), y)
|
|||
USB_TYPE := usb3.0_hi3518ev300
|
||||
LITEOS_CMACRO_TEST += -DTEST3518EV300
|
||||
|
||||
########################## Qemu ARM Virt Options##############################
|
||||
else ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y)
|
||||
HWI_TYPE := arm/interrupt/gic
|
||||
TIMER_TYPE := arm/timer/arm_generic
|
||||
UART_TYPE := amba_pl011
|
||||
|
||||
endif
|
||||
|
||||
ifeq ($(LOSCFG_HRTIMER_ENABLE), y)
|
||||
HRTIMER_SRC := hw/$(HRTIMER_TYPE)
|
||||
endif
|
||||
HWI_SRC := hw/$(HWI_TYPE)
|
||||
TIMER_SRC := hw/$(TIMER_TYPE)
|
||||
HRTIMER_SRC := hw/$(HRTIMER_TYPE)
|
||||
NET_SRC := net/$(NET_TYPE)
|
||||
UART_SRC := uart/$(UART_TYPE)
|
||||
USB_SRC := usb/$(USB_TYPE)
|
||||
|
@ -69,22 +77,26 @@ LITEOS_BASELIB += -lbsp
|
|||
|
||||
LITEOS_PLATFORM := $(subst $\",,$(LOSCFG_PLATFORM))
|
||||
|
||||
PLATFORM_BSP_HISI_BASE := $(LITEOSTOPDIR)/platform
|
||||
PLATFORM_BSP_BASE := $(LITEOSTOPDIR)/platform
|
||||
|
||||
PLATFORM_INCLUDE := -I $(LITEOSTOPDIR)/../../vendor/hisi/hi35xx/$(LITEOS_PLATFORM)/config/board/include \
|
||||
-I $(PLATFORM_BSP_HISI_BASE)/../kernel/common \
|
||||
-I $(PLATFORM_BSP_HISI_BASE)/../../../drivers/liteos/platform/pm \
|
||||
-I $(PLATFORM_BSP_HISI_BASE)/hw/include \
|
||||
-I $(PLATFORM_BSP_HISI_BASE)/include \
|
||||
-I $(PLATFORM_BSP_HISI_BASE)/$(UART_SRC)
|
||||
PLATFORM_INCLUDE := -I $(PLATFORM_BSP_BASE)/../kernel/common \
|
||||
-I $(PLATFORM_BSP_BASE)/../../../drivers/liteos/platform/pm \
|
||||
-I $(PLATFORM_BSP_BASE)/hw/include \
|
||||
-I $(PLATFORM_BSP_BASE)/include \
|
||||
-I $(PLATFORM_BSP_BASE)/$(UART_SRC)
|
||||
|
||||
ifeq ($(findstring y, $(LOSCFG_PLATFORM_HI3518EV300)$(LOSCFG_PLATFORM_HI3516DV300)), y)
|
||||
PLATFORM_INCLUDE += -I $(LITEOSTOPDIR)/../../vendor/hisi/hi35xx/$(LITEOS_PLATFORM)/config/board/include
|
||||
PLATFORM_INCLUDE += -I $(LITEOSTOPDIR)/../../vendor/hisi/hi35xx/$(LITEOS_PLATFORM)/config/board/include/hisoc
|
||||
else ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y)
|
||||
PLATFORM_INCLUDE += -I $(LITEOSTOPDIR)/../../device/qemu/arm/$(LITEOS_PLATFORM)/config/board/include
|
||||
# TODO: remove hisoc dependency in the code to avoid using hisoc here
|
||||
PLATFORM_INCLUDE += -I $(LITEOSTOPDIR)/../../device/qemu/arm/$(LITEOS_PLATFORM)/config/board/include/hisoc
|
||||
endif
|
||||
#
|
||||
#-include $(LITEOSTOPDIR)/platform/bsp/board/$(LITEOS_PLATFORM)/board.mk
|
||||
#
|
||||
|
||||
LIB_SUBDIRS += $(PLATFORM_BSP_HISI_BASE)
|
||||
LIB_SUBDIRS += $(PLATFORM_BSP_BASE)
|
||||
LITEOS_PLATFORM_INCLUDE += $(PLATFORM_INCLUDE)
|
||||
LITEOS_CXXINCLUDE += $(PLATFORM_INCLUDE)
|
||||
|
|
|
@ -100,7 +100,16 @@ STATIC UINT32 OsShellSourceInit(INT32 consoleId)
|
|||
ret = LOS_NOK;
|
||||
goto ERR_OUT4;
|
||||
}
|
||||
if (consoleId == CONSOLE_TELNET) {
|
||||
if (consoleId == CONSOLE_TELNET
|
||||
#if !defined(LOSCFG_PLATFORM_ROOTFS)
|
||||
/*
|
||||
* In case of ROOTFS disabled but
|
||||
* serial console enabled, it is required
|
||||
* to create Shell task in kernel for it.
|
||||
*/
|
||||
|| consoleId == CONSOLE_SERIAL
|
||||
#endif
|
||||
) {
|
||||
ret = OsShellCreateTask(shellCB);
|
||||
if (ret != LOS_OK) {
|
||||
goto ERR_OUT4;
|
||||
|
|
|
@ -33,7 +33,12 @@ MODULE_NAME := $(notdir $(shell pwd))
|
|||
|
||||
LOCAL_SRCS := $(wildcard *.c)
|
||||
|
||||
ifneq ($(LOSCFG_NET_LWIP_SACK), y)
|
||||
LOCAL_SRCS := $(filter-out net_syscall.c, $(LOCAL_SRCS))
|
||||
endif
|
||||
|
||||
LOCAL_INCLUDE := -I $(LITEOSTOPDIR)/kernel/base/include \
|
||||
-I $(LITEOSTOPDIR)/kernel/extended/dynload/include \
|
||||
-I $(LITEOSTOPDIR)/fs/include \
|
||||
-I $(LITEOSTOPDIR)/compat/posix/include \
|
||||
-I $(LITEOSTOPDIR)/bsd/compat/linuxkpi/include \
|
||||
|
|
|
@ -30,6 +30,12 @@
|
|||
*/
|
||||
|
||||
#define _GNU_SOURCE
|
||||
#include "menuconfig.h"
|
||||
#ifdef LOSCFG_FS_VFS
|
||||
#include "fs/fs.h"
|
||||
#include "fs/file.h"
|
||||
#endif
|
||||
#include "los_signal.h"
|
||||
#include "los_syscall.h"
|
||||
#include "los_task_pri.h"
|
||||
#include "los_process_pri.h"
|
||||
|
@ -40,10 +46,6 @@
|
|||
#include "mqueue.h"
|
||||
#include "los_futex_pri.h"
|
||||
#include "sys/times.h"
|
||||
#ifdef LOSCFG_FS_VFS
|
||||
#include "fs/fs.h"
|
||||
#include "fs/file.h"
|
||||
#endif
|
||||
#include "dirent.h"
|
||||
#include "fcntl.h"
|
||||
#include "unistd.h"
|
||||
|
|
|
@ -29,7 +29,6 @@
|
|||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "los_syscall.h"
|
||||
#include "los_process_pri.h"
|
||||
#include "lwip/sockets.h"
|
||||
#include <stdlib.h>
|
||||
|
|
|
@ -36,6 +36,7 @@
|
|||
#include "time.h"
|
||||
#include "user_copy.h"
|
||||
#include "sys/times.h"
|
||||
#include "los_signal.h"
|
||||
#include "los_memory.h"
|
||||
#include "los_strncpy_from_user.h"
|
||||
|
||||
|
|
|
@ -15,8 +15,10 @@ LOSCFG_COMPILER_CLANG_LLVM=y
|
|||
LOSCFG_PLATFORM="hi3516dv300"
|
||||
LOSCFG_PLATFORM_HI3516DV300=y
|
||||
# LOSCFG_PLATFORM_HI3518EV300 is not set
|
||||
# LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7 is not set
|
||||
# LOSCFG_TEE_ENABLE is not set
|
||||
LOSCFG_PLATFORM_BSP_GIC_V2=y
|
||||
LOSCFG_HRTIMER_ENABLE=y
|
||||
LOSCFG_ARCH_ARM=y
|
||||
LOSCFG_ARCH_ARM_AARCH32=y
|
||||
LOSCFG_ARCH_ARM_V7A=y
|
||||
|
|
|
@ -15,7 +15,9 @@ LOSCFG_COMPILER_CLANG_LLVM=y
|
|||
LOSCFG_PLATFORM="hi3518ev300"
|
||||
# LOSCFG_PLATFORM_HI3516DV300 is not set
|
||||
LOSCFG_PLATFORM_HI3518EV300=y
|
||||
# LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7 is not set
|
||||
LOSCFG_PLATFORM_BSP_GIC_V2=y
|
||||
LOSCFG_HRTIMER_ENABLE=y
|
||||
LOSCFG_ARCH_ARM=y
|
||||
LOSCFG_ARCH_ARM_AARCH32=y
|
||||
LOSCFG_ARCH_ARM_V7A=y
|
||||
|
|
|
@ -0,0 +1,147 @@
|
|||
#
|
||||
# Automatically generated file; DO NOT EDIT.
|
||||
# Huawei LiteOS Configuration
|
||||
#
|
||||
|
||||
#
|
||||
# Compiler
|
||||
#
|
||||
# LOSCFG_COMPILER_HIMIX_32 is not set
|
||||
LOSCFG_COMPILER_CLANG_LLVM=y
|
||||
|
||||
#
|
||||
# Platform
|
||||
#
|
||||
LOSCFG_PLATFORM="virt"
|
||||
# LOSCFG_PLATFORM_HI3516DV300 is not set
|
||||
# LOSCFG_PLATFORM_HI3518EV300 is not set
|
||||
LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7=y
|
||||
LOSCFG_PLATFORM_BSP_GIC_V2=y
|
||||
# LOSCFG_HRTIMER_ENABLE is not set
|
||||
LOSCFG_ARCH_ARM=y
|
||||
LOSCFG_ARCH_ARM_AARCH32=y
|
||||
LOSCFG_ARCH_ARM_V7A=y
|
||||
LOSCFG_ARCH_ARM_VER="armv7-a"
|
||||
LOSCFG_ARCH_FPU_VFP_V4=y
|
||||
LOSCFG_ARCH_FPU_VFP_D32=y
|
||||
LOSCFG_ARCH_FPU_VFP_NEON=y
|
||||
LOSCFG_ARCH_FPU="neon-vfpv4"
|
||||
LOSCFG_ARCH_CORTEX_A7=y
|
||||
LOSCFG_ARCH_CPU="cortex-a7"
|
||||
|
||||
#
|
||||
# Extra Configurations
|
||||
#
|
||||
# LOSCFG_ARCH_FPU_DISABLE is not set
|
||||
LOSCFG_IRQ_USE_STANDALONE_STACK=y
|
||||
|
||||
#
|
||||
# Kernel
|
||||
#
|
||||
# LOSCFG_KERNEL_SMP is not set
|
||||
LOSCFG_KERNEL_EXTKERNEL=y
|
||||
# LOSCFG_KERNEL_CPPSUPPORT is not set
|
||||
LOSCFG_KERNEL_CPUP=y
|
||||
LOSCFG_CPUP_INCLUDE_IRQ=y
|
||||
# LOSCFG_KERNEL_DYNLOAD is not set
|
||||
# LOSCFG_KERNEL_VDSO is not set
|
||||
# LOSCFG_KERNEL_TICKLESS is not set
|
||||
# LOSCFG_KERNEL_TRACE is not set
|
||||
LOSCFG_KERNEL_LITEIPC=y
|
||||
LOSCFG_KERNEL_PIPE=y
|
||||
# LOSCFG_BASE_CORE_HILOG is not set
|
||||
|
||||
#
|
||||
# Lib
|
||||
#
|
||||
LOSCFG_LIB_LIBC=y
|
||||
LOSCFG_LIB_ZLIB=y
|
||||
|
||||
#
|
||||
# Compat
|
||||
#
|
||||
LOSCFG_COMPAT_POSIX=y
|
||||
LOSCFG_COMPAT_BSD=y
|
||||
|
||||
#
|
||||
# FileSystem
|
||||
#
|
||||
LOSCFG_FS_VFS=y
|
||||
# LOSCFG_FS_VFS_BLOCK_DEVICE is not set
|
||||
LOSCFG_FILE_MODE=y
|
||||
# LOSCFG_FS_FAT is not set
|
||||
LOSCFG_FS_RAMFS=y
|
||||
LOSCFG_FS_PROC=y
|
||||
# LOSCFG_FS_JFFS is not set
|
||||
|
||||
#
|
||||
# Net
|
||||
#
|
||||
# LOSCFG_NET_LWIP_SACK is not set
|
||||
|
||||
#
|
||||
# Debug
|
||||
#
|
||||
# LOSCFG_COMPILE_DEBUG is not set
|
||||
# LOSCFG_PLATFORM_ADAPT is not set
|
||||
# LOSCFG_ENABLE_OOM_LOOP_TASK is not set
|
||||
# LOSCFG_ENABLE_MAGICKEY is not set
|
||||
# LOSCFG_THUMB is not set
|
||||
LOSCFG_DEBUG_VERSION=y
|
||||
# LOSCFG_DEBUG_KERNEL is not set
|
||||
LOSCFG_SHELL=y
|
||||
|
||||
#
|
||||
# Functionality of Shell
|
||||
#
|
||||
# LOSCFG_SHELL_LK is not set
|
||||
# LOSCFG_SHELL_EXCINFO is not set
|
||||
# LOSCFG_EXC_INTERACTION is not set
|
||||
# LOSCFG_USER_INIT_DEBUG is not set
|
||||
# LOSCFG_SHELL_CMD_DEBUG is not set
|
||||
# LOSCFG_MEM_DEBUG is not set
|
||||
# LOSCFG_NULL_ADDRESS_PROTECT is not set
|
||||
LOSCFG_DRIVERS_HDF_PLATFORM_UART=y
|
||||
# LOSCFG_PLATFORM_UART_WITHOUT_VFS is not set
|
||||
# LOSCFG_PLATFORM_NO_UART is not set
|
||||
|
||||
#
|
||||
# Driver
|
||||
#
|
||||
LOSCFG_DRIVERS=y
|
||||
# LOSCFG_DRIVERS_USB is not set
|
||||
LOSCFG_DRIVERS_HDF=y
|
||||
LOSCFG_DRIVERS_HDF_PLATFORM=y
|
||||
# LOSCFG_DRIVERS_HDF_PLATFORM_I2C is not set
|
||||
# LOSCFG_DRIVERS_HDF_PLATFORM_SPI is not set
|
||||
# LOSCFG_DRIVERS_HDF_PLATFORM_GPIO is not set
|
||||
# LOSCFG_DRIVERS_HDF_PLATFORM_WATCHDOG is not set
|
||||
# LOSCFG_DRIVERS_HDF_PLATFORM_SDIO is not set
|
||||
# LOSCFG_DRIVERS_HDF_PLATFORM_RTC is not set
|
||||
# LOSCFG_DRIVERS_HDF_PLATFORM_HISI_SDK is not set
|
||||
# LOSCFG_DRIVERS_HDF_WIFI is not set
|
||||
# LOSCFG_DRIVERS_HDF_INPUT is not set
|
||||
# LOSCFG_DRIVERS_HDF_LCD is not set
|
||||
# LOSCFG_DRIVERS_HDF_USB is not set
|
||||
LOSCFG_DRIVERS_MEM=y
|
||||
# LOSCFG_DRIVERS_MMC is not set
|
||||
# LOSCFG_DRIVERS_MTD is not set
|
||||
# LOSCFG_DRIVERS_RANDOM is not set
|
||||
# LOSCFG_DRIVERS_VIDEO is not set
|
||||
# LOSCFG_DRIVERS_HIEVENT is not set
|
||||
|
||||
#
|
||||
# Security
|
||||
#
|
||||
LOSCFG_SECURITY=y
|
||||
LOSCFG_SECURITY_CAPABILITY=y
|
||||
LOSCFG_SECURITY_VID=y
|
||||
# LOSCFG_SECURITY_BOOT is not set
|
||||
|
||||
#
|
||||
# Stack Smashing Protector (SSP) Compiler Feature
|
||||
#
|
||||
# LOSCFG_CC_NO_STACKPROTECTOR is not set
|
||||
# LOSCFG_CC_STACKPROTECTOR is not set
|
||||
# LOSCFG_CC_STACKPROTECTOR_STRONG is not set
|
||||
LOSCFG_CC_STACKPROTECTOR_ALL=y
|
|
@ -15,8 +15,10 @@ LOSCFG_COMPILER_CLANG_LLVM=y
|
|||
LOSCFG_PLATFORM="hi3516dv300"
|
||||
LOSCFG_PLATFORM_HI3516DV300=y
|
||||
# LOSCFG_PLATFORM_HI3518EV300 is not set
|
||||
# LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7 is not set
|
||||
# LOSCFG_TEE_ENABLE is not set
|
||||
LOSCFG_PLATFORM_BSP_GIC_V2=y
|
||||
LOSCFG_HRTIMER_ENABLE=y
|
||||
LOSCFG_ARCH_ARM=y
|
||||
LOSCFG_ARCH_ARM_AARCH32=y
|
||||
LOSCFG_ARCH_ARM_V7A=y
|
||||
|
|
|
@ -15,7 +15,9 @@ LOSCFG_COMPILER_CLANG_LLVM=y
|
|||
LOSCFG_PLATFORM="hi3518ev300"
|
||||
# LOSCFG_PLATFORM_HI3516DV300 is not set
|
||||
LOSCFG_PLATFORM_HI3518EV300=y
|
||||
# LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7 is not set
|
||||
LOSCFG_PLATFORM_BSP_GIC_V2=y
|
||||
LOSCFG_HRTIMER_ENABLE=y
|
||||
LOSCFG_ARCH_ARM=y
|
||||
LOSCFG_ARCH_ARM_AARCH32=y
|
||||
LOSCFG_ARCH_ARM_V7A=y
|
||||
|
|
|
@ -163,8 +163,10 @@ LITEOS_BASELIB += -lbase
|
|||
LIB_SUBDIRS += kernel/base
|
||||
LITEOS_KERNEL_INCLUDE := -I $(LITEOSTOPDIR)/kernel/include
|
||||
|
||||
ifeq ($(findstring y, $(LOSCFG_PLATFORM_HI3518EV300)$(LOSCFG_PLATFORM_HI3516DV300)), y)
|
||||
LITEOS_BASELIB += -lhi35xx_bsp
|
||||
LIB_SUBDIRS += $(LITEOSTOPDIR)/../../vendor/hisi/hi35xx/$(LITEOS_PLATFORM)/config/board/
|
||||
endif
|
||||
|
||||
ifeq ($(LOSCFG_KERNEL_CPUP), y)
|
||||
LITEOS_BASELIB += -lcpup
|
||||
|
@ -358,7 +360,11 @@ endif
|
|||
|
||||
#################################### Net Option End####################################
|
||||
LITEOS_DRIVERS_BASE_PATH := $(LITEOSTOPDIR)/../../drivers/liteos
|
||||
ifeq ($(findstring y, $(LOSCFG_PLATFORM_HI3518EV300)$(LOSCFG_PLATFORM_HI3516DV300)), y)
|
||||
LITEOS_VENDOR_DRIVERS_BASE_PATH := $(LITEOSTOPDIR)/../../vendor/hisi/hi35xx/platform
|
||||
else ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y)
|
||||
LITEOS_VENDOR_DRIVERS_BASE_PATH := $(LITEOSTOPDIR)/../../device/qemu/arm/platform
|
||||
endif
|
||||
################################## Driver Option Begin #################################
|
||||
ifeq ($(LOSCFG_DRIVERS_HDF), y)
|
||||
include $(LITEOSTOPDIR)/../../drivers/hdf/lite/hdf_lite.mk
|
||||
|
@ -457,7 +463,10 @@ ifeq ($(LOSCFG_COMPILE_DEBUG), y)
|
|||
LITEOS_COPTS_OPTION = -g -gdwarf-2
|
||||
else
|
||||
ifeq ($(LOSCFG_COMPILER_CLANG_LLVM), y)
|
||||
LITEOS_COPTS_OPTMIZE = -Oz -flto
|
||||
# WORKAROUND: Disable LTO to avoid undefined __stack_chk_guard
|
||||
# problem. "externally_visible" attribute could be
|
||||
# a fix for that but it is not known to our LLVM.
|
||||
LITEOS_COPTS_OPTMIZE = -Oz #-flto
|
||||
else
|
||||
LITEOS_COPTS_OPTMIZE = -O2
|
||||
endif
|
||||
|
|
|
@ -81,7 +81,7 @@ all : $(LIB)
|
|||
|
||||
$(LOCAL_COBJS): $(OBJOUT)/%.o: %.c
|
||||
$(HIDE)$(OBJ_MKDIR)
|
||||
$(HIDE)$(CC) $(LITEOS_CFLAGS) $(LOCAL_FLAGS) $(LOCAL_CFLAGS) -c $< -o $@
|
||||
$(HIDE)$(CC) $(LITEOS_CFLAGS) $(LOCAL_INCLUDE) $(LOCAL_FLAGS) $(LOCAL_CFLAGS) -c $< -o $@
|
||||
|
||||
$(LOCAL_CPPOBJS): $(OBJOUT)/%.o: %.cpp
|
||||
$(HIDE)$(OBJ_MKDIR)
|
||||
|
|
Loading…
Reference in New Issue