6 //#define PAGE_SHIFT 12
8 #define BLOCK_PARAS_SHIFT (BLOCK_SHIFT - PARA_SHIFT)
9 #define BLOCK_PARAS (1 << BLOCK_PARAS_SHIFT)
11 //#define PAGE_PARAS_SHIFT (PAGE_SHIFT - PARA_SHIFT)
12 //#define PAGE_PARAS (1 << PAGE_PARAS_SHIFT)
14 //#define PAGE_BLOCKS_SHIFT (PAGE_SHIFT - BLOCK_SHIFT)
15 //#define PAGE_BLOCKS (1 << PAGE_BLOCKS_SHIFT)
18 #include "core.h" // TEMPORARY, JUST TO GET INDIRECT_CORE SETTING
21 struct lru_item *prev;
22 struct lru_item *next;
25 #define PROCESS_FLAGS_ACTIVE 1
27 #define PROCESS_FLAGS_CORE_ITEM 2
32 struct lru_item lru_item;
33 struct pool_item core_item;
34 struct pool_item swap_item;
42 // derived variables, not stored in process to save space
51 extern struct process *processes;
52 extern int n_processes;
54 extern int process_avail;
56 extern struct lru_item lru_head, *victim;
58 #define PROCESS_ALLOC_MODE_REALLOC 1 // must = POOL_ALLOC_MODE_REALLOC
59 #define PROCESS_ALLOC_MODE_LAST_FIT 2 // must = POOL_ALLOC_MODE_LAST_FIT
61 void process_init(int n, int spare);
63 struct process *process,
68 void process_run(struct process *process);
69 void process_free(struct process *process);
70 void process_calc(struct process *process, struct process_calc *calc);
73 void swap_read_write(int core_block, int swap_block, int blocks, bool dir);