mirror of
https://gitee.com/openharmony/resourceschedule_ffrt
synced 2024-12-02 10:26:58 +00:00
add ffrt ndk
Signed-off-by: wangyulie <wanglieyu@126.com>
This commit is contained in:
parent
d609c95cbd
commit
b25bcd5c61
76
BUILD.gn
76
BUILD.gn
@ -155,3 +155,79 @@ ohos_shared_library("libffrt") {
|
||||
]
|
||||
relative_install_dir = "chipset-sdk"
|
||||
}
|
||||
|
||||
ohos_shared_library("ffrt_ndk") {
|
||||
output_name = "ffrt"
|
||||
configs = [ ":ffrt_config" ]
|
||||
|
||||
sources = [
|
||||
"src/core/entity.cpp",
|
||||
"src/core/task.cpp",
|
||||
"src/core/task_ctx.cpp",
|
||||
"src/core/version_ctx.cpp",
|
||||
"src/dfx/bbox/bbox.cpp",
|
||||
"src/dfx/log/ffrt_log.cpp",
|
||||
"src/dfx/log/hmos/log_base.cpp",
|
||||
"src/dfx/trace/ffrt_trace.cpp",
|
||||
"src/dfx/watchdog/watchdog.cpp",
|
||||
"src/eu/co2_context.c",
|
||||
"src/eu/co_routine.cpp",
|
||||
"src/eu/cpu_monitor.cpp",
|
||||
"src/eu/cpu_worker.cpp",
|
||||
"src/eu/cpuworker_manager.cpp",
|
||||
"src/eu/execute_unit.cpp",
|
||||
"src/eu/osattr_manager.cpp",
|
||||
"src/eu/qos_config.cpp",
|
||||
"src/eu/qos_convert.cpp",
|
||||
"src/eu/qos_interface.cpp",
|
||||
"src/eu/rtg_ioctl.cpp",
|
||||
"src/eu/rtg_perf_ctrl.c",
|
||||
"src/eu/worker_manager.cpp",
|
||||
"src/eu/worker_thread.cpp",
|
||||
"src/queue/queue_monitor.cpp",
|
||||
"src/queue/serial_handler.cpp",
|
||||
"src/queue/serial_looper.cpp",
|
||||
"src/queue/serial_queue.cpp",
|
||||
"src/queue/serial_queue_api.cpp",
|
||||
"src/queue/serial_task.cpp",
|
||||
"src/sched/deadline.cpp",
|
||||
"src/sched/execute_ctx.cpp",
|
||||
"src/sched/frame_interval.cpp",
|
||||
"src/sched/interval.cpp",
|
||||
"src/sched/load_tracking.cpp",
|
||||
"src/sched/multi_workgroup.cpp",
|
||||
"src/sched/sched_deadline.cpp",
|
||||
"src/sched/task_manager.cpp",
|
||||
"src/sched/task_state.cpp",
|
||||
"src/sync/condition_variable.cpp",
|
||||
"src/sync/delayed_worker.cpp",
|
||||
"src/sync/io_poller.cpp",
|
||||
"src/sync/mutex.cpp",
|
||||
"src/sync/mutex_perf.cpp",
|
||||
"src/sync/perf_counter.cpp",
|
||||
"src/sync/sleep.cpp",
|
||||
"src/sync/sync.cpp",
|
||||
"src/sync/thread.cpp",
|
||||
"src/sync/wait_queue.cpp",
|
||||
"src/util/graph_check.cpp",
|
||||
"src/util/task_deleter.cpp",
|
||||
]
|
||||
|
||||
external_deps = [
|
||||
"faultloggerd:libbacktrace_local",
|
||||
"frame_aware_sched:rtg_interface",
|
||||
"hilog:libhilog",
|
||||
"hisysevent:libhisysevent",
|
||||
"hitrace:hitrace_meter",
|
||||
"ipc:ipc_core",
|
||||
]
|
||||
|
||||
deps = [
|
||||
"//third_party/bounds_checking_function:libsec_shared",
|
||||
"//third_party/libunwind:libunwind",
|
||||
]
|
||||
|
||||
part_name = "ffrt"
|
||||
subsystem_name = "resourceschedule"
|
||||
innerapi_tags = [ "ndk" ]
|
||||
}
|
||||
|
@ -28,6 +28,7 @@
|
||||
"hisysevent",
|
||||
"hitrace",
|
||||
"ipc",
|
||||
"napi",
|
||||
"frame_aware_sched",
|
||||
"faultloggerd"
|
||||
],
|
||||
@ -38,7 +39,8 @@
|
||||
},
|
||||
"build": {
|
||||
"sub_component": [
|
||||
"//foundation/resourceschedule/ffrt:libffrt"
|
||||
"//foundation/resourceschedule/ffrt:libffrt",
|
||||
"//foundation/resourceschedule/ffrt:ffrt_ndk"
|
||||
],
|
||||
"inner_kits": [
|
||||
{
|
||||
|
41
interfaces/kits/BUILD.gn
Normal file
41
interfaces/kits/BUILD.gn
Normal file
@ -0,0 +1,41 @@
|
||||
# Copyright (c) 2023 Huawei Device Co., Ltd.
|
||||
# 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
|
||||
#
|
||||
# http://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.
|
||||
|
||||
import("//build/ohos.gni")
|
||||
import("//build/ohos/ndk/ndk.gni")
|
||||
|
||||
ohos_ndk_headers("ffrt_header") {
|
||||
dest_dir = "$ndk_headers_out_dir/ffrt"
|
||||
sources = [
|
||||
"c/condition_variable.h",
|
||||
"c/mutex.h",
|
||||
"c/queue.h",
|
||||
"c/sleep.h",
|
||||
"c/task.h",
|
||||
"c/type_def.h",
|
||||
]
|
||||
}
|
||||
|
||||
ohos_ndk_library("libffrt_ndk") {
|
||||
output_name = "ffrt"
|
||||
ndk_description_file = "./ffrt.ndk.json"
|
||||
system_capability = "SystemCapability.Resourceschedule.Ffrt.Core"
|
||||
system_capability_headers = [
|
||||
"ffrt/condition_variable.h",
|
||||
"ffrt/mutex.h",
|
||||
"ffrt/queue.h",
|
||||
"ffrt/sleep.h",
|
||||
"ffrt/task.h",
|
||||
"ffrt/type_def.h",
|
||||
]
|
||||
}
|
@ -13,11 +13,24 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup Ffrt
|
||||
* @{
|
||||
*
|
||||
* @brief ffrt provides APIs.
|
||||
*
|
||||
*
|
||||
* @syscap SystemCapability.Resourceschedule.Ffrt.Core
|
||||
*
|
||||
* @since 10
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file condition_variable.h
|
||||
*
|
||||
* @brief Declares the condition variable interfaces in C.
|
||||
*
|
||||
* @syscap SystemCapability.Resourceschedule.Ffrt.Core
|
||||
* @since 10
|
||||
* @version 1.0
|
||||
*/
|
||||
@ -33,6 +46,7 @@
|
||||
* @param attr Indicates a pointer to the condition variable attribute.
|
||||
* @return Returns <b>ffrt_thrd_success</b> if the condition variable is initialized;
|
||||
returns <b>ffrt_thrd_error</b> otherwise.
|
||||
* @syscap SystemCapability.Resourceschedule.Ffrt.Core
|
||||
* @since 10
|
||||
* @version 1.0
|
||||
*/
|
||||
@ -44,6 +58,7 @@ FFRT_C_API int ffrt_cond_init(ffrt_cond_t* cond, const ffrt_condattr_t* attr);
|
||||
* @param cond Indicates a pointer to the condition variable.
|
||||
* @return Returns <b>ffrt_thrd_success</b> if the thread is unblocked;
|
||||
returns <b>ffrt_thrd_error</b> otherwise.
|
||||
* @syscap SystemCapability.Resourceschedule.Ffrt.Core
|
||||
* @since 10
|
||||
* @version 1.0
|
||||
*/
|
||||
@ -55,6 +70,7 @@ FFRT_C_API int ffrt_cond_signal(ffrt_cond_t* cond);
|
||||
* @param cond Indicates a pointer to the condition variable.
|
||||
* @return Returns <b>ffrt_thrd_success</b> if the threads are unblocked;
|
||||
returns <b>ffrt_thrd_error</b> otherwise.
|
||||
* @syscap SystemCapability.Resourceschedule.Ffrt.Core
|
||||
* @since 10
|
||||
* @version 1.0
|
||||
*/
|
||||
@ -67,6 +83,7 @@ FFRT_C_API int ffrt_cond_broadcast(ffrt_cond_t* cond);
|
||||
* @param mutex Indicates a pointer to the mutex.
|
||||
* @return Returns <b>ffrt_thrd_success</b> if the thread is unblocked after being blocked;
|
||||
returns <b>ffrt_thrd_error</b> otherwise.
|
||||
* @syscap SystemCapability.Resourceschedule.Ffrt.Core
|
||||
* @since 10
|
||||
* @version 1.0
|
||||
*/
|
||||
|
@ -13,11 +13,24 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup Ffrt
|
||||
* @{
|
||||
*
|
||||
* @brief ffrt provides APIs.
|
||||
*
|
||||
*
|
||||
* @syscap SystemCapability.Resourceschedule.Ffrt.Core
|
||||
*
|
||||
* @since 10
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file mutex.h
|
||||
*
|
||||
* @brief Declares the mutex interfaces in C.
|
||||
*
|
||||
* @syscap SystemCapability.Resourceschedule.Ffrt.Core
|
||||
* @since 10
|
||||
* @version 1.0
|
||||
*/
|
||||
|
@ -13,11 +13,24 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup Ffrt
|
||||
* @{
|
||||
*
|
||||
* @brief ffrt provides APIs.
|
||||
*
|
||||
*
|
||||
* @syscap SystemCapability.Resourceschedule.Ffrt.Core
|
||||
*
|
||||
* @since 10
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file queue.h
|
||||
*
|
||||
* @brief Declares the queue interfaces in C.
|
||||
*
|
||||
* @syscap SystemCapability.Resourceschedule.Ffrt.Core
|
||||
* @since 10
|
||||
* @version 1.0
|
||||
*/
|
||||
|
@ -13,11 +13,24 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup Ffrt
|
||||
* @{
|
||||
*
|
||||
* @brief ffrt provides APIs.
|
||||
*
|
||||
*
|
||||
* @syscap SystemCapability.Resourceschedule.Ffrt.Core
|
||||
*
|
||||
* @since 10
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file sleep.h
|
||||
*
|
||||
* @brief Declares the sleep and yield interfaces in C.
|
||||
*
|
||||
* @syscap SystemCapability.Resourceschedule.Ffrt.Core
|
||||
* @since 10
|
||||
* @version 1.0
|
||||
*/
|
||||
|
@ -13,11 +13,24 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup Ffrt
|
||||
* @{
|
||||
*
|
||||
* @brief ffrt provides APIs.
|
||||
*
|
||||
*
|
||||
* @syscap SystemCapability.Resourceschedule.Ffrt.Core
|
||||
*
|
||||
* @since 10
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file task.h
|
||||
*
|
||||
* @brief Declares the task interfaces in C.
|
||||
*
|
||||
* @syscap SystemCapability.Resourceschedule.Ffrt.Core
|
||||
* @since 10
|
||||
* @version 1.0
|
||||
*/
|
||||
|
@ -12,12 +12,25 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup Ffrt
|
||||
* @{
|
||||
*
|
||||
* @brief ffrt provides APIs.
|
||||
*
|
||||
*
|
||||
* @syscap SystemCapability.Resourceschedule.Ffrt.Core
|
||||
*
|
||||
* @since 10
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file type_def.h
|
||||
*
|
||||
* @brief Declares common types.
|
||||
*
|
||||
* @syscap SystemCapability.Resourceschedule.Ffrt.Core
|
||||
* @since 10
|
||||
* @version 1.0
|
||||
*/
|
||||
|
45
interfaces/kits/ffrt.ndk.json
Normal file
45
interfaces/kits/ffrt.ndk.json
Normal file
@ -0,0 +1,45 @@
|
||||
[
|
||||
{ "name": "ffrt_cond_init" },
|
||||
{ "name": "ffrt_cond_signal" },
|
||||
{ "name": "ffrt_cond_broadcast" },
|
||||
{ "name": "ffrt_cond_wait" },
|
||||
{ "name": "ffrt_cond_timedwait" },
|
||||
{ "name": "ffrt_cond_destroy" },
|
||||
{ "name": "ffrt_mutex_init" },
|
||||
{ "name": "ffrt_mutex_lock" },
|
||||
{ "name": "ffrt_mutex_unlock" },
|
||||
{ "name": "ffrt_mutex_trylock" },
|
||||
{ "name": "ffrt_mutex_destroy" },
|
||||
{ "name": "ffrt_queue_attr_init" },
|
||||
{ "name": "ffrt_queue_attr_destroy" },
|
||||
{ "name": "ffrt_queue_attr_set_qos" },
|
||||
{ "name": "ffrt_queue_attr_get_qos" },
|
||||
{ "name": "ffrt_queue_attr_set_timeout" },
|
||||
{ "name": "ffrt_queue_attr_get_timeout" },
|
||||
{ "name": "ffrt_queue_attr_set_callback" },
|
||||
{ "name": "ffrt_queue_attr_get_callback" },
|
||||
{ "name": "ffrt_queue_create" },
|
||||
{ "name": "ffrt_queue_destroy" },
|
||||
{ "name": "ffrt_queue_submit" },
|
||||
{ "name": "ffrt_queue_submit_h" },
|
||||
{ "name": "ffrt_queue_wait" },
|
||||
{ "name": "ffrt_queue_cancel" },
|
||||
{ "name": "ffrt_usleep" },
|
||||
{ "name": "ffrt_yield" },
|
||||
{ "name": "ffrt_task_attr_init" },
|
||||
{ "name": "ffrt_task_attr_set_name" },
|
||||
{ "name": "ffrt_task_attr_get_name" },
|
||||
{ "name": "ffrt_task_attr_destroy" },
|
||||
{ "name": "ffrt_task_attr_set_qos" },
|
||||
{ "name": "ffrt_task_attr_get_qos" },
|
||||
{ "name": "ffrt_task_attr_set_delay" },
|
||||
{ "name": "ffrt_task_attr_get_delay" },
|
||||
{ "name": "ffrt_this_task_update_qos" },
|
||||
{ "name": "ffrt_this_task_get_id" },
|
||||
{ "name": "ffrt_alloc_auto_managed_function_storage_base" },
|
||||
{ "name": "ffrt_submit_base" },
|
||||
{ "name": "ffrt_submit_h_base" },
|
||||
{ "name": "ffrt_task_handle_destroy" },
|
||||
{ "name": "ffrt_wait_deps" },
|
||||
{ "name": "ffrt_wait" }
|
||||
]
|
Loading…
Reference in New Issue
Block a user