Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
yhzhang0128 committed Mar 31, 2022
1 parent 4cc380e commit 28f7700
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 19 deletions.
17 changes: 1 addition & 16 deletions earth/cpu_intr.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,23 +53,8 @@ int intr_enable() {
__asm__ volatile("csrrs %0, mie, %1"
: "=r"(tmp)
: "r"(0x080));
return 0;
}

int intr_disable() {
int tmp;
/* Disable global interrupt */
__asm__ volatile("csrrc %0, mstatus, %1"
: "=r"(tmp)
: "r"(0x00000008UL));
/* Disable software interrupt */
__asm__ volatile("csrrc %0, mie, %1"
: "=r"(tmp)
: "r"(0x008));
/* Disable timer interrupt */
__asm__ volatile("csrrc %0, mie, %1"
: "=r"(tmp)
: "r"(0x080));
/* Note: intr_disable is similar by using csrrc instead of csrrs */
return 0;
}

Expand Down
1 change: 0 additions & 1 deletion earth/earth.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ void earth_init() {
/* Initialize CPU interrupt */
intr_init();
earth->intr_enable = intr_enable;
earth->intr_disable = intr_disable;
earth->intr_register = intr_register;
earth->excp_register = excp_register;
SUCCESS("Finished initializing the CPU interrupts");
Expand Down
1 change: 0 additions & 1 deletion earth/earth.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ void mmu_init();

typedef void (*handler_t)(int);
int intr_enable();
int intr_disable();
int intr_register(handler_t handler);
int excp_register(handler_t handler);

Expand Down
1 change: 0 additions & 1 deletion library/egos.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
struct earth {
/* CPU interface */
int (*intr_enable)();
int (*intr_disable)();
int (*intr_register)(void (*handler)(int));
int (*excp_register)(void (*handler)(int));

Expand Down

0 comments on commit 28f7700

Please sign in to comment.