Skip to content

Commit

Permalink
Merge pull request #67 from ToolmanP/fix-lab3
Browse files Browse the repository at this point in the history
Lab3: fix docs and sanitize macro defs
  • Loading branch information
ToolmanP authored Dec 5, 2024
2 parents e710e89 + b13b4ab commit 6d1a210
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
6 changes: 0 additions & 6 deletions Lab3/kernel/object/thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,6 @@ void thread_deinit(void *thread_ptr)
/* The thread struct itself will be freed in __free_object */
}

#define PFLAGS2VMRFLAGS(PF) \
(((PF) & PF_X ? VMR_EXEC : 0) | ((PF) & PF_W ? VMR_WRITE : 0) \
| ((PF) & PF_R ? VMR_READ : 0))

#define OFFSET_MASK (0xFFF)

/* Required by LibC */
void prepare_env(char *env, vaddr_t top_vaddr, char *name,
struct process_metadata *meta);
Expand Down
4 changes: 2 additions & 2 deletions Pages/Lab3/fault.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ AArch64 中的每个异常级别都有其自己独立的异常向量表,其虚

在 ChCore 中,仅使用了 EL0 和 EL1 两个异常级别,因此仅需要对 EL1 异常向量表进行初始化即可。在本实验中,ChCore 内除系统调用外所有的同步异常均交由 `handle_entry_c` 函数进行处理。遇到异常时,硬件将根据 ChCore 的配置执行对应的汇编代码,将异常类型和当前异常处理程序条目类型作为参数传递,对于 sync_el1h 类型的异常,跳转 `handle_entry_c` 使用 C 代码处理异常。对于 irq_el1t、fiq_el1t、fiq_el1h、error_el1t、error_el1h、sync_el1t 则跳转 `unexpected_handler` 处理异常。

> [!CODING] 练习题
> 按照前文所述的表格填写 `kernel/arch/aarch64/irq/irq_entry.S` 中的异常向量表,并且增加对应的函数跳转操作
> [!CODING] 练习题5
> 按照前文所述的表格填写 `kernel/arch/aarch64/irq/irq_entry.S` 中的异常向量表,并且增加对应的函数跳转操作
---
> [!SUCCESS]
Expand Down

0 comments on commit 6d1a210

Please sign in to comment.