diff --git a/khdf/liteos_m/BUILD.gn b/khdf/liteos_m/BUILD.gn index 241db0ffb72441acd2892457c38cb1c5b7f9b805..3f09f501d2a8890a27fc95bbbf09089c0233518d 100644 --- a/khdf/liteos_m/BUILD.gn +++ b/khdf/liteos_m/BUILD.gn @@ -28,10 +28,11 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. group("hdf_lite") { - deps = [ - "osal:hdf_osal_lite", - "core:hdf_core", - "hcs:hdf_hcs", - "test\sample_driver:sample_driver" - ] + deps = [ + "core:hdf_core", + "hcs:hdf_hcs", + "osal:hdf_osal_lite", + "platform:hdf_platform_lite", + "test\sample_driver:sample_driver", + ] } diff --git a/khdf/liteos_m/core/BUILD.gn b/khdf/liteos_m/core/BUILD.gn index 9be8f0e11140b32f4f74ef50a183d9173fe1b970..8ecc0da3f7c352855b1fc8053c071cec6ee557b0 100644 --- a/khdf/liteos_m/core/BUILD.gn +++ b/khdf/liteos_m/core/BUILD.gn @@ -1,107 +1,103 @@ -# -# Copyright (c) 2021, Huawei Device Co., Ltd. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, -# are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, this list of -# conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, this list -# of conditions and the following disclaimer in the documentation and/or other materials -# provided with the distribution. -# -# 3. Neither the name of the copyright holder nor the names of its contributors may be used -# to endorse or promote products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# +# Copyright (c) 2021, Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -import("//drivers/adapter/khdf/liteos_m/hdf.gni") - -config("libhdf_core_pub_config") { - visibility = [ ":*" ] - -include_dirs = [ - "$hdf_fwk_path/include", - "$hdf_fwk_path/include/osal", - "$hdf_fwk_path/include/utils", - "$hdf_fwk_path/utils/include", - "$hdf_fwk_path/include/platform", - "$hdf_fwk_path/include/core", - "$hdf_fwk_path/include/net", - "$hdf_fwk_path/include/wifi", - "$hdf_fwk_path/model/network/common/netdevice", - "$hdf_fwk_path/ability/sbuf/include", - "$hdf_fwk_path/support/platform/include", - "$hdf_fwk_path/core/host/include", - "$hdf_fwk_path/core/manager/include", - "$hdf_fwk_path/core/shared/include", - "$hdf_fwk_path/core/common/include/manager", - "$hdf_fwk_path/core/common/include/host", - "$hdf_fwk_path/core/adapter/vnode/include", - "$hdf_fwk_path/core/adapter/syscall/include", - "$hdf_fwk_path/include/config", - "$hdf_fwk_path/ability/config/hcs_parser/include", - ] -} - -static_library("hdf_core") { - sources = [ - "common/src/hdf_device_node_ext.c", - "common/src/devmgr_service_start.c", - "$hdf_fwk_path/utils/src/hdf_cstring.c", - "$hdf_fwk_path/utils/src/hdf_slist.c", - "$hdf_fwk_path/utils/src/hdf_sref.c", - "$hdf_fwk_path/ability/sbuf/src/hdf_sbuf.c", - "$hdf_fwk_path/core/host/src/devhost_service.c", - "$hdf_fwk_path/core/host/src/devmgr_service_clnt.c", - "$hdf_fwk_path/core/host/src/devsvc_manager_clnt.c", - "$hdf_fwk_path/core/host/src/hdf_device.c", - "$hdf_fwk_path/core/host/src/hdf_device_node.c", - "$hdf_fwk_path/core/host/src/hdf_device_token.c", - "$hdf_fwk_path/core/host/src/hdf_driver_loader.c", - "$hdf_fwk_path/core/host/src/hdf_observer_record.c", - "$hdf_fwk_path/core/host/src/hdf_service_subscriber.c", - "$hdf_fwk_path/core/host/src/hdf_device_object.c", - "$hdf_fwk_path/core/host/src/hdf_service_observer.c", - "$hdf_fwk_path/core/host/src/power_state_token.c", - "$hdf_fwk_path/core/manager/src/devhost_service_clnt.c", - "$hdf_fwk_path/core/manager/src/device_token_clnt.c", - "$hdf_fwk_path/core/manager/src/devmgr_service.c", - "$hdf_fwk_path/core/manager/src/devsvc_manager.c", - "$hdf_fwk_path/core/manager/src/hdf_driver_installer.c", - "$hdf_fwk_path/core/manager/src/hdf_host_info.c", - "$hdf_fwk_path/core/manager/src/power_state_manager.c", - "$hdf_fwk_path/core/manager/src/power_state_token_clnt.c", - "$hdf_fwk_path/core/shared/src/hdf_service_record.c", - "$hdf_fwk_path/core/shared/src/hdf_device_info.c", - "$hdf_fwk_path/core/shared/src/hdf_object_manager.c", - "$hdf_fwk_path/core/common/src/devlite_object_config.c", - "$hdf_fwk_path/core/common/src/hdf_attribute.c", - "$hdf_fwk_path/core/common/src/load_driver_entry.c", - "$hdf_fwk_path/ability/config/hcs_parser/src/hcs_blob_if.c", - "$hdf_fwk_path/ability/config/hcs_parser/src/hcs_parser.c", - "$hdf_fwk_path/ability/config/hcs_parser/src/hcs_generate_tree.c", - "$hdf_fwk_path/ability/config/hcs_parser/src/hcs_tree_if.c", - "$hdf_fwk_path/ability/config/device_resource_if.c", - ] - - include_dirs = [] - public_configs = [ - ":libhdf_core_pub_config" - ] - deps = [ - "$khdf_path/osal:hdf_osal_lite" - ] -} \ No newline at end of file + +import("//drivers/adapter/khdf/liteos_m/hdf.gni") + +config("libhdf_core_pub_config") { + visibility = [ ":*" ] + + include_dirs = [ + "$hdf_fwk_path/include", + "$hdf_fwk_path/include/osal", + "$hdf_fwk_path/include/utils", + "$hdf_fwk_path/utils/include", + "$hdf_fwk_path/include/platform", + "$hdf_fwk_path/include/core", + "$hdf_fwk_path/include/net", + "$hdf_fwk_path/include/wifi", + "$hdf_fwk_path/model/network/common/netdevice", + "$hdf_fwk_path/ability/sbuf/include", + "$hdf_fwk_path/support/platform/include", + "$hdf_fwk_path/core/host/include", + "$hdf_fwk_path/core/manager/include", + "$hdf_fwk_path/core/shared/include", + "$hdf_fwk_path/core/common/include/manager", + "$hdf_fwk_path/core/common/include/host", + "$hdf_fwk_path/core/adapter/vnode/include", + "$hdf_fwk_path/core/adapter/syscall/include", + "$hdf_fwk_path/include/config", + "$hdf_fwk_path/ability/config/hcs_parser/include", + ] +} + +static_library("hdf_core") { + sources = [ + "$hdf_fwk_path/ability/config/device_resource_if.c", + "$hdf_fwk_path/ability/config/hcs_parser/src/hcs_blob_if.c", + "$hdf_fwk_path/ability/config/hcs_parser/src/hcs_generate_tree.c", + "$hdf_fwk_path/ability/config/hcs_parser/src/hcs_parser.c", + "$hdf_fwk_path/ability/config/hcs_parser/src/hcs_tree_if.c", + "$hdf_fwk_path/ability/sbuf/src/hdf_sbuf.c", + "$hdf_fwk_path/core/common/src/devlite_object_config.c", + "$hdf_fwk_path/core/common/src/hdf_attribute.c", + "$hdf_fwk_path/core/common/src/load_driver_entry.c", + "$hdf_fwk_path/core/host/src/devhost_service.c", + "$hdf_fwk_path/core/host/src/devmgr_service_clnt.c", + "$hdf_fwk_path/core/host/src/devsvc_manager_clnt.c", + "$hdf_fwk_path/core/host/src/hdf_device.c", + "$hdf_fwk_path/core/host/src/hdf_device_node.c", + "$hdf_fwk_path/core/host/src/hdf_device_object.c", + "$hdf_fwk_path/core/host/src/hdf_device_token.c", + "$hdf_fwk_path/core/host/src/hdf_driver_loader.c", + "$hdf_fwk_path/core/host/src/hdf_observer_record.c", + "$hdf_fwk_path/core/host/src/hdf_service_observer.c", + "$hdf_fwk_path/core/host/src/hdf_service_subscriber.c", + "$hdf_fwk_path/core/host/src/power_state_token.c", + "$hdf_fwk_path/core/manager/src/devhost_service_clnt.c", + "$hdf_fwk_path/core/manager/src/device_token_clnt.c", + "$hdf_fwk_path/core/manager/src/devmgr_service.c", + "$hdf_fwk_path/core/manager/src/devsvc_manager.c", + "$hdf_fwk_path/core/manager/src/hdf_driver_installer.c", + "$hdf_fwk_path/core/manager/src/hdf_host_info.c", + "$hdf_fwk_path/core/manager/src/power_state_manager.c", + "$hdf_fwk_path/core/manager/src/power_state_token_clnt.c", + "$hdf_fwk_path/core/shared/src/hdf_device_info.c", + "$hdf_fwk_path/core/shared/src/hdf_object_manager.c", + "$hdf_fwk_path/core/shared/src/hdf_service_record.c", + "$hdf_fwk_path/utils/src/hdf_cstring.c", + "$hdf_fwk_path/utils/src/hdf_slist.c", + "$hdf_fwk_path/utils/src/hdf_sref.c", + "common/src/devmgr_service_start.c", + "common/src/hdf_device_node_ext.c", + ] + + include_dirs = [] + public_configs = [ ":libhdf_core_pub_config" ] + deps = [ "$khdf_path/osal:hdf_osal_lite" ] +} diff --git a/khdf/liteos_m/hcs/BUILD.gn b/khdf/liteos_m/hcs/BUILD.gn index 20462f7f702971f59dc4b06c0c9aab5ce0229532..e221e0318cafca42592ab7304051bc0d7725ef3d 100644 --- a/khdf/liteos_m/hcs/BUILD.gn +++ b/khdf/liteos_m/hcs/BUILD.gn @@ -30,19 +30,16 @@ import("//drivers/adapter/khdf/liteos_m/hdf.gni") static_library("hdf_hcs") { - sources = [ - "hdf_config_gen_hex.c" - ] - config_path = product_path + "/config/hdf.hcs" - print("aaa " + ohos_root_path) - exec_script( - "hcs_build.py", - [ - ohos_root_path+"$hdf_fwk_path/tools/hc-gen/bin/hc-gen", - "-i", - "-o", - rebase_path("hdf_config_gen.c"), - config_path - ], - "") -} \ No newline at end of file + sources = [ "hdf_config_gen_hex.c" ] + config_path = product_path + "/config/hdf.hcs" + print("aaa " + ohos_root_path) + exec_script("hcs_build.py", + [ + ohos_root_path + "$hdf_fwk_path/tools/hc-gen/bin/hc-gen", + "-i", + "-o", + rebase_path("hdf_config_gen.c"), + config_path, + ], + "") +} diff --git a/khdf/liteos_m/osal/BUILD.gn b/khdf/liteos_m/osal/BUILD.gn index a4e8d26cc97b9c138df19539f3c643898e9e1301..ed4796088b8c6016ea56e0f2d80d096b8269b545 100644 --- a/khdf/liteos_m/osal/BUILD.gn +++ b/khdf/liteos_m/osal/BUILD.gn @@ -1,61 +1,59 @@ -# -# Copyright (c) 2021, Huawei Device Co., Ltd. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, -# are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, this list of -# conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, this list -# of conditions and the following disclaimer in the documentation and/or other materials -# provided with the distribution. -# -# 3. Neither the name of the copyright holder nor the names of its contributors may be used -# to endorse or promote products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# +# Copyright (c) 2021, Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -import("//drivers/adapter/khdf/liteos_m/hdf.gni") - -config("libhdf_osal_pub_config") { - visibility = [ ":*" ] - include_dirs = [ - "include", - "//utils/native/lite/include", - "//drivers/framework/include/osal", - "//drivers/framework/include/utils", - "//kernel/liteos_m/kernel/arch/include", - "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", - "//kernel/liteos_m/components/bounds_checking_function/include", - "//kernel/liteos_m/kernel/include", - "//kernel/liteos_m/utils/", - ] -} - -static_library("hdf_osal_lite") { - sources = [ - "src/osal_mutex.c", - "src/osal_mem.c", - "src/osal_sem.c", - "src/osal_thread.c", - "src/osal_time.c", - "src/osal_timer.c", - "src/osal_spinlock.c", - ] - include_dirs = [] - public_configs = [ - ":libhdf_osal_pub_config", - ] -} + +import("//drivers/adapter/khdf/liteos_m/hdf.gni") + +config("libhdf_osal_pub_config") { + visibility = [ ":*" ] + include_dirs = [ + "include", + "//utils/native/lite/include", + "//drivers/framework/include/osal", + "//drivers/framework/include/utils", + "//kernel/liteos_m/kernel/arch/include", + "//base/hiviewdfx/hilog_lite/interfaces/native/innerkits", + "//kernel/liteos_m/components/bounds_checking_function/include", + "//kernel/liteos_m/kernel/include", + "//kernel/liteos_m/utils/", + ] +} + +static_library("hdf_osal_lite") { + sources = [ + "src/osal_mem.c", + "src/osal_mutex.c", + "src/osal_sem.c", + "src/osal_spinlock.c", + "src/osal_thread.c", + "src/osal_time.c", + "src/osal_timer.c", + ] + include_dirs = [] + public_configs = [ ":libhdf_osal_pub_config" ] +} diff --git a/khdf/liteos_m/platform/BUILD.gn b/khdf/liteos_m/platform/BUILD.gn new file mode 100644 index 0000000000000000000000000000000000000000..5315cec1295a0692deccd3d454ac5831c1f2f668 --- /dev/null +++ b/khdf/liteos_m/platform/BUILD.gn @@ -0,0 +1,56 @@ +# +# Copyright (c) 2021, Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import("//drivers/adapter/khdf/liteos_m/hdf.gni") + +config("libhdf_platform_pub_config") { + visibility = [ ":*" ] + include_dirs = [ + "$hdf_fwk_path/include/platform", + "$hdf_fwk_path/support/platform/include", + ] +} + +static_library("hdf_platform_lite") { + sources = [ + "$hdf_fwk_path/support/platform/src/gpio_core.c", + "$hdf_fwk_path/support/platform/src/gpio_if.c", + "$hdf_fwk_path/support/platform/src/i2c_core.c", + "$hdf_fwk_path/support/platform/src/i2c_if.c", + "$hdf_fwk_path/support/platform/src/uart_core.c", + "$hdf_fwk_path/support/platform/src/uart_if.c", + "plat_common.c", + ] + include_dirs = [ "kernel/liteos_m/kernel/arch/include" ] + public_configs = [ ":libhdf_platform_pub_config" ] + deps = [ + "$khdf_path/core:hdf_core", + "$khdf_path/osal:hdf_osal_lite", + ] +} diff --git a/khdf/liteos_m/platform/plat_common.c b/khdf/liteos_m/platform/plat_common.c new file mode 100644 index 0000000000000000000000000000000000000000..d053fae04ddc4522339219f5b993a4b84ca23cd7 --- /dev/null +++ b/khdf/liteos_m/platform/plat_common.c @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2020-2021 Huawei Device Co., Ltd. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, this list of + * conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, this list + * of conditions and the following disclaimer in the documentation and/or other materials + * provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its contributors may be used + * to endorse or promote products derived from this software without specific prior written + * permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; + * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "plat_common.h" +#include "los_interrupt.h" + +bool PlatInIrqContext(void) +{ + return (OS_INT_ACTIVE > 0); +} diff --git a/khdf/liteos_m/test/sample_driver/BUILD.gn b/khdf/liteos_m/test/sample_driver/BUILD.gn index a88e5efa394e66bfe73d6ffe7e59c66c5ae1ef60..4481444fe12c8e70a2d091118b69fe6a442c612b 100644 --- a/khdf/liteos_m/test/sample_driver/BUILD.gn +++ b/khdf/liteos_m/test/sample_driver/BUILD.gn @@ -1,48 +1,42 @@ -# -# Copyright (c) 2021, Huawei Device Co., Ltd. All rights reserved. -# -# Redistribution and use in source and binary forms, with or without modification, -# are permitted provided that the following conditions are met: -# -# 1. Redistributions of source code must retain the above copyright notice, this list of -# conditions and the following disclaimer. -# -# 2. Redistributions in binary form must reproduce the above copyright notice, this list -# of conditions and the following disclaimer in the documentation and/or other materials -# provided with the distribution. -# -# 3. Neither the name of the copyright holder nor the names of its contributors may be used -# to endorse or promote products derived from this software without specific prior written -# permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR -# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# +# Copyright (c) 2021, Huawei Device Co., Ltd. All rights reserved. +# +# Redistribution and use in source and binary forms, with or without modification, +# are permitted provided that the following conditions are met: +# +# 1. Redistributions of source code must retain the above copyright notice, this list of +# conditions and the following disclaimer. +# +# 2. Redistributions in binary form must reproduce the above copyright notice, this list +# of conditions and the following disclaimer in the documentation and/or other materials +# provided with the distribution. +# +# 3. Neither the name of the copyright holder nor the names of its contributors may be used +# to endorse or promote products derived from this software without specific prior written +# permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - -import("//drivers/adapter/khdf/liteos_m/hdf.gni") - -static_library("sample_driver") { - sources = [ - "src/sample_driver.c" - ] - include_dirs = [ - "include" - ] - - deps = [ - "$khdf_path/osal:hdf_osal_lite", - "$khdf_path/core:hdf_core", - ] - - ldflags = [ - "-Wl,--whole-archive" - ] -} + +import("//drivers/adapter/khdf/liteos_m/hdf.gni") + +static_library("sample_driver") { + sources = [ "src/sample_driver.c" ] + include_dirs = [ "include" ] + + deps = [ + "$khdf_path/core:hdf_core", + "$khdf_path/osal:hdf_osal_lite", + ] + + ldflags = [ "-Wl,--whole-archive" ] +}