STRUCT SMEM_HEADER(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME

struct smem_header β€” bestie, it's the header that sits right at the beginning of the primary smem region πŸ‘‘


✨ SYNOPSIS

struct smem_header {
    struct smem_proc_comm proc_comm[4];
    __le32 version[32];
    __le32 initialized;
    __le32 free_offset;
    __le32 available;
    __le32 reserved;
    struct smem_global_entry toc[SMEM_ITEM_COUNT];
 };

πŸŽ€ MEMBERS

okay so let's go through the crew one by one, no cap, every single field:

  • proc_comm β€” literally the proc_comm communication interface, but make it legacy πŸ’€ it's the old-school one, still showing up to the party
  • version β€” an array of versions for the various subsystems πŸ¦‹ everybody's got their own version number in here
  • initialized β€” a boolean that says whether smem is initialized or not, iykyk ✨
  • free_offset β€” the index of the first unallocated byte in smem πŸ“ that's your "next free spot" pointer basically
  • available β€” the number of bytes available for allocation, like your remaining allowance πŸ’Έ
  • reserved β€” reserved field, and it must be 0 🚨 not "should", not "ideally" β€” must. do not touch, do not decorate, just leave it at zero fr fr
  • toc β€” an array of references to items πŸ“š the table of contents, main character energy

πŸ¦‹ SEE ALSO

Kernel file ./drivers/soc/qcom/smem.c β€” and the whole extended fam πŸ‘‘:

struct smem_proc_comm(9), struct smem_global_entry(9), struct smem_ptable_entry(9), struct smem_ptable(9), struct smem_partition_header(9), struct smem_partition(9), struct smem_private_entry(9), struct smem_info(9), struct smem_region(9), struct qcom_smem(9), qcom_smem_bust_hwspin_lock_by_host(9), qcom_smem_is_available(9), qcom_smem_alloc(9), qcom_smem_get(9), qcom_smem_get_free_space(9), qcom_smem_virt_to_phys(9), qcom_smem_get_soc_id(9), qcom_smem_get_feature_code(9)


and that's the whole page, bestie 🫢 this one lives in ./drivers/soc/qcom, and the version/date energy on it is October 2026 β€” so yeah, struct smem_header(9), dated October 2026, sourced from ./drivers/soc/qcom. slay πŸ’…βœ¨

πŸ“¦ where this page comes from