diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-10 06:52:52 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-05-10 06:52:52 +0000 |
commit | b6adc5e2be61a59ded39267b00b1a15a1d4c1462 (patch) | |
tree | 90aacb633d142c11c6922b13965018a37799de0e /hifi/xaf/hifi-dpf/include/xf-sched.h | |
parent | 0f093620bf86767800575bbd7644fde3c29963b1 (diff) | |
parent | 9f8b1d25aaf497ac7a04690a235050323519aecb (diff) | |
download | hikey-android13-mainline-cellbroadcast-release.tar.gz |
Snap for 8564071 from 9f8b1d25aaf497ac7a04690a235050323519aecb to mainline-cellbroadcast-releaseaml_cbr_331910000aml_cbr_331810000aml_cbr_331710020aml_cbr_331610010aml_cbr_331510000aml_cbr_331411000aml_cbr_331310010aml_cbr_331111030aml_cbr_331013010aml_cbr_330911010aml_cbr_330810000android13-mainline-cellbroadcast-release
Change-Id: Ic7878aff9a21c0c57fef66cc871ce587dfbb86ae
Diffstat (limited to 'hifi/xaf/hifi-dpf/include/xf-sched.h')
-rw-r--r-- | hifi/xaf/hifi-dpf/include/xf-sched.h | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/hifi/xaf/hifi-dpf/include/xf-sched.h b/hifi/xaf/hifi-dpf/include/xf-sched.h deleted file mode 100644 index 3c04436c..00000000 --- a/hifi/xaf/hifi-dpf/include/xf-sched.h +++ /dev/null @@ -1,98 +0,0 @@ -/******************************************************************************* -* Copyright (C) 2018 Cadence Design Systems, Inc. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to use this Software with Cadence processor cores only and -* not with any other processors and platforms, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be included -* in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -******************************************************************************/ - -/******************************************************************************* - * xf-sched.h - * - * Non-preemptive earliest-deadline-first scheduler - * - ******************************************************************************/ - -#ifndef __XF_SCHED_H -#define __XF_SCHED_H - -/******************************************************************************* - * Types definitions - ******************************************************************************/ - -/* ...scheduler data */ -typedef rb_tree_t xf_sched_t; - -/* ...scheduling item */ -typedef rb_node_t xf_task_t; - -/******************************************************************************* - * Helpers - ******************************************************************************/ - -/* ...retrieve timestamp from task handle */ -static inline u32 xf_task_timestamp(xf_task_t *t) -{ - /* ...wipe out last bit of "color" */ - return (((rb_node_t *)t)->color & ~1); -} - -/* ...set task decoding timestamp */ -static inline u32 xf_task_timestamp_set(xf_task_t *t, u32 ts) -{ - /* ...technically, wiping out last bit of timestamp is not needed */ - return (((rb_node_t *)t)->color = ts); -} - -/* ...compare two timestamps with respect to wrap-around */ -static inline int xf_timestamp_before(u32 t0, u32 t1) -{ - /* ...distance between active items is never high */ - return ((s32)(t0 - t1) < 0); -} - -/* ...current scheduler timestamp */ -static inline u32 xf_sched_timestamp(xf_sched_t *sched) -{ - /* ...don't quite care about last bit */ - return ((rb_tree_t *)sched)->root.color; -} - -/* ...set scheduler timestamp */ -static inline u32 xf_sched_timestamp_set(xf_sched_t *sched, u32 ts) -{ - /* ...wipe out last bit (black color is 0) */ - return (((rb_tree_t *)sched)->root.color = ts & ~0x1); -} - -/******************************************************************************* - * Entry points - ******************************************************************************/ - -/* ...place message into scheduler queue */ -extern void xf_sched_put(xf_sched_t *sched, xf_task_t *t, u32 ts); - -/* ...get first item from the scheduler */ -extern xf_task_t * xf_sched_get(xf_sched_t *sched); - -/* ...cancel task execution */ -extern void xf_sched_cancel(xf_sched_t *sched, xf_task_t *t); - -/* ...initialize scheduler */ -extern void xf_sched_init(xf_sched_t *sched); - -#endif /* __XF_SCHED_H */ |