STRUCT SCM_LEGACY_COMMAND(9)
π struct scm_legacy_command(9) π
okay bestie, welcome to the Kernel API Manual π this is the page for struct scm_legacy_command, and yes it's giving "one SCM command buffer" β that's the whole NAME vibe, we're keeping it β¨
πΈ SYNOPSIS πΈ
struct scm_legacy_command {
__le32 len;
__le32 buf_offset;
__le32 resp_hdr_offset;
__le32 id;
__le32 buf[];
};
no cap, that's the whole struct, and honestly it's lowkey gorgeous π
β¨ Members β¨
lenβ the total available memory for the command and the response, together, one number, that's it π«Άbuf_offsetβ where the command buffer starts β¨resp_hdr_offsetβ where the response buffer starts πΈidβ the command that's actually gonna be executed, iykyk πbufβ the buffer you get back fromscm_legacy_get_command_bufferπ
π¦ Description π¦
so the way an SCM command is laid out in memory is literally this, look π
------------------- <--- struct scm_legacy_command
| command header |
------------------- <--- scm_legacy_get_command_buffer
| command buffer |
------------------- <--- struct scm_legacy_response and
| response header | scm_legacy_command_to_response
------------------- <--- scm_legacy_get_response_buffer
| response buffer |
-------------------
iconic, right? but here's the part where you gotta listen to me π₯Ί there can be arbitrary padding between the headers and the buffers. arbitrary!! so you should always use the appropriate scm_legacy_get_*_buffer routines to access the buffers in a safe manner. fr fr, do not go poking at offsets by hand, that's not the vibe π
π SEE ALSO π
- the kernel file
./drivers/firmware/qcom/qcom_scm-legacy.cπ struct arm_smccc_args(9)struct scm_legacy_response(9)scm_legacy_command_to_response(9)scm_legacy_get_command_buffer(9)scm_legacy_get_response_buffer(9)scm_legacy_call(9)scm_legacy_call_atomic(9)
go read them, they're all slay, I promise π
mwah π this came from ./drivers/firmware/qcom, dated October 2026 β that's the source and the date, wrapped up with a bow π go off and write some extremely safe buffer access okay?? π§ββοΈ
π¦ 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