|
| bool | AuEDFSetParams (AA64Thread *thread, uint64_t period_us, uint64_t wcet_us) |
| | AuEDFSetParams – admit a thread to the EDF class.
|
| |
| void | AuEDFRemove (AA64Thread *thread) |
| | AuEDFRemove – drop a thread's EDF reservation.
|
| |
| void | AuEDFWaitPeriod (AA64Thread *thread) |
| | AuEDFWaitPeriod – end current job, sleep until next release Must be called by the EDF thread itself (thread context, not IRQ). Counts a deadline miss when the job overran, catches up whole missed periods, then blocks until the next release and yields the CPU.
|
| |
| void | AuEDFHandleReleases (uint64_t now_us) |
| | AuEDFHandleReleases – wake EDF threads whose release arrived Called once per timer tick from AuScheduleThread. Accepts BLOCKED and LEFT_IN_KERNEL: AuScheduleNext() (used to yield after WaitPeriod) always parks as LEFT_IN_KERNEL, mirroring AuHandleSleepThreads which likewise wakes sleepers out of that state – the cooperative resume path in AuScheduleThread restores them correctly.
|
| |
| AA64Thread * | AuEDFPickNext (void) |
| | AuEDFPickNext – earliest absolute deadline among runnable EDF threads Accepts READY and LEFT_IN_KERNEL (parked by AuScheduleNext): the LEFT_IN_KERNEL resume branch in AuScheduleThread restores parked threads from their cooperative frame either way.
|
| |
| uint64_t | AuEDFGetMisses (AA64Thread *thread) |
| |
| void | AuEDFSelfTestStart (void) |
| |
Earliest-Deadline-First real-time class for the AA64 scheduler.
Model: implicit-deadline periodic tasks. An EDF thread publishes (period, wcet); each job released every period has absolute deadline release + period. Admission control enforces total utilization <= 1 (Q16 fixed point), so admitted tasks are schedulable on one CPU.
Two-class design: EDF threads strictly preempt best-effort threads, which keep the existing round-robin behavior untouched. Threads that never call AuEDFSetParams see zero behavior change.
No WCET enforcement (cooperative): an overrunning job is charged a deadline miss and re-armed, never killed. Timebase is the CNTV microsecond counter (AuGetCurrentUS), tick granularity for wakeups.
| AA64Thread* thread_list_head |
|
extern |
BSD 2-Clause License
Copyright (c) 2022-2023, Manas Kamal Choudhury All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.