Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Sep 2021 21:21:10 GMT
From:      Olivier Houchard <cognet@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: a342ecd326ee - main - arm: Handle thumb2 thread entry point.
Message-ID:  <202109212121.18LLLAvB053396@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by cognet:

URL: https://cgit.FreeBSD.org/src/commit/?id=a342ecd326ee9e021b0a4d6dc8aca1a297c606f8

commit a342ecd326ee9e021b0a4d6dc8aca1a297c606f8
Author:     Olivier Houchard <cognet@FreeBSD.org>
AuthorDate: 2021-09-21 21:19:46 +0000
Commit:     Olivier Houchard <cognet@FreeBSD.org>
CommitDate: 2021-09-21 21:20:27 +0000

    arm: Handle thumb2 thread entry point.
    
    In cpu_set_upcall(), if the thread startup routine is a thumb routine, make
    sure to set PSR_T, so that the CPU will run in thumb mode.
    
    MFC After:      1 week
---
 sys/arm/arm/vm_machdep.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sys/arm/arm/vm_machdep.c b/sys/arm/arm/vm_machdep.c
index 03bbf75ebf71..ba44aa162e8b 100644
--- a/sys/arm/arm/vm_machdep.c
+++ b/sys/arm/arm/vm_machdep.c
@@ -235,6 +235,8 @@ cpu_set_upcall(struct thread *td, void (*entry)(void *), void *arg,
 	tf->tf_pc = (int)entry;
 	tf->tf_r0 = (int)arg;
 	tf->tf_spsr = PSR_USR32_MODE;
+	if ((register_t)entry & 1)
+		tf->tf_spsr |= PSR_T;
 }
 
 int



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