SSAM_DEFINE_SYNC_REQUEST_WR(9)
π SSAM_DEFINE_SYNC_REQUEST_WR(9) β like, the Kernel API Manual, section 9 bestie β¨
okay so before we even start β this is a page from the Kernel API Manual (section 9, iykyk), and it's about that macro life. stay with me, it's actually so good.
πΈ NAME πΈ
SSAM_DEFINE_SYNC_REQUEST_WR β define a synchronous SAM request function that's got both an argument AND a return value. both. not one. both. we love a versatile icon π
β¨ SYNOPSIS β¨
SSAM_DEFINE_SYNC_REQUEST_WR (name , atype , rtype , spec... );
π ARGUMENTS π
nameβ the name of the generated function. you get to pick it bestie, that's your baby's name πΌatypeβ the type of the request's argument.rtypeβ the type of the request's return value.specβ the specification (astruct ssam_request_spec) that defines the request. this is the blueprint, the vision board, the whole plan π«
π¦ DESCRIPTION π¦
so what this actually does: it defines a function that executes the synchronous SAM request specified by spec, where the request takes an argument of type atype and has a return value of type rtype. (both! she does both!) ππ
the generated function is genuinely such a hard worker β she handles setting up the request and response structs, the buffer allocation, AND execution of the request itself, and she returns once the request has been fully completed. no half-finished energy here. periodt.
heads up: the required transport buffer gets allocated on the stack. that's just how it is, no cap.
the generated function is defined as:
static int name(struct ssam_controller *ctrl, const atype *arg, rtype *ret)
and it returns the status of the request β zero on success and negative on failure π
breaking down the parameters, bestie:
ctrlβ the controller via which the request is sent.argβ the request argument, specified via this pointer.retβ the request's return value gets written to the memory pointed to by this parameter.
if you want the full tea on how the generated function behaves, go read ssam_request_do_sync_onstack. she's the main character, this macro is just her vibe π
π§ SEE ALSO π§
everything is connected, it's giving cinematic universe π
Kernel file ./include/linux/surface_aggregator/controller.h:
- enum
ssam_event_flags(9) - struct
ssam_event(9) - enum
ssam_request_flags(9) - struct
ssam_request(9) - struct
ssam_response(9) - struct
ssam_request_sync(9) ssam_request_sync_set_data(9)ssam_request_sync_set_resp(9)ssam_request_sync_wait(9)ssam_request_do_sync_onstack(9)__ssam_retry(9)ssam_retry(9)- struct
ssam_request_spec(9) - struct
ssam_request_spec_md(9) SSAM_DEFINE_SYNC_REQUEST_N(9)SSAM_DEFINE_SYNC_REQUEST_W(9)SSAM_DEFINE_SYNC_REQUEST_R(9)SSAM_DEFINE_SYNC_REQUEST_MD_N(9)SSAM_DEFINE_SYNC_REQUEST_MD_W(9)SSAM_DEFINE_SYNC_REQUEST_MD_R(9)SSAM_DEFINE_SYNC_REQUEST_MD_WR(9)- enum
ssam_notif_flags(9) - struct
ssam_notifier_block(9) ssam_notifier_from_errno(9)ssam_notifier_to_errno(9)- struct
ssam_event_registry(9) - struct
ssam_event_id(9) - enum
ssam_event_mask(9) SSAM_EVENT_REGISTRY(9)- enum
ssam_event_notifier_flags(9) - struct
ssam_event_notifier(9) ssam_notifier_unregister(9)
and that's the whole page, bestie, you ate that π«Άβ¨ π
source: ./include/linux/surface_aggreg... β dated October 2026 π cheers from SSAM_DEFINE_SYNC_REQUEST_WR(9), mwah ππΈ
π¦ 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