1 /* 2 * Copyright (C) 2021 HiSilicon (Shanghai) Technologies CO., LIMITED. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 2 7 * of the License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, write to the Free Software 16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 17 */ 18 #ifndef __HDMI_OSAL_H__ 19 #define __HDMI_OSAL_H__ 20 21 #include "hi_type.h" 22 23 typedef enum { 24 OSAL_RDONLY, 25 OSAL_WRONLY, 26 OSAL_RDWR, 27 OSAL_BUTT 28 } osal_file_flag; 29 30 #define is_str_equal(p1, p2) ({ (((p1) != HI_NULL) && ((p2) != HI_NULL) && (osal_strlen(p1) == osal_strlen(p2)) && \ 31 (osal_strncmp(p1, p2, osal_strlen(p1)) == 0)) ? HI_TRUE : HI_FALSE; }) 32 33 struct file *hdmi_osal_file_open(const hi_char *file_name, osal_file_flag e_flags); 34 35 hi_void hdmi_osal_file_close(struct file *file); 36 37 hi_s32 hdmi_osal_file_read(struct file *file, hi_char *buf, hi_u32 len); 38 39 hi_s32 hdmi_osal_file_write(struct file *file, hi_char *buf, hi_u32 len); 40 41 hi_u32 hdmi_osal_get_time_in_ms(hi_void); 42 43 hi_u64 hdmi_osal_get_time_in_us(hi_void); 44 45 #endif /* __HDMI_OSAL_H__ */ 46 47