text: /*
   * Copyright (c) 2001-2003 Swedish Institute of Computer Science.
   * All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without modification,
   * are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of source code must retain the above copyright notice,
   *    this list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   *    this list of conditions and the following disclaimer in the documentation
   *    and/or other materials provided with the distribution.
   * 3. The name of the author may not be used to endorse or promote products
   *    derived from this software without specific prior written permission.
   *
   * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
   * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
   * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
   * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
   * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
   * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
   * OF SUCH DAMAGE.
   *
   * This file is part of the lwIP TCP/IP stack.
   *
   * Author: Adam Dunkels <adam@sics.se>
   *
   */
  
  /* lwIP includes. */
  #include "sys_arch.h"
  //#include "cc.h"
  /*#include "lwip/debug.h"
  #include "lwip/def.h"
  #include "lwip/sys.h"
  #include "lwip/mem.h"
  #include "lwip/stats.h"*/
  //#include "FreeRTOS.h"
  //#include "task.h"
  
  
  /*
    This optional function does a "fast" critical region protection and returns
    the previous protection level. This function is only called during very short
    critical regions. An embedded system which supports ISR-based drivers might
    want to implement this function by disabling interrupts. Task-based systems
    might want to implement this by using a mutex or disabling tasking. This
    function should support recursive calls from the same task or interrupt. In
    other words, sys_arch_protect() could be called while already protected. In
    that case the return value indicates that it is already protected.
  
    sys_arch_protect() is only required if your port is supporting an operating
    system.
  */
  unsigned int sys_arch_protect(void)
  {
  	portDISABLE_INTERRUPTS();
  	return 1;
  }
  
  /*
    This optional function does a "fast" set of critical region protection to the
    value specified by pval. See the documentation for sys_arch_protect() for
    more information. This function is only required if your port is supporting
    an operating system.
  */
  void sys_arch_unprotect(unsigned  pval)
  {
  	( void ) pval;
  	portENABLE_INTERRUPTS();
  }
  
  /*
   * Prints an assertion messages and aborts execution.
   */
  void sys_assert( const char *msg )
  {	
  	( void ) msg;
  	/*FSL:only needed for debugging
  	printf(msg);
  	printf("\n\r");
  	*/
  	portDISABLE_INTERRUPTS(  );
      for(;;)
      ;
  }
  