qemu-cr16/include/qemu/s390x_pci_mmio.h
Farhan Ali b17d69a1da util: Add functions for s390x mmio read/write
Starting with z15 (or newer) we can execute mmio
instructions from userspace. On older platforms
where we don't have these instructions available
we can fallback to using system calls to access
the PCI mapped resources.

This patch adds helper functions for mmio reads
and writes for s390x.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Niklas Schnelle <schnelle@linux.ibm.com>
Signed-off-by: Farhan Ali <alifm@linux.ibm.com>
Acked-by: Thomas Huth <thuth@redhat.com>
Message-id: 20250430185012.2303-2-alifm@linux.ibm.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
2025-05-08 10:03:07 -04:00

24 lines
726 B
C

/*
* s390x PCI MMIO definitions
*
* Copyright 2025 IBM Corp.
* Author(s): Farhan Ali <alifm@linux.ibm.com>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#ifndef S390X_PCI_MMIO_H
#define S390X_PCI_MMIO_H
#ifdef __s390x__
uint8_t s390x_pci_mmio_read_8(const void *ioaddr);
uint16_t s390x_pci_mmio_read_16(const void *ioaddr);
uint32_t s390x_pci_mmio_read_32(const void *ioaddr);
uint64_t s390x_pci_mmio_read_64(const void *ioaddr);
void s390x_pci_mmio_write_8(void *ioaddr, uint8_t val);
void s390x_pci_mmio_write_16(void *ioaddr, uint16_t val);
void s390x_pci_mmio_write_32(void *ioaddr, uint32_t val);
void s390x_pci_mmio_write_64(void *ioaddr, uint64_t val);
#endif /* __s390x__ */
#endif /* S390X_PCI_MMIO_H */