diff options
author | jake <jake@FreeBSD.org> | 2001-08-21 00:00:18 +0000 |
---|---|---|
committer | jake <jake@FreeBSD.org> | 2001-08-21 00:00:18 +0000 |
commit | e8076017f82688e6c835131014dc1298b4cdb47b (patch) | |
tree | 9f95370808ba3e61a62de3fc155d48601f570579 /sys/sparc64 | |
parent | 56800e0ac6cad27bcaae6f8bf582a2896ba674dd (diff) | |
download | FreeBSD-src-e8076017f82688e6c835131014dc1298b4cdb47b.zip FreeBSD-src-e8076017f82688e6c835131014dc1298b4cdb47b.tar.gz |
Disable interrupts when calling openfirmware.
Diffstat (limited to 'sys/sparc64')
-rw-r--r-- | sys/sparc64/sparc64/support.S | 20 | ||||
-rw-r--r-- | sys/sparc64/sparc64/support.s | 20 |
2 files changed, 26 insertions, 14 deletions
diff --git a/sys/sparc64/sparc64/support.S b/sys/sparc64/sparc64/support.S index 22aeafa..15c7a68 100644 --- a/sys/sparc64/sparc64/support.S +++ b/sys/sparc64/sparc64/support.S @@ -346,11 +346,17 @@ END(ofwstack) * void openfirmware(cell_t args[]) */ ENTRY(openfirmware) - save - setx ofwstack_last - SPOFF, %l0, %l1 - mov %l1, %sp /* XXX race between save and %sp setup */ + /* + * Disable interrupts. The firmware should not deal with our interrupts + * anyway, and the temporary stack is not large enough to hold the stack + * footprint of the interrrupt handling. + */ + rdpr %pstate, %o3 + andn %o3, PSTATE_IE, %o1 + wrpr %o1, 0, %pstate + setx ofwstack_last - SPOFF, %o1, %o2 + save %o2, 0, %sp flushw - rdpr %pstate, %l0 rdpr %tl, %l1 rdpr %tba, %l2 mov AA_DMMU_PCXR, %l3 @@ -368,13 +374,13 @@ ENTRY(openfirmware) wrpr %g0, 0, %tl call %l6 mov %i0, %o0 - wrpr %l0, 0, %pstate wrpr %l1, 0, %tl wrpr %l2, 0, %tba stxa %l4, [%l3] ASI_DMMU wrpr %l7, 0, %pil membar #Sync flush %sp - ret - restore + restore + retl + wrpr %o3, 0, %pstate END(openfirmware) diff --git a/sys/sparc64/sparc64/support.s b/sys/sparc64/sparc64/support.s index 22aeafa..15c7a68 100644 --- a/sys/sparc64/sparc64/support.s +++ b/sys/sparc64/sparc64/support.s @@ -346,11 +346,17 @@ END(ofwstack) * void openfirmware(cell_t args[]) */ ENTRY(openfirmware) - save - setx ofwstack_last - SPOFF, %l0, %l1 - mov %l1, %sp /* XXX race between save and %sp setup */ + /* + * Disable interrupts. The firmware should not deal with our interrupts + * anyway, and the temporary stack is not large enough to hold the stack + * footprint of the interrrupt handling. + */ + rdpr %pstate, %o3 + andn %o3, PSTATE_IE, %o1 + wrpr %o1, 0, %pstate + setx ofwstack_last - SPOFF, %o1, %o2 + save %o2, 0, %sp flushw - rdpr %pstate, %l0 rdpr %tl, %l1 rdpr %tba, %l2 mov AA_DMMU_PCXR, %l3 @@ -368,13 +374,13 @@ ENTRY(openfirmware) wrpr %g0, 0, %tl call %l6 mov %i0, %o0 - wrpr %l0, 0, %pstate wrpr %l1, 0, %tl wrpr %l2, 0, %tba stxa %l4, [%l3] ASI_DMMU wrpr %l7, 0, %pil membar #Sync flush %sp - ret - restore + restore + retl + wrpr %o3, 0, %pstate END(openfirmware) |