/* tab:4 * * AM.h - Active Message macros * * "Copyright (c) 1996 and The Regents of the University * of California. All rights reserved. * * Permission to use, copy, modify, and distribute this software and its * documentation for any purpose, without fee, and without written agreement is * hereby granted, provided that the above copyright notice and the following * two paragraphs appear in all copies of this software. * * IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT * OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE UNIVERSITY OF * CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * * THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY * AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS." * * Author: Andrea C. Dusseau * Version: 2 * Creation Date: Mon Feb 12 22:19:59 1996 * Filename: AM.h * History: */ #ifndef __AM_H__ #define __AM_H__ #define AM_Safe(__function) \ { int __rc; \ if ((__rc = __function) != AM_OK) { \ fprintf(stderr, "ERROR: %s failed with code %d\n", #__function, __rc); \ exit(1); \ } \ } #define AM_Request1(endpoint, dest, handler, a) \ AM_Request4(endpoint, dest, handler, (int)a, 0, 0, 0) #define AM_Request2(endpoint, dest, handler, a, b) \ AM_Request4(endpoint, dest, handler, (int)a, (int)b, 0, 0) #define AM_Request3(endpoint, dest, handler, a, b, c) \ AM_Request4(endpoint, dest, handler, (int)a, (int)b, (int)c, 0) #define AM_Request5(endpoint, dest, handler, a, b, c, d, e) \ AM_Request8(endpoint, dest, handler, (int)a, (int)b, (int)c, (int)d, \ (int)e, 0, 0, 0) #define AM_Request6(endpoint, dest, handler, a, b, c, d, e, f) \ AM_Request8(endpoint, dest, handler, (int)a, (int)b, (int)c, (int)d, \ (int)e, (int)f, 0, 0) #define AM_Request7(endpoint, dest, handler, a, b, c, d, e, f, g) \ AM_Request8(endpoint, dest, handler, (int)a, (int)b, (int)c, (int)d, \ (int)e, (int)f, (int)g, 0) #define AM_Reply1(token, handler, a) \ AM_Reply4(token, handler, (int)a, 0, 0, 0) #define AM_Reply2(token, handler, a, b) \ AM_Reply4(token, handler, (int)a, (int)b, 0, 0) #define AM_Reply3(token, handler, a, b, c) \ AM_Reply4(token, handler, (int)a, (int)b, (int)c, 0) #endif