- refactored interrupt en/dis

- enable mips-debugger in App



git-svn-id: http://moon:8086/svn/mips@132 a8ebac50-d88d-4704-bea3-6648445a41b3
This commit is contained in:
2017-01-26 20:09:46 +00:00
parent 3bcdafc447
commit 41414d5648
7 changed files with 26 additions and 15 deletions
+3 -1
View File
@@ -2,10 +2,12 @@
# BOARD = {ml402, denano}
# TLB = {no, yes}
# ENDIANESS = {eb, el}
# DEBUGGER = {gdb, mips, rom}
BOARD ?= ml402
TLB ?= no
ENDIANESS ?= eb
DEBUGGER ?= rom
DEBUGGER ?= mips
ifeq ($(ENDIANESS),el)
+1 -1
View File
@@ -103,7 +103,7 @@ void board_init(void)
// Setup interrupt support
interrupt_init();
interrupt_enable_all();
interrupt_global_enable();
// Do some initializations here
}
+1 -1
View File
@@ -91,7 +91,7 @@ void board_init(void)
// Setup interrupt support
interrupt_init();
interrupt_enable_all();
interrupt_global_enable();
// Do some initializations here
}
+2 -2
View File
@@ -59,13 +59,13 @@ void interrupt_disable(int irq_num)
}
}
void interrupt_enable_all()
void interrupt_global_enable()
{
uint32_t reg = CP0_SR_read() | SR_MASK_IEC;
CP0_SR_write(reg);
}
void interrupt_disable_all()
void interrupt_global_disable()
{
uint32_t reg = CP0_SR_read() & ~SR_MASK_IEC;
CP0_SR_write(reg);
+2 -2
View File
@@ -12,7 +12,7 @@ int _irq_dispatch(struct xcptcontext * xcp);
void interrupt_register(int irq_num, fp_irq_t fp);
void interrupt_enable(int irq_num);
void interrupt_disable(int irq_num);
void interrupt_enable_all();
void interrupt_disable_all();
void interrupt_global_enable();
void interrupt_global_disable();
#endif // IRQ_H
+2 -2
View File
@@ -14,7 +14,7 @@ void enter_critical()
{
if (critical_nesting_counter == 0)
{
interrupt_disable_all();
interrupt_global_disable();
}
critical_nesting_counter++;
}
@@ -26,7 +26,7 @@ void exit_critical()
critical_nesting_counter--;
if (critical_nesting_counter == 0)
{
interrupt_enable_all();
interrupt_global_enable();
}
}
}
+15 -6
View File
@@ -245,6 +245,7 @@ int Test10_LoadStore()
// sputs("buf = ");
// print_word((int)buf);
// sputs("\n");
interrupt_global_disable();
while(1)
{
@@ -357,6 +358,8 @@ int Test10_LoadStore()
err = NO_ERROR;
break;
}
interrupt_global_enable();
free(buf);
if (IS_ERROR(err))
@@ -838,20 +841,26 @@ uint32_t test_Icache()
uint32_t *pInstr = malloc(sizeof(test_icache_instr));
memcpy(pInstr, test_icache_instr, sizeof(test_icache_instr));
func_t pF = (func_t)pInstr;
uint32_t v1;
uint32_t v2;
uint32_t v3;
uint32_t v = pF();
printf("v = %u\n", (unsigned)v);
interrupt_global_disable();
v1 = pF();
pInstr[4] = 0x24100002;
v = pF();
printf("v = %u\n", (unsigned)v);
v2 = pF();
ICACHE_invalidate_at(&pInstr[4]);
v = pF();
printf("v = %u\n", (unsigned)v);
v3 = pF();
interrupt_global_enable();
free(pF);
printf("v1 = %u\n", (unsigned)v1);
printf("v2 = %u\n", (unsigned)v2);
printf("v3 = %u\n", (unsigned)v3);
return 0;
}