Have switch_{to,back} use an opaque uintptr_t
[akaros.git] / kern / src / ucq.c
index aca23ca..8b24b7d 100644 (file)
@@ -21,7 +21,7 @@ void send_ucq_msg(struct ucq *ucq, struct proc *p, struct event_msg *msg)
        assert(is_user_rwaddr(ucq, sizeof(struct ucq)));
        /* So we can try to send ucqs to _Ss before they initialize */
        if (!ucq->ucq_ready) {
-               if (p->state & (PROC_RUNNING_M | PROC_RUNNABLE_M))
+               if (__proc_is_mcp(p))
                        warn("proc %d is _M with an uninitialized ucq %p\n", p->pid, ucq);
                return;
        }
@@ -134,7 +134,7 @@ error_addr:
 void print_ucq(struct proc *p, struct ucq *ucq)
 {
        struct ucq_page *ucq_pg;
-       struct proc *old_proc = switch_to(p);
+       uintptr_t old_proc = switch_to(p);
 
        printk("UCQ %p\n", ucq);
        printk("prod_idx: %p, cons_idx: %p\n", atomic_read(&ucq->prod_idx),