F4.1: sincronización con herencia de prioridad (mutex + semáforo)#79
Merged
Conversation
Añade primitivas de sincronización al scheduler con herencia de prioridad para acotar la inversión de prioridad: - sched.rs: MutexCb/SemCb, estados BlockedMutex/BlockedSem, prioridad base vs efectiva, herencia (recompute_priority) en cada lock/unlock, API bloqueante (switch_until_ready) y no bloqueante (try_lock/try_wait), limpieza de propiedad/waiters en kill (release_task_sync). - syscall.rs: IDs 0x20-0x23 (MutexLock/Unlock, SemWait/Post), hooks, dispatch y trampolines SVC userland. - rugus-kernel: hooks + wrappers privilegiados cpu_* + sem_init + sync_selftest (autodiagnóstico no bloqueante en boot). - examples F407/F769: log "sync selftest: PASS" en arranque. - appliance F103: rechaza sync userland con Einval (sin multitarea). - host-tests: módulo sync_tests (herencia de prioridad + conteo de semáforo) y aserciones de dispatch. Validado: F407 y F769 reportan "sync selftest: PASS (mutex + semaphore)" por RTT; 20 tests host en verde; clippy/doc/fmt limpios en ambos targets. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resumen
Primera unidad del roadmap F4 hacia un kernel maduro/industrial. Añade primitivas de sincronización con herencia de prioridad para acotar la inversión de prioridad.
mutex_lock/sem_wait) y no bloqueante (try_lock/try_wait).BlockedMutex/BlockedSem; limpieza de propiedad y máscaras de waiters enkill(release_task_sync) para evitar fugas/deadlock.0x20-0x23+ hooks + trampolines SVC userland.sync_selftestno bloqueante en boot (kernel) y wrappers privilegiadoscpu_*.Einval(sin multitarea).Validación
sync selftest: PASS (mutex + semaphore).sync selftest: PASS (mutex + semaphore).sync_tests: herencia de prioridad + conteo de semáforo).clippy/doc/fmtlimpios en thumbv7em y thumbv7m.Notas de diseño
MAX_TASKS=4.*_for_testporqueMockArch::switch_contextes no-op (la API bloqueante haría bucle infinito en host).🤖 Generated with Claude Code