of_flat_dt_match_machine(9)
π of_flat_dt_match_machine(9) π
okay so welcome to the Kernel API Manual, bestie β yes this is a real manual page from the kernel, and yes it's about finding out which machine you're on. very main character energy, i fear. let's get into it β¨
πΈ NAME πΈ
of_flat_dt_match_machine β literally it just iterates the match tables to find the matching machine. that's the whole vibe check right there, no cap π¦
π SYNOPSIS π
const void * of_flat_dt_match_machine (const void *default_match ,
const void * (*get_next_compat)(const char * const**) );
like... look at that signature. two args. one's a pointer, one's a callback that returns a pointer to a function... it's giving "function pointers are my entire personality" and honestly? respect π
β ARGUMENTS β
default_matchβ a machine specific ptr that gets returned in case of no match. so like, your fallback bestie when nobody else shows up to the party π it's the "you tried" consolation prize.get_next_compatβ callback function to return the next compatible match table. so every time the loop wants more tables, it hits this up and it's like "here's the next one, queen" π«Ά
β¨ DESCRIPTION β¨
So the whole thing: it iterates through the machine match tables to find the best match for the machine compatible string in the FDT. that's it, that's the plot π
it's shuffling through the flat device tree match tables going "are you my machine? no? next." until it hits the right one. iconic behavior honestly. and if literally none of them match, you get back default_match β the friend that was always there π₯Ί
π₯ SEE ALSO π₯
Kernel file ./drivers/of/fdt.c β and also a whole squad of siblings, all lowercase, all with (9), all lowkey obsessed with the flat device tree:
unflatten_dt_nodes(9)__unflatten_device_tree(9)of_fdt_unflatten_tree(9)early_init_fdt_scan_reserved_mem(9)early_init_fdt_reserve_self(9)of_scan_flat_dt(9)of_scan_flat_dt_subnodes(9)of_get_flat_dt_subnode_by_name(9)of_fdt_is_compatible(9)of_flat_dt_is_compatible(9)early_init_dt_check_for_initrd(9)early_init_dt_check_for_elfcorehdr(9)early_init_dt_check_for_usable_mem_range(9)early_init_dt_check_kho(9)unflatten_device_tree(9)unflatten_and_copy_device_tree(9)
like the whole friend group showed up. iykyk π
ngl there's no extra warnings in here, just vibes and pointers. but fr fr, if you're poking at this in the kernel, remember:default_matchis your safety net, andget_next_compatis doing all the actual work ππ
okay that's the page, bestie π§ from ./drivers/of, dated October 2026, and it's of_flat_dt_match_machine(9) β slay, go forth and match your machine ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms