Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create a io region for an EDID data block. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-id: 20180925075646.25114-4-kraxel@redhat.com
- Loading branch information
Showing
3 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#include "qemu/osdep.h" | ||
#include "qemu-common.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); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters