spz-lab3/inc/kernel.h

35 lines
685 B
C

#ifndef KERNEL_HEADER
#define KERNEL_HEADER
#include "process.h"
struct RunQ {
struct Process *current_proc;
size_t max_procs;
size_t proc_amount;
size_t next_proc_id;
};
struct RunQ *RunQ(size_t max_procs);
void RUNQ_add_process(size_t max_page_accesses, size_t total_pages_owned, size_t ws_size);
void RUNQ_remove_current_process(void);
struct PhysPage {
size_t ppn;
size_t busy_flag;
size_t last_accessed;
struct PhysPage *prev;
struct PhysPage *next;
struct PageTableEntry *pt;
size_t pt_index;
};
void KERNEL_page_fault(struct PageTableEntry *pt, size_t page_no);
void KERNEL_update_job(size_t page_amount);
void KERNEL_sanity_check_memory_lists(void);
#endif