1 /*
2 * Copyright (c) 2020 HiSilicon (Shanghai) Technologies CO., LIMITED.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 * Description: osal adapt atomic timer file.
15 */
16 #include "osal_adapt.h"
17
osal_adapt_timer_init(osal_timer * timer,void * func,unsigned long data,unsigned int interval)18 int osal_adapt_timer_init(osal_timer *timer, void *func, unsigned long data, unsigned int interval)
19 {
20 timer->timer = NULL;
21 timer->handler = func;
22 timer->data = data;
23 timer->interval = interval;
24 return osal_timer_init(timer);
25 }
26
osal_adapt_jiffies_to_msecs(const unsigned int n)27 unsigned int osal_adapt_jiffies_to_msecs(const unsigned int n)
28 {
29 return osal_jiffies_to_msecs(n);
30 }
31
osal_adapt_timer_destroy(osal_timer * timer)32 int osal_adapt_timer_destroy(osal_timer *timer)
33 {
34 return osal_timer_destroy(timer);
35 }
36
osal_adapt_get_jiffies(void)37 unsigned long long osal_adapt_get_jiffies(void)
38 {
39 return osal_get_jiffies();
40 }
41
osal_adapt_timer_mod(osal_timer * timer,unsigned int interval)42 int osal_adapt_timer_mod(osal_timer *timer, unsigned int interval)
43 {
44 return osal_timer_mod(timer, interval);
45 }
46