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