• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2022 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 
19 #ifndef __HI_COMMON_H__
20 #define __HI_COMMON_H__
21 
22 #include "hi_type.h"
23 #include "hi_log.h"
24 #ifndef __KERNEL__
25 #include <time.h>
26 #endif
27 
28 #ifdef __cplusplus
29 #if __cplusplus
30 extern "C" {
31 #endif
32 #endif /* __cplusplus */
33 
34 /*******************************Structure declaration *****************************/
35 /* @addtogroup     COMMON */
36 /* @{ */ /** <!--  [COMMON] */
37 
38 #define HI_USLEEP(us)                       \
39     do {                                    \
40         struct timespec ts;                 \
41         ts.tv_sec = us / 1000000;           \
42         ts.tv_nsec = (us % 1000000) * 1000; \
43         nanosleep(&ts, NULL);               \
44     } while (0)
45 
46 /** Global config structure */
47 typedef struct hiSYS_CONF_S {
48     /* <Not used, reserved for extension */
49     /* <CNcomment: ÔÝʱûÓÝʹÓã¬Ýô´ýÀ©Õ¹ */
50     hi_u32 u32Reverse;
51 } HI_SYS_CONF_S;
52 
53 /* Define the chip type. */
54 typedef enum hiCHIP_TYPE_E {
55     HI_CHIP_TYPE_HI3751,
56 
57     HI_CHIP_TYPE_BUTT
58 } HI_CHIP_TYPE_E;
59 
60 /* Define the chip version. */
61 typedef enum hiCHIP_VERSION_E {
62     HI_CHIP_VERSION_V300 = 0x300,
63     HI_CHIP_VERSION_V310 = 0x310,
64     HI_CHIP_VERSION_V320 = 0x320,
65     HI_CHIP_VERSION_V330 = 0x330,
66     HI_CHIP_VERSION_V350 = 0x350,
67     HI_CHIP_VERSION_V351 = 0x351,
68     HI_CHIP_VERSION_BUTT
69 } HI_CHIP_VERSION_E;
70 
71 /* Define the chip support attrs */
72 typedef enum hiCHIP_CAP_E {
73     HI_CHIP_CAP_DOLBY,
74     HI_CHIP_CAP_DTS,
75     HI_CHIP_CAP_ADVCA,
76     HI_CHIP_CAP_MACROVISION,
77     HI_CHIP_CAP_DD,
78     HI_CHIP_CAP_DBX,
79 
80     HI_CHIP_CAP_BUTT
81 } HI_CHIP_CAP_E;
82 
83 /* System version, that is, the version of the software developer's kit (SDK) */
84 typedef struct hiSYS_VERSION_S {
85     HI_CHIP_TYPE_E
86     /* <Chip type corresponding to the SDK */
87     /* <CNcomment:  SDKÈí¼þ¶ÔÓ¦µÄݾƬÀàÝÝ */
88     enChipTypeSoft;
89     HI_CHIP_TYPE_E
90     /* <Chip type that is detected when the SDK is running */
91     /* <CNcomment:  SDKÔËÝÝʱ¼ì²âµ½µÄݾƬÀàÝÝ */
92     enChipTypeHardWare;
93     HI_CHIP_VERSION_E
94     /* <Chip version that is detected when the SDK is running */
95     /* <CNcomment: SDKÔËÝÝʱ¼ì²âµ½Ý¾Æ¬°æ±¾ºÅ */
96     enChipVersion;
97     /* <Version string of the SDK */
98     /* <CNcomment:  SDKÈí¼þ°æ±¾ºÅ×Ö·û´® */
99     hi_char aVersion[80]; /* 80 ??ʾSDK Version???��? */
100     /* <Version string of the Boot */
101     /* <CNcomment:  Boot°æ±¾ºÅ×Ö·û´® */
102     hi_char BootVersion[80]; /* 80 ??ʾBoot Version???��? */
103 } HI_SYS_VERSION_S;
104 
105 /* Define the chip attributes */
106 typedef struct hiSYS_CHIP_ATTR_S {
107     /* <Whether this chip support dolby or not */
108     /* <CNcomment:ݾƬÊÇ·ñÖ§³Ö¶Å±È */
109     hi_bool bDolbySupport;
110     /* <the unique chipid */
111     /* <CNcomment:ݾƬΨһID */
112     hi_u64 u64ChipID;
113 } HI_SYS_CHIP_ATTR_S;
114 
115 /* Maximum bytes of a buffer name */
116 #define MAX_BUFFER_NAME_SIZE 32
117 
118 /* Structure of an MMZ buffer */
119 typedef struct hiMMZ_BUF_S {
120     /* <Strings of an MMZ buffer name */
121     /* <CNcomment:  MMZ bufferÃû×Ö×Ö·û´® */
122     hi_char bufname[MAX_BUFFER_NAME_SIZE];
123     /* <Physical address of an MMZ buffer */
124     /* <CNcomment:  MMZ bufferÎïÀíµØÖ· */
125     hi_u32 phyaddr;
126     /* <Kernel-state virtual address of an MMZ buffer */
127     /* <CNcomment:  MMZ bufferÄÚºË̬ÝéÄâµØÖ· */
128     hi_u8 *kernel_viraddr;
129     /* <User-state virtual address of an MMZ buffer */
130     /* <CNcomment:  MMZ bufferÓû§Ì¬ÝéÄâµØÖ· */
131     hi_u8 *user_viraddr;
132     /* <Size of an MMZ buffer */
133     /* <CNcomment:  MMZ buffer´óÝ¡ */
134     hi_u32 bufsize;
135     /* <Overflow threshold of an MMZ buffer, in percentage. For example, the value 100 indicates 100%. */
136     /* <CNcomment:  MMZ bufferÉÝÒçË®Ýߣ¬°´°Ù·Ö±ÈÉèÖã¬ÀýÈç: 100 indicates 100%. */
137     hi_u32 overflow_threshold;
138     /* <Underflow threshold of an MMZ buffer, in percentage. For example, the value 0 indicates 0%. */
139     /* <CNcomment:  MMZ bufferÝÂÒçË®Ýߣ¬°´°Ù·Ö±ÈÉèÖã¬ÀýÈç: 0 indicates 0%. */
140     hi_u32 underflow_threshold;
141 } HI_MMZ_BUF_S;
142 
143 typedef struct hiRECT_S {
144     hi_s32 s32X;
145     hi_s32 s32Y;
146     hi_s32 s32Width;
147     hi_s32 s32Height;
148 } HI_RECT_S;
149 
150 typedef struct hiRANGE_S {
151     hi_u32 u32Min; /* <the minimum value */ /* <CNcomment È¡Öµ·¶Î§×îÝ¡Öµ */
152     hi_u32 u32Max; /* <the maximum value */ /* <CNcomment È¡Öµ·¶Î§×î´óÖµ */
153 } HI_RANGE_S;
154 
155 typedef struct hiCOLOR_S {
156     hi_u32 u32R; /* <the value of red color */   /* <CNcomment ºìÉ«·ÖÝ¿ */
157     hi_u32 u32G; /* <the value of green color */ /* <CNcomment ÂÌÉ«·ÖÝ¿ */
158     hi_u32 u32B; /* <the value of blue color */  /* <CNcomment À¶É«·ÖÝ¿ */
159 } HI_COLOR_S;
160 
161 typedef enum hiLAYER_ZORDER_E {
162     HI_LAYER_ZORDER_MOVETOP = 0,
163     /* <Move to the top */ /* <CNcomment:  ÒƵ½×²¿ */
164     HI_LAYER_ZORDER_MOVEUP,
165     /* <Move up */ /* <CNcomment:  ÝòÉÝÒƵ½ */
166     HI_LAYER_ZORDER_MOVEBOTTOM,
167     /* <Move to the bottom */ /* <CNcomment:  ÒƵ½×îµ×²¿ */
168     HI_LAYER_ZORDER_MOVEDOWN,
169     /* <Move down */ /* <CNcomment:  ÝòÝÂÒƵ½ */
170     HI_LAYER_ZORDER_BUTT
171 } HI_LAYER_ZORDER_E;
172 
173 typedef enum hiSYS_POLICY_TYPE {
174     HI_SYS_POLICY_EXTRA_BUFF = 0,
175     HI_SYS_POLICY_CTS_FLAG = 1,
176     HI_SYS_POLICY_GTS_FLAG = 2,
177     HI_SYS_POLICY_DISP_WIDTH = 3,
178     HI_SYS_POLICY_VCODEC_WIDTH = 4,
179     HI_SYS_POLICY_BUTT
180 } HI_SYS_POLICY_TYPE_E;
181 
182 typedef struct {
183     hi_bool bPolicyValid;
184     hi_u32 u32PolicyValue;
185 } HI_SYS_POLICY_S;
186 
187 /* Defines user mode proc show buffer */
188 /* CNcomment: Óû§Ì¬PROC buffer¶¨Òå */
189 typedef struct hiPROC_SHOW_BUFFER_S {
190     hi_u8 *pu8Buf; /* <Buffer address */ /* <CNcomment: BufferµØÖ· */
191     hi_u32 u32Size; /* <Buffer size */ /* <CNcomment: Buffer´óÝ¡ */
192     hi_u32 u32Offset; /* <Offset */ /* <CNcomment: ´òÓ¡Æ«ÒƵØÖ· */
193 } HI_PROC_SHOW_BUFFER_S;
194 
195 /* Proc show function */
196 /* CNcomment: ProcÝÅÝ¢ÝÔʾ»Øµ÷º¯Êý */
197 typedef hi_s32 (*HI_PROC_SHOW_FN)(HI_PROC_SHOW_BUFFER_S *pstBuf, hi_void *pPrivData);
198 
199 /* Proc command function */
200 /* CNcomment: Proc¿ØÖƻص÷º¯Êý */
201 typedef hi_s32 (*HI_PROC_CMD_FN)(HI_PROC_SHOW_BUFFER_S *pstBuf, hi_u32 u32Argc, hi_u8 *pu8Argv[],
202     hi_void *pPrivData);
203 
204 /* Defines user mode proc entry */
205 /* CNcomment: Óû§Ì¬PROCÈë¿Ú¶¨Òå */
206 typedef struct hiPROC_ENTRY_S {
207     hi_char *pszEntryName; /* <Entry name */ /* <CNcomment: Èë¿ÚÎļþÃû */
208     /* <Directory name. If null, the entry will be added to /proc/hisi directory */
209     hi_char *pszDirectory;
210     /* <CNcomment: Ŀ¼Ãû£¬Èç¹ûΪ¿Õ£¬½«´´½¨µ½/proc/hisiĿ¼Ý */
211     HI_PROC_SHOW_FN
212     pfnShowProc; /* <Proc show function */ /* <CNcomment: ProcÝÅÝ¢ÝÔʾ»Øµ÷º¯Êý */
213     HI_PROC_CMD_FN pfnCmdProc; /* <Proc command function */ /* <CNcomment: Proc¿ØÖƻص÷º¯Êý */
214     hi_void *pPrivData; /* <Private data */ /* <CNcomment: BufferµØÖ· */
215 } HI_PROC_ENTRY_S;
216 
217 /* Defines DDR configuration type struct */
218 /* CNcomment: DDR ÅäÖÃÀàÝݽṹ¶¨Òå */
219 typedef struct hiSYS_MEM_CONFIG_S {
220     hi_u32 u32TotalSize; /* Total memory size(MB) */ /* <CNcomment: ×ÜÄÚ´æ´óÝ¡(MB) */
221     hi_u32 u32MMZSize; /* MMZ memory size(MB) */ /* <CNcomment: MMZÄÚ´æ´óÝ¡(MB) */
222 } HI_SYS_MEM_CONFIG_S;
223 
224 /* Defines common flag type struct */
225 typedef struct {
226     hi_s32 cts_flag;
227     hi_s32 gts_flag;
228 } HI_SYS_COMM_FLAG_S;
229 
230 #ifndef __KERNEL__
231 /* @} */ /* <!-- ==== Structure Definition end ==== */
232 
233 /******************************* API declaration *****************************/
234 /* \addtogroup      COMMON */
235 /* @{ */ /* <!-- [COMMON] */
236 
237 /**
238 @brief Initializes the system. CNcomment: ݵݳ³õʼ»¯ CNend
239 @attention \n
240 You must call this API to initialize the system before using the APIs of all modules.
241 Though you can call other APIs successfully before calling this API, the subsequent operations may fail.\n
242 CNcomment: ÔÚʹÓÃËùÓÝÄ£¿éµÄ½Ó¿Ú֮ǰ¶¼ÝèÒªÝȵ÷Óô˽ӿڶÔݵݳ½øÝݳõʼ»¯\n
243 ÔÚµ÷ÓÃÕâ¸ö½Ó¿Ú֮ǰµ÷ÓÃÆäËû½Ó¿Ú£¬²»»á·µ»Øʧ°Ü£¬µ«ÊDz»±£Ö¤Ö´ÝݵÄÕýÈ·ÝÔ CNend
244 @param N/A CNcomment: ÎÞ CNend
245 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
246 @retval ::HI_FAILURE Calling this API fails. CNcomment: APIݵݳµ÷ÓÃʧ°Ü CNend
247 @see \n
248 N/A CNcomment: ÎÞ CNend
249 */
250 hi_s32 HI_SYS_Init(void);
251 
252 /**
253 @brief Deinitializes the system. CNcomment: ݵݳȥ³õʼ»¯ CNend
254 @attention \n
255 If all modules are not used, you need to call this API to deinitialize the system.\n
256 CNcomment: ËùÓÝÄ£¿é¶¼²»ÔÙʹÓúóµ÷Óô˽ӿÚÈ¥³õʼ»¯ CNend
257 @param N/A CNcomment: ÎÞ CNend
258 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
259 @retval ::HI_FAILURE Calling this API fails. CNcomment: APIݵݳµ÷ÓÃʧ°Ü CNend
260 @see \n
261 N/A CNcomment: ÎÞ CNend
262 */
263 hi_s32 HI_SYS_DeInit(void);
264 
265 /**
266 @brief Obtains the compiled time of a version. CNcomment: »ñÈ¡°æ±¾µÄ±àÒëʱ¼ä CNend
267 @attention \n
268 The compiled time is the time during which the common module is made again.
269 CNcomment: ʱ¼äΪ½øÝÝcommonÄ£¿éÖØÝÂmakeµÄʱ¼ä CNend
270 @param[out] pstTime Pointer to the compiled time of a version (output).
271     CNcomment: Ö¸ÕëÀàÝÝ£¬Êä³ö°æ±¾±àÒëµÄʱ¼ä¡£ CNend
272 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
273 @retval ::HI_FAILURE Calling this API fails. CNcomment: APIݵݳµ÷ÓÃʧ°Ü CNend
274 @see \n
275 N/A CNcomment: ÎÞ CNend
276 */
277 hi_s32 HI_SYS_GetBuildTime(struct tm *pstTime);
278 
279 /**
280 @brief Obtains the version number. CNcomment: »ñÈ¡°æ±¾ºÅ CNend
281 @attention \n
282 N/A CNcomment: ÎÞ CNend
283 @param[out] pstVersion Pointer to the version number (output). CNcomment: Ö¸ÕëÀàÝÝ£¬Êä³ö°æ±¾ºÅ¡£ CNend
284 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
285 @retval ::HI_FAILURE Calling this API fails. CNcomment: APIݵݳµ÷ÓÃʧ°Ü CNend
286 @see \n
287 N/A CNcomment: ÎÞ CNend
288 */
289 hi_s32 HI_SYS_GetVersion(HI_SYS_VERSION_S *pstVersion);
290 
291 /**
292 @brief Obtains the chip support attributes. CNcomment: »ñȡݾƬ֧³ÖµÄÄÜݦÊôÝÔ CNend
293 @attention \n
294 N/A CNcomment: ÎÞ CNend
295 @param[in] enChipCap Indicate which chip capability. CNcomment: ÊäÈë²ÎÊý£¬Ö¸Ã÷»ñÈ¡ºÎÖÖݾƬÄÜݦÊôÝÔCNend
296 @param[out] pbSupport Pointer to the chip whether support the attributes(output).
297     CNcomment: Êä³ö²ÎÊý£¬±£´æ»ñÈ¡½á¹û CNend
298 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
299 @retval ::HI_FAILURE Calling this API fails. CNcomment: APIݵݳµ÷ÓÃʧ°Ü CNend
300 @see \n
301 N/A CNcomment: ÎÞ CNend
302 */
303 hi_s32 HI_SYS_GetChipCapability(HI_CHIP_CAP_E enChipCap, hi_bool *pbSupport);
304 
305 /**
306 @brief Obtains the chip attributes. CNcomment: »ñȡݾƬÊôÝÔ CNend
307 @attention \n
308 N/A CNcomment: ÎÞ CNend
309 @param[out] pstChipAttr Pointer to the chip attributes(output). CNcomment: Ö¸ÕëÀàÝÝ£¬Êä³öݾƬÊôÝÔ CNend
310 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
311 @retval ::HI_FAILURE Calling this API fails. CNcomment: APIݵݳµ÷ÓÃʧ°Ü CNend
312 @see \n
313 N/A CNcomment: ÎÞ CNend
314 */
315 hi_s32 HI_SYS_GetChipAttr(HI_SYS_CHIP_ATTR_S *pstChipAttr);
316 
317 /**
318 @brief Obtains the chip attributes. CNcomment: »ñÈ¡ÄÚ´æÅäÖÃÝÅÝ¢ CNend
319 @attention \n
320 N/A CNcomment: ÎÞ CNend
321 @param[out] pstConfig Pointer to address for memory configuration(output).
322     CNcomment: Ö¸ÕëÀàÝÝ£¬Êä³öÄÚ´æÅäÖÃÝÅÝ¢Ö¸Õë CNend
323 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
324 @retval ::HI_FAILURE Calling this API fails. CNcomment: APIݵݳµ÷ÓÃʧ°Ü CNend
325 @see \n
326 N/A CNcomment: ÎÞ CNend
327 */
328 hi_s32 HI_SYS_GetMemConfig(HI_SYS_MEM_CONFIG_S *pstConfig);
329 
330 /**
331 @brief Performs global system configuration. CNcomment: ÉèÖÃݵݳµÄÈ«¾ÖÅäÖà CNend
332 @attention \n
333 N/A CNcomment: ÎÞ CNend
334 @param[in] pstSysConf Pointer to the address for system configuration
335     CNcomment: Ö¸ÕëÀàÝÝ£¬ÝµÝ³ÅäÖÃÖ¸ÕëµØÖ·¡£ CNend
336 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
337 @retval ::HI_FAILURE Calling this API fails. CNcomment: APIݵݳµ÷ÓÃʧ°Ü CNend
338 @see \n
339 N/A CNcomment: ÎÞ CNend
340 */
341 hi_s32 HI_SYS_SetConf(const HI_SYS_CONF_S *pstSysConf);
342 
343 /**
344 @brief Obtains global system configuration. CNcomment: »ñȡݵݳµÄÈ«¾ÖÅäÖà CNend
345 @attention \n
346 N/A CNcomment: ÎÞ CNend
347 @param[out] pstSysConf Pointer to the system configuration (output). CNcomment: Ö¸ÕëÀàÝÝ£¬Êä³öݵݳÅäÖᣠCNend
348 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
349 @retval ::HI_FAILURE Calling this API fails. CNcomment: APIݵݳµ÷ÓÃʧ°Ü CNend
350 @see \n
351 N/A CNcomment: ÎÞ CNend
352 */
353 hi_s32 HI_SYS_GetConf(HI_SYS_CONF_S *pstSysConf);
354 
355 /**
356 @brief Get policy. CNcomment: CNend
357 @attention \n
358 N/A CNcomment:CNend
359 @param[out] policy Pointer to the value (output) CNcomment:CNend
360 @retval ::HI_SUCCESS Success CNcomment:CNend
361 @retval ::HI_FAILURE Calling this API fails. CNcomment:CNend
362 @see \n
363 N/A CNcomment:CNend
364 */
365 hi_s32 HI_SYS_GetPolicy(HI_SYS_POLICY_TYPE_E enPolicyType, HI_SYS_POLICY_S *pstPolicy);
366 
367 /**
368 @brief Set policy. CNcomment: CNend
369 @attention \n
370 N/A CNcomment:CNend
371 @param[out] policy Pointer to the value (output) CNcomment:CNend
372 @retval ::HI_SUCCESS Success CNcomment:CNend
373 @retval ::HI_FAILURE Calling this API fails. CNcomment:CNend
374 @see \n
375 N/A CNcomment:CNend
376 */
377 hi_s32 HI_SYS_SetPolicy(HI_SYS_POLICY_TYPE_E enPolicyType, HI_SYS_POLICY_S *pstPolicy);
378 
379 /**
380 @brief Sets the debugging information level of a module. CNcomment: ÉèÖÃÄ£¿éµÄµ÷ÊÔÝÅÝ¢¼¶±ð CNend
381 @attention \n
382 N/A CNcomment: ÎÞ CNend
383 @param[in] enModId Debugging ID of a module CNcomment: Ä£¿éµÄµ÷ÊÔID¡£ CNend
384 @param[in] enLogLevel Debugging information level of a module CNcomment: Ä£¿éµÄµ÷ÊÔÝÅÝ¢¼¶±ð¡£ CNend
385 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
386 @retval ::HI_FAILURE Calling this API fails. CNcomment: APIݵݳµ÷ÓÃʧ°Ü CNend
387 @see \n
388 */
389 hi_s32 HI_SYS_SetLogLevel(HI_MOD_ID_E enModId, HI_LOG_LEVEL_E enLogLevel);
390 
391 /**
392 @brief The interface of enable or disable log store. CNcomment: ʹ?ܻ?ȥʹ?? SDK?ں˴?ӡ??Ϣ???浽?ļ??IJ??? CNend
393 @attention \n
394 N/A CNcomment: ?? CNend
395 @param[in]  enable_store .enable log store or disable it. CNcomment: ʹ?ܻ?ȥʹ?? CNend
396 @retval ::HI_SUCCESS Success CNcomment: ?ɹ? CNend
397 @retval ::HI_FAILURE Calling this API fails. CNcomment: API????ʧ?? CNend
398 @see \n
399 */
400 hi_s32 HI_SYS_LogStore(hi_bool bEnable);
401 
402 /**
403 @brief Writes to a register or a memory. CNcomment:  Ý´¼Ä´æÆ÷»òÄÚ´æ CNend
404 @attention \n
405 N/A CNcomment: ÎÞ CNend
406 @param[in] u32RegAddr Physical address of a register or a memory CNcomment: ¼Ä´æÆ÷»òÄÚ´æµÄÎïÀíµØÖ·¡£ CNend
407 @param[in] u32Value Value of a register CNcomment:  ¼Ä´æÆ÷µÄÖµ¡£ CNend
408 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
409 @retval ::HI_FAILURE Calling this API fails. CNcomment: APIݵݳµ÷ÓÃʧ°Ü CNend
410 @see \n
411 N/A CNcomment: ÎÞ CNend
412 */
413 hi_s32 HI_SYS_WriteRegister(hi_u32 u32RegAddr, hi_u32 u32Value);
414 
415 /**
416 @brief Reads a register or a memory. CNcomment: ¶Ý¼Ä´æÆ÷»òÄÚ´æ CNend
417 @attention \n
418 N/A CNcomment: ÎÞ CNend
419 @param[in] u32RegAddr Physical address of a register or a memory CNcomment: ¼Ä´æÆ÷»òÄÚ´æµÄÎïÀíµØÖ·¡£ CNend
420 @param[out] pu32Value Pointer to the register value (output) CNcomment:  Ö¸ÕëÀàÝÝ£¬Êä³ö¼Ä´æÆ÷µÄÖµ¡£ CNend
421 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
422 @retval ::HI_FAILURE Calling this API fails. CNcomment: APIݵݳµ÷ÓÃʧ°Ü CNend
423 @see \n
424 N/A CNcomment: ÎÞ CNend
425 */
426 hi_s32 HI_SYS_ReadRegister(hi_u32 u32RegAddr, hi_u32 *pu32Value);
427 
428 /**
429 @brief Get timestamp. CNcomment: »ñȡʱ¼ä´Ý¡£ CNend
430 @attention \n
431 N/A CNcomment: ÎÞ CNend
432 @param[out] pu32TimeMs Pointer to the timestamp value (output) CNcomment: Êä³öʱ¼ä´Ý¡£ CNend
433 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
434 @retval ::HI_FAILURE Calling this API fails. CNcomment: APIݵݳµ÷ÓÃʧ°Ü CNend
435 @see \n
436 N/A CNcomment: ÎÞ CNend
437 */
438 hi_s32 HI_SYS_GetTimeStampMs(hi_u32 *pu32TimeMs);
439 
440 /**
441 @brief Applies for a media memory zone (MMZ)/SMMU and maps the user-state address.
442 CNcomment:  ÉêÇëMMZ/SMMUÄڴ棬²¢Ó³ÉäÓû§Ì¬µØÖ· CNend
443 @attention \n
444 N/A CNcomment: ÎÞ CNend
445 @param[in/out] pstBuf Structure of the buffer information. Bufname and bufsize are inputs, and the physical address and
446     user-state virtual address are outputs.
447     CNcomment: bufferÝÅÝ¢½á¹¹£¬bufnameºÝbufsize×÷ΪÊäÈë,ÎïÀíµØÖ·ºÝÓû§Ì¬ÝéÄâµØÖ·×÷ΪÊä³ö CNend
448 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
449 @retval ::HI_FAILURE Calling this API fails. CNcomment: APIݵݳµ÷ÓÃʧ°Ü CNend
450 @see \n
451 N/A CNcomment: ÎÞ CNend
452 */
453 hi_s32 HI_MMZ_Malloc(HI_MMZ_BUF_S *pstBuf);
454 
455 /**
456 @brief Unmaps the user-state address and releases the MMZ/SMMU.
457     CNcomment: ½â³ýÓû§Ì¬µØÖ·µÄÓ³É䣬²¢ÊÝ·ÅMMZÄÚ´æ CNend
458 @attention \n
459 Ensure that the lengths of the transferred physical address and user-state virtual address are correct.
460 CNcomment: ±£Ö¤´«ÈëµÄÎïÀíµØÖ·¡¢Óû§Ì¬ÝéÄâµØÖ·ºÝ³¤¶ÈÕýÈ· CNend
461 @param[in] pstBuf Structure of the buffer information CNcomment: bufferÝÅÝ¢½á¹¹ CNend
462 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
463 @retval ::HI_FAILURE Calling this API fails. CNcomment: APIݵݳµ÷ÓÃʧ°Ü CNend
464 @see \n
465 N/A CNcomment: ÎÞ CNend
466 */
467 hi_s32 HI_MMZ_Free(HI_MMZ_BUF_S *pstBuf);
468 
469 /**
470 @brief pplies for an MMZ/SMMU with a specified name and obtains its physical address or SMMU address.
471 CNcomment: Ö¸¶¨MMZ/SMMUµÄÃû×ÖÉêÇëMMZ/SMMUÄڴ棬·µ»ØÎïÀíµØÖ·»òSMMUµØÖ· CNend
472 @attention \n
473 N/A CNcomment: ÎÞ CNend
474 @param[in] u32Size Buffer size CNcomment: buffer´óÝ¡ CNend
475 @param[in] u32Align Alignment mode CNcomment: ¶ÔÆ뷽ʽ CNend
476 @param[in] ps8MMZName Name of an MMZ in the buffer. If the MMZ name is set to NULL, an MMZ is anonymously applied for.
477     CNcomment: buffer·ÖÇøµÄÃû×Ö£¬´«ÈëNULLÄäÃûÉêÇë CNend
478 @param[in] ps8BufName Buffer name CNcomment: buffer¿éµÄÃû×Ö CNend
479 @retval ::NULL The application fails. CNcomment: ÉêÇëʧ°Ü CNend
480 @retval Physical address CNcomment: ÎïÀíµØÖ·»òSMMUµØÖ· CNend
481 @see \n
482 N/A CNcomment: ÎÞ CNend
483 */
484 hi_u32 HI_MMZ_New(hi_u32 u32Size, hi_u32 u32Align, hi_char *ps8MMZName, hi_char *ps8MMBName);
485 
486 /**
487 @brief Releases an MMZ/SMMU based on its physical address. CNcomment: ݨ¹ýÎïÀíµØÖ·ÊÝ·ÅMMZ/SMMUÄÚ´æ CNend
488 @attention \n
489 N/A CNcomment: ÎÞ CNend
490 @param[in] u32PhysAddr Physical address of a buffer CNcomment: bufferÎïÀíµØÖ· CNend
491 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
492 @retval ::HI_FAILURE Calling this API fails. CNcomment: APIݵݳµ÷ÓÃʧ°Ü CNend
493 @see \n
494 N/A CNcomment: ÎÞ CNend
495 */
496 hi_s32 HI_MMZ_Delete(hi_u32 u32PhysAddr);
497 
498 /**
499 @brief Maps the physical address of an MMZ/SMMU applied for to a user-state virtual address.
500     You can determine whether to cache the address.
501 CNcomment: ½«MMZ/SMMUÉêÇëµÄÎïÀíµØÖ·Ó³Éä³ÉÓû§Ì¬ÝéÄâµØÖ·£¬¿ÉÒÔÖ¸¶¨ÊÇ·ñcached CNend
502 @attention \n
503 N/A CNcomment: ÎÞ CNend
504 @param[in] u32PhysAddr Physical address of a buffer CNcomment: bufferÎïÀíµØÖ· CNend
505 @param[in] u32Cached Whether to cache the address. 0: no; 1: yes CNcomment: ÊÇ·ñʹÓÃcache£¬0²»Ê¹Óã¬1ʹÓà CNend
506 @retval ::NULL The application fails. CNcomment: ÉêÇëʧ°Ü CNend
507 @retval User-state virtual address CNcomment: Óû§Ì¬ÝéµØÖ· CNend
508 @see \n
509 N/A CNcomment: ÎÞ CNend
510 */
511 hi_void *HI_MMZ_Map(hi_u32 u32PhysAddr, hi_u32 u32Cached);
512 
513 /**
514 @brief Unmaps the user-state address of an MMZ/SMMU. CNcomment: ½â³ýMMZ/SMMUÄÚ´æÓû§Ì¬µØÖ·µÄÓ³Éä CNend
515 @attention \n
516 N/A CNcomment: ÎÞ CNend
517 @param[in] u32PhysAddr Physical address of a buffer CNcomment: bufferÎïÀíµØÖ· CNend
518 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
519 @retval ::HI_FAILURE Calling this API fails. CNcomment: APIݵݳµ÷ÓÃʧ°Ü CNend
520 @see \n
521 N/A CNcomment: ÎÞ CNend
522 */
523 hi_s32 HI_MMZ_Unmap(hi_u32 u32PhysAddr);
524 
525 /**
526 @brief Flushes D-cache to the cached MMZ/SMMU. CNcomment: ¶ÔÓÚcachedÀàÝÝMMZ/SMMU£¬Ë¢Dcacheµ½ÄÚ´æ CNend
527 @attention \n
528 For MMZ/SMMU, if the value 0 is transferred, all D-caches are refreshed; otherwise,
529               only the transferred memory is refreshed.
530 CNcomment: ¶ÔÓÚMMZ/SMMU£¬Èç¹û´«Èë0£¬ÔòË¢ÝÂËùÓݵÄDcache£»·ñÔòֻˢ´«ÈëµÄÄÇ¿éÄÚ´æ CNend
531 @param[in] u32PhysAddr Physical address of a buffer CNcomment: bufferÎïÀíµØÖ· CNend
532 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
533 @retval ::HI_FAILURE Calling this API fails. CNcomment: APIݵݳµ÷ÓÃʧ°Ü CNend
534 @see \n
535 N/A CNcomment: ÎÞ CNend
536 */
537 hi_s32 HI_MMZ_Flush(hi_u32 u32PhysAddr);
538 
539 /**
540 @brief Maps a physical address to a user-state virtual address. CNcomment: ½«ÎïÀíµØÖ·Ó³Éä³ÉÓû§Ì¬ÝéÄâµØÖ· CNend
541 @attention \n
542 N/A CNcomment: ÎÞ CNend
543 @param[in] u32PhyAddr Physical address of a buffer CNcomment: bufferÎïÀíµØÖ· CNend
544 @param[in] u32Size Buffer size CNcomment: bufferµÄ´óÝ¡ CNend
545 @retval ::NULL The application fails. CNcomment: ÉêÇëʧ°Ü CNend
546 @retval User-state virtual address CNcomment: Óû§Ì¬ÝéµØÖ· CNend
547 @see \n
548 N/A CNcomment: ÎÞ CNend
549 */
550 hi_void *HI_MEM_Map(hi_u32 u32PhyAddr, hi_u32 u32Size);
551 
552 /**
553 @brief Unmaps a user-state address. CNcomment: ½â³ýÓû§Ì¬µØÖ·µÄÓ³Éä CNend
554 @attention \n
555 N/A CNcomment: ÎÞ CNend
556 @param[in] pAddrMapped User-state virtual address of a buffer. CNcomment: bufferµÄÓû§Ì¬ÝéµØÖ· CNend
557 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
558 @retval ::HI_FAILURE Calling this API fails. CNcomment: APIݵݳµ÷ÓÃʧ°Ü CNend
559 @see \n
560 N/A CNcomment: ÎÞ CNend
561 */
562 hi_s32 HI_MEM_Unmap(hi_void *pAddrMapped);
563 
564 /**
565 @brief Obtains the physical address and size based on the virtual address.
566     CNcomment: ¸ù¾ÝÝéÄâµØÖ·»ñÈ¡ÎïÀíµØÖ·£¬ÒÔ¼°´óÝ¡ CNend
567 @attention \n
568 N/A CNcomment: ÎÞ CNend
569 @param[in] pVir User-state virtual address CNcomment: Óû§Ì¬ÝéµØÖ· CNend
570 @param[out] pu32Phyaddr Physical address  CNcomment: ÎïÀíµØÖ· CNend
571 @param[out] pu32Size Size CNcomment: ´óÝ¡ CNend
572 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
573 @retval ::HI_FAILURE Calling this API fails. CNcomment: APIݵݳµ÷ÓÃʧ°Ü CNend
574 @see \n
575 N/A CNcomment: ÎÞ CNend
576 */
577 hi_s32 HI_MMZ_GetPhyaddr(hi_void *pVir, hi_u32 *pu32Phyaddr, hi_u32 *pu32Size);
578 
579 /**
580 @brief Register one module to manager. CNcomment:Ä£¿é×¢²á£¬ÓÃÓÚ¹ÜÀí CNend
581 @attention Before manager someone module, calling this interface. CNcomment:ÈçÝè¹ÜÀíÄ£¿é£¬Óô˽ӿÚÝÈ×¢²á CNend
582 @param[in] pszModuleName The module name CNcomment:Ä£¿éÃû³Æ CNend
583 @param[in] u32ModuleID   The module ID. CNcomment:Ä£¿éID CNend
584 @retval ::HI_SUCCESS Success CNcomment:³É¹¦ CNend
585 @retval ::HI_FAILURE Failure CNcomment:ʧ°Ü CNend
586 @see \n
587 N/A CNcomment:ÎÞ CNend
588 */
589 hi_s32 HI_MODULE_Register(hi_u32 u32ModuleID, const hi_char *pszModuleName);
590 
591 /**
592 @brief Register one moudle by name. CNcomment:Ä£¿é×¢²á£¬IDÓÉݵݳ·ÖÅä CNend
593 @attention Before manager someone module, calling this interface. CNcomment:ÈçÝè¹ÜÀíÄ£¿é£¬Óô˽ӿÚÝÈ×¢²á CNend
594 @param[in] pszModuleName The module name CNcomment:Ä£¿éÃû³Æ CNend
595 @param[out] pu32ModuleID The module id allocated by system. CNcomment:ݵݳ·ÖÅäµÄÄ£¿éID CNend
596 @retval ::HI_SUCCESS Success CNcomment:³É¹¦ CNend
597 @retval ::HI_FAILURE Failure CNcomment:ʧ°Ü CNend
598 @see \n
599 N/A CNcomment:ÎÞ CNend
600 */
601 hi_s32 HI_MODULE_RegisterByName(const hi_char *pszModuleName, hi_u32 *pu32ModuleID);
602 
603 /**
604 @brief UnRegister one module to trace. CNcomment:Ä£¿éÒƳý CNend
605 @attention Before stopping to manage someone module, calling this interface.
606     CNcomment:²»ÝèÒª¹ÜÀí´ËÄ£¿éʱ£¬Ê¹Óô˽ӿÚÒƳýÄ£¿é CNend
607 @param[in] u32ModuleID The module ID. CNcomment:Ä£¿éID CNend
608 @param[out] None CNcomment:ÎÞ CNend
609 @retval ::HI_SUCCESS Success CNcomment:³É¹¦ CNend
610 @retval ::HI_FAILURE Failure CNcomment:ʧ°Ü CNend
611 @see \n
612 N/A CNcomment:ÎÞ CNend
613 */
614 hi_s32 HI_MODULE_UnRegister(hi_u32 u32ModuleID);
615 
616 /**
617 @brief User mode proc cretea directory. CNcomment:Óû§Ì¬proc´´½¨Ä¿Â¼ CNend
618 @attention You need register module before calling this API. Only support create one level directory.
619     CNcomment:ÝèÒªÝÈ×¢²áÄ£¿é£¬Ö»Ö§³Ö´´½¨Ò»¼¶Ä¿Â¼ CNend
620 @param[in] pszName The directory name. CNcomment:Ŀ¼Ãû CNend
621 @param[out] None CNcomment:ÎÞ CNend
622 @retval ::HI_SUCCESS Success CNcomment:³É¹¦ CNend
623 @retval ::HI_FAILURE Failure CNcomment:ʧ°Ü CNend
624 @see \n
625 N/A CNcomment:ÎÞ CNend
626 */
627 hi_s32 HI_PROC_AddDir(const hi_char *pszName);
628 
629 /**
630 @brief User mode proc remove directory. CNcomment:Óû§Ì¬procɾ³ýĿ¼ CNend
631 @attention It will return fail if there are entries in the directory.
632     CNcomment:Èç¹ûĿ¼Ý»¹ÓÝÈë¿ÚÎļþ,½«»áɾ³ýʧ°Ü CNend
633 @param[in] pszName The directory name. CNcomment:Ŀ¼Ãû CNend
634 @retval ::HI_SUCCESS Success CNcomment:³É¹¦ CNend
635 @retval ::HI_FAILURE Failure CNcomment:ʧ°Ü CNend
636 @see \n
637 N/A CNcomment:ÎÞ CNend
638 */
639 hi_s32 HI_PROC_RemoveDir(const hi_char *pszName);
640 
641 /**
642 @brief User mode proc add entry. CNcomment:Óû§Ì¬proc´´½¨Èë¿Ú CNend
643 @attention \n
644 N/A CNcomment: ÎÞ CNend
645 @param[in] u32ModuleID Module ID. CNcomment:Ä£¿éID CNend
646 @param[in] pstEntry Parameter of entry. CNcomment:´´½¨Èë¿Ú²ÎÊý CNend
647 @retval ::HI_SUCCESS Success CNcomment:³É¹¦ CNend
648 @retval ::HI_FAILURE Failure CNcomment:ʧ°Ü CNend
649 @see \n
650 N/A CNcomment:ÎÞ CNend
651 */
652 hi_s32 HI_PROC_AddEntry(hi_u32 u32ModuleID, const HI_PROC_ENTRY_S *pstEntry);
653 
654 /**
655 @brief User mode proc remove entry. CNcomment:Óû§Ì¬procɾ³ýÈë¿Ú CNend
656 @attention \n
657 N/A CNcomment: ÎÞ CNend
658 @param[in] u32ModuleID Module ID. CNcomment:Ä£¿éID CNend
659 @param[in] pstEntry Parameter of entry. CNcomment:ɾ³ýÈë¿Ú²ÎÊý CNend
660 @retval ::HI_SUCCESS Success CNcomment:³É¹¦ CNend
661 @retval ::HI_FAILURE Failure CNcomment:ʧ°Ü CNend
662 @see \n
663 N/A CNcomment:ÎÞ CNend
664 */
665 hi_s32 HI_PROC_RemoveEntry(hi_u32 u32ModuleID, const HI_PROC_ENTRY_S *pstEntry);
666 
667 /**
668 @brief User mode proc print function. CNcomment:Óû§Ì¬proc´òÓ¡ÄÚÈݵĺ¯Êý CNend
669 @attention \n
670 N/A CNcomment: ÎÞ CNend
671 @param[in] pstBuf Output buffer parameter. CNcomment:Êä³öbuffer²ÎÊý CNend
672 @param[in] pFmt   Format parameter. CNcomment:´òÓ¡¸ñʽ»¯²ÎÊý CNend
673 @retval ::HI_SUCCESS Success CNcomment:³É¹¦ CNend
674 @retval ::HI_FAILURE Failure CNcomment:ʧ°Ü CNend
675 @see \n
676 N/A CNcomment:ÎÞ CNend
677 */
678 hi_s32 HI_PROC_Printf(HI_PROC_SHOW_BUFFER_S *pstBuf, const hi_char *pFmt, ...);
679 
680 /**
681 @brief malloc the pointed size from system heap. CNcomment:´ÓݵݳÖÝ·ÖÅäÖ¸¶¨´óÝ¡µÄÄÚ´æ CNend
682 @attention None CNcomment:ÎÞ CNend
683 @param[in] u32ModuleID The module ID, who need to request memory. CNcomment:Ä£¿éID CNend
684 @param[in] u32Size The size of requesting. CNcomment:ÇëÇó·ÖÅäµÄ´óÝ¡£¬µ¥Î»ÊÇ×Ö½Ú CNend
685 @param[out] None CNcomment:ÎÞ CNend
686 @retval ::Valid memory address Success CNcomment:³É¹¦·µ»Ø·ÖÅäµ½µÄ¿Õ¼äÊ×µØÖ· CNend
687 @retval ::NULL Failure CNcomment:ʧ°Ü·µ»ØNULL CNend
688 @see \n
689 N/A CNcomment:ÎÞ CNend
690 */
691 hi_void *HI_MEM_Malloc(hi_u32 u32ModuleID, hi_u32 u32Size);
692 
693 /**
694 @brief Free the requsted memory by hi_malloc. CNcomment:ÊÝ·Å·ÖÅäµÄÄÚ´æ CNend
695 @attention when stopping to use the memory, calling this interface.
696     CNcomment:²»ÔÙÝèÒªÕâ¿éÄÚ´æʱ£¬Ê¹Óô˽ӿڽøÝÝÊÝ·Å CNend
697 @param[in] u32ModuleID The module ID, who need to free memory. CNcomment:Ä£¿éID CNend
698 @param[in] pMemAddr The memory address to free CNcomment:ÊÝ·Å¿Õ¼äµÄÊ×µØÖ· CNend
699 @param[out] None CNcomment:ÎÞ CNend
700 @retval ::None CNcomment:ÎÞ CNend
701 @see \n
702 N/A CNcomment:ÎÞ CNend
703 */
704 hi_void HI_MEM_Free(hi_u32 u32ModuleID, hi_void *pMemAddr);
705 
706 /**
707 @brief Calloc memory, with u32MemBlock blocks and u32Size size per. CNcomment:·ÖÅäݬÝø´óÝ¡µÄÄÚ´æ¿é CNend
708 @attention None CNcomment:ÎÞ CNend
709 @param[in] u32ModuleID The module id, who need to calloc memory. CNcomment:Ä£¿éID CNend
710 @param[in] u32MemBlock The requesting block number. CNcomment:·ÖÅäµÄ¿éÊý CNend
711 @param[in] u32Size The requesting size per block. CNcomment:ÿ¿éµÄ´óÝ¡£¬µ¥Î»ÊÇ×Ö½Ú CNend
712 @param[out] None CNcomment:ÎÞ CNend
713 @retval ::Valid memory address Success CNcomment:³É¹¦Ôò·µ»Ø·ÖÅäµ½µÄÄÚ´æÊ×µØÖ· CNend
714 @retval ::NULL Failure CNcomment:ʧ°Ü·µ»ØNULL CNend
715 @see \n
716 N/A CNcomment: ÎÞ CNend
717 */
718 hi_void *HI_MEM_Calloc(hi_u32 u32ModuleID, hi_u32 u32MemBlock, HI_U32 u32Size);
719 
720 #ifdef MMZ_V2_SUPPORT
721 /**
722 @brief pplies for an MMZ with a specified name and obtains its physical address.
723     CNcomment: Ö¸¶¨mmzµÄÃû×ÖÉêÇëmmzÄڴ棬·µ»ØÎïÀíµØÖ· CNend
724 @attention \n
725 N/A CNcomment: ÎÞ CNend
726 @param[in] u32Size Buffer size CNcomment: buffer´óÝ¡ CNend
727 @param[in] u32Align Alignment mode CNcomment: ¶ÔÆ뷽ʽ CNend
728 @param[in] ps8MMZName Name of an MMZ in the buffer. If the MMZ name is set to NULL, an MMZ is anonymously applied for.
729     CNcomment: buffer·ÖÇøµÄÃû×Ö£¬´«ÈëNULLÄäÃûÉêÇë CNend
730 @param[in] ps8MMBName Buffer name CNcomment: buffer¿éµÄÃû×Ö CNend
731 @retval ::NULL The application fails. CNcomment: ÉêÇëʧ°Ü CNend
732 @retval Physical address CNcomment: ÎïÀíµØÖ· CNend
733 @see \n
734 N/A CNcomment: ÎÞ CNend
735 */
736 hi_void *HI_MMZ_New_Share(hi_u32 u32Size, hi_u32 u32Align, hi_char *ps8MMZName, hi_char *ps8MMBName);
737 
738 /**
739 @brief pplies for an MMZ with a specified name and obtains its physical address.
740     CNcomment: Ö¸¶¨mmzµÄÃû×ÖÉêÇëmmzÄڴ棬·µ»ØÎïÀíµØÖ· CNend
741 @attention \n
742 N/A CNcomment: ÎÞ CNend
743 @param[in] u32Size Buffer size CNcomment: buffer´óÝ¡ CNend
744 @param[in] u32Align Alignment mode CNcomment: ¶ÔÆ뷽ʽ CNend
745 @param[in] ps8MMZName Name of an MMZ in the buffer. If the MMZ name is set to NULL, an MMZ is anonymously applied for.
746     CNcomment: buffer·ÖÇøµÄÃû×Ö£¬´«ÈëNULLÄäÃûÉêÇë CNend
747 @param[in] ps8MMBName Buffer name CNcomment: buffer¿éµÄÃû×Ö CNend
748 @retval ::NULL The application fails. CNcomment: ÉêÇëʧ°Ü CNend
749 @retval Physical address CNcomment: ÎïÀíµØÖ· CNend
750 @see \n
751 N/A CNcomment: ÎÞ CNend
752 */
753 hi_void *HI_MMZ_New_Shm_Com(hi_u32 u32Size, hi_u32 u32Align, hi_char *ps8MMZName, hi_char *ps8MMBName);
754 
755 /**
756 @brief Get physical address and size of chm or com type MMZ. CNcomment: »ñÈ¡shm»òcomÝÝMMZÎïÀíµØÖ·ºÝ´óÝ¡ CNend
757 @attention \n
758 N/A CNcomment: ÎÞ CNend
759 @param[out] pu32PhysAddr Physical address of the buffer CNcomment: bufferÎïÀíµØÖ· CNend
760 @param[out] pu32Size     Size of the buffer             CNcomment: buffer´óÝ¡ CNend
761 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
762 @retval ::HI_FAILURE Calling this API fails. CNcomment: APIݵݳµ÷ÓÃʧ°Ü CNend
763 @see \n
764 N/A CNcomment: ÎÞ CNend
765 */
766 hi_s32 HI_MMZ_Get_Shm_Com(hi_u32 *pu32PhysAddr, hi_u32 *pu32Size);
767 
768 /**
769 @brief Force releases an MMZ based on its physical address. CNcomment: ݨ¹ýÎïÀíµØÖ·Ç¿ÝÝÊÝ·ÅmmzÄÚ´æ CNend
770 @attention \n
771 N/A CNcomment: ÎÞ CNend
772 @param[in] u32PhysAddr Physical address of a buffer CNcomment: bufferÎïÀíµØÖ· CNend
773 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
774 @retval ::HI_FAILURE Calling this API fails. CNcomment: APIݵݳµ÷ÓÃʧ°Ü CNend
775 @see \n
776 N/A CNcomment: ÎÞ CNend
777 */
778 hi_s32 HI_MMZ_Force_Delete(hi_u32 u32PhysAddr);
779 
780 /**
781 @brief Flushes MMZ. CNcomment: Flush MMZÊý¾Ý CNend
782 @attention \n
783 @param[in] u32PhysAddr Physical address of a buffer CNcomment: bufferÎïÀíµØÖ· CNend
784 @param[in] u32VirtAddr Virtual address of a buffer  CNcomment: bufferÝéÄâµØÖ· CNend
785 @param[in] u32Size     Size of a buffer             CNcomment: buffer¿Õ¼ä´óÝ¡ CNend
786 @retval ::HI_SUCCESS Success CNcomment: ³É¹¦ CNend
787 @retval ::HI_FAILURE Fail. CNcomment: ʧ°Ü CNend
788 @see \n
789 N/A CNcomment: ÎÞ CNend
790 */
791 hi_s32 HI_MMZ_Flush_Dirty(hi_u32 u32PhysAddr, hi_u32 u32VirtAddr, hi_u32 u32Size);
792 
793 #endif /* endif MMZ_V2_SUPPORT */
794 
795 /** @} */ /** <!-- ==== API declaration end ==== */
796 
797 #endif /* endif __KERNEL__ */
798 
799 #ifdef __cplusplus
800 #if __cplusplus
801 }
802 #endif
803 #endif /* __cplusplus */
804 
805 #endif /* __HI_COMMON_H__ */
806 
807