spz-lab3/inc/process.h

36 lines
635 B
C

#ifndef PROCESS_HEADER
#define PROCESS_HEADER
#include <stddef.h>
struct PageTableEntry {
size_t p:1;
size_t r:1;
size_t m:1;
size_t ppn;
};
struct Process {
struct Process *prev;
struct Process *next;
size_t id;
size_t pages_accessed;
size_t max_accesses;
size_t total_pages_owned;
struct PageTableEntry *pt;
size_t *ws;
size_t ws_size;
};
struct Process *Process(size_t proc_id,
size_t max_accesses,
size_t total_pages_owned,
size_t ws_size);
void PROCESS_destroy(struct Process *p);
size_t PROCESS_run_for(struct Process *p, size_t time_bits);
void PROCESS_change_working_set(struct Process *p);
#endif