For some SMP calls it is necessary to lock the current CPU for the process
receiving the SMP call. This is done by setting the CPU affinity to the
current CPU and preventing the CPU selection algorithm from switching
CPUs.
dtcb->flags |= TCB_FLAG_CPU_LOCKED;
CPU_SET(dtcb->cpu, &dtcb->affinity);
However, this logic is currently broken, as CPU_SET is defined as:
#define CPU_SET(c,s) do { *(s) |= (1u << (c)); } while (0)
In order to assign tcb->cpu (the current CPU) to the affinity mask, the
mask must be cleared first by calling CPU_ZERO.