1 /* Copyright 2015-present Samsung Electronics Co., Ltd. and other contributors
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
16 /****************************************************************************
17 * Copyright (C) 2013 Gregory Nutt. All rights reserved.
18 * Author: Gregory Nutt <gnutt@nuttx.org>
20 * Redistribution and use in source and binary forms, with or without
21 * modification, are permitted provided that the following conditions
24 * 1. Redistributions of source code must retain the above copyright
25 * notice, this list of conditions and the following disclaimer.
26 * 2. Redistributions in binary form must reproduce the above copyright
27 * notice, this list of conditions and the following disclaimer in
28 * the documentation and/or other materials provided with the
30 * 3. Neither the name NuttX nor the names of its contributors may be
31 * used to endorse or promote products derived from this software
32 * without specific prior written permission.
34 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
35 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
36 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
37 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
38 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
39 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
40 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
41 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
42 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
43 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
44 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
45 * POSSIBILITY OF SUCH DAMAGE.
47 ****************************************************************************/
49 /****************************************************************************
51 ****************************************************************************/
53 #include <nuttx/config.h>
54 #include <nuttx/arch.h>
60 # if !defined(CONFIG_HAVE_CXX) || !defined(CONFIG_HAVE_CXXINITIALIZE)
61 # error Need CONFIG_HAVE_CXX and CONFIG_HAVE_CXXINITIALIZE
65 /****************************************************************************
67 ****************************************************************************/
70 * Compiler built-in setjmp function.
72 * @return 0 when called the first time
73 * 1 when returns from a longjmp call
79 return __builtin_setjmp (buf);
83 * Compiler built-in longjmp function.
86 * ignores value argument
90 longjmp (jmp_buf buf, int value)
92 /* Must be called with 1. */
93 __builtin_longjmp (buf, 1);
96 extern "C" int iotjs_entry(int argc, char *argv[]);
97 extern "C" int tuv_cleanup(void);
99 #ifdef CONFIG_BUILD_KERNEL
100 extern "C" int main(int argc, FAR char *argv[])
102 extern "C" int iotjs_main(int argc, char *argv[])
107 ret = iotjs_entry(argc, argv);