Skip to content

Commit 89c4131

Browse files
authored
Merge pull request #95 from ToolmanP/boweraccess
Lab5: BowerAccess Lab
2 parents 8b6f5da + 06822e4 commit 89c4131

File tree

30 files changed

+408
-18
lines changed

30 files changed

+408
-18
lines changed

Lab5/filelist.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ FS_WRAPPER := $(FS_BASE_DIR)/fs_wrapper.c
77
FS_OPS := $(FS_BASE_DIR)/fs_wrapper_ops.c
88
FSM := $(FSM_DIR)/fsm.c
99
FSM_CLIENT_CAP := $(FSM_DIR)/fsm_client_cap.c
10+
FS_FILE_FAULT := $(FS_BASE_DIR)/fs_page_fault.c
1011

11-
FILES := $(FS_VNODE) $(FS_WRAPPER) $(FS_OPS) $(FSM) $(FSM_CLIENT_CAP)
12+
FILES := $(FS_VNODE) $(FS_WRAPPER) $(FS_OPS) $(FSM) $(FSM_CLIENT_CAP) $(FS_FILE_FAULT)

Lab5/kernel/include/mm/vmspace.h

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ struct vmregion {
3434
vmr_prop_t perm;
3535
struct pmobject *pmo;
3636
struct list_head cow_private_pages;
37+
/* for Lab5, llm page lru list */
38+
struct list_head llm_pages;
39+
int num_llm_pages;
40+
};
41+
42+
#define MAX_LLM_PAGE_NUM 16
43+
struct llm_page {
44+
struct list_head node;
45+
vaddr_t vaddr;
3746
};
3847

3948
/* This struct represents one virtual address space */
@@ -60,7 +69,6 @@ struct vmspace {
6069
unsigned char history_cpus[PLAT_CPU_NUM];
6170

6271
struct vmregion *heap_boundary_vmr;
63-
6472
/* Records size of memory mapped. Protected by pgtbl_lock. */
6573
long rss;
6674
};

Lab5/kernel/include/object/memory.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ struct pmobject {
4141
*/
4242
void *private;
4343
struct list_head mapping_list;
44+
/* Lab5, counting page faults */
45+
long page_faults;
4446
};
4547

4648
/* kernel internal interfaces */

Lab5/kernel/include/object/user_fault.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,5 +62,8 @@ void handle_user_fault(struct pmobject *pmo, vaddr_t fault_va);
6262
int sys_user_fault_register(cap_t notific_cap, vaddr_t msg_buffer);
6363
int sys_user_fault_map(badge_t client_badge, vaddr_t fault_va, vaddr_t remap_va,
6464
bool copy, unsigned long perm);
65+
/* Syscall for Lab5 only */
66+
int sys_user_fault_map_batched(badge_t client_badge, vaddr_t fault_va, vaddr_t remap_va,
67+
bool copy, unsigned long perm, bool completed, vaddr_t orig_fault_va);
6568

6669
#endif /* OBJECT_USER_FAULT_H */

Lab5/kernel/mm/vmspace.c.dbg.obj

49.9 KB
Binary file not shown.

Lab5/kernel/mm/vmspace.c.obj

944 Bytes
Binary file not shown.
60.1 KB
Binary file not shown.

Lab5/kernel/object/memory.c.obj

472 Bytes
Binary file not shown.
45.4 KB
Binary file not shown.
3.6 KB
Binary file not shown.

0 commit comments

Comments
 (0)