STRUCT CXL_RD_OPS(9)
π struct cxl_rd_ops(9) β like, the CXL root decoder callback ops bestie β¨
Okay so welcome to the Kernel API Manual page for struct cxl_rd_ops β this is the little struct that holds the callbacks a CXL root decoder uses, and honestly? It's giving "small but mighty" π
πΈ NAME πΈ
struct cxl_rd_ops β CXL root decoder callback operations. That's it, that's the whole vibe. It's the ops struct, it's iconic, it does exactly what it says on the tin π
β¨ SYNOPSIS β¨
Here's the whole thing, literally copy-pasted energy but make it correct β two function pointers, no cap:
struct cxl_rd_ops {
u64 (*hpa_to_spa)(struct cxl_root_decoder *cxlrd, u64 hpa);
u64 (*spa_to_hpa)(struct cxl_root_decoder *cxlrd, u64 spa);
};
π¦ Members π¦
Two members, both baddies, both doing address translation for you π«Ά
hpa_to_spaβ converts a host physical address into a system physical address. Basically it takes yourhpaand tells you whatspait maps to, and it takes astruct cxl_root_decoder *cxlrdplus au64 hpato do it π₯spa_to_hpaβ the β¨reverseβ¨ direction: converts a system physical address into a host physical address. Same deal, it's handed astruct cxl_root_decoder *cxlrdand au64 spaand gives you back the host-side answer π«
Lowkey the whole point of this struct is that the root decoder doesn't hardcode how translation works β it just gets these two callbacks and lets them handle it. Main character energy for a function pointer table, fr fr π
π SEE ALSO π
Go read the kernel file ./drivers/cxl/cxl.h first, iykyk, and then go hang out with all the other cxl objects(9) besties β they're all linked together and honestly it's a whole friend group π
cxl objects(9)struct cxl_decoder(9)struct cxl_endpoint_decoder(9)struct cxl_switch_decoder(9)struct cxl_root_decoder(9)struct cxl_region_params(9)struct cxl_region(9)struct cxl_port(9)struct cxl_root(9)struct cxl_dport(9)struct cxl_ep(9)struct cxl_region_ref(9)struct cxl_endpoint_dvsec_info(9)
Okay that's the whole page bestie, go forth and translate those addresses π
β¨ This one lives in ./drivers/cxl, it's dated October 2026, and yes β it's still struct cxl_rd_ops(9), slay ππ¦
π¦ 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