Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 24 Sep 2019 02:38:09 +0000 (UTC)
From:      Mitchell Horne <mhorne@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: r352641 - stable/12/sys/riscv/riscv
Message-ID:  <201909240238.x8O2c9dU085048@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mhorne
Date: Tue Sep 24 02:38:08 2019
New Revision: 352641
URL: https://svnweb.freebsd.org/changeset/base/352641

Log:
  MFC r352036:
  
  Fix compilation of locore.S with clang

Modified:
  stable/12/sys/riscv/riscv/locore.S
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/riscv/riscv/locore.S
==============================================================================
--- stable/12/sys/riscv/riscv/locore.S	Tue Sep 24 02:36:09 2019	(r352640)
+++ stable/12/sys/riscv/riscv/locore.S	Tue Sep 24 02:38:08 2019	(r352641)
@@ -69,12 +69,18 @@ _start:
 	la	t0, hart_lottery
 	li	t1, 1
 	amoadd.w t0, t1, 0(t0)
-	bnez	t0, mpentry
 
 	/*
-	 * Page tables
+	 * We must jump to mpentry in the non-BSP case because the offset is
+	 * too large to fit in a 12-bit branch immediate.
 	 */
+	beqz	t0, 1f
+	j	mpentry
 
+	/*
+	 * Page tables
+	 */
+1:
 	/* Add L1 entry for kernel */
 	la	s1, pagetable_l1
 	la	s2, pagetable_l2	/* Link to next level PN */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201909240238.x8O2c9dU085048>