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 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7/*
8 * @file generic/xlnx/sys.h
9 * @brief generic xlnx 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#ifndef __MICROBLAZE__
17#include "xscugic.h"
18#endif
19
20#include <metal/assert.h>
21#include <metal/io.h>
22#include <metal/sys.h>
23#include <stdint.h>
24#include <metal/compiler.h>
25#include <metal/utilities.h>
26
27#include <xil_cache.h>
28#include <xil_exception.h>
29#include <xparameters.h>
30
31#ifndef __METAL_GENERIC_XLNX_SYS__H__
32#define __METAL_GENERIC_XLNX_SYS__H__
33
34#ifdef __cplusplus
35extern "C" {
36#endif
37
38#ifndef __MICROBLAZE__
39#define XLNX_MAXIRQS XSCUGIC_MAX_NUM_INTR_INPUTS
40#endif
41
42#if defined(SDT) && !defined(__MICROBLAZE__)
43#define XPAR_SCUGIC_0_DIST_BASEADDR XPAR_SCUGIC_DIST_BASEADDR
44#endif
45
54void metal_xlnx_irq_isr(void *arg);
55
64int metal_xlnx_irq_init(void);
65
66/* Microblaze defines these routines */
67#ifdef __MICROBLAZE__
68void metal_weak sys_irq_enable(unsigned int vector);
69
70void metal_weak sys_irq_disable(unsigned int vector);
71#else
72static inline void sys_irq_enable(unsigned int vector)
73{
74 XScuGic_EnableIntr(XPAR_SCUGIC_0_DIST_BASEADDR, vector);
75}
76
77static inline void sys_irq_disable(unsigned int vector)
78{
79 XScuGic_DisableIntr(XPAR_SCUGIC_0_DIST_BASEADDR, vector);
80}
81#endif
82
83#ifdef __cplusplus
84}
85#endif
86
87#endif /* __METAL_GENERIC_XLNX_SYS__H__ */
#define metal_weak
Definition compiler.h:21
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