Add kernel configuration option to enable/disable HR Timer

High resolution timer can now be excluded from the build.
There is currently no HR Timer implementation for other
platform than HiSi.

Note: HR Timer will be enabled by default

Signed-off-by: Zbigniew Bodek <zbigniew.bodek@huawei.com>
Change-Id: I5daf8e0ceec2a17025b579513e3bd74db1040916
This commit is contained in:
Zbigniew Bodek 2020-10-28 23:41:30 +08:00
parent 07c89a8473
commit 51263d8796
4 changed files with 18 additions and 2 deletions

View File

@ -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

View File

@ -56,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

View File

@ -33,10 +33,13 @@ 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

View File

@ -64,9 +64,11 @@ else ifeq ($(LOSCFG_PLATFORM_QEMU_ARM_VIRT_CA7), y)
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)