#ifndef _KERNEL_PROC_SUSPENTION_Q_H
#define _KERNEL_PROC_SUSPENTION_Q_H

#include <libk/list.h>
#include <sync/spin_lock.h>

struct proc;
struct cpu;
struct reschedule_ctx;

struct proc_suspension_q {
  struct list_node_link* proc_list;
  spin_lock_t lock;
};

struct proc_sq_entry {
  struct list_node_link sq_link;
  struct list_node_link proc_link;
  struct proc* proc;
  struct proc_suspension_q* sq;
};

void proc_sqs_cleanup (struct proc* proc);

void proc_sq_suspend (struct proc* proc, struct proc_suspension_q* sq, spin_lock_t* resource_lock,
                      struct reschedule_ctx* rctx);

void proc_sq_resume (struct proc* proc, struct proc_sq_entry* sq_entry,
                     struct reschedule_ctx* rctx);

#endif // _KERNEL_PROC_SUSPENTION_Q_H
