]> mj.ucw.cz Git - pciutils.git/blob - lib/physmem.h
libpci: Move physical memory mapping mmap() code from ecam/mmio-ports to physmem...
[pciutils.git] / lib / physmem.h
1 /*
2  *      The PCI Library -- Physical memory mapping API
3  *
4  *      Copyright (c) 2023 Pali Rohár <pali@kernel.org>
5  *
6  *      Can be freely distributed and used under the terms of the GNU GPL v2+
7  *
8  *      SPDX-License-Identifier: GPL-2.0-or-later
9  */
10
11 struct physmem;
12
13 void physmem_init_config(struct pci_access *a);
14 int physmem_access(struct pci_access *a, int w);
15 struct physmem *physmem_open(struct pci_access *a, int w);
16 void physmem_close(struct physmem *physmem);
17 long physmem_get_pagesize(struct physmem *physmem);
18 void *physmem_map(struct physmem *physmem, u64 addr, size_t length, int w);
19 int physmem_unmap(struct physmem *physmem, void *ptr, size_t length);