• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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: wifi dmac os adapt layer
15  * Author:
16  * Create: 2021-08-05
17  */
18 
19 #ifndef __FRW_OSAL_H__
20 #define __FRW_OSAL_H__
21 
22 #include "osal_types.h"
23 #include "oal_types.h"
24 #include "osal_adapt.h"
25 #if defined(_PRE_OS_VERSION_LINUX) && defined(_PRE_OS_VERSION) && (_PRE_OS_VERSION_LINUX == _PRE_OS_VERSION)
26 #include<linux/interrupt.h>
27 #endif
28 /* 禁止所有中断 */
frw_osal_irq_lock(osal_void)29 static inline osal_u32 frw_osal_irq_lock(osal_void)
30 {
31 #if defined(_PRE_OS_VERSION_LINUX) && defined(_PRE_OS_VERSION) && (_PRE_OS_VERSION_LINUX == _PRE_OS_VERSION)
32     local_irq_disable();
33     return OAL_SUCC;
34 #else
35     return osal_adapt_irq_lock();
36 #endif
37 }
38 
39 /* 恢复中断 */
frw_osal_irq_restore(osal_u32 irq_status)40 static inline osal_void frw_osal_irq_restore(osal_u32 irq_status)
41 {
42 #if defined(_PRE_OS_VERSION_LINUX) && defined(_PRE_OS_VERSION) && (_PRE_OS_VERSION_LINUX == _PRE_OS_VERSION)
43     unref_param(irq_status);
44     local_irq_enable();
45     return;
46 #else
47     return osal_adapt_irq_restore(irq_status);
48 #endif
49 }
50 
51 #endif // endif __FRW_OSAL_H__
52 
53