1/* 2 * mmio_interface.h 3 * 4 * Copyright (C) 2017 : GreenSocs 5 * http://www.greensocs.com/ , email: info@greensocs.com 6 * 7 * Developed by : 8 * Frederic Konrad <fred.konrad@greensocs.com> 9 * 10 * This program is free software; you can redistribute it and/or modify 11 * it under the terms of the GNU General Public License as published by 12 * the Free Software Foundation, either version 2 of the License, or 13 * (at your option)any later version. 14 * 15 * This program is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU General Public License for more details. 19 * 20 * You should have received a copy of the GNU General Public License along 21 * with this program; if not, see <http://www.gnu.org/licenses/>. 22 * 23 */ 24 25#ifndef MMIO_INTERFACE_H 26#define MMIO_INTERFACE_H 27 28#include "exec/memory.h" 29 30#define TYPE_MMIO_INTERFACE "mmio_interface" 31#define MMIO_INTERFACE(obj) OBJECT_CHECK(MMIOInterface, (obj), \ 32 TYPE_MMIO_INTERFACE) 33 34typedef struct MMIOInterface { 35 DeviceState parent_obj; 36 37 MemoryRegion *subregion; 38 MemoryRegion ram_mem; 39 uint64_t start; 40 uint64_t end; 41 bool ro; 42 uint64_t id; 43 void *host_ptr; 44} MMIOInterface; 45 46void mmio_interface_map(MMIOInterface *s); 47void mmio_interface_unmap(MMIOInterface *s); 48 49#endif /* MMIO_INTERFACE_H */ 50