| // Copyright 2018 The Fuchsia Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| library fuchsia.hardware.mailbox; |
| |
| using zx; |
| |
| // Mailboxes |
| type MailboxType = strict enum : uint8 { |
| SCP_SECURE_MAILBOX = 0x0; |
| SCP_NS_LOW_PRIORITY_MAILBOX = 0x1; |
| SCP_NS_HIGH_PRIORITY_MAILBOX = 0x2; |
| AP_SECURE_MAILBOX = 0x3; |
| AP_NS_LOW_PRIORITY_MAILBOX = 0x4; |
| AP_NS_HIGH_PRIORITY_MAILBOX = 0x5; |
| INVALID_MAILBOX = 0x6; |
| }; |
| |
| type MailboxDataBuf = struct { |
| cmd uint32; |
| @buffer |
| tx vector<uint8>:MAX; |
| }; |
| |
| type MailboxChannel = struct { |
| mailbox MailboxType; |
| @buffer |
| rx vector<uint8>:MAX; |
| }; |
| |
| @transport("Banjo") |
| @banjo_layout("ddk-protocol") |
| protocol Mailbox { |
| SendCommand(struct { |
| channel MailboxChannel; |
| mdata MailboxDataBuf; |
| }) -> (struct { |
| s zx.status; |
| }); |
| }; |