B.3 PROGRAM .SLAVE

Dependencies:   mbed

Committer:
manujose
Date:
Tue Dec 14 23:26:42 2010 +0000
Revision:
1:695db1757630
Parent:
0:9092ea8d9a6c

        

Who changed what in which revision?

UserRevisionLine numberNew contents of line
manujose 0:9092ea8d9a6c 1 /*
manujose 0:9092ea8d9a6c 2 * Copyright (c) 2004-2005, Swedish Institute of Computer Science.
manujose 0:9092ea8d9a6c 3 * All rights reserved.
manujose 0:9092ea8d9a6c 4 *
manujose 0:9092ea8d9a6c 5 * Redistribution and use in source and binary forms, with or without
manujose 0:9092ea8d9a6c 6 * modification, are permitted provided that the following conditions
manujose 0:9092ea8d9a6c 7 * are met:
manujose 0:9092ea8d9a6c 8 * 1. Redistributions of source code must retain the above copyright
manujose 0:9092ea8d9a6c 9 * notice, this list of conditions and the following disclaimer.
manujose 0:9092ea8d9a6c 10 * 2. Redistributions in binary form must reproduce the above copyright
manujose 0:9092ea8d9a6c 11 * notice, this list of conditions and the following disclaimer in the
manujose 0:9092ea8d9a6c 12 * documentation and/or other materials provided with the distribution.
manujose 0:9092ea8d9a6c 13 * 3. Neither the name of the Institute nor the names of its contributors
manujose 0:9092ea8d9a6c 14 * may be used to endorse or promote products derived from this software
manujose 0:9092ea8d9a6c 15 * without specific prior written permission.
manujose 0:9092ea8d9a6c 16 *
manujose 0:9092ea8d9a6c 17 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
manujose 0:9092ea8d9a6c 18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
manujose 0:9092ea8d9a6c 19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
manujose 0:9092ea8d9a6c 20 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
manujose 0:9092ea8d9a6c 21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
manujose 0:9092ea8d9a6c 22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
manujose 0:9092ea8d9a6c 23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
manujose 0:9092ea8d9a6c 24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
manujose 0:9092ea8d9a6c 25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
manujose 0:9092ea8d9a6c 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
manujose 0:9092ea8d9a6c 27 * SUCH DAMAGE.
manujose 0:9092ea8d9a6c 28 *
manujose 0:9092ea8d9a6c 29 * This file is part of the Contiki operating system.
manujose 0:9092ea8d9a6c 30 *
manujose 0:9092ea8d9a6c 31 * Author: Adam Dunkels <adam@sics.se>
manujose 0:9092ea8d9a6c 32 *
manujose 0:9092ea8d9a6c 33 * $Id: lc-addrlabels.h,v 1.4 2006/06/03 11:29:43 adam Exp $
manujose 0:9092ea8d9a6c 34 */
manujose 0:9092ea8d9a6c 35
manujose 0:9092ea8d9a6c 36 /**
manujose 0:9092ea8d9a6c 37 * \addtogroup lc
manujose 0:9092ea8d9a6c 38 * @{
manujose 0:9092ea8d9a6c 39 */
manujose 0:9092ea8d9a6c 40
manujose 0:9092ea8d9a6c 41 /**
manujose 0:9092ea8d9a6c 42 * \file
manujose 0:9092ea8d9a6c 43 * Implementation of local continuations based on the "Labels as
manujose 0:9092ea8d9a6c 44 * values" feature of gcc
manujose 0:9092ea8d9a6c 45 * \author
manujose 0:9092ea8d9a6c 46 * Adam Dunkels <adam@sics.se>
manujose 0:9092ea8d9a6c 47 *
manujose 0:9092ea8d9a6c 48 * This implementation of local continuations is based on a special
manujose 0:9092ea8d9a6c 49 * feature of the GCC C compiler called "labels as values". This
manujose 0:9092ea8d9a6c 50 * feature allows assigning pointers with the address of the code
manujose 0:9092ea8d9a6c 51 * corresponding to a particular C label.
manujose 0:9092ea8d9a6c 52 *
manujose 0:9092ea8d9a6c 53 * For more information, see the GCC documentation:
manujose 0:9092ea8d9a6c 54 * http://gcc.gnu.org/onlinedocs/gcc/Labels-as-Values.html
manujose 0:9092ea8d9a6c 55 *
manujose 0:9092ea8d9a6c 56 */
manujose 0:9092ea8d9a6c 57
manujose 0:9092ea8d9a6c 58 #ifndef __LC_ADDRLABELS_H__
manujose 0:9092ea8d9a6c 59 #define __LC_ADDRLABELS_H__
manujose 0:9092ea8d9a6c 60
manujose 0:9092ea8d9a6c 61 /** \hideinitializer */
manujose 0:9092ea8d9a6c 62 typedef void * lc_t;
manujose 0:9092ea8d9a6c 63
manujose 0:9092ea8d9a6c 64 #define LC_INIT(s) s = NULL
manujose 0:9092ea8d9a6c 65
manujose 0:9092ea8d9a6c 66 #define LC_RESUME(s) \
manujose 0:9092ea8d9a6c 67 do { \
manujose 0:9092ea8d9a6c 68 if(s != NULL) { \
manujose 0:9092ea8d9a6c 69 goto *s; \
manujose 0:9092ea8d9a6c 70 } \
manujose 0:9092ea8d9a6c 71 } while(0)
manujose 0:9092ea8d9a6c 72
manujose 0:9092ea8d9a6c 73 #define LC_CONCAT2(s1, s2) s1##s2
manujose 0:9092ea8d9a6c 74 #define LC_CONCAT(s1, s2) LC_CONCAT2(s1, s2)
manujose 0:9092ea8d9a6c 75
manujose 0:9092ea8d9a6c 76 #define LC_SET(s) \
manujose 0:9092ea8d9a6c 77 do { \
manujose 0:9092ea8d9a6c 78 LC_CONCAT(LC_LABEL, __LINE__): \
manujose 0:9092ea8d9a6c 79 (s) = &&LC_CONCAT(LC_LABEL, __LINE__); \
manujose 0:9092ea8d9a6c 80 } while(0)
manujose 0:9092ea8d9a6c 81
manujose 0:9092ea8d9a6c 82 #define LC_END(s)
manujose 0:9092ea8d9a6c 83
manujose 0:9092ea8d9a6c 84 #endif /* __LC_ADDRLABELS_H__ */
manujose 0:9092ea8d9a6c 85 /** @} */