The branch main has been updated by cognet:

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

commit 2191473724fbac4a7ca6da24bdc23164126ee904
Author:     Olivier Houchard <[email protected]>
AuthorDate: 2021-09-21 21:17:53 +0000
Commit:     Olivier Houchard <[email protected]>
CommitDate: 2021-09-21 21:20:27 +0000

    arm64: 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/arm64/arm64/vm_machdep.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sys/arm64/arm64/vm_machdep.c b/sys/arm64/arm64/vm_machdep.c
index bf7641074317..dfc2f8cb267f 100644
--- a/sys/arm64/arm64/vm_machdep.c
+++ b/sys/arm64/arm64/vm_machdep.c
@@ -200,9 +200,11 @@ cpu_set_upcall(struct thread *td, void (*entry)(void *), 
void *arg,
        struct trapframe *tf = td->td_frame;
 
        /* 32bits processes use r13 for sp */
-       if (td->td_frame->tf_spsr & PSR_M_32)
+       if (td->td_frame->tf_spsr & PSR_M_32) {
                tf->tf_x[13] = STACKALIGN((uintptr_t)stack->ss_sp + 
stack->ss_size);
-       else
+               if ((register_t)entry & 1)
+                       tf->tf_spsr |= PSR_T;
+       } else
                tf->tf_sp = STACKALIGN((uintptr_t)stack->ss_sp + 
stack->ss_size);
        tf->tf_elr = (register_t)entry;
        tf->tf_x[0] = (register_t)arg;
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to