qemu/include/hw/intc/xlnx_scu_gic.h
<<
>>
Prefs
   1/*
   2 * xlnx_scu_gic.h
   3 *
   4 *  Copyright (C) 2016 : GreenSocs
   5 *      http://www.greensocs.com/ , email: info@greensocs.com
   6 *
   7 *  Developed by :
   8 *  Frederic Konrad   <fred.konrad@greensocs.com>
   9 *
  10 * This program is free software; you can redistribute it and/or modify
  11 * it under the terms of the GNU General Public License as published by
  12 * the Free Software Foundation, either version 2 of the License, or
  13 * (at your option) any later version.
  14 *
  15 * This program is distributed in the hope that it will be useful,
  16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  18 * GNU General Public License for more details.
  19 *
  20 * You should have received a copy of the GNU General Public License along
  21 * with this program; if not, see <http://www.gnu.org/licenses/>.
  22 *
  23 */
  24
  25#ifndef XLNX_SCU_GIC_H
  26#define XLNX_SCU_GIC_H
  27
  28#include "arm_gic.h"
  29
  30#define TYPE_XLNX_SCU_GIC "xlnx,zynqmp-scugic"
  31
  32#define XLNX_SCU_GIC(obj) \
  33     OBJECT_CHECK(XlnxSCUGICState, (obj), TYPE_XLNX_SCU_GIC)
  34#define XLNX_SCU_GIC_CLASS(klass) \
  35     OBJECT_CLASS_CHECK(XlnxSCUGICClass, (klass), TYPE_XLNX_SCU_GIC)
  36#define XLNX_SCU_GIC_GET_CLASS(obj) \
  37     OBJECT_GET_CLASS(XlnxSCUGICClass, (obj), TYPE_XLNX_SCU_GIC)
  38
  39#define XLNX_SCU_GIC_MAX_INJECTOR 2
  40#define XLNX_SCU_GIC_IRQ_REG 5
  41
  42struct XlnxSCUGICState {
  43    /*< private >*/
  44    GICState parent;
  45
  46    /*< public >*/
  47    uint32_t intr_inj[XLNX_SCU_GIC_MAX_INJECTOR][XLNX_SCU_GIC_IRQ_REG];
  48    uint32_t ext_level[XLNX_SCU_GIC_IRQ_REG];
  49};
  50
  51typedef struct XlnxSCUGICState XlnxSCUGICState;
  52
  53struct XlnxSCUGICClass {
  54    /*< private >*/
  55    ARMGICClass parent_class;
  56
  57    /*< public >*/
  58    qemu_irq_handler parent_irq_handler;
  59};
  60
  61typedef struct XlnxSCUGICClass XlnxSCUGICClass;
  62
  63void xlnx_scu_gic_set_intr(XlnxSCUGICState *s, unsigned int reg, uint32_t val,
  64                           uint8_t injector);
  65
  66#endif /* XLNX_SCU_GIC_H */
  67