Date: Fri, 6 Nov 2015 04:56:52 +0000 (UTC) From: Justin Hibbits <jhibbits@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r290434 - head/sys/powerpc/powerpc Message-ID: <201511060456.tA64uqj3066313@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhibbits Date: Fri Nov 6 04:56:52 2015 New Revision: 290434 URL: https://svnweb.freebsd.org/changeset/base/290434 Log: Write 2- and 4-byte aligned values as single writes in ddb(4) On the mpc85xx SoC family, writes to any part of a word in the CCSR affect the full word. This prevents single-byte writes from taking the desired effect. Code copied directly from ARM. Modified: head/sys/powerpc/powerpc/db_interface.c Modified: head/sys/powerpc/powerpc/db_interface.c ============================================================================== --- head/sys/powerpc/powerpc/db_interface.c Fri Nov 6 04:45:29 2015 (r290433) +++ head/sys/powerpc/powerpc/db_interface.c Fri Nov 6 04:56:52 2015 (r290434) @@ -67,8 +67,14 @@ db_write_bytes(vm_offset_t addr, size_t dst = (char *)addr; cnt = size; - while (cnt-- > 0) - *dst++ = *data++; + if (size == 4 && (addr & 3) == 0 && ((uintptr_t)data & 3) == 0) + *((int*)dst) = *((int*)data); + else + if (size == 2 && (addr & 1) == 0 && ((uintptr_t)data & 1) == 0) + *((short*)dst) = *((short*)data); + else + while (cnt-- > 0) + *dst++ = *data++; kdb_cpu_sync_icache((void *)addr, size); } (void)kdb_jmpbuf(prev_jb);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201511060456.tA64uqj3066313>