From c099bcb7402421985e6e8c025e8cde591eaa073a Mon Sep 17 00:00:00 2001 From: 3gg <3gg@shellblade.net> Date: Tue, 14 Oct 2025 17:54:17 -0700 Subject: Add MAIL_T macro; read framebuffer allocation response --- src/mailbox.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/mailbox.h') diff --git a/src/mailbox.h b/src/mailbox.h index b35c7a6..2104265 100644 --- a/src/mailbox.h +++ b/src/mailbox.h @@ -1,3 +1,9 @@ +/* +References: + https://github-wiki-see.page/m/raspberrypi/firmware/wiki/Mailbox-property-interface + https://jsandler18.github.io/extra/prop-channel.html + https://jsandler18.github.io/extra/mailbox.html +*/ #pragma once #include @@ -6,6 +12,9 @@ // must be aligned to a 16-byte boundary. #define MAIL_ALIGN 16 +// Type prefix for data arrays used as mail. +#define MAIL_T volatile __attribute__((aligned(MAIL_ALIGN))) + enum { PROPERTY_CHANNEL = 8, @@ -55,9 +64,6 @@ typedef struct __attribute__((aligned(MAIL_ALIGN))) Mail { Tag tags[]; // Variable quantity. } Mail; -// TODO: Remove? Unused. -#define MAIL_SIZE(TYPE) (sizeof(TYPE) + (2 * sizeof(uint32_t))) - void mbox_init(); const Mail* mbox_read(uint8_t channel); void mbox_write(uint8_t channel, volatile const void* mail); -- cgit v1.2.3