Statistics
| Branch: | Revision:

root / hw / i8259_internal.h @ 2cae4119

History | View | Annotate | Download (2.8 kB)

1 512709f5 Jan Kiszka
/*
2 512709f5 Jan Kiszka
 * QEMU 8259 - internal interfaces
3 512709f5 Jan Kiszka
 *
4 512709f5 Jan Kiszka
 * Copyright (c) 2011 Jan Kiszka, Siemens AG
5 512709f5 Jan Kiszka
 *
6 512709f5 Jan Kiszka
 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 512709f5 Jan Kiszka
 * of this software and associated documentation files (the "Software"), to deal
8 512709f5 Jan Kiszka
 * in the Software without restriction, including without limitation the rights
9 512709f5 Jan Kiszka
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 512709f5 Jan Kiszka
 * copies of the Software, and to permit persons to whom the Software is
11 512709f5 Jan Kiszka
 * furnished to do so, subject to the following conditions:
12 512709f5 Jan Kiszka
 *
13 512709f5 Jan Kiszka
 * The above copyright notice and this permission notice shall be included in
14 512709f5 Jan Kiszka
 * all copies or substantial portions of the Software.
15 512709f5 Jan Kiszka
 *
16 512709f5 Jan Kiszka
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 512709f5 Jan Kiszka
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 512709f5 Jan Kiszka
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 512709f5 Jan Kiszka
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 512709f5 Jan Kiszka
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 512709f5 Jan Kiszka
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22 512709f5 Jan Kiszka
 * THE SOFTWARE.
23 512709f5 Jan Kiszka
 */
24 512709f5 Jan Kiszka
25 512709f5 Jan Kiszka
#ifndef QEMU_I8259_INTERNAL_H
26 512709f5 Jan Kiszka
#define QEMU_I8259_INTERNAL_H
27 512709f5 Jan Kiszka
28 512709f5 Jan Kiszka
#include "hw.h"
29 512709f5 Jan Kiszka
#include "pc.h"
30 512709f5 Jan Kiszka
#include "isa.h"
31 512709f5 Jan Kiszka
32 512709f5 Jan Kiszka
typedef struct PICCommonState PICCommonState;
33 512709f5 Jan Kiszka
34 8f04ee08 Anthony Liguori
#define TYPE_PIC_COMMON "pic-common"
35 8f04ee08 Anthony Liguori
#define PIC_COMMON(obj) \
36 8f04ee08 Anthony Liguori
     OBJECT_CHECK(PICCommon, (obj), TYPE_PIC_COMMON)
37 8f04ee08 Anthony Liguori
#define PIC_COMMON_CLASS(klass) \
38 8f04ee08 Anthony Liguori
     OBJECT_CLASS_CHECK(PICCommonClass, (klass), TYPE_PIC_COMMON)
39 8f04ee08 Anthony Liguori
#define PIC_COMMON_GET_CLASS(obj) \
40 8f04ee08 Anthony Liguori
     OBJECT_GET_CLASS(PICCommonClass, (obj), TYPE_PIC_COMMON)
41 8f04ee08 Anthony Liguori
42 8f04ee08 Anthony Liguori
typedef struct PICCommonClass
43 8f04ee08 Anthony Liguori
{
44 8f04ee08 Anthony Liguori
    ISADeviceClass parent_class;
45 8f04ee08 Anthony Liguori
    void (*init)(PICCommonState *s);
46 8f04ee08 Anthony Liguori
    void (*pre_save)(PICCommonState *s);
47 8f04ee08 Anthony Liguori
    void (*post_load)(PICCommonState *s);
48 8f04ee08 Anthony Liguori
} PICCommonClass;
49 8f04ee08 Anthony Liguori
50 512709f5 Jan Kiszka
struct PICCommonState {
51 512709f5 Jan Kiszka
    ISADevice dev;
52 512709f5 Jan Kiszka
    uint8_t last_irr; /* edge detection */
53 512709f5 Jan Kiszka
    uint8_t irr; /* interrupt request register */
54 512709f5 Jan Kiszka
    uint8_t imr; /* interrupt mask register */
55 512709f5 Jan Kiszka
    uint8_t isr; /* interrupt service register */
56 512709f5 Jan Kiszka
    uint8_t priority_add; /* highest irq priority */
57 512709f5 Jan Kiszka
    uint8_t irq_base;
58 512709f5 Jan Kiszka
    uint8_t read_reg_select;
59 512709f5 Jan Kiszka
    uint8_t poll;
60 512709f5 Jan Kiszka
    uint8_t special_mask;
61 512709f5 Jan Kiszka
    uint8_t init_state;
62 512709f5 Jan Kiszka
    uint8_t auto_eoi;
63 512709f5 Jan Kiszka
    uint8_t rotate_on_auto_eoi;
64 512709f5 Jan Kiszka
    uint8_t special_fully_nested_mode;
65 512709f5 Jan Kiszka
    uint8_t init4; /* true if 4 byte init */
66 512709f5 Jan Kiszka
    uint8_t single_mode; /* true if slave pic is not initialized */
67 512709f5 Jan Kiszka
    uint8_t elcr; /* PIIX edge/trigger selection*/
68 512709f5 Jan Kiszka
    uint8_t elcr_mask;
69 512709f5 Jan Kiszka
    qemu_irq int_out[1];
70 512709f5 Jan Kiszka
    uint32_t master; /* reflects /SP input pin */
71 512709f5 Jan Kiszka
    uint32_t iobase;
72 512709f5 Jan Kiszka
    uint32_t elcr_addr;
73 512709f5 Jan Kiszka
    MemoryRegion base_io;
74 512709f5 Jan Kiszka
    MemoryRegion elcr_io;
75 512709f5 Jan Kiszka
};
76 512709f5 Jan Kiszka
77 512709f5 Jan Kiszka
void pic_reset_common(PICCommonState *s);
78 512709f5 Jan Kiszka
79 512709f5 Jan Kiszka
ISADevice *i8259_init_chip(const char *name, ISABus *bus, bool master);
80 512709f5 Jan Kiszka
81 512709f5 Jan Kiszka
82 512709f5 Jan Kiszka
#endif /* !QEMU_I8259_INTERNAL_H */