It's defined in machine/htif.c. HTIF is a RISC-V thing; see slide 12 of:
https://riscv.org/wp-content/uploads/2015/01/riscv-software-...
There's (I think) an analogous design in the Apple SEP; search "mailbox" in:
https://www.blackhat.com/docs/us-16/materials/us-16-Mandt-De...