1*9a0c3479SRui Paulo#- 2*9a0c3479SRui Paulo# Copyright (c) 2013 Rui Paulo 3*9a0c3479SRui Paulo# All rights reserved. 4*9a0c3479SRui Paulo# 5*9a0c3479SRui Paulo# Redistribution and use in source and binary forms, with or without 6*9a0c3479SRui Paulo# modification, are permitted provided that the following conditions 7*9a0c3479SRui Paulo# are met: 8*9a0c3479SRui Paulo# 1. Redistributions of source code must retain the above copyright 9*9a0c3479SRui Paulo# notice, this list of conditions and the following disclaimer. 10*9a0c3479SRui Paulo# 2. Redistributions in binary form must reproduce the above copyright 11*9a0c3479SRui Paulo# notice, this list of conditions and the following disclaimer in the 12*9a0c3479SRui Paulo# documentation and/or other materials provided with the distribution. 13*9a0c3479SRui Paulo# 14*9a0c3479SRui Paulo# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15*9a0c3479SRui Paulo# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16*9a0c3479SRui Paulo# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17*9a0c3479SRui Paulo# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18*9a0c3479SRui Paulo# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19*9a0c3479SRui Paulo# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20*9a0c3479SRui Paulo# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21*9a0c3479SRui Paulo# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22*9a0c3479SRui Paulo# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23*9a0c3479SRui Paulo# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24*9a0c3479SRui Paulo# SUCH DAMAGE. 25*9a0c3479SRui Paulo# 26*9a0c3479SRui Paulo# 27*9a0c3479SRui Paulo# Mailboxes are used as an IPC mechanism that allows subsystems to 28*9a0c3479SRui Paulo# communicate with each other. 29*9a0c3479SRui Paulo# A system can have multiple mailboxes (e.g. OMAP4) but there's usually a 30*9a0c3479SRui Paulo# system wide mailbox. 31*9a0c3479SRui Paulo# 32*9a0c3479SRui Paulo 33*9a0c3479SRui PauloINTERFACE mbox; 34*9a0c3479SRui Paulo 35*9a0c3479SRui PauloMETHOD int read { 36*9a0c3479SRui Paulo device_t dev; 37*9a0c3479SRui Paulo int channel; 38*9a0c3479SRui Paulo uint32_t *data; 39*9a0c3479SRui Paulo}; 40*9a0c3479SRui Paulo 41*9a0c3479SRui PauloMETHOD int write { 42*9a0c3479SRui Paulo device_t dev; 43*9a0c3479SRui Paulo int channel; 44*9a0c3479SRui Paulo uint32_t data; 45*9a0c3479SRui Paulo}; 46