Skip to content

Instantly share code, notes, and snippets.

Avatar

Tony Wasserka neobrain

View GitHub Profile
@neobrain
neobrain / aco_format.awk
Last active Oct 26, 2020
ACO IR formatter
View aco_format.awk
# Reads RADV_DEBUG output and formats ACO IR (skipping non-shader code)
# Usage:
# * awk log -f aco_format.awk
# * cat | awk -f aco_format.awk
BEGIN {
# All defs go into $1
FS="="
}
@neobrain
neobrain / kernel_scheduling.md
Created Dec 3, 2016 — forked from Subv/kernel_scheduling.md
Nintendo 3DS Kernel scheduler findings
View kernel_scheduling.md

Kernel synchronization

  • Each core has its own KScheduler instance.

KObject waitlists

Each KObject manages a list of threads that are waiting on it. This list is iterated over each time the KObject is signaled.

The KObject will try to retrieve the KThread with the highest priority from this list, check if it is ready to run (See KThread waitlist), and append it to the scheduler's queue if it is ready.

This awakening operation is performed for every KThread that is ready to run.

View svcBindInterrupt_body.c
if ( !levelHighActive_ )
{
LABEL_10:
if ( interruptID == 15 )
{
if ( sub_FFF0D1F8(&stru_FFF2E0A0.threadPairsPerPriority[3].last, 0, 1) )
{
res = 0xD8A007F0;
}