1## 2 # Copyright (C) 2017 C-SKY Microsystems Co., Ltd. All rights reserved. 3 # 4 # Licensed under the Apache License, Version 2.0 (the "License"); 5 # you may not use this file except in compliance with the License. 6 # You may obtain a copy of the License at 7 # 8 # http://www.apache.org/licenses/LICENSE-2.0 9 # 10 # Unless required by applicable law or agreed to in writing, software 11 # distributed under the License is distributed on an "AS IS" BASIS, 12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 # See the License for the specific language governing permissions and 14 # limitations under the License. 15## 16 17INCDIR += -I$(KERNELDIR)/rhino/arch/include 18INCDIR += -I$(KERNELDIR)/rhino/core/include 19ifeq ($(CONFIG_KERNEL_PWR_MGMT), y) 20INCDIR += -I$(KERNELDIR)/rhino/common 21INCDIR += -I$(KERNELDIR)/rhino/pwrmgmt 22endif 23INCDIR += -I$(LIBSDIR)/mm 24INCDIR += -I$(LIBSDIR)/trace/include 25 26KERNEL_CSRC += $(KERNELDIR)/rhino/driver/systick.c 27KERNEL_CSRC += $(KERNELDIR)/rhino/driver/hook_impl.c 28KERNEL_CSRC += $(KERNELDIR)/rhino/driver/hook_weak.c 29KERNEL_CSRC += $(KERNELDIR)/rhino/driver/yoc_impl.c 30 31KERNEL_CSRC += $(KERNELDIR)/rhino/adapter/csi_rhino.c 32 33KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_buf_queue.c 34KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_dyn_mem_proc.c 35KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_err.c 36KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_event.c 37KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_idle.c 38KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_mm.c 39KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_mm_debug.c 40KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_mm_blk.c 41KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_mm_region.c 42KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_mm_firstfit.c 43KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_mm_bestfit.c 44KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_ringbuf.c 45KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_mutex.c 46KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_obj.c 47KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_pend.c 48KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_queue.c 49KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_sched.c 50KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_sem.c 51KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_stats.c 52KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_sys.c 53KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_task.c 54KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_task_sem.c 55KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_tick.c 56KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_time.c 57KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_timer.c 58KERNEL_CSRC += $(KERNELDIR)/rhino/core/k_workqueue.c 59 60KERNEL_CSRC += $(KERNELDIR)/rhino/common/k_atomic.c 61KERNEL_CSRC += $(KERNELDIR)/rhino/common/k_ffs.c 62 63ifeq ($(CONFIG_KERNEL_PWR_MGMT), y) 64KERNEL_CSRC += $(KERNELDIR)/rhino/board/board_cpu_pwr.c 65KERNEL_CSRC += $(KERNELDIR)/rhino/board/board_cpu_pwr_systick.c 66KERNEL_CSRC += $(KERNELDIR)/rhino/board/board_cpu_pwr_timer.c 67 68KERNEL_CSRC += $(KERNELDIR)/rhino/pwrmgmt/cpu_pwr_hal_lib.c 69KERNEL_CSRC += $(KERNELDIR)/rhino/pwrmgmt/cpu_pwr_lib.c 70KERNEL_CSRC += $(KERNELDIR)/rhino/pwrmgmt/cpu_pwr_show.c 71KERNEL_CSRC += $(KERNELDIR)/rhino/pwrmgmt/cpu_tickless.c 72endif 73 74ifeq ($(CONFIG_SUPPORT_TSPEND), y) 75IS_TSPEND=tspend 76else 77IS_TSPEND=non_tspend 78endif 79 80ifeq ($(CONFIG_SYSTEM_SECURE), y) 81IS_SECURE=security 82else 83IS_SECURE=non_security 84endif 85 86ifeq ($(CONFIG_CPU_E802)$(CONFIG_CPU_S802)$(CONFIG_CPU_E802T)$(CONFIG_CPU_S802T)$(CONFIG_CPU_CK802), y) 87KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/802/cpu_impl.c 88KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/802/csky_sched.c 89KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/802/dump_backtrace.c 90KERNEL_SSRC += $(KERNELDIR)/rhino/arch/csky/802/$(IS_TSPEND)/port_s.S 91KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/802/$(IS_SECURE)/port_c.c 92endif 93 94ifeq ($(CONFIG_CPU_E803)$(CONFIG_CPU_S803)$(CONFIG_CPU_E803T)$(CONFIG_CPU_S803T)$(CONFIG_CPU_CK803), y) 95KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/803/cpu_impl.c 96KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/803/csky_sched.c 97KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/803/dump_backtrace.c 98KERNEL_SSRC += $(KERNELDIR)/rhino/arch/csky/803/$(IS_TSPEND)/port_s.S 99KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/803/$(IS_SECURE)/port_c.c 100endif 101 102ifeq ($(CONFIG_CPU_E804D)$(CONFIG_CPU_E804DT)$(CONFIG_CPU_CK803ER1)$(CONFIG_CPU_CK803ER2)$(CONFIG_CPU_CK803ER3), y) 103KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/804d/cpu_impl.c 104KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/804d/csky_sched.c 105KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/804d/dump_backtrace.c 106KERNEL_SSRC += $(KERNELDIR)/rhino/arch/csky/804d/$(IS_TSPEND)/port_s.S 107KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/804d/$(IS_SECURE)/port_c.c 108endif 109 110ifeq ($(CONFIG_CPU_E804F)$(CONFIG_CPU_E804FT)$(CONFIG_CPU_CK803F), y) 111KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/804f/cpu_impl.c 112KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/804f/csky_sched.c 113KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/804f/dump_backtrace.c 114KERNEL_SSRC += $(KERNELDIR)/rhino/arch/csky/804f/$(IS_TSPEND)/port_s.S 115KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/804f/$(IS_SECURE)/port_c.c 116endif 117 118ifeq ($(CONFIG_CPU_CK803EF), y) 119KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/803ef_32gpr/cpu_impl.c 120KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/803ef_32gpr/csky_sched.c 121KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/803ef_32gpr/dump_backtrace.c 122KERNEL_SSRC += $(KERNELDIR)/rhino/arch/csky/803ef_32gpr/$(IS_TSPEND)/port_s.S 123KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/803ef_32gpr/$(IS_SECURE)/port_c.c 124endif 125 126ifeq ($(CONFIG_CPU_E804DF)$(CONFIG_CPU_E804DFT)$(CONFIG_CPU_CK804EF)$(CONFIG_CPU_CK803EFR1)$(CONFIG_CPU_CK803EFR2)$(CONFIG_CPU_CK803EFR3), y) 127KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/804df/cpu_impl.c 128KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/804df/csky_sched.c 129KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/804df/dump_backtrace.c 130KERNEL_SSRC += $(KERNELDIR)/rhino/arch/csky/804df/$(IS_TSPEND)/port_s.S 131KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/804df/$(IS_SECURE)/port_c.c 132endif 133 134ifeq ($(CONFIG_CPU_I805)$(CONFIG_CPU_I805F)$(CONFIG_CPU_CK805)$(CONFIG_CPU_CK805F), y) 135KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/805/cpu_impl.c 136KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/805/csky_sched.c 137KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/805/dump_backtrace.c 138KERNEL_SSRC += $(KERNELDIR)/rhino/arch/csky/805/$(IS_TSPEND)/port_s.S 139KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/805/$(IS_SECURE)/port_c.c 140endif 141 142ifeq ($(CONFIG_CPU_C807)$(CONFIG_CPU_R807), y) 143KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/807/cpu_impl.c 144KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/807/csky_sched.c 145KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/807/dump_backtrace.c 146KERNEL_SSRC += $(KERNELDIR)/rhino/arch/csky/807/$(IS_TSPEND)/port_s.S 147KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/807/$(IS_SECURE)/port_c.c 148endif 149 150ifeq ($(CONFIG_CPU_C807F)$(CONFIG_CPU_C807FV)$(CONFIG_CPU_R807F), y) 151KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/807f/cpu_impl.c 152KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/807f/csky_sched.c 153KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/807f/dump_backtrace.c 154KERNEL_SSRC += $(KERNELDIR)/rhino/arch/csky/807f/$(IS_TSPEND)/port_s.S 155KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/807f/$(IS_SECURE)/port_c.c 156endif 157 158ifeq ($(CONFIG_CPU_C810)$(CONFIG_CPU_C810V)$(CONFIG_CPU_C810T)$(CONFIG_CPU_C810TV), y) 159KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/810/cpu_impl.c 160KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/810/csky_sched.c 161KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/810/dump_backtrace.c 162KERNEL_SSRC += $(KERNELDIR)/rhino/arch/csky/810/$(IS_TSPEND)/port_s.S 163KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/810/$(IS_SECURE)/port_c.c 164endif 165 166ifeq ($(CONFIG_CPU_CK610E), y) 167KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/ck610/cpu_impl.c 168KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/ck610/csky_sched.c 169KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/ck610/dump_backtrace.c 170KERNEL_SSRC += $(KERNELDIR)/rhino/arch/csky/ck610/$(IS_TSPEND)/port_s.S 171KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/ck610/$(IS_SECURE)/port_c.c 172endif 173 174ifeq ($(CONFIG_CPU_CK610EF), y) 175KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/ck610f/cpu_impl.c 176KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/ck610f/csky_sched.c 177KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/ck610f/dump_backtrace.c 178KERNEL_SSRC += $(KERNELDIR)/rhino/arch/csky/ck610f/$(IS_TSPEND)/port_s.S 179KERNEL_CSRC += $(KERNELDIR)/rhino/arch/csky/ck610f/$(IS_SECURE)/port_c.c 180endif 181 182ifeq ($(CONFIG_ARCH_RV32)$(CONFIG_ARCH_RV32EMC), y) 183KERNEL_CSRC += $(KERNELDIR)/rhino/arch/riscv/rv32_16gpr/cpu_impl.c 184KERNEL_CSRC += $(KERNELDIR)/rhino/arch/riscv/rv32_16gpr/csky_sched.c 185KERNEL_SSRC += $(KERNELDIR)/rhino/arch/riscv/rv32_16gpr/$(IS_TSPEND)/port_s.S 186KERNEL_CSRC += $(KERNELDIR)/rhino/arch/riscv/rv32_16gpr/$(IS_SECURE)/port_c.c 187endif 188 189ifeq ($(CONFIG_CPU_CM0), y) 190KERNEL_CSRC += $(KERNELDIR)/rhino/arch/arm/cm0/cpu_impl.c 191KERNEL_CSRC += $(KERNELDIR)/rhino/arch/arm/cm0/csky_sched.c 192KERNEL_SSRC += $(KERNELDIR)/rhino/arch/arm/cm0/$(IS_TSPEND)/port_s.S 193KERNEL_CSRC += $(KERNELDIR)/rhino/arch/arm/cm0/$(IS_SECURE)/port_c.c 194endif 195