#![no_std]

mod dprintf;
mod mailbox_client;

use crate::mailbox_client::MailboxClient;
use libtock::result::TockResult;
use libtock::syscalls;
use matcha_config::*;

libtock_core::stack_size! {0x1000}

// Global static message buffer. The mailbox driver will copy incoming messages
// here when they arrive.
static mut MESSAGE_BUF: [u8; 4096] = [0; 4096];

//------------------------------------------------------------------------------

#[libtock::main]
async fn main() -> TockResult<()> {
    dprintf!("SEC: Booting seL4 from TockOS app!\r\n");
    let _result = syscalls::command(CAPSULE_ELFLOADER, CMD_ELFLOADER_BOOT_SEL4, 0, 0);
    dprintf!("SEC: Booting seL4 from TockOS app done!\r\n");

    MailboxClient::init();

    unsafe {
        loop {
            dprintf!("SEC: Waiting for request\r\n");
            let message_size = MailboxClient::wait_message_async(&mut MESSAGE_BUF).await;
            dprintf!("SEC: Request arrived, {} bytes\r\n", message_size);

            let dst: *mut u32 = core::mem::transmute(MESSAGE_BUF.as_ptr());

            // We don't actually have any message handling set up, so we just
            // tweak the first and last dword of the message so the sender can
            // tell we were able to modify it.
            let last = (message_size / 4) - 1;
            dprintf!("request[0] = {:X}\r\n", dst.offset(0).read());
            dprintf!(
                "request[{}] = {:X}\r\n",
                last,
                dst.offset(last as isize).read()
            );

            dst.offset(0).write(0x12345678);
            dst.offset(last as isize).write(0x87654321);

            dprintf!("SEC: Sending response\r\n");
            MailboxClient::send_message_sync(message_size, &MESSAGE_BUF);

            dprintf!("SEC: Response sent\r\n");
        }
    }
    // Unreachable
}
