spu_msg_sg_add(9)
π spu_msg_sg_add π
okay bestie, welcome to the Kernel API Manual, section 9 β this is the page for spu_msg_sg_add(9) and honestly? it's giving "small function, big responsibilities." π
β¨ NAME β¨
spu_msg_sg_add β literally copies scatterlist entries from one sg to another, up to a given length. that's the whole vibe. π¦
πΈ SYNOPSIS πΈ
u32 spu_msg_sg_add (struct scatterlist **to_sg , struct scatterlist
**from_sg , u32 *from_skip , u8 from_nents , u32 length );
π ARGUMENTS π
to_sgβ the scatterlist you're copying to. the destination. the glow-up location. πfrom_sgβ the scatterlist you're copying from. the source material, the original.from_skipβ how many bytes to skip infrom_sg, ngl. it's non-zero when a previous request already included part of the buffer in an entry infrom_sg. and it assumesfrom_skip<from_sg->lengthβ that's the rule, no cap. πfrom_nentsβ number of entries infrom_sg. how many we got. π₯lengthβ number of bytes to copy. heads up: it may reach this limit before exhaustingfrom_sg. so like, it might stop early, iykyk. π
π¦ DESCRIPTION π¦
so the way that this works is: it copies the entries themselves, not the data in the entries. very demure, very mindful β pointers, not payloads. β¨
it assumes to_sg has enough entries (bestie, please make sure it does π), and it does not limit the size of an individual buffer in to_sg.
also to_sg, from_sg, and skip are all updated to the end of the copy. all three. every single one. periodt. π
π RETURN π
the number of bytes copied. that's it, that's the return value. β
π§ SEE ALSO π§
- Kernel file
./drivers/crypto/bcm/util.c spu_sg_at_offset(9)spu_sg_count(9)do_shash(9)format_value_ccm(9)
go read those too, you'll be obsessed π«Ά
mwah π this page lives in ./drivers/crypto/bcm, and it's dated October 2026 β so yeah, ahead of the curve fr fr. take care of her, she's iconic. πΈ
π¦ 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