cros_ec_cmd_readmem(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– cros_ec_cmd_readmem(9) β€” Kernel API Manual πŸ’–

okay so bestie, welcome to the cros_ec_cmd_readmem page from the Kernel API Manual ✨ this one's a little function that literally just reads stuff out of EC memory, and honestly? it ate. let's get into it 🫢


🌸 NAME 🌸

cros_ec_cmd_readmem β€” Read from EC memory. that's it, that's the whole vibe. you want bytes out of the EC's memory, this is the girl for the job πŸ’…


✨ SYNOPSIS ✨

int cros_ec_cmd_readmem (struct cros_ec_device *ec_dev , u8 offset , u8
       size , void *dest );

like, look at her. four little params, one int coming back. main character energy fr 😭


πŸŽ€ ARGUMENTS πŸŽ€

  • ec_dev β€” the EC device πŸ’– this is your whole context, your little guy, the device you're talking to.
  • offset β€” this one's within the EC_LPC_ADDR_MEMMAP region. so it's not some absolute address, it's an offset inside that memmap zone, iykyk πŸ¦‹
  • size β€” number of bytes to read. how much you're grabbing. no cap, pick this carefully πŸ‘‘
  • dest β€” the EC command output data. this is where the bytes land, bestie, so make sure it's pointing somewhere real πŸ™ˆ

πŸ”₯ RETURN πŸ”₯

  • >= 0 on success β€” we love a win πŸ’œ
  • negative error number on failure β€” she'll tell you something went wrong by going negative, so check it!! 😭
ngl, always check the return value. negative means bad news, and it's giving "handle me" energy πŸ’€

🌈 SEE ALSO 🌈

the kernel file lives at ./drivers/platform/chrome/cros_ec_proto.c β€” go say hi 🧚

and the whole friend group:

like, that's the entire group chat, all linked up πŸ’…βœ¨


and that's the page, bestie!! πŸ“ shoutout to the ./drivers/platform/chrome directory and the October 2026 date stamp β€” that's the source/version and date, mwah πŸ’‹ slay, go read some EC memory responsibly πŸŒΈπŸ’–

πŸ“¦ where this page comes from