cmdq_pkt_logic_command(9)
π
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 ofleft_operandandright_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:
cmdq_dev_get_client_reg(9)cmdq_mbox_create(9)cmdq_mbox_destroy(9)cmdq_pkt_create(9)cmdq_pkt_destroy(9)cmdq_pkt_write(9)cmdq_pkt_write_pa(9)cmdq_pkt_write_subsys(9)cmdq_pkt_write_mask(9)cmdq_pkt_write_mask_pa(9)cmdq_pkt_write_mask_subsys(9)cmdq_pkt_write_s(9)cmdq_pkt_write_s_mask(9)cmdq_pkt_write_s_value(9)cmdq_pkt_write_s_mask_value(9)cmdq_pkt_mem_move(9)cmdq_pkt_wfe(9)cmdq_pkt_acquire_event(9)cmdq_pkt_clear_event(9)cmdq_pkt_set_event(9)cmdq_pkt_poll(9)cmdq_pkt_poll_mask(9)cmdq_pkt_assign(9)cmdq_pkt_poll_addr(9)cmdq_pkt_jump_abs(9)cmdq_pkt_jump_rel(9)cmdq_pkt_jump_rel_temp(9)cmdq_pkt_eoc(9)
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
- 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