xref: /wlan-driver/fw-api/hw/kiwi/v2/HALcomdef.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 
2 /*
3  * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #ifndef HAL_COMDEF_H
21 #define HAL_COMDEF_H
22 
23 #ifndef _ARM_ASM_
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
29 #include "com_dtypes.h"
30 
31 #ifndef _BOOL32_DEFINED
32 typedef  unsigned long int  bool32;
33 #define _BOOL32_DEFINED
34 #endif
35 
36 #define HAL_ENUM_32BITS(x) HAL_##x##_FORCE32BITS = 0x7FFFFFFF
37 
38   #define inp(port)         (*((volatile byte *) (port)))
39   #define inpw(port)        (*((volatile word *) (port)))
40   #define inpdw(port)       (*((volatile dword *)(port)))
41 
42   #define outp(port, val)   (*((volatile byte *) (port)) = ((byte) (val)))
43   #define outpw(port, val)  (*((volatile word *) (port)) = ((word) (val)))
44   #define outpdw(port, val) (*((volatile dword *) (port)) = ((dword) (val)))
45 
46 #ifdef __cplusplus
47 }
48 #endif
49 
50 #endif
51 
52 #endif
53