libmetal
sys.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2015, Xilinx Inc. and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 /*
8  * @file generic/zynq7/sys.h
9  * @brief generic zynq7 system primitives for libmetal.
10  */
11 
12 #ifndef __METAL_GENERIC_SYS__H__
13 #error "Include metal/sys.h instead of metal/generic/@PROJECT_MACHINE@/sys.h"
14 #endif
15 
16 #include "xscugic.h"
17 
18 #ifndef __METAL_GENERIC_ZYNQ7_SYS__H__
19 #define __METAL_GENERIC_ZYNQ7_SYS__H__
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
25 #ifdef METAL_INTERNAL
26 
27 static inline void sys_irq_enable(unsigned int vector)
28 {
29  XScuGic_EnableIntr(XPAR_SCUGIC_0_DIST_BASEADDR, vector);
30 }
31 
32 static inline void sys_irq_disable(unsigned int vector)
33 {
34  XScuGic_DisableIntr(XPAR_SCUGIC_0_DIST_BASEADDR, vector);
35 }
36 
37 #endif /* METAL_INTERNAL */
38 
39 #ifdef __cplusplus
40 }
41 #endif
42 
43 #endif /* __METAL_GENERIC_ZYNQ7_SYS__H__ */
void sys_irq_enable(unsigned int vector)
Definition: sys.c:29
void sys_irq_disable(unsigned int vector)
Definition: sys.c:36