00001 /*---------------------------------------------------------------------------- 00002 * Copyright (c) <2013-2015>, <Huawei Technologies Co., Ltd> 00003 * All rights reserved. 00004 * Redistribution and use in source and binary forms, with or without modification, 00005 * are permitted provided that the following conditions are met: 00006 * 1. Redistributions of source code must retain the above copyright notice, this list of 00007 * conditions and the following disclaimer. 00008 * 2. Redistributions in binary form must reproduce the above copyright notice, this list 00009 * of conditions and the following disclaimer in the documentation and/or other materials 00010 * provided with the distribution. 00011 * 3. Neither the name of the copyright holder nor the names of its contributors may be used 00012 * to endorse or promote products derived from this software without specific prior written 00013 * permission. 00014 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 00015 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 00016 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 00017 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 00018 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 00019 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 00020 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 00021 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 00022 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 00023 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 00024 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00025 *---------------------------------------------------------------------------*/ 00026 /*---------------------------------------------------------------------------- 00027 * Notice of Export Control Law 00028 * =============================================== 00029 * Huawei LiteOS may be subject to applicable export control laws and regulations, which might 00030 * include those applicable to Huawei LiteOS of U.S. and the country in which you are located. 00031 * Import, export and usage of Huawei LiteOS in any manner by you shall be in compliance with such 00032 * applicable export control laws and regulations. 00033 *---------------------------------------------------------------------------*/ 00034 00035 /**@defgroup los_hwi Hardware interrupt 00036 *@ingroup kernel 00037 */ 00038 #ifndef _LOS_HWI_H 00039 #define _LOS_HWI_H 00040 00041 #include "los_base.h" 00042 #include "los_sys.h" 00043 00044 #ifdef __cplusplus 00045 #if __cplusplus 00046 extern "C" { 00047 #endif /* __cplusplus */ 00048 #endif /* __cplusplus */ 00049 00050 /** 00051 * @ingroup los_hwi 00052 * Maximum number of used hardware interrupts. 00053 */ 00054 #ifndef OS_HWI_MAX_NUM 00055 #define OS_HWI_MAX_NUM 32 00056 #endif 00057 00058 /** 00059 * @ingroup los_hwi 00060 * Highest priority of a hardware interrupt. 00061 */ 00062 #ifndef OS_HWI_PRIO_HIGHEST 00063 #define OS_HWI_PRIO_HIGHEST 0 00064 #endif 00065 00066 /** 00067 * @ingroup los_hwi 00068 * Lowest priority of a hardware interrupt. 00069 */ 00070 #ifndef OS_HWI_PRIO_LOWEST 00071 #define OS_HWI_PRIO_LOWEST 7 00072 #endif 00073 00074 /** 00075 * @ingroup los_config 00076 * Configuration item for interrupt with argument 00077 */ 00078 #ifndef OS_HWI_WITH_ARG 00079 #define OS_HWI_WITH_ARG NO 00080 #endif 00081 00082 /** 00083 * @ingroup los_hwi 00084 * Define the type of a hardware interrupt number. 00085 */ 00086 typedef UINT32 HWI_HANDLE_T; 00087 00088 /** 00089 * @ingroup los_hwi 00090 * Define the type of a hardware interrupt priority. 00091 */ 00092 typedef UINT16 HWI_PRIOR_T; 00093 00094 /** 00095 * @ingroup los_hwi 00096 * Define the type of hardware interrupt mode configurations. 00097 */ 00098 typedef UINT16 HWI_MODE_T; 00099 00100 /** 00101 * @ingroup los_hwi 00102 * Define the type of the parameter used for the hardware interrupt creation function. The function of this parameter varies among platforms. 00103 */ 00104 typedef UINT32 HWI_ARG_T; 00105 00106 /** 00107 * @ingroup los_hwi 00108 * Define the type of a hardware interrupt handling function. 00109 */ 00110 #if (OS_HWI_WITH_ARG == YES) 00111 00112 typedef VOID (* HWI_PROC_FUNC)(VOID *pParm); 00113 typedef struct 00114 { 00115 HWI_PROC_FUNC pfnHandler; 00116 VOID* pParm; 00117 } HWI_SLAVE_FUNC; 00118 00119 #else 00120 00121 typedef VOID (* HWI_PROC_FUNC)(void); 00122 00123 #endif 00124 00125 /** 00126 * @ingroup los_hwi 00127 * Define the type of a hardware interrupt vector table function. 00128 */ 00129 typedef VOID (**HWI_VECTOR_FUNC)(void); 00130 00131 00132 /** 00133 * @ingroup los_hwi 00134 * Count of interrupts. 00135 */ 00136 extern UINT32 g_vuwIntCount; 00137 00138 /** 00139 * @ingroup los_hwi 00140 * An interrupt is active. 00141 */ 00142 #define OS_INT_ACTIVE (g_vuwIntCount > 0) 00143 00144 /** 00145 * @ingroup los_hwi 00146 * An interrupt is inactive. 00147 */ 00148 #define OS_INT_INACTIVE (!(OS_INT_ACTIVE)) 00149 00150 /** 00151 * @ingroup los_hwi 00152 * Count of M-Core system interrupt vector. 00153 */ 00154 #define OS_SYS_VECTOR_CNT 16 00155 00156 /** 00157 * @ingroup los_hwi 00158 * Count of M-Core interrupt vector. 00159 */ 00160 #define OS_VECTOR_CNT (OS_SYS_VECTOR_CNT + OS_HWI_MAX_NUM) 00161 00162 /** 00163 * @ingroup los_hwi 00164 * AIRCR register priority group parameter . 00165 */ 00166 #define OS_NVIC_AIRCR_PRIGROUP 7 00167 00168 /** 00169 * @ingroup los_hwi 00170 * Boot interrupt vector table. 00171 */ 00172 extern UINT32 _BootVectors[]; 00173 00174 /** 00175 * @ingroup los_hwi 00176 * Hardware interrupt error code: Invalid interrupt number. 00177 * 00178 * Value: 0x02000900 00179 * 00180 * Solution: Ensure that the interrupt number is valid. The value range of the interrupt number applicable for a Cortex-A7 platform is [OS_USER_HWI_MIN,OS_USER_HWI_MAX]. 00181 */ 00182 #define OS_ERRNO_HWI_NUM_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x00) 00183 00184 /** 00185 * @ingroup los_hwi 00186 * Hardware interrupt error code: Null hardware interrupt handling function. 00187 * 00188 * Value: 0x02000901 00189 * 00190 * Solution: Pass in a valid non-null hardware interrupt handling function. 00191 */ 00192 #define OS_ERRNO_HWI_PROC_FUNC_NULL LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x01) 00193 00194 /** 00195 * @ingroup los_hwi 00196 * Hardware interrupt error code: Insufficient interrupt resources for hardware interrupt creation. 00197 * 00198 * Value: 0x02000902 00199 * 00200 * Solution: Increase the configured maximum number of supported hardware interrupts. 00201 */ 00202 #define OS_ERRNO_HWI_CB_UNAVAILABLE LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x02) 00203 00204 /** 00205 * @ingroup los_hwi 00206 * Hardware interrupt error code: Insufficient memory for hardware interrupt initialization. 00207 * 00208 * Value: 0x02000903 00209 * 00210 * Solution: Expand the configured memory. 00211 */ 00212 #define OS_ERRNO_HWI_NO_MEMORY LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x03) 00213 00214 /** 00215 * @ingroup los_hwi 00216 * Hardware interrupt error code: The interrupt has already been created. 00217 * 00218 * Value: 0x02000904 00219 * 00220 * Solution: Check whether the interrupt specified by the passed-in interrupt number has already been created. 00221 */ 00222 #define OS_ERRNO_HWI_ALREADY_CREATED LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x04) 00223 00224 /** 00225 * @ingroup los_hwi 00226 * Hardware interrupt error code: Invalid interrupt priority. 00227 * 00228 * Value: 0x02000905 00229 * 00230 * Solution: Ensure that the interrupt priority is valid. The value range of the interrupt priority applicable for a Cortex-A7 platform is [0,15]. 00231 */ 00232 #define OS_ERRNO_HWI_PRIO_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x05) 00233 00234 /** 00235 * @ingroup los_hwi 00236 * Hardware interrupt error code: Incorrect interrupt creation mode. 00237 * 00238 * Value: 0x02000906 00239 * 00240 * Solution: The interrupt creation mode can be only set to OS_HWI_MODE_COMM or OS_HWI_MODE_FAST of which the value can be 0 or 1. 00241 */ 00242 #define OS_ERRNO_HWI_MODE_INVALID LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x06) 00243 00244 /** 00245 * @ingroup los_hwi 00246 * Hardware interrupt error code: The interrupt has already been created as a fast interrupt. 00247 * 00248 * Value: 0x02000907 00249 * 00250 * Solution: Check whether the interrupt specified by the passed-in interrupt number has already been created. 00251 */ 00252 #define OS_ERRNO_HWI_FASTMODE_ALREADY_CREATED LOS_ERRNO_OS_ERROR(LOS_MOD_HWI, 0x07) 00253 00254 /** 00255 * @ingroup los_hwi 00256 * SysTick control and status register. 00257 */ 00258 #define OS_SYSTICK_CONTROL_REG 0xE000E010 00259 00260 /** 00261 * @ingroup los_hw 00262 * SysTick current value register. 00263 */ 00264 #define OS_SYSTICK_CURRENT_REG 0xE000E018 00265 00266 /** 00267 * @ingroup los_hwi 00268 * Interrupt Priority-Level Registers. 00269 */ 00270 #define OS_NVIC_PRI_BASE 0xE000E400 00271 00272 /** 00273 * @ingroup los_hwi 00274 * Interrupt enable register for 0-31. 00275 */ 00276 #define OS_NVIC_SETENA_BASE 0xE000E100 00277 00278 /** 00279 * @ingroup los_hwi 00280 * interrupt pending register. 00281 */ 00282 #define OS_NVIC_SETPEND_BASE 0xE000E200 00283 00284 /** 00285 * @ingroup los_hwi 00286 * ?D??ACTIVE???????? 00287 */ 00288 #define OS_NVIC_INT_ACT_BASE 0xE000E300 00289 00290 /** 00291 * @ingroup los_hwi 00292 * Interrupt disable register for 0-31. 00293 */ 00294 #define OS_NVIC_CLRENA_BASE 0xE000E180 00295 00296 /** 00297 * @ingroup los_hwi 00298 * Interrupt control and status register. 00299 */ 00300 #define OS_NVIC_INT_CTRL 0xE000ED04 00301 00302 /** 00303 * @ingroup los_hwi 00304 * Vector table offset register. 00305 */ 00306 #define OS_NVIC_VTOR 0xE000ED08 00307 00308 /** 00309 * @ingroup los_hwi 00310 * Application interrupt and reset control register 00311 */ 00312 #define OS_NVIC_AIRCR 0xE000ED0C 00313 00314 /** 00315 * @ingroup los_hwi 00316 * System exception priority register. 00317 */ 00318 #define OS_NVIC_EXCPRI_BASE 0xE000ED18 00319 00320 /** 00321 * @ingroup los_hwi 00322 * Interrupt No. 1 :reset. 00323 */ 00324 #define OS_EXC_RESET 1 00325 00326 /** 00327 * @ingroup los_hwi 00328 * Interrupt No. 2 :Non-Maskable Interrupt. 00329 */ 00330 #define OS_EXC_NMI 2 00331 00332 /** 00333 * @ingroup los_hwi 00334 * Interrupt No. 3 :(hard)fault. 00335 */ 00336 #define OS_EXC_HARD_FAULT 3 00337 00338 /** 00339 * @ingroup los_hwi 00340 * Interrupt No. 4 :MemManage fault. 00341 */ 00342 #define OS_EXC_MPU_FAULT 4 00343 00344 /** 00345 * @ingroup los_hwi 00346 * Interrupt No. 5 :Bus fault. 00347 */ 00348 #define OS_EXC_BUS_FAULT 5 00349 00350 /** 00351 * @ingroup los_hwi 00352 * Interrupt No. 6 :Usage fault. 00353 */ 00354 #define OS_EXC_USAGE_FAULT 6 00355 00356 /** 00357 * @ingroup los_hwi 00358 * Interrupt No. 11 :SVCall. 00359 */ 00360 #define OS_EXC_SVC_CALL 11 00361 00362 /** 00363 * @ingroup los_hwi 00364 * Interrupt No. 12 :Debug monitor. 00365 */ 00366 #define OS_EXC_DBG_MONITOR 12 00367 00368 /** 00369 * @ingroup los_hwi 00370 * Interrupt No. 14 :PendSV. 00371 */ 00372 #define OS_EXC_PEND_SV 14 00373 00374 /** 00375 * @ingroup los_hwi 00376 * Interrupt No. 15 :SysTick. 00377 */ 00378 #define OS_EXC_SYS_TICK 15 00379 00380 00381 /** 00382 * @ingroup los_hwi 00383 * hardware interrupt form mapping handling function array. 00384 */ 00385 extern HWI_PROC_FUNC m_pstHwiForm[OS_VECTOR_CNT]; 00386 00387 #if (OS_HWI_WITH_ARG == YES) 00388 /** 00389 * @ingroup los_hwi 00390 * hardware interrupt Slave form mapping handling function array. 00391 */ 00392 extern HWI_SLAVE_FUNC m_pstHwiSlaveForm[OS_VECTOR_CNT]; 00393 00394 /** 00395 * @ingroup los_hwi 00396 * Set interrupt vector table. 00397 */ 00398 #define osSetVector(uwNum, pfnVector, uwArg) \ 00399 m_pstHwiForm[uwNum + OS_SYS_VECTOR_CNT] = (HWI_PROC_FUNC)osInterrupt;\ 00400 m_pstHwiSlaveForm[uwNum + OS_SYS_VECTOR_CNT].pfnHandler= pfnVector; \ 00401 m_pstHwiSlaveForm[uwNum + OS_SYS_VECTOR_CNT].pParm = (VOID*)uwArg; 00402 #else 00403 /** 00404 * @ingroup los_hwi 00405 * hardware interrupt Slave form mapping handling function array. 00406 */ 00407 extern HWI_PROC_FUNC m_pstHwiSlaveForm[OS_VECTOR_CNT]; 00408 00409 /** 00410 * @ingroup los_hwi 00411 * Set interrupt vector table. 00412 */ 00413 #define osSetVector(uwNum, pfnVector) \ 00414 m_pstHwiForm[uwNum + OS_SYS_VECTOR_CNT] = osInterrupt;\ 00415 m_pstHwiSlaveForm[uwNum + OS_SYS_VECTOR_CNT] = pfnVector; 00416 #endif 00417 00418 /** 00419 * @ingroup los_hwi 00420 * @brief Create a hardware interrupt. 00421 * 00422 * @par Description: 00423 * This API is used to configure a hardware interrupt and register a hardware interrupt handling function. 00424 * 00425 * @attention 00426 * <ul> 00427 * <li>The hardware interrupt module is usable only when the configuration item for hardware interrupt tailoring is enabled.</li> 00428 * <li>Hardware interrupt number value range: [OS_USER_HWI_MIN,OS_USER_HWI_MAX]. The value range applicable for a Cortex-A7 platform is [32,95].</li> 00429 * <li>OS_HWI_MAX_NUM specifies the maximum number of interrupts that can be created.</li> 00430 * <li>Before executing an interrupt on a platform, refer to the chip manual of the platform.</li> 00431 * </ul> 00432 * 00433 * @param uwHwiNum [IN] Type#HWI_HANDLE_T: hardware interrupt number. The value range applicable for a Cortex-A7 platform is [32,95]. 00434 * @param usHwiPrio [IN] Type#HWI_PRIOR_T: hardware interrupt priority. Ignore this parameter temporarily. 00435 * @param usMode [IN] Type#HWI_MODE_T: hardware interrupt mode. Ignore this parameter temporarily. 00436 * @param pfnHandler [IN] Type#HWI_PROC_FUNC: interrupt handler used when a hardware interrupt is triggered. 00437 * @param uwArg [IN] Type#HWI_ARG_T: input parameter of the interrupt handler used when a hardware interrupt is triggered. 00438 * 00439 * @retval #OS_ERRNO_HWI_PROC_FUNC_NULL 0x02000901: Null hardware interrupt handling function. 00440 * @retval #OS_ERRNO_HWI_NUM_INVALID 0x02000900: Invalid interrupt number. 00441 * @retval #OS_ERRNO_HWI_NO_MEMORY 0x02000903: Insufficient memory for hardware interrupt creation. 00442 * @retval #OS_ERRNO_HWI_ALREADY_CREATED 0x02000904: The interrupt handler being created has already been created. 00443 * @retval #LOS_OK 0, : The interrupt is successfully created. 00444 * @par Dependency: 00445 * <ul><li>los_hwi.h: the header file that contains the API declaration.</li></ul> 00446 * @see None. 00447 * @since Huawei LiteOS V100R001C00 00448 */ 00449 extern UINT32 LOS_HwiCreate( HWI_HANDLE_T uwHwiNum, 00450 HWI_PRIOR_T usHwiPrio, 00451 HWI_MODE_T usMode, 00452 HWI_PROC_FUNC pfnHandler, 00453 HWI_ARG_T uwArg 00454 ); 00455 00456 /** 00457 * @ingroup los_hwi 00458 * @brief: Hardware interrupt entry function. 00459 * 00460 * @par Description: 00461 * This API is used as all hardware interrupt handling function entry. 00462 * 00463 * @attention: 00464 * <ul><li>None.</li></ul> 00465 * 00466 * @param:None. 00467 * 00468 * @retval:None. 00469 * @par Dependency: 00470 * <ul><li>los_hwi.h: the header file that contains the API declaration.</li></ul> 00471 * @see None. 00472 * @since Huawei LiteOS V100R001C00 00473 */ 00474 extern VOID osInterrupt(VOID); 00475 00476 00477 00478 /** 00479 * @ingroup los_hwi 00480 * @brief: Get a interrupt number. 00481 * 00482 * @par Description: 00483 * This API is used to get the current interrupt number. 00484 * 00485 * @attention: 00486 * <ul><li>None.</li></ul> 00487 * 00488 * @param: None. 00489 * 00490 * @retval: Interrupt Indexes number. 00491 * @par Dependency: 00492 * <ul><li>los_hwi.h: the header file that contains the API declaration.</li></ul> 00493 * @see None. 00494 * @since Huawei LiteOS V100R001C00 00495 */ 00496 extern UINT32 osIntNumGet(VOID); 00497 00498 /** 00499 * @ingroup los_hwi 00500 * @brief: Default vector handling function. 00501 * 00502 * @par Description: 00503 * This API is used to configure interrupt for null function. 00504 * 00505 * @attention: 00506 * <ul><li>None.</li></ul> 00507 * 00508 * @param:None. 00509 * 00510 * @retval:None. 00511 * @par Dependency: 00512 * <ul><li>los_hwi.h: the header file that contains the API declaration.</li 00513 ></ul> 00514 * @see None. 00515 * @since Huawei LiteOS V100R001C00 00516 */ 00517 extern VOID osHwiDefaultHandler(VOID); 00518 00519 /** 00520 * @ingroup los_hwi 00521 * @brief: Reset the vector table. 00522 * 00523 * @par Description: 00524 * This API is used to reset the vector table. 00525 * 00526 * @attention: 00527 * <ul><li>None.</li></ul> 00528 * 00529 * @param:None. 00530 * 00531 * @retval:None. 00532 * @par Dependency: 00533 * <ul><li>los_hwi.h: the header file that contains the API declaration.</li></ul> 00534 * @see None. 00535 * @since Huawei LiteOS V100R001C00 00536 */ 00537 extern VOID Reset_Handler(VOID); 00538 00539 /** 00540 * @ingroup los_hwi 00541 * @brief: Pended System Call. 00542 * 00543 * @par Description: 00544 * PendSV can be pended and is useful for an OS to pend an exception 00545 * so that an action can be performed after other important tasks are completed. 00546 * 00547 * @attention: 00548 * <ul><li>None.</li></ul> 00549 * 00550 * @param:None. 00551 * 00552 * @retval:None. 00553 * @par Dependency: 00554 * <ul><li>los_hwi.h: the header file that contains the API declaration.</li></ul> 00555 * @see None. 00556 * @since Huawei LiteOS V100R001C00 00557 */ 00558 extern VOID osPendSV(VOID); 00559 00560 /** 00561 *@ingroup los_hwi 00562 *@brief Enable all interrupts. 00563 * 00564 *@par Description: 00565 *<ul> 00566 *<li>This API is used to enable all IRQ and FIQ interrupts in the CPSR.</li> 00567 *</ul> 00568 *@attention 00569 *<ul> 00570 *<li>None.</li> 00571 *</ul> 00572 * 00573 *@param None. 00574 * 00575 *@retval CPSR value obtained after all interrupts are enabled. 00576 *@par Dependency: 00577 *<ul><li>los_hwi.h: the header file that contains the API declaration.</li></ul> 00578 *@see LOS_IntRestore 00579 *@since Huawei LiteOS V100R001C00 00580 */ 00581 extern UINTPTR LOS_IntUnLock(VOID); 00582 00583 00584 00585 /** 00586 *@ingroup los_hwi 00587 *@brief Disable all interrupts. 00588 * 00589 *@par Description: 00590 *<ul> 00591 *<li>This API is used to disable all IRQ and FIQ interrupts in the CPSR.</li> 00592 *</ul> 00593 *@attention 00594 *<ul> 00595 *<li>None.</li> 00596 *</ul> 00597 * 00598 *@param None. 00599 * 00600 *@retval CPSR value obtained before all interrupts are disabled. 00601 *@par Dependency: 00602 *<ul><li>los_hwi.h: the header file that contains the API declaration.</li></ul> 00603 *@see LOS_IntRestore 00604 *@since Huawei LiteOS V100R001C00 00605 */ 00606 extern UINTPTR LOS_IntLock(VOID); 00607 00608 00609 00610 /** 00611 *@ingroup los_hwi 00612 *@brief Restore interrupts. 00613 * 00614 *@par Description: 00615 *<ul> 00616 *<li>This API is used to restore the CPSR value obtained before all interrupts are disabled.</li> 00617 *</ul> 00618 *@attention 00619 *<ul> 00620 *<li>This API can be called only after all interrupts are disabled, and the input parameter value should be the value returned by calling the all interrupt disabling API.</li> 00621 *</ul> 00622 * 00623 *@param uvIntSave [IN] CPSR value obtained before all interrupts are disabled. 00624 * 00625 *@retval None. 00626 *@par Dependency: 00627 *<ul><li>los_hwi.h: the header file that contains the API declaration.</li></ul> 00628 *@see LOS_IntLock 00629 *@since Huawei LiteOS V100R001C00 00630 */ 00631 extern VOID LOS_IntRestore(UINTPTR uvIntSave); 00632 00633 /** 00634 *@ingroup los_hwi 00635 *@brief Get value from xPSR register. 00636 * 00637 *@par Description: 00638 *<ul> 00639 *<li>This API is used to Get value from xPSR register.</li> 00640 *</ul> 00641 *@attention 00642 *<ul> 00643 *<li>None.</li> 00644 *</ul> 00645 * 00646 *@param None. 00647 * 00648 *@retval xPSR register value. 00649 *@par Dependency: 00650 *<ul><li>los_hwi.h: the header file that contains the API declaration.</li></ 00651 ul> 00652 *@see LOS_IntRestore 00653 *@since Huawei LiteOS V100R001C00 00654 */ 00655 extern VOID LOS_GetCpuCycle(UINT32 *puwCntHi, UINT32 *puwCntLo); 00656 00657 #if (LOSCFG_KERNEL_TICKLESS == YES) 00658 extern VOID LOS_SysTickReload(UINT32 uwCyclesPerTick); 00659 #endif 00660 00661 extern UINT32 LOS_SysTickCurrCycleGet(VOID); 00662 00663 00664 /** 00665 * @ingroup los_hwi 00666 * @brief Delete hardware interrupt. 00667 * 00668 * @par Description: 00669 * This API is used to delete hardware interrupt. 00670 * 00671 * @attention 00672 * <ul> 00673 * <li>The hardware interrupt module is usable only when the configuration item for hardware interrupt tailoring is enabled.</li> 00674 * <li>Hardware interrupt number value range: [OS_USER_HWI_MIN,OS_USER_HWI_MAX]. The value range applicable for a Cortex-A7 platform is [32,95].</li> 00675 * <li>OS_HWI_MAX_NUM specifies the maximum number of interrupts that can be created.</li> 00676 * <li>Before executing an interrupt on a platform, refer to the chip manual of the platform.</li> 00677 * </ul> 00678 * 00679 * @param uwHwiNum [IN] Type#HWI_HANDLE_T: hardware interrupt number. The value range applicable for a Cortex-A7 platform is [32,95]. 00680 * 00681 * @retval #OS_ERRNO_HWI_NUM_INVALID 0x02000900: Invalid interrupt number. 00682 * @retval #LOS_OK 0: The interrupt is successfully delete. 00683 * @par Dependency: 00684 * <ul><li>los_hwi.h: the header file that contains the API declaration.</li></ul> 00685 * @see None. 00686 * @since Huawei LiteOS V100R001C00 00687 */ 00688 extern UINT32 LOS_HwiDelete(HWI_HANDLE_T uwHwiNum); 00689 00690 #ifdef __cplusplus 00691 #if __cplusplus 00692 } 00693 #endif /* __cplusplus */ 00694 #endif /* __cplusplus */ 00695 00696 00697 00698 #endif /* _LOS_HWI_H */ 00699