libmetal
Loading...
Searching...
No Matches
sys.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2015, Xilinx Inc. and Contributors. All rights reserved.
3 * Copyright (c) 2023 Advanced Micro Devices, Inc. All rights reserved.
4 *
5 * SPDX-License-Identifier: BSD-3-Clause
6 */
7
8/*
9 * @file freertos/xlnx/sys.h
10 * @brief freertos Xilinx common system primitives for libmetal.
11 */
12
13#ifndef __METAL_FREERTOS_SYS__H__
14#error "Include metal/sys.h instead of metal/freertos/@PROJECT_MACHINE@/sys.h"
15#endif
16
17#ifndef __METAL_FREERTOS_XLNX_SYS__H__
18#define __METAL_FREERTOS_XLNX_SYS__H__
19
20#include "xscugic.h"
21#include "FreeRTOS.h"
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27#if defined(SDT) && defined(PLATFORM_ZYNQ)
28#define XPAR_SCUGIC_0_DIST_BASEADDR XPAR_SCUGIC_DIST_BASEADDR
29#endif
30
31#ifndef XLNX_MAXIRQS
32#define XLNX_MAXIRQS XSCUGIC_MAX_NUM_INTR_INPUTS
33#endif
34
43void metal_xlnx_irq_isr(void *arg);
44
53int metal_xlnx_irq_init(void);
54
55static inline void sys_irq_enable(unsigned int vector)
56{
57#ifdef PLATFORM_ZYNQ
58 XScuGic_EnableIntr(XPAR_SCUGIC_0_DIST_BASEADDR, vector);
59#else
60 vPortEnableInterrupt(vector);
61#endif
62}
63
64static inline void sys_irq_disable(unsigned int vector)
65{
66#ifdef PLATFORM_ZYNQ
67 XScuGic_DisableIntr(XPAR_SCUGIC_0_DIST_BASEADDR, vector);
68#else
69 vPortDisableInterrupt(vector);
70#endif
71}
72
73#ifdef __cplusplus
74}
75#endif
76
77#endif /* __METAL_FREERTOS_XLNX_SYS__H__ */
void sys_irq_disable(unsigned int vector)
Definition sys.c:36
void sys_irq_enable(unsigned int vector)
Definition sys.c:29
int metal_xlnx_irq_init(void)
metal_xlnx_irq_int
Definition irq.c:62
void metal_xlnx_irq_isr(void *arg)
metal_xlnx_irq_isr
Definition irq.c:51