cxl_calc_interleave_pos(9)
β¨ cxl_calc_interleave_pos(9) β¨
okay so bestie, we're in the Kernel API Manual today and this function is literally the main character of interleave math π
πΈ NAME πΈ
cxl_calc_interleave_pos β calculate an endpoint position in a region π
π¦ SYNOPSIS π¦
int cxl_calc_interleave_pos (struct cxl_endpoint_decoder *cxled , struct
range *hpa_range );
like, yes, it wraps onto two lines, that's just how it's printed, don't come for me π
π ARGUMENTS π
cxledβ the endpoint decoder that's a member of the given region π«Άhpa_rangeβ the endpoint's HPA range, already translated β¨
π DESCRIPTION π
okay so the way this works: the endpoint position gets calculated by traversing the topology from the endpoint all the way up to the root decoder, and iteratively applying this calculation:
position = position * parent_ways + parent_pos;
and position is inferred from switch and root decoder target lists. iykyk π₯
π RETURN π
position >= 0on success β slay π-ENXIOon failure β π
π SEE ALSO π
- Kernel file
./drivers/cxl/core/region.c cxl core region(9)cxl_port_pick_region_decoder(9)cxl_port_attach_region(9)devm_cxl_add_region(9)cxl_validate_translation_params(9)
and that's the whole page, no cap π§ this came out of ./drivers/cxl/core, dated October 2026 β ok bye, go read the source, ily π«Άπ
π¦ 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