Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Mar 2019 21:11:47 +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: r344730 - head/sys/powerpc/powerpc
Message-ID:  <201903022111.x22LBlGc027136@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhibbits
Date: Sat Mar  2 21:11:46 2019
New Revision: 344730
URL: https://svnweb.freebsd.org/changeset/base/344730

Log:
  powerpc: fix 'show spr' for ELFv1 powerpc64
  
  Update and flush the right cache range for the ELFv1 ABI.
  
  MFC after:	1 week

Modified:
  head/sys/powerpc/powerpc/machdep.c

Modified: head/sys/powerpc/powerpc/machdep.c
==============================================================================
--- head/sys/powerpc/powerpc/machdep.c	Sat Mar  2 20:59:18 2019	(r344729)
+++ head/sys/powerpc/powerpc/machdep.c	Sat Mar  2 21:11:46 2019	(r344730)
@@ -541,12 +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?201903022111.x22LBlGc027136>