Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitda58afc

Browse files
ASM->C for interrupt masking
1 parentb316e1b commitda58afc

File tree

2 files changed

+12
-27
lines changed

2 files changed

+12
-27
lines changed

‎romstage.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,14 @@ void switch_vpu_to_pllc() {
112112
CM_TIMERCTL=CM_PASSWORD |CM_SRC_OSC |0x10;
113113
}
114114

115-
voidset_interrupt(intintno,boolenable) {
115+
voidset_interrupt(intintno,boolenable,intcore) {
116+
intbase= (core==0) ? :IC0_BASE :IC1_Base;
117+
116118
intoffset=0x10+ ((intno >>3) <<2);
117119
uint32_tslot=0xF << ((intno&7) <<2);
118120

119-
uint32_tv=mmio_read32(IC0_BASE+offset)& ~slot;
120-
mmio_write32(IC0_BASE+offset,enable ?v |slot :v);
121+
uint32_tv=mmio_read32(base+offset)& ~slot;
122+
mmio_write32(base+offset,enable ?v |slot :v);
121123
}
122124

123125
externvoidsdram_init();
@@ -131,9 +133,15 @@ int _main(unsigned int cpuid, unsigned int load_address) {
131133
uart_init();
132134

133135
for(inti=0;i<64;++i) {
134-
set_interrupt(i, (i!= (125-64))&& (i!= (121-64))&& (i!= (120-64))&& (i!= (73-64))&& (i!= (96-64)));
136+
set_interrupt(i, (i!= (125-64))&& (i!= (121-64))&& (i!= (120-64))&& (i!= (73-64))&& (i!= (96-64)),0);
137+
set_interrupt(i,0,1);
135138
}
136139

140+
IC0_VADDR=0x1B000;
141+
IC1_VADDR=0x1B000;
142+
143+
__asm__volatile("ei");
144+
137145
printf(
138146
"==================================================================\n"
139147
"::\n"

‎start.s

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -110,29 +110,6 @@ L_setup_hw_irq:
110110
mov r28, #0x1D000
111111
movsp, #0x1C000
112112

113-
/* mask interrupts*/
114-
mov r0, #(IC0_BASE+0x10)
115-
mov r1, #(IC1_BASE+0x10)
116-
mov r2,0x00000000
117-
mov r3, #(IC0_BASE+0x10+0x20)
118-
119-
mask_all:
120-
st r2, (r0)
121-
st r2, (r1)
122-
add r0,4
123-
add r1,4
124-
ble r0, r3, mask_all
125-
126-
/* set interrupt vector bases*/
127-
mov r3, #0x1B000
128-
mov r0, #IC0_VADDR
129-
st r3, (r0)
130-
mov r0, #IC1_VADDR
131-
st r3, (r0)
132-
133-
/* enable interrupts*/
134-
ei
135-
136113
/* jump to C code*/
137114
mov r0, r5
138115
lea r1, _start

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp