From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E901s-0002Mp-D5 for qemu-devel@nongnu.org; Sat, 27 Aug 2005 08:43:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E901q-0002MN-G5 for qemu-devel@nongnu.org; Sat, 27 Aug 2005 08:43:23 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E8zyy-0001Fh-Nc for qemu-devel@nongnu.org; Sat, 27 Aug 2005 08:40:24 -0400 Received: from [195.3.96.91] (helo=email.aon.at) by monty-python.gnu.org with esmtp (Exim 4.34) id 1E8znw-0002BE-TT for qemu-devel@nongnu.org; Sat, 27 Aug 2005 08:29:01 -0400 Received: from m906p016.adsl.highway.telekom.at (HELO s37.loc) ([62.47.145.48]) (envelope-sender ) by smarthub73.highway.telekom.at (qmail-ldap-1.03) with SMTP for ; 27 Aug 2005 12:27:12 -0000 Received: from cow by s37.loc with local (Exim 4.52) id 1E8zn1-0000cr-0a for qemu-devel@nongnu.org; Sat, 27 Aug 2005 14:28:03 +0200 Date: Sat, 27 Aug 2005 14:28:03 +0200 From: Bernhard Fischer Message-ID: <20050827122802.GC15261@aon.at> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="bAr+fMtvBxbbbkvl" Content-Disposition: inline Subject: [Qemu-devel] [patch] fix a few comments in exec.c Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --bAr+fMtvBxbbbkvl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi, * exec.c: (cpu_physical_memory_rw): fix comments and trim some whitespace while at it. Please apply. thank you, Bernhard --bAr+fMtvBxbbbkvl Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="qemu.cow-20050827-1420.diff" diff -X excl -rduNp qemu.oorig/exec.c qemu/exec.c --- qemu.oorig/exec.c 2005-08-23 19:58:48.000000000 +0200 +++ qemu/exec.c 2005-08-27 14:18:31.000000000 +0200 @@ -2167,7 +2167,7 @@ void stl_phys(target_phys_addr_t addr, u } #else -void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf, +void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf, int len, int is_write) { int l, io_index; @@ -2176,7 +2176,7 @@ void cpu_physical_memory_rw(target_phys_ target_phys_addr_t page; unsigned long pd; PhysPageDesc *p; - + while (len > 0) { page = addr & TARGET_PAGE_MASK; l = (page + TARGET_PAGE_SIZE) - addr; @@ -2188,22 +2188,22 @@ void cpu_physical_memory_rw(target_phys_ } else { pd = p->phys_offset; } - + if (is_write) { if ((pd & ~TARGET_PAGE_MASK) != IO_MEM_RAM) { io_index = (pd >> IO_MEM_SHIFT) & (IO_MEM_NB_ENTRIES - 1); if (l >= 4 && ((addr & 3) == 0)) { - /* 32 bit read access */ + /* 32 bit write access */ val = ldl_p(buf); io_mem_write[io_index][2](io_mem_opaque[io_index], addr, val); l = 4; } else if (l >= 2 && ((addr & 1) == 0)) { - /* 16 bit read access */ + /* 16 bit write access */ val = lduw_p(buf); io_mem_write[io_index][1](io_mem_opaque[io_index], addr, val); l = 2; } else { - /* 8 bit access */ + /* 8 bit write access */ val = ldub_p(buf); io_mem_write[io_index][0](io_mem_opaque[io_index], addr, val); l = 1; @@ -2218,7 +2218,7 @@ void cpu_physical_memory_rw(target_phys_ /* invalidate code */ tb_invalidate_phys_page_range(addr1, addr1 + l, 0); /* set dirty bit */ - phys_ram_dirty[addr1 >> TARGET_PAGE_BITS] |= + phys_ram_dirty[addr1 >> TARGET_PAGE_BITS] |= (0xff & ~CODE_DIRTY_FLAG); } } @@ -2237,14 +2237,14 @@ void cpu_physical_memory_rw(target_phys_ stw_p(buf, val); l = 2; } else { - /* 8 bit access */ + /* 8 bit read access */ val = io_mem_read[io_index][0](io_mem_opaque[io_index], addr); stb_p(buf, val); l = 1; } } else { /* RAM case */ - ptr = phys_ram_base + (pd & TARGET_PAGE_MASK) + + ptr = phys_ram_base + (pd & TARGET_PAGE_MASK) + (addr & ~TARGET_PAGE_MASK); memcpy(buf, ptr, l); } --bAr+fMtvBxbbbkvl--