Date: Mon, 6 May 2019 03:31:28 +0000 (UTC) From: Justin Hibbits <jhibbits@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r347175 - stable/12/sys/powerpc/powerpc Message-ID: <201905060331.x463VSWj005008@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jhibbits Date: Mon May 6 03:31:27 2019 New Revision: 347175 URL: https://svnweb.freebsd.org/changeset/base/347175 Log: MFC r340262,344730 r340262: powerpc64: Fix "show spr" command on ELFv2 kernels r344730: powerpc: fix 'show spr' for ELFv1 powerpc64 Modified: stable/12/sys/powerpc/powerpc/machdep.c Directory Properties: stable/12/ (props changed) Modified: stable/12/sys/powerpc/powerpc/machdep.c ============================================================================== --- stable/12/sys/powerpc/powerpc/machdep.c Mon May 6 03:20:02 2019 (r347174) +++ stable/12/sys/powerpc/powerpc/machdep.c Mon May 6 03:31:27 2019 (r347175) @@ -541,8 +541,16 @@ DB_SHOW_COMMAND(spr, db_show_spr) saved_sprno = sprno = (intptr_t) addr; sprno = ((sprno & 0x3e0) >> 5) | ((sprno & 0x1f) << 5); p = (uint32_t *)(void *)&get_spr; +#ifdef __powerpc64__ +#if defined(_CALL_ELF) && _CALL_ELF == 2 + /* Account for ELFv2 function prologue. */ + p += 2; +#else + p = *(volatile uint32_t * volatile *)p; +#endif +#endif *p = (*p & ~0x001ff800) | (sprno << 11); - __syncicache(get_spr, cacheline_size); + __syncicache(__DEVOLATILE(uint32_t *, p), cacheline_size); spr = get_spr(sprno); db_printf("SPR %d(%x): %lx\n", saved_sprno, saved_sprno,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905060331.x463VSWj005008>