From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:59585) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rav1B-0005ER-4x for qemu-devel@nongnu.org; Wed, 14 Dec 2011 15:01:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rav1A-0001Pi-35 for qemu-devel@nongnu.org; Wed, 14 Dec 2011 15:01:33 -0500 Received: from cpe-70-123-132-139.austin.res.rr.com ([70.123.132.139]:45639 helo=localhost6.localdomain6) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rav19-0001PX-SK for qemu-devel@nongnu.org; Wed, 14 Dec 2011 15:01:32 -0500 From: Anthony Liguori Date: Wed, 14 Dec 2011 14:01:11 -0600 Message-Id: <1323892874-13234-2-git-send-email-aliguori@us.ibm.com> In-Reply-To: <1323892874-13234-1-git-send-email-aliguori@us.ibm.com> References: <1323892874-13234-1-git-send-email-aliguori@us.ibm.com> Subject: [Qemu-devel] [PATCH v2 1/4] memory: make memory API parsable by gtkdoc-scan (v2) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Peter Maydell , Anthony Liguori , Avi Kivity , Stefan Weil gtkdoc-scan cannot handle nested structs so remove those from the memory API. Signed-off-by: Anthony Liguori --- v1 -> v2 - no need to use underscores anymore --- memory.h | 73 ++++++++++++++++++++++++++++++++++--------------------------- 1 files changed, 41 insertions(+), 32 deletions(-) diff --git a/memory.h b/memory.h index beae127..057aa34 100644 --- a/memory.h +++ b/memory.h @@ -30,6 +30,8 @@ typedef struct MemoryRegionOps MemoryRegionOps; typedef struct MemoryRegion MemoryRegion; typedef struct MemoryRegionPortio MemoryRegionPortio; typedef struct MemoryRegionMmio MemoryRegionMmio; +typedef struct MemoryRegionGuestConstraints MemoryRegionGuestConstraints; +typedef struct MemoryRegionInternalConstraints MemoryRegionInternalConstraints; /* Must match *_DIRTY_FLAGS in cpu-all.h. To be replaced with dynamic * registration. @@ -43,6 +45,42 @@ struct MemoryRegionMmio { CPUWriteMemoryFunc *write[3]; }; +struct MemoryRegionGuestConstraints +{ + /* If nonzero, specify bounds on access sizes beyond which a machine + * check is thrown. + */ + unsigned min_access_size; + unsigned max_access_size; + /* If true, unaligned accesses are supported. Otherwise unaligned + * accesses throw machine checks. + */ + bool unaligned; + /* + * If present, and returns #false, the transaction is not accepted + * by the device (and results in machine dependent behaviour such + * as a machine check exception). + */ + bool (*accepts)(void *opaque, target_phys_addr_t addr, + unsigned size, bool is_write); +}; + +struct MemoryRegionInternalConstraints +{ + /* If nonzero, specifies the minimum size implemented. Smaller sizes + * will be rounded upwards and a partial result will be returned. + */ + unsigned min_access_size; + /* If nonzero, specifies the maximum size implemented. Larger sizes + * will be done as a series of accesses with smaller sizes. + */ + unsigned max_access_size; + /* If true, unaligned accesses are supported. Otherwise all accesses + * are converted to (possibly multiple) naturally aligned accesses. + */ + bool unaligned; +}; + /* * Memory region callbacks */ @@ -61,39 +99,10 @@ struct MemoryRegionOps { enum device_endian endianness; /* Guest-visible constraints: */ - struct { - /* If nonzero, specify bounds on access sizes beyond which a machine - * check is thrown. - */ - unsigned min_access_size; - unsigned max_access_size; - /* If true, unaligned accesses are supported. Otherwise unaligned - * accesses throw machine checks. - */ - bool unaligned; - /* - * If present, and returns #false, the transaction is not accepted - * by the device (and results in machine dependent behaviour such - * as a machine check exception). - */ - bool (*accepts)(void *opaque, target_phys_addr_t addr, - unsigned size, bool is_write); - } valid; + MemoryRegionGuestConstraints valid; + /* Internal implementation constraints: */ - struct { - /* If nonzero, specifies the minimum size implemented. Smaller sizes - * will be rounded upwards and a partial result will be returned. - */ - unsigned min_access_size; - /* If nonzero, specifies the maximum size implemented. Larger sizes - * will be done as a series of accesses with smaller sizes. - */ - unsigned max_access_size; - /* If true, unaligned accesses are supported. Otherwise all accesses - * are converted to (possibly multiple) naturally aligned accesses. - */ - bool unaligned; - } impl; + MemoryRegionInternalConstraints impl; /* If .read and .write are not present, old_portio may be used for * backwards compatibility with old portio registration -- 1.7.4.1