File: pl022.h

package info (click to toggle)
qemu 1%3A5.2%2Bdfsg-11%2Bdeb11u3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 203,452 kB
  • sloc: ansic: 2,327,684; pascal: 107,506; asm: 49,545; python: 40,498; sh: 35,286; cpp: 33,587; makefile: 15,209; perl: 6,965; xml: 3,028; objc: 1,460; php: 1,299; tcl: 1,070; yacc: 604; lex: 363; sql: 71; awk: 35; sed: 11
file content (52 lines) | stat: -rw-r--r-- 1,235 bytes parent folder | download
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
 * ARM PrimeCell PL022 Synchronous Serial Port
 *
 * Copyright (c) 2007 CodeSourcery.
 * Written by Paul Brook
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 or
 * (at your option) any later version.
 */

/* This is a model of the Arm PrimeCell PL022 synchronous serial port.
 * The PL022 TRM is:
 * http://infocenter.arm.com/help/topic/com.arm.doc.ddi0194h/DDI0194H_ssp_pl022_trm.pdf
 *
 * QEMU interface:
 * + sysbus IRQ: SSPINTR combined interrupt line
 * + sysbus MMIO region 0: MemoryRegion for the device's registers
 */

#ifndef HW_SSI_PL022_H
#define HW_SSI_PL022_H

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

#define TYPE_PL022 "pl022"
OBJECT_DECLARE_SIMPLE_TYPE(PL022State, PL022)

struct PL022State {
    SysBusDevice parent_obj;

    MemoryRegion iomem;
    uint32_t cr0;
    uint32_t cr1;
    uint32_t bitmask;
    uint32_t sr;
    uint32_t cpsr;
    uint32_t is;
    uint32_t im;
    /* The FIFO head points to the next empty entry.  */
    int tx_fifo_head;
    int rx_fifo_head;
    int tx_fifo_len;
    int rx_fifo_len;
    uint16_t tx_fifo[8];
    uint16_t rx_fifo[8];
    qemu_irq irq;
    SSIBus *ssi;
};

#endif