+#if CONFIG_KERN_PRI
+/**
+ * Changes the priority of an already enqueued process.
+ *
+ * Searches and removes the process from the ready list, then uses LIST_ENQUEUE(()
+ * to insert again to fix priority.
+ *
+ * No action is performed for processes that aren't in the ready list, eg. in semaphore queues.
+ *
+ * \note Performance could be improved with a different implementation of priority list.
+ */
+INLINE void sched_reenqueue(struct Process *proc)
+{
+ IRQ_ASSERT_DISABLED();
+ LIST_ASSERT_VALID(&ProcReadyList);
+ Node *n;
+ PriNode *pos = NULL;
+ FOREACH_NODE(n, &ProcReadyList)
+ {
+ if (n == &proc->link.link)
+ {
+ pos = (PriNode *)n;
+ break;
+ }
+ }
+
+ // only remove and enqueue again if process is already in the ready list
+ // otherwise leave it alone
+ if (pos)
+ {
+ REMOVE(&proc->link.link);
+ LIST_ENQUEUE(&ProcReadyList, &proc->link);
+ }
+}
+#endif //CONFIG_KERN_PRI
+
+/// Schedule another process *without* adding the current one to the ready list.
+void proc_switch(void);
+
+#if CONFIG_KERN_PREEMPT
+void proc_entry(void (*user_entry)(void));
+void preempt_init(void);
+#endif