MCPcopy Create free account
hub / github.com/F-Stack/f-stack / fiq_release

Function fiq_release

freebsd/arm/arm/fiq.c:132–166  ·  view source on GitHub ↗

* fiq_release: * * Release the FIQ vector. */

Source from the content-addressed store, hash-verified

130 * Release the FIQ vector.
131 */
132void
133fiq_release(struct fiqhandler *fh)
134{
135 u_int oldirqstate;
136 struct fiqhandler *ofh;
137
138 oldirqstate = disable_interrupts(PSR_F);
139
140 /*
141 * If we are the currently active FIQ handler, then we
142 * need to save our registers and pop the next one back
143 * into the vector.
144 */
145 if (fh == TAILQ_FIRST(&fiqhandler_stack)) {
146 if (fh->fh_regs != NULL)
147 fiq_getregs(fh->fh_regs);
148 TAILQ_REMOVE(&fiqhandler_stack, fh, fh_list);
149 if ((ofh = TAILQ_FIRST(&fiqhandler_stack)) != NULL) {
150 if (ofh->fh_regs != NULL)
151 fiq_setregs(ofh->fh_regs);
152 fiq_installhandler(ofh->fh_func, ofh->fh_size);
153 }
154 } else
155 TAILQ_REMOVE(&fiqhandler_stack, fh, fh_list);
156
157 if (TAILQ_FIRST(&fiqhandler_stack) == NULL) {
158 /* Copy the NULL handler back down into the vector. */
159 fiq_installhandler(fiq_nullhandler_code, fiq_nullhandler_size);
160
161 /* Make sure FIQs are disabled when we return. */
162 oldirqstate |= PSR_F;
163 }
164
165 restore_interrupts(oldirqstate);
166}

Callers

nothing calls this directly

Calls 3

disable_interruptsFunction · 0.85
fiq_installhandlerFunction · 0.85
restore_interruptsFunction · 0.85

Tested by

no test coverage detected