cmdq_pkt_logic_command(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cmdq_pkt_logic_command(9) β€” the Kernel API Manual glow-up πŸŽ€

okay so bestie, picture this: you're over here building a CMDQ packet, right? and you need the GCE to actually do a lil logic operation for you. that's literally what this function is for. it appends a logic command to the CMDQ packet and asks GCE to execute an instruction that stores the result of a logic operation β€” with a left operand and a right operand β€” into result_reg_idx. math but make it ✨hardware✨.


✨ SYNOPSIS ✨

int cmdq_pkt_logic_command (struct cmdq_pkt *pkt , u16 result_reg_idx ,
       struct cmdq_operand *left_operand , enum cmdq_logic_op s_op , struct
       cmdq_operand *right_operand );

that's the whole vibe. five args, one int back. periodt. πŸ’…


🫢 ARGUMENTS 🫢

  • pkt β€” the CMDQ packet, aka the main character. this is where the command gets appended, no cap.
  • result_reg_idx β€” the SPR index that stores the operation result of left_operand and right_operand. it's giving "the receipts go here". 🧾✨
  • left_operand β€” left operand. that's it, that's the whole thing. 🀝
  • s_op β€” the logic operator enum. the actual bit of math happening between the two operands, iykyk.
  • right_operand β€” right operand. the other half of the duo. πŸ¦‹

πŸ”₯ RETURN πŸ”₯

0 for success; else the error code is returned. so like, if you get 0 you're slaying, and if you get anything else the kernel is lowkey telling you something went wrong 😭 β€” go read that error code, bestie, don't ignore it.


🌈 SEE ALSO 🌈

the kernel file for all this lives at ./include/linux/soc/mediatek/mtk-cmdq.h β€” go peek, it's iconic πŸ‘‘

and here's the whole friend group, fr fr:


ngl bestie, cross-reference the whole squad above before you go improvising anything. the manpage said it, not me πŸ’€

and that's the page! 🌸 big sign-off energy: this one came from ./include/linux/soc/mediatek and it's dated October 2026 β€” so it's fresh, it's cute, and it's cmdq_pkt_logic_command(9) approved πŸ«ΆπŸ’–πŸŽ€

πŸ“¦ where this page comes from