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
This commit is contained in:
Olivier Houchard 2021-09-21 23:19:46 +02:00
parent 2191473724
commit a342ecd326
1 changed files with 2 additions and 0 deletions

View File

@ -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