-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrap.h
50 lines (38 loc) · 1.27 KB
/
trap.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/* See COPYRIGHT for copyright information. */
#ifndef FOS_KERN_TRAP_H
#define FOS_KERN_TRAP_H
#ifndef FOS_KERNEL
# error "This is a FOS kernel header; user programs should not #include it"
#endif
#include <inc/trap.h>
#include <inc/mmu.h>
/* The kernel's interrupt descriptor table */
extern struct Gatedesc idt[];
extern uint8 bypassInstrLength ;
uint32 _EnableModifiedBuffer ;
uint32 _EnableBuffering ;
uint32 _PageRepAlgoType;
#define PG_REP_LRU 0x1
#define PG_REP_CLOCK 0x2
#define PG_REP_FIFO 0x3
#define PG_REP_MODIFIEDCLOCK 0x4
void idt_init(void);
void print_regs(struct PushRegs *regs);
void print_trapframe(struct Trapframe *tf);
void fault_handler(struct Trapframe *);
void backtrace(struct Trapframe *);
void setPageReplacmentAlgorithmLRU();
void setPageReplacmentAlgorithmCLOCK();
void setPageReplacmentAlgorithmFIFO();
void setPageReplacmentAlgorithmModifiedCLOCK();
uint32 isPageReplacmentAlgorithmLRU();
uint32 isPageReplacmentAlgorithmCLOCK();
uint32 isPageReplacmentAlgorithmFIFO();
uint32 isPageReplacmentAlgorithmModifiedCLOCK();
void enableModifiedBuffer(uint32 enableIt);
uint32 isModifiedBufferEnabled();
//ours
void PFH_placement(struct Env *, uint32);
void PFH_replacement_MC(struct Env *, uint32);
uint32 MC_getVictimVA(struct Env *);
#endif /* FOS_KERN_TRAP_H */