Imported Upstream version 3.2.2
[debian/gnuradio] / gcell / include / gcell / gc_mbox.h
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2007,2008,2009 Free Software Foundation, Inc.
4  * 
5  * This file is part of GNU Radio
6  * 
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  * 
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21 #ifndef INCLUDED_GCELL_GC_MBOX_H
22 #define INCLUDED_GCELL_GC_MBOX_H
23
24 /*
25  * The PPE and SPE exchange a few 32-bit messages via mailboxes.
26  * All have a 4 bit opcode in the high bits.
27  *
28  *      3                   2                   1
29  *    1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
30  *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
31  *   |  op   |                        arg                            |
32  *   +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
33  *
34  */
35
36 #define MK_MBOX_MSG(cmd, args) ((((cmd) & 0xf) << 28) | ((args) & 0x0fffffff))
37 #define MBOX_MSG_OP(msg)  (((msg) >> 28) & 0xf)
38 #define MBOX_MSG_ARG(msg) ((msg) & 0x0fffffff)
39
40 // PPE to SPE (sent via SPE Read Inbound Mailbox)
41
42 #define OP_EXIT                 0x0     // exit now
43 #define OP_GET_SPU_BUFSIZE      0x1 
44 #define OP_CHECK_QUEUE          0x2
45
46 // SPE to PPE (sent via SPE Write Outbound Interrupt Mailbox)
47
48 #define OP_JOBS_DONE            0x3     // arg is 0 or 1, indicating which
49                                         //   gc_completion_info_t contains the info
50 #define OP_SPU_BUFSIZE          0x4     // arg is max number of bytes
51
52
53 #endif /* INCLUDED_GCELL_GC_MBOX_H */