exec: cleanup DEBUG_SUBPAGE
Touched some error after enabling DEBUG_SUBPAGE. Signed-off-by: Amos Kong <akong@redhat.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
		
							parent
							
								
									d8039e58b1
								
							
						
					
					
						commit
						016e9d62fe
					
				
							
								
								
									
										18
									
								
								exec.c
									
									
									
									
									
								
							
							
						
						
									
										18
									
								
								exec.c
									
									
									
									
									
								
							@ -1573,7 +1573,7 @@ static uint64_t subpage_read(void *opaque, hwaddr addr,
 | 
				
			|||||||
    uint8_t buf[4];
 | 
					    uint8_t buf[4];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(DEBUG_SUBPAGE)
 | 
					#if defined(DEBUG_SUBPAGE)
 | 
				
			||||||
    printf("%s: subpage %p len %d addr " TARGET_FMT_plx "\n", __func__,
 | 
					    printf("%s: subpage %p len %u addr " TARGET_FMT_plx "\n", __func__,
 | 
				
			||||||
           subpage, len, addr);
 | 
					           subpage, len, addr);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    address_space_read(subpage->as, addr + subpage->base, buf, len);
 | 
					    address_space_read(subpage->as, addr + subpage->base, buf, len);
 | 
				
			||||||
@ -1596,7 +1596,7 @@ static void subpage_write(void *opaque, hwaddr addr,
 | 
				
			|||||||
    uint8_t buf[4];
 | 
					    uint8_t buf[4];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(DEBUG_SUBPAGE)
 | 
					#if defined(DEBUG_SUBPAGE)
 | 
				
			||||||
    printf("%s: subpage %p len %d addr " TARGET_FMT_plx
 | 
					    printf("%s: subpage %p len %u addr " TARGET_FMT_plx
 | 
				
			||||||
           " value %"PRIx64"\n",
 | 
					           " value %"PRIx64"\n",
 | 
				
			||||||
           __func__, subpage, len, addr, value);
 | 
					           __func__, subpage, len, addr, value);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
@ -1617,16 +1617,16 @@ static void subpage_write(void *opaque, hwaddr addr,
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static bool subpage_accepts(void *opaque, hwaddr addr,
 | 
					static bool subpage_accepts(void *opaque, hwaddr addr,
 | 
				
			||||||
                            unsigned size, bool is_write)
 | 
					                            unsigned len, bool is_write)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    subpage_t *subpage = opaque;
 | 
					    subpage_t *subpage = opaque;
 | 
				
			||||||
#if defined(DEBUG_SUBPAGE)
 | 
					#if defined(DEBUG_SUBPAGE)
 | 
				
			||||||
    printf("%s: subpage %p %c len %d addr " TARGET_FMT_plx "\n",
 | 
					    printf("%s: subpage %p %c len %u addr " TARGET_FMT_plx "\n",
 | 
				
			||||||
           __func__, subpage, is_write ? 'w' : 'r', len, addr);
 | 
					           __func__, subpage, is_write ? 'w' : 'r', len, addr);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return address_space_access_valid(subpage->as, addr + subpage->base,
 | 
					    return address_space_access_valid(subpage->as, addr + subpage->base,
 | 
				
			||||||
                                      size, is_write);
 | 
					                                      len, is_write);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static const MemoryRegionOps subpage_ops = {
 | 
					static const MemoryRegionOps subpage_ops = {
 | 
				
			||||||
@ -1646,8 +1646,8 @@ static int subpage_register (subpage_t *mmio, uint32_t start, uint32_t end,
 | 
				
			|||||||
    idx = SUBPAGE_IDX(start);
 | 
					    idx = SUBPAGE_IDX(start);
 | 
				
			||||||
    eidx = SUBPAGE_IDX(end);
 | 
					    eidx = SUBPAGE_IDX(end);
 | 
				
			||||||
#if defined(DEBUG_SUBPAGE)
 | 
					#if defined(DEBUG_SUBPAGE)
 | 
				
			||||||
    printf("%s: %p start %08x end %08x idx %08x eidx %08x mem %ld\n", __func__,
 | 
					    printf("%s: %p start %08x end %08x idx %08x eidx %08x section %d\n",
 | 
				
			||||||
           mmio, start, end, idx, eidx, memory);
 | 
					           __func__, mmio, start, end, idx, eidx, section);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    for (; idx <= eidx; idx++) {
 | 
					    for (; idx <= eidx; idx++) {
 | 
				
			||||||
        mmio->sub_section[idx] = section;
 | 
					        mmio->sub_section[idx] = section;
 | 
				
			||||||
@ -1668,8 +1668,8 @@ static subpage_t *subpage_init(AddressSpace *as, hwaddr base)
 | 
				
			|||||||
                          "subpage", TARGET_PAGE_SIZE);
 | 
					                          "subpage", TARGET_PAGE_SIZE);
 | 
				
			||||||
    mmio->iomem.subpage = true;
 | 
					    mmio->iomem.subpage = true;
 | 
				
			||||||
#if defined(DEBUG_SUBPAGE)
 | 
					#if defined(DEBUG_SUBPAGE)
 | 
				
			||||||
    printf("%s: %p base " TARGET_FMT_plx " len %08x %d\n", __func__,
 | 
					    printf("%s: %p base " TARGET_FMT_plx " len %08x\n", __func__,
 | 
				
			||||||
           mmio, base, TARGET_PAGE_SIZE, subpage_memory);
 | 
					           mmio, base, TARGET_PAGE_SIZE);
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
    subpage_register(mmio, 0, TARGET_PAGE_SIZE-1, PHYS_SECTION_UNASSIGNED);
 | 
					    subpage_register(mmio, 0, TARGET_PAGE_SIZE-1, PHYS_SECTION_UNASSIGNED);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user