/* * ======== clk0Fxn ======= */ Void clk0Fxn(UArg arg0) { Swi_post(swi0); Swi_post(swi1); Semaphore_post(sem0); }
/* * ======== main ======== */ Void main() { Swi_post(swi0); Swi_post(swi1); Clock_start(clk1); BIOS_start(); }
void countdown (void){ TimerIntClear(GPT2_BASE, TIMER_TIMA_TIMEOUT); Swi_post(swi0); }
/* * ======== Swi_or ======== */ Void Swi_or(Swi_Object *swi, UInt mask) { UInt hwiKey; hwiKey = Hwi_disable(); swi->trigger |= mask; Hwi_restore(hwiKey); Swi_post(swi); }
/* * ======== Swi_inc ======== */ Void Swi_inc(Swi_Object *swi) { UInt hwiKey; hwiKey = Hwi_disable(); swi->trigger += 1; Hwi_restore(hwiKey); Swi_post(swi); }
/* * ======== IpcPower_suspend ======== */ Void IpcPower_suspend() { Assert_isTrue((curInit > 0) , NULL); #ifndef SMP Semaphore_post(IpcPower_semSuspend); #else Swi_post(suspendResumeSwi); #endif }
/* * ======== myTickFxn ======== * Timer ISR function that posts a Swi to peform * the non-realtime service functions. */ Void myTickFxn(UArg arg) { /* * Uncomment this next line to toggle the LED state. */ /* P1OUT ^= 0x1; */ tickCount += 1; /* increment the counter */ /* post a Swi to perform the "heavy lifting" */ Swi_post(mySwi); }
/* * ======== TransportShm_notifyFxn ======== */ Void TransportShm_notifyFxn(UInt16 procId, UInt16 lineId, UInt32 eventId, UArg arg, UInt32 payload) { Swi_Handle swiHandle; /* Swi_Handle was passed as arg in register */ swiHandle = (Swi_Handle)arg; /* post the Swi */ Swi_post(swiHandle); }
/* * ======== timerFunc ======== * This function runs every PERIOD ms in the context of a Hwi thread. */ Void timerFunc(UArg arg) { static UInt tickCount = 0; /* change load values every 5 seconds */ if (++tickCount >= (5 * NUMPERSEC)) { tickCount = 0; step(); } /* Make Swi load thread ready to run */ Swi_post(swi); /* Make Task load thread ready to run */ Semaphore_post(sem); /* Do Hwi thread load now */ hwiLoad(); }
/* * ======== IpcPower_suspendTaskFxn ======== */ Void IpcPower_suspendTaskFxn(UArg arg0, UArg arg1) { while (curInit) { /* Wait for suspend notification from host-side */ Semaphore_pend(IpcPower_semSuspend, BIOS_WAIT_FOREVER); if (curInit) { /* Call pre-suspend preparation function */ IpcPower_preSuspend(); Swi_post(suspendResumeSwi); /* Call post-resume preparation function */ IpcPower_postResume(); } } /* Signal the task end */ Semaphore_post(IpcPower_semExit); }
void SWItrigger::post() { Swi_post(SWItriggerHandle); }
/* * ======== clk1Fxn ======== */ Void clk1Fxn(UArg arg) { clk1Count++; Swi_post(swiB); }
/* * ======== clk0Fxn ======== */ Void clk0Fxn(UArg arg) { clk0Count++; Swi_post(swiA); }
void SWI::post() { Swi_post(SWIHandle); }