summary refs log tree commit diff stats
path: root/include/hw/intc/loongarch_dintc.h
blob: 0b0b5347b2c8f72b2e5e199c09becb1b2d506a61 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/* SPDX-License-Identifier: GPL-2.0-or-later */
/*
 * LoongArch  direct interrupt controller definitions
 *
 * Copyright (C) 2025 Loongson Technology Corporation Limited
 */

#include "qom/object.h"
#include "hw/sysbus.h"
#include "hw/loongarch/virt.h"


#define NR_VECTORS     256

#define TYPE_LOONGARCH_DINTC "loongarch_dintc"
OBJECT_DECLARE_TYPE(LoongArchDINTCState, LoongArchDINTCClass, LOONGARCH_DINTC)

typedef struct DINTCCore {
    CPUState *cpu;
    qemu_irq parent_irq;
    uint64_t arch_id;
} DINTCCore;

struct LoongArchDINTCState {
    SysBusDevice parent_obj;
    MemoryRegion dintc_mmio;
    DINTCCore *cpu;
    uint32_t num_cpu;
};

struct LoongArchDINTCClass {
    SysBusDeviceClass parent_class;

    DeviceRealize parent_realize;
    DeviceUnrealize parent_unrealize;
};