File: edid-region.c

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 (33 lines) | stat: -rw-r--r-- 848 bytes parent folder | download | duplicates (10)
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
#include "qemu/osdep.h"
#include "exec/memory.h"
#include "hw/display/edid.h"

static uint64_t edid_region_read(void *ptr, hwaddr addr, unsigned size)
{
    uint8_t *edid = ptr;

    return edid[addr];
}

static void edid_region_write(void *ptr, hwaddr addr,
                             uint64_t val, unsigned size)
{
    /* read only */
}

static const MemoryRegionOps edid_region_ops = {
    .read = edid_region_read,
    .write = edid_region_write,
    .valid.min_access_size = 1,
    .valid.max_access_size = 4,
    .impl.min_access_size = 1,
    .impl.max_access_size = 1,
    .endianness = DEVICE_LITTLE_ENDIAN,
};

void qemu_edid_region_io(MemoryRegion *region, Object *owner,
                         uint8_t *edid, size_t size)
{
    memory_region_init_io(region, owner, &edid_region_ops,
                          edid, "edid", size);
}