Commit 18c7ed6a authored by Philippe Gerum's avatar Philippe Gerum Committed by Jan Kiszka

cobalt/kernel: substitute ipipe_processor_id() with raw_smp_processor_id()

raw_smp_processor_id() has been callable from any pipeline domain for
many moons now, there is no point in using the legacy
ipipe_processor_id() call anymore.
Signed-off-by: Philippe Gerum's avatarPhilippe Gerum <rpm@xenomai.org>
Signed-off-by: Jan Kiszka's avatarJan Kiszka <jan.kiszka@siemens.com>
parent dec7f062
......@@ -60,7 +60,7 @@
#define primary_mode_only() XENO_BUG_ON(CONTEXT, ipipe_root_p)
#define secondary_mode_only() XENO_BUG_ON(CONTEXT, !ipipe_root_p)
#define interrupt_only() XENO_BUG_ON(CONTEXT, !xnsched_interrupt_p())
#define realtime_cpu_only() XENO_BUG_ON(CONTEXT, !xnsched_supported_cpu(ipipe_processor_id()))
#define realtime_cpu_only() XENO_BUG_ON(CONTEXT, !xnsched_supported_cpu(raw_smp_processor_id()))
#define thread_only() XENO_BUG_ON(CONTEXT, xnsched_interrupt_p())
#define irqoff_only() XENO_BUG_ON(CONTEXT, hard_irqs_disabled() == 0)
#ifdef CONFIG_XENO_OPT_DEBUG_LOCKING
......
......@@ -175,7 +175,7 @@ static inline void xnlock_init (struct xnlock *lock)
static inline int ____xnlock_get(struct xnlock *lock /*, */ XNLOCK_DBG_CONTEXT_ARGS)
{
int cpu = ipipe_processor_id();
int cpu = raw_smp_processor_id();
unsigned long long start;
if (lock->owner == cpu)
......@@ -242,7 +242,7 @@ static inline void __xnlock_put_irqrestore(struct xnlock *lock, spl_t flags
static inline int xnlock_is_owner(struct xnlock *lock)
{
if (__locking_active__)
return lock->owner == ipipe_processor_id();
return lock->owner == raw_smp_processor_id();
return 1;
}
......
......@@ -78,7 +78,7 @@ static inline union vfp_state *get_fpu_owner(void)
return NULL;
#endif
cpu = ipipe_processor_id();
cpu = raw_smp_processor_id();
vfp_owner = vfp_current_hw_state[cpu];
if (!vfp_owner)
return NULL;
......@@ -214,8 +214,8 @@ void xnarch_leave_root(struct xnthread *root)
void xnarch_switch_fpu(struct xnthread *from, struct xnthread *to)
{
union vfp_state *const from_fpup = from ? from->tcb.fpup : NULL;
unsigned cpu = ipipe_processor_id();
unsigned cpu = raw_smp_processor_id();
if (xnthread_test_state(to, XNROOT) == 0) {
union vfp_state *const to_fpup = to->tcb.fpup;
unsigned fpexc = do_enable_vfp();
......@@ -252,7 +252,7 @@ void xnarch_switch_fpu(struct xnthread *from, struct xnthread *to)
do_vfp_fmxr(FPEXC, fpen & ~XNARCH_VFP_ANY_EXC);
if (from_fpup == current_task_fpup)
return;
__asm_vfp_save(from_fpup, fpen);
do_vfp_fmxr(FPEXC, fpdis);
}
......@@ -260,7 +260,7 @@ void xnarch_switch_fpu(struct xnthread *from, struct xnthread *to)
}
}
int xnarch_handle_fpu_fault(struct xnthread *from,
int xnarch_handle_fpu_fault(struct xnthread *from,
struct xnthread *to, struct ipipe_trap_data *d)
{
if (xnthread_test_state(to, XNFPU))
......
......@@ -90,7 +90,7 @@ void xnarch_switch_fpu(struct xnthread *from, struct xnthread *to)
fpsimd_save_state(from_fpup);
fpsimd_load_state(to_fpup);
to_fpup->cpu = ipipe_processor_id();
to_fpup->cpu = raw_smp_processor_id();
}
void xnarch_init_shadow_tcb(struct xnthread *thread)
......
......@@ -227,7 +227,7 @@ void xnarch_switch_to(struct xnthread *out, struct xnthread *in)
if (!copy_fpregs_to_fpstate(prev_fpu))
prev_fpu->last_cpu = -1;
else
prev_fpu->last_cpu = smp_processor_id();
prev_fpu->last_cpu = raw_smp_processor_id();
}
#endif
......@@ -288,7 +288,7 @@ void xnarch_switch_to(struct xnthread *out, struct xnthread *in)
* PF_KTHREAD, i.e including kernel threads.
*/
struct fpu *fpu = &current->thread.fpu;
int cpu = smp_processor_id();
int cpu = raw_smp_processor_id();
if (!fpregs_state_valid(fpu, cpu)) {
copy_kernel_to_fpregs(&fpu->state);
......@@ -513,7 +513,7 @@ void xnarch_leave_root(struct xnthread *root)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,2,0)
switch_fpu_finish(&current->thread.fpu);
#else
switch_fpu_finish(&current->thread.fpu, smp_processor_id());
switch_fpu_finish(&current->thread.fpu, raw_smp_processor_id());
#endif
#else
/* mark current thread as not owning the FPU anymore */
......
......@@ -577,7 +577,7 @@ int xnlock_dbg_release(struct xnlock *lock,
int cpu;
lock_time = xnclock_read_raw(&nkclock) - lock->lock_date;
cpu = ipipe_processor_id();
cpu = raw_smp_processor_id();
stats = &per_cpu(xnlock_stats, cpu);
if (lock->file == NULL) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment