blob: ca48435a6a800d0a0e7697e7517db1b3fb838f70 [file] [log] [blame]
# Copyright 2024 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations under
# the License.
package(default_visibility = ["//visibility:public"])
cc_library(
name = "offset",
hdrs = [
"include/gen_offset.h",
"include/kernel_arch_interface.h",
"include/kernel_internal.h",
"include/kernel_offsets.h",
],
copts = ["-include generated/zephyr/autoconf.h"],
includes = ["include"],
deps = [
"//:autoconf_library",
"//include:zephyr",
],
)
cc_library(
name = "kernel",
srcs = [
"banner.c",
"busy_wait.c",
"device.c",
"errno.c",
"fatal.c",
"float.c",
"init.c",
"init_static.c",
"kheap.c",
"main_weak.c",
"mem_slab.c",
"version.c",
] + [
# Depends on CONFIG_MULTITHREADING
"idle.c",
"mailbox.c",
"msg_q.c",
"mutex.c",
"queue.c",
"sem.c",
"stack.c",
"system_work_q.c",
"work.c",
"condvar.c",
"priority_queues.c",
"thread.c",
"sched.c",
] + [
# Depends on CONFIG_TIMESLICING
"timeslicing.c",
] + [
# Depends on CONFIG_XIP
"xip.c",
] + [
# Depends on CONFIG_SYS_CLOCK_EXISTS
"timeout.c",
"timer.c",
] + [
# Depends on !CONFIG_DYNAMIC_THREAD
"dynamic_disabled.c",
] + [
# Depends on CONFIG_KERNEL_MEM_POOL
"mempool.c",
],
hdrs = glob(["include/*.h"]),
copts = [
"-include generated/zephyr/autoconf.h",
"-include $(location //:autoconf_file)",
],
includes = ["include"],
deps = [
"//:autoconf_library",
"//:dts_cc_library",
"//:offsets_header_lib",
"//:syscall_list",
"//:zephyr",
"//include:zephyr",
"//lib/heap",
"//lib/os",
"@zephyr_version//:version",
],
additional_compiler_inputs = ["//:autoconf_file"],
alwayslink = True,
)