summaryrefslogtreecommitdiffstats
path: root/include/hw/char/goldfish_tty.h
blob: b9dd67362a68927b7507355c32663c0150e880d2 (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
/*
 * SPDX-License-Identifer: GPL-2.0-or-later
 *
 * Goldfish TTY
 *
 * (c) 2020 Laurent Vivier <laurent@vivier.eu>
 *
 */

#ifndef HW_CHAR_GOLDFISH_TTY_H
#define HW_CHAR_GOLDFISH_TTY_H

#include "qemu/fifo8.h"
#include "chardev/char-fe.h"

#define TYPE_GOLDFISH_TTY "goldfish_tty"
OBJECT_DECLARE_SIMPLE_TYPE(GoldfishTTYState, GOLDFISH_TTY)

#define GOLFISH_TTY_BUFFER_SIZE 128

struct GoldfishTTYState {
    SysBusDevice parent_obj;

    MemoryRegion iomem;
    qemu_irq irq;
    CharBackend chr;

    uint32_t data_len;
    uint64_t data_ptr;
    bool int_enabled;

    Fifo8 rx_fifo;
};

#endif