STRUCT CROS_EC_READMEM(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct cros_ec_readmem(9) ✨

okay bestie, so this is a page from the Kernel API Manual and it's literally about struct cros_ec_readmem β€” the struct you use to read mapped memory πŸ’… that's the whole vibe, let's get into it 🫢


🌸 NAME 🌸

struct cros_ec_readmem β€” the struct used to read mapped memory, no cap πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

here's the whole thing, exactly as it lives, no edits from me i promise πŸ™ˆ

struct cros_ec_readmem {
    uint32_t offset;
    uint32_t bytes;
    uint8_t buffer[EC_MEMMAP_SIZE];
 };

πŸ‘― Members πŸ‘―

  • offset β€” where you're starting inside the EC_LPC_ADDR_MEMMAP region. that's the spot, that's the coordinate ✨
  • bytes β€” how many bytes you wanna read. zero means "read a string" (including ' ') β€” yes that's a whole mode, it's giving string energy 😭 and heads up: at most only EC_MEMMAP_SIZE bytes can be read. that's the ceiling, periodt.
  • buffer β€” where the result gets stored. iconic. and the ioctl returns the number of bytes read, or a negative value on error πŸ’€ so like, check your return values bestie.

πŸŽ€ SEE ALSO πŸŽ€

  • Kernel file ./include/linux/platform_data/cros_ec_chardev.h β€” go read it, iykyk πŸ“–

lowkey a lil reminder: bytes of zero pulls a string (including ' '), and you can't sneak past EC_MEMMAP_SIZE bytes. the struct does not do cardio πŸƒβ€β™€οΈπŸ’¨

and that's the whole page, bestie!! 🌈 this lovely lil doc came to you from ./include/linux/platform_data and it's dated October 2026 β€” slay, go read some mapped memory, you're the main character now πŸ‘‘πŸ’œ

πŸ“¦ where this page comes from