diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 29d4e72e6..5c5ebdd25 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,23 +1,14 @@ -+++ -version = "1.4" -aliases = ["/version/1/4"] -+++ - # Contributor Covenant Code of Conduct +*Note*: this Code of Conduct pertains to individuals' behavior. Please also see the [Organizational Code of Conduct][OCoC]. + ## Our Pledge -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to make participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, sex characteristics, gender identity and expression, -level of experience, education, socio-economic status, nationality, personal -appearance, race, religion, or sexual identity and orientation. +In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. ## Our Standards -Examples of behavior that contributes to creating a positive environment -include: +Examples of behavior that contributes to creating a positive environment include: * Using welcoming and inclusive language * Being respectful of differing viewpoints and experiences @@ -27,55 +18,32 @@ include: Examples of unacceptable behavior by participants include: -* The use of sexualized language or imagery and unwelcome sexual attention or - advances +* The use of sexualized language or imagery and unwelcome sexual attention or advances * Trolling, insulting/derogatory comments, and personal or political attacks * Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. +Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. -Project maintainers have the right and responsibility to remove, edit, or -reject comments, commits, code, wiki edits, issues, and other contributions -that are not aligned to this Code of Conduct, or to ban temporarily or -permanently any contributor for other behaviors that they deem inappropriate, -threatening, offensive, or harmful. +Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. ## Scope -This Code of Conduct applies within all project spaces, and it also applies when -an individual is representing the project or its community in public spaces. -Examples of representing a project or community include using an official -project e-mail address, posting via an official social media account, or acting -as an appointed representative at an online or offline event. Representation of -a project may be further defined and clarified by project maintainers. +This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. ## Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported by contacting the project team at otc.community.care@intel.com. All -complaints will be reviewed and investigated and will result in a response that -is deemed necessary and appropriate to the circumstances. The project team is -obligated to maintain confidentiality with regard to the reporter of an incident. -Further details of specific enforcement policies may be posted separately. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the Bytecode Alliance CoC team at [report@bytecodealliance.org](mailto:report@bytecodealliance.org). The CoC team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The CoC team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. -Project maintainers who do not follow or enforce the Code of Conduct in good -faith may face temporary or permanent repercussions as determined by other -members of the project's leadership. +Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the Bytecode Alliance's leadership. ## Attribution -This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, -available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html +This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] +[OCoC]: ORG_CODE_OF_CONDUCT.md [homepage]: https://www.contributor-covenant.org - -For answers to common questions about this code of conduct, see -https://www.contributor-covenant.org/faq +[version]: https://www.contributor-covenant.org/version/1/4/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 06ff8cf2d..9210b3deb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,9 +8,11 @@ We want to make contributing to this project as easy and transparent as possible - Proposing new features License -===================== -WAMR uses the permissive open source `Apache 2.0 license`_ that allows you to freely use, modify, distribute and sell your own products that include Apache 2.0 licensed software. -Any contributions you make will be under the same license. Feel free to contact the maintainers if that's a concern. +======= +WAMR uses the same license as LLVM: the `Apache 2.0 license` with the LLVM +exception. See the LICENSE file for details. This license allows you to freely +use, modify, distribute and sell your own products based on WAMR. +Any contributions you make will be under the same license. Code changes =================== @@ -34,5 +36,4 @@ We use GitHub issues to track public bugs. Report a bug by [open a new issue](ht Code of Conduct =============== -This project is governed by the [Contributor Covenant](CODE_OF_CONDUCT.md). -All contributors and participants agree to abide by its terms. +WAMR is a [Bytecode Alliance](https://bytecodealliance.org/) project, and follows the Bytecode Alliance's [Code of Conduct](CODE_OF_CONDUCT.md) and [Organizational Code of Conduct](ORG_CODE_OF_CONDUCT.md). diff --git a/LICENSE b/LICENSE index 8f71f43fe..c6bd7e0c5 100644 --- a/LICENSE +++ b/LICENSE @@ -178,7 +178,7 @@ APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "{}" + boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright {yyyy} {name of copyright owner} + Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -200,3 +200,20 @@ See the License for the specific language governing permissions and limitations under the License. + +--- LLVM Exceptions to the Apache 2.0 License ---- + +As an exception, if, as a result of your compiling your source code, portions +of this Software are embedded into an Object form of such source code, you +may redistribute such embedded portions in such Object form without complying +with the conditions of Sections 4(a), 4(b) and 4(d) of the License. + +In addition, if you combine or link compiled forms of this Software with +software that is licensed under the GPLv2 ("Combined Software") and if a +court of competent jurisdiction determines that the patent provision (Section +3), the indemnity provision (Section 9) or other Section of the License +conflicts with the conditions of the GPLv2, you may retroactively and +prospectively choose to deem waived or otherwise exclude such Section(s) of +the License, but only in their entirety and only with respect to the Combined +Software. + diff --git a/ORG_CODE_OF_CONDUCT.md b/ORG_CODE_OF_CONDUCT.md new file mode 100644 index 000000000..e05e40c3c --- /dev/null +++ b/ORG_CODE_OF_CONDUCT.md @@ -0,0 +1,139 @@ +# Bytecode Alliance Organizational Code of Conduct (OCoC) + +*Note*: this Code of Conduct pertains to organizations' behavior. Please also see the [Individual Code of Conduct](CODE_OF_CONDUCT.md). + +## Preamble + +The Bytecode Alliance (BA) welcomes involvement from organizations, +including commercial organizations. This document is an +*organizational* code of conduct, intended particularly to provide +guidance to commercial organizations. It is distinct from the +[Individual Code of Conduct (ICoC)](CODE_OF_CONDUCT.md), and does not +replace the ICoC. This OCoC applies to any group of people acting in +concert as a BA member or as a participant in BA activities, whether +or not that group is formally incorporated in some jurisdiction. + +The code of conduct described below is not a set of rigid rules, and +we did not write it to encompass every conceivable scenario that might +arise. For example, it is theoretically possible there would be times +when asserting patents is in the best interest of the BA community as +a whole. In such instances, consult with the BA, strive for +consensus, and interpret these rules with an intent that is generous +to the community the BA serves. + +While we may revise these guidelines from time to time based on +real-world experience, overall they are based on a simple principle: + +*Bytecode Alliance members should observe the distinction between + public community functions and private functions — especially + commercial ones — and should ensure that the latter support, or at + least do not harm, the former.* + +## Guidelines + + * **Do not cause confusion about Wasm standards or interoperability.** + + Having an interoperable WebAssembly core is a high priority for + the BA, and members should strive to preserve that core. It is fine + to develop additional non-standard features or APIs, but they + should always be clearly distinguished from the core interoperable + Wasm. + + Treat the WebAssembly name and any BA-associated names with + respect, and follow BA trademark and branding guidelines. If you + distribute a customized version of software originally produced by + the BA, or if you build a product or service using BA-derived + software, use names that clearly distinguish your work from the + original. (You should still provide proper attribution to the + original, of course, wherever such attribution would normally be + given.) + + Further, do not use the WebAssembly name or BA-associated names in + other public namespaces in ways that could cause confusion, e.g., + in company names, names of commercial service offerings, domain + names, publicly-visible social media accounts or online service + accounts, etc. It may sometimes be reasonable, however, to + register such a name in a new namespace and then immediately donate + control of that account to the BA, because that would help the project + maintain its identity. + + * **Do not restrict contributors.** If your company requires + employees or contractors to sign non-compete agreements, those + agreements must not prevent people from participating in the BA or + contributing to related projects. + + This does not mean that all non-compete agreements are incompatible + with this code of conduct. For example, a company may restrict an + employee's ability to solicit the company's customers. However, an + agreement must not block any form of technical or social + participation in BA activities, including but not limited to the + implementation of particular features. + + The accumulation of experience and expertise in individual persons, + who are ultimately free to direct their energy and attention as + they decide, is one of the most important drivers of progress in + open source projects. A company that limits this freedom may hinder + the success of the BA's efforts. + + * **Do not use patents as offensive weapons.** If any BA participant + prevents the adoption or development of BA technologies by + asserting its patents, that undermines the purpose of the + coalition. The collaboration fostered by the BA cannot include + members who act to undermine its work. + + * **Practice responsible disclosure** for security vulnerabilities. + Use designated, non-public reporting channels to disclose technical + vulnerabilities, and give the project a reasonable period to + respond, remediate, and patch. + + Vulnerability reporters may patch their company's own offerings, as + long as that patching does not significantly delay the reporting of + the vulnerability. Vulnerability information should never be used + for unilateral commercial advantage. Vendors may legitimately + compete on the speed and reliability with which they deploy + security fixes, but withholding vulnerability information damages + everyone in the long run by risking harm to the BA project's + reputation and to the security of all users. + + * **Respect the letter and spirit of open source practice.** While + there is not space to list here all possible aspects of standard + open source practice, some examples will help show what we mean: + + * Abide by all applicable open source license terms. Do not engage + in copyright violation or misattribution of any kind. + + * Do not claim others' ideas or designs as your own. + + * When others engage in publicly visible work (e.g., an upcoming + demo that is coordinated in a public issue tracker), do not + unilaterally announce early releases or early demonstrations of + that work ahead of their schedule in order to secure private + advantage (such as marketplace advantage) for yourself. + + The BA reserves the right to determine what constitutes good open + source practices and to take action as it deems appropriate to + encourage, and if necessary enforce, such practices. + +## Enforcement + +Instances of organizational behavior in violation of the OCoC may +be reported by contacting the Bytecode Alliance CoC team at +[report@bytecodealliance.org](mailto:report@bytecodealliance.org). The +CoC team will review and investigate all complaints, and will respond +in a way that it deems appropriate to the circumstances. The CoC team +is obligated to maintain confidentiality with regard to the reporter of +an incident. Further details of specific enforcement policies may be +posted separately. + +When the BA deems an organization in violation of this OCoC, the BA +will, at its sole discretion, determine what action to take. The BA +will decide what type, degree, and duration of corrective action is +needed, if any, before a violating organization can be considered for +membership (if it was not already a member) or can have its membership +reinstated (if it was a member and the BA canceled its membership due +to the violation). + +In practice, the BA's first approach will be to start a conversation, +with punitive enforcement used only as a last resort. Violations +often turn out to be unintentional and swiftly correctable with all +parties acting in good faith. diff --git a/README.md b/README.md index a7383eb65..b19b5033e 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,10 @@ WebAssembly Micro Runtime ========================= + +**A [Bytecode Alliance][BA] project** + +[BA]: https://bytecodealliance.org/ + WebAssembly Micro Runtime (WAMR) is a standalone WebAssembly (WASM) runtime with small footprint. It includes a few parts as below: - A WebAssembly VM core (namely iwasm) - The supporting API's for the WASM applications @@ -57,7 +62,7 @@ Embed WAMR WAMR can be built into a standalone executable which takes the WASM application file name as input, and then executes it. In some other situations, the WAMR source code is embedded the product code and built into the final product. -WAMR provides a set of C API for loading the WASM module, instantiating the module and invoking a WASM function from a native call. +WAMR provides a set of C API for loading the WASM module, instantiating the module and invoking a WASM function from a native call. See the [doc/embed_wamr.md](./doc/embed_wamr.md) for the details. @@ -66,7 +71,7 @@ WAMR application programming library WAMR defined event driven programming model: - Single thread per WASM app instance -- App must implement system callbacks: on_init, on_destrory +- App must implement system callbacks: on_init, on_destroy In general there are a few API classes for the WASM application programming: @@ -112,12 +117,17 @@ See the [major features releasing history and contributor names](./doc/release_a Roadmap ======= -See the [roadmap](./doc/roadmap.md) to understand what major features are planed or under development. +See the [roadmap](./doc/roadmap.md) to understand what major features are planned or under development. Please submit issues for any new feature request, or your plan for contributing new features. - +License +======= +WAMR uses the same license as LLVM: the `Apache 2.0 license` with the LLVM +exception. See the LICENSE file for details. This license allows you to freely +use, modify, distribute and sell your own products based on WAMR. +Any contributions you make will be under the same license. Submit issues and contact the maintainers diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 000000000..3513b9cb3 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,29 @@ +# Security Policy + +Building secure foundations for software development is at the core of what we do in the Bytecode Alliance. Contributions of external security researchers are a vital part of that. + +## Scope + +If you believe you've found a security issue in any website, service, or software owned or operated by the Bytecode Alliance, we encourage you to notify us. + +## How to Submit a Report + +To submit a vulnerability report to the Bytecode Alliance, please contact us at [security@bytecodealliance.org](mailto:security@bytecodealliance.org). Your submission will be reviewed and validated by a member of our security team. + +## Safe Harbor + +The Bytecode Alliance supports safe harbor for security researchers who: + +* Make a good faith effort to avoid privacy violations, destruction of data, and interruption or degradation of our services. +* Only interact with accounts you own or with explicit permission of the account holder. If you do encounter Personally Identifiable Information (PII) contact us immediately, do not proceed with access, and immediately purge any local information. +* Provide us with a reasonable amount of time to resolve vulnerabilities prior to any disclosure to the public or a third-party. + +We will consider activities conducted consistent with this policy to constitute "authorized" conduct and will not pursue civil action or initiate a complaint to law enforcement. We will help to the extent we can if legal action is initiated by a third party against you. + +Please submit a report to us before engaging in conduct that may be inconsistent with or unaddressed by this policy. + +## Preferences + +* Please provide detailed reports with reproducible steps and a clearly defined impact. +* Submit one vulnerability per report. +* Social engineering (e.g. phishing, vishing, smishing) is prohibited. diff --git a/core/app-mgr/app-manager/CMakeLists.txt b/core/app-mgr/app-manager/CMakeLists.txt deleted file mode 100644 index ef2d49c9b..000000000 --- a/core/app-mgr/app-manager/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -include_directories (. - include - platform/include - platform/${PLATFORM} - ../classlib/include - utils/coap/er-coap - utils/coap/extension - ../external/iwasm/include) - - -file (GLOB_RECURSE source_all ../../app-manager/*.c) - -add_library (appmgrlib ${source_all}) - diff --git a/core/app-mgr/app-manager/app_manager.c b/core/app-mgr/app-manager/app_manager.c index b349191f1..04628b16b 100644 --- a/core/app-mgr/app-manager/app_manager.c +++ b/core/app-mgr/app-manager/app_manager.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "app_manager.h" diff --git a/core/app-mgr/app-manager/app_manager.h b/core/app-mgr/app-manager/app_manager.h index 8021e30d1..605ec7418 100644 --- a/core/app-mgr/app-manager/app_manager.h +++ b/core/app-mgr/app-manager/app_manager.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef APP_MANAGER_H @@ -20,7 +9,7 @@ #include "bh_platform.h" #include "bh_common.h" #include "bh_queue.h" -#include "korp_types.h" +#include "bh_types.h" #include "app_manager_export.h" #include "native_interface.h" #include "shared_utils.h" diff --git a/core/app-mgr/app-manager/app_manager_host.c b/core/app-mgr/app-manager/app_manager_host.c index ac8caddae..8e4b29cd1 100644 --- a/core/app-mgr/app-manager/app_manager_host.c +++ b/core/app-mgr/app-manager/app_manager_host.c @@ -1,21 +1,10 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_common.h" -#include "korp_types.h" +#include "bh_types.h" #include "app_manager_host.h" #include "app_manager.h" #include "app_manager_export.h" diff --git a/core/app-mgr/app-manager/app_manager_host.h b/core/app-mgr/app-manager/app_manager_host.h index 1d6b45c87..cc663725b 100644 --- a/core/app-mgr/app-manager/app_manager_host.h +++ b/core/app-mgr/app-manager/app_manager_host.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _APP_MANAGER_HOST_H_ diff --git a/core/app-mgr/app-manager/app_mgr.cmake b/core/app-mgr/app-manager/app_mgr.cmake index a549f307d..afd441348 100644 --- a/core/app-mgr/app-manager/app_mgr.cmake +++ b/core/app-mgr/app-manager/app_mgr.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception set (__APP_MGR_DIR ${CMAKE_CURRENT_LIST_DIR}) diff --git a/core/app-mgr/app-manager/ble_msg.c b/core/app-mgr/app-manager/ble_msg.c index 3a9da09c6..3794fa56b 100644 --- a/core/app-mgr/app-manager/ble_msg.c +++ b/core/app-mgr/app-manager/ble_msg.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #if 0 diff --git a/core/app-mgr/app-manager/event.c b/core/app-mgr/app-manager/event.c index 2295f20fe..67def1c78 100644 --- a/core/app-mgr/app-manager/event.c +++ b/core/app-mgr/app-manager/event.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include diff --git a/core/app-mgr/app-manager/event.h b/core/app-mgr/app-manager/event.h index 84742adae..a9c3de3b2 100644 --- a/core/app-mgr/app-manager/event.h +++ b/core/app-mgr/app-manager/event.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _EVENT_H_ diff --git a/core/app-mgr/app-manager/message.c b/core/app-mgr/app-manager/message.c index 0bccaecc8..8fc3ac51a 100644 --- a/core/app-mgr/app-manager/message.c +++ b/core/app-mgr/app-manager/message.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "app_manager.h" diff --git a/core/app-mgr/app-manager/module_config.h b/core/app-mgr/app-manager/module_config.h index 0899a0274..b742fed3a 100644 --- a/core/app-mgr/app-manager/module_config.h +++ b/core/app-mgr/app-manager/module_config.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _MODULE_CONFIG_H_ diff --git a/core/app-mgr/app-manager/module_jeff.c b/core/app-mgr/app-manager/module_jeff.c index 91e5770f3..af2fbaef0 100644 --- a/core/app-mgr/app-manager/module_jeff.c +++ b/core/app-mgr/app-manager/module_jeff.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifdef ENABLE_JEFF diff --git a/core/app-mgr/app-manager/module_jeff.h b/core/app-mgr/app-manager/module_jeff.h index db3961199..bb39f27e4 100644 --- a/core/app-mgr/app-manager/module_jeff.h +++ b/core/app-mgr/app-manager/module_jeff.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _MODULE_JEFF_H_ diff --git a/core/app-mgr/app-manager/module_utils.c b/core/app-mgr/app-manager/module_utils.c index 36ad5426c..44e486edd 100644 --- a/core/app-mgr/app-manager/module_utils.c +++ b/core/app-mgr/app-manager/module_utils.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "app_manager.h" diff --git a/core/app-mgr/app-manager/module_wasm_app.c b/core/app-mgr/app-manager/module_wasm_app.c index 580e76fc8..7fbe8a53e 100644 --- a/core/app-mgr/app-manager/module_wasm_app.c +++ b/core/app-mgr/app-manager/module_wasm_app.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "module_wasm_app.h" diff --git a/core/app-mgr/app-manager/module_wasm_app.h b/core/app-mgr/app-manager/module_wasm_app.h index 077af05e8..e0f1296d3 100644 --- a/core/app-mgr/app-manager/module_wasm_app.h +++ b/core/app-mgr/app-manager/module_wasm_app.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _MODULE_WASM_APP_H_ diff --git a/core/app-mgr/app-manager/module_wasm_lib.c b/core/app-mgr/app-manager/module_wasm_lib.c index f69e7a4cf..bdf3215c8 100644 --- a/core/app-mgr/app-manager/module_wasm_lib.c +++ b/core/app-mgr/app-manager/module_wasm_lib.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ diff --git a/core/app-mgr/app-manager/module_wasm_lib.h b/core/app-mgr/app-manager/module_wasm_lib.h index 7482cddcf..63ffd92b5 100644 --- a/core/app-mgr/app-manager/module_wasm_lib.h +++ b/core/app-mgr/app-manager/module_wasm_lib.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _MODULE_WASM_LIB_H_ diff --git a/core/app-mgr/app-manager/platform/linux/app_mgr_linux.c b/core/app-mgr/app-manager/platform/linux/app_mgr_linux.c index cbfeb375b..45957bc18 100644 --- a/core/app-mgr/app-manager/platform/linux/app_mgr_linux.c +++ b/core/app-mgr/app-manager/platform/linux/app_mgr_linux.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "app_manager.h" diff --git a/core/app-mgr/app-manager/platform/zephyr/app_mgr_zephyr.c b/core/app-mgr/app-manager/platform/zephyr/app_mgr_zephyr.c index 074d359f9..67ae69b4f 100644 --- a/core/app-mgr/app-manager/platform/zephyr/app_mgr_zephyr.c +++ b/core/app-mgr/app-manager/platform/zephyr/app_mgr_zephyr.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "app_manager.h" diff --git a/core/app-mgr/app-manager/resource_reg.c b/core/app-mgr/app-manager/resource_reg.c index 4fe477e3d..a58025370 100644 --- a/core/app-mgr/app-manager/resource_reg.c +++ b/core/app-mgr/app-manager/resource_reg.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ diff --git a/core/app-mgr/app-manager/watchdog.c b/core/app-mgr/app-manager/watchdog.c index c3d9b0e99..e23939452 100644 --- a/core/app-mgr/app-manager/watchdog.c +++ b/core/app-mgr/app-manager/watchdog.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "watchdog.h" @@ -52,8 +41,8 @@ bool watchdog_timer_init(module_data *m_data) #ifdef WATCHDOG_ENABLED /* TODO */ watchdog_timer *wd_timer = &m_data->wd_timer; - if (BH_SUCCESS != vm_mutex_init(&wd_timer->lock)) - return false; + if (0 != vm_mutex_init(&wd_timer->lock)) + return false; if (!(wd_timer->timer_handle = app_manager_timer_create(watchdog_timer_callback, wd_timer))) { diff --git a/core/app-mgr/app-manager/watchdog.h b/core/app-mgr/app-manager/watchdog.h index 3c957551a..a7a508bdb 100644 --- a/core/app-mgr/app-manager/watchdog.h +++ b/core/app-mgr/app-manager/watchdog.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ diff --git a/core/app-mgr/app-mgr-shared/app_manager_export.h b/core/app-mgr/app-mgr-shared/app_manager_export.h index 2a7ea21d5..91ea96aba 100644 --- a/core/app-mgr/app-mgr-shared/app_manager_export.h +++ b/core/app-mgr/app-mgr-shared/app_manager_export.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _APP_MANAGER_EXPORT_H_ diff --git a/core/app-mgr/app-mgr-shared/app_mgr_shared.cmake b/core/app-mgr/app-mgr-shared/app_mgr_shared.cmake index 16df591d7..590e3f5a2 100644 --- a/core/app-mgr/app-mgr-shared/app_mgr_shared.cmake +++ b/core/app-mgr/app-mgr-shared/app_mgr_shared.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception set (APP_MGR_SHARED_DIR ${CMAKE_CURRENT_LIST_DIR}) diff --git a/core/app-mgr/app-mgr-shared/host_link.h b/core/app-mgr/app-mgr-shared/host_link.h index d6cf59762..6c455ecec 100644 --- a/core/app-mgr/app-mgr-shared/host_link.h +++ b/core/app-mgr/app-mgr-shared/host_link.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef DEPS_APP_MGR_APP_MGR_SHARED_HOST_LINK_H_ diff --git a/core/iwasm/app-samples/hello-world-cmake/CMakeLists.txt b/core/iwasm/app-samples/hello-world-cmake/CMakeLists.txt index fd4b2cca9..935846d65 100644 --- a/core/iwasm/app-samples/hello-world-cmake/CMakeLists.txt +++ b/core/iwasm/app-samples/hello-world-cmake/CMakeLists.txt @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception cmake_minimum_required (VERSION 3.5) project(hello_world) diff --git a/core/iwasm/app-samples/hello-world-cmake/build.sh b/core/iwasm/app-samples/hello-world-cmake/build.sh index 56077177a..c00eb8a51 100755 --- a/core/iwasm/app-samples/hello-world-cmake/build.sh +++ b/core/iwasm/app-samples/hello-world-cmake/build.sh @@ -1,18 +1,7 @@ #!/bin/bash # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception mkdir build cd build diff --git a/core/iwasm/app-samples/hello-world-cmake/main.c b/core/iwasm/app-samples/hello-world-cmake/main.c index ced441960..1c356c479 100644 --- a/core/iwasm/app-samples/hello-world-cmake/main.c +++ b/core/iwasm/app-samples/hello-world-cmake/main.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "stdio.h" diff --git a/core/iwasm/app-samples/hello-world-cmake/print.c b/core/iwasm/app-samples/hello-world-cmake/print.c index 62378b834..8eee6b6b3 100644 --- a/core/iwasm/app-samples/hello-world-cmake/print.c +++ b/core/iwasm/app-samples/hello-world-cmake/print.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "stdio.h" diff --git a/core/iwasm/app-samples/hello-world/build.sh b/core/iwasm/app-samples/hello-world/build.sh index c856b5d99..1509e8158 100755 --- a/core/iwasm/app-samples/hello-world/build.sh +++ b/core/iwasm/app-samples/hello-world/build.sh @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception emcc -g -O3 *.c -s WASM=1 -s SIDE_MODULE=1 -s ASSERTIONS=1 -s STACK_OVERFLOW_CHECK=2 \ -s TOTAL_MEMORY=65536 -s TOTAL_STACK=4096 -o test.wasm diff --git a/core/iwasm/app-samples/hello-world/main.c b/core/iwasm/app-samples/hello-world/main.c index 0db9659b1..791e1d025 100644 --- a/core/iwasm/app-samples/hello-world/main.c +++ b/core/iwasm/app-samples/hello-world/main.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include diff --git a/core/iwasm/app-samples/smart-light/build.sh b/core/iwasm/app-samples/smart-light/build.sh index f1b43c8ff..e6dab5fc5 100755 --- a/core/iwasm/app-samples/smart-light/build.sh +++ b/core/iwasm/app-samples/smart-light/build.sh @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception emcc -g -O3 *.c -s WASM=1 -s SIDE_MODULE=1 -s ASSERTIONS=1 -s STACK_OVERFLOW_CHECK=2 \ -s TOTAL_MEMORY=65536 -s TOTAL_STACK=4096 -o test.wasm diff --git a/core/iwasm/app-samples/smart-light/main.c b/core/iwasm/app-samples/smart-light/main.c index 62ae5ac1f..2355b3120 100644 --- a/core/iwasm/app-samples/smart-light/main.c +++ b/core/iwasm/app-samples/smart-light/main.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include diff --git a/core/iwasm/lib/app-libs/base/bh_platform.c b/core/iwasm/lib/app-libs/base/bh_platform.c index a712336f0..37b828e0e 100644 --- a/core/iwasm/lib/app-libs/base/bh_platform.c +++ b/core/iwasm/lib/app-libs/base/bh_platform.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_platform.h" diff --git a/core/iwasm/lib/app-libs/base/bh_platform.h b/core/iwasm/lib/app-libs/base/bh_platform.h index 7d12983bb..d44522c02 100755 --- a/core/iwasm/lib/app-libs/base/bh_platform.h +++ b/core/iwasm/lib/app-libs/base/bh_platform.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef DEPS_IWASM_APP_LIBS_BASE_BH_PLATFORM_H_ diff --git a/core/iwasm/lib/app-libs/base/request.c b/core/iwasm/lib/app-libs/base/request.c index ade6ce4e2..5dd415dcc 100644 --- a/core/iwasm/lib/app-libs/base/request.c +++ b/core/iwasm/lib/app-libs/base/request.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "attr_container.h" diff --git a/core/iwasm/lib/app-libs/base/request.h b/core/iwasm/lib/app-libs/base/request.h index f60b9f698..571bda72f 100644 --- a/core/iwasm/lib/app-libs/base/request.h +++ b/core/iwasm/lib/app-libs/base/request.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _AEE_REQUEST_H_ diff --git a/core/iwasm/lib/app-libs/base/timer.c b/core/iwasm/lib/app-libs/base/timer.c index 0b3cd9f01..0a2c055d4 100644 --- a/core/iwasm/lib/app-libs/base/timer.c +++ b/core/iwasm/lib/app-libs/base/timer.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include diff --git a/core/iwasm/lib/app-libs/base/timer_wasm_app.h b/core/iwasm/lib/app-libs/base/timer_wasm_app.h index 045a3f439..17e59bc03 100644 --- a/core/iwasm/lib/app-libs/base/timer_wasm_app.h +++ b/core/iwasm/lib/app-libs/base/timer_wasm_app.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _AEE_TIMER_H_ diff --git a/core/iwasm/lib/app-libs/extension/connection/connection.c b/core/iwasm/lib/app-libs/extension/connection/connection.c index e60504c24..75ad0b0e6 100644 --- a/core/iwasm/lib/app-libs/extension/connection/connection.c +++ b/core/iwasm/lib/app-libs/extension/connection/connection.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "connection.h" diff --git a/core/iwasm/lib/app-libs/extension/connection/connection.h b/core/iwasm/lib/app-libs/extension/connection/connection.h index d87352a2b..6de04e109 100644 --- a/core/iwasm/lib/app-libs/extension/connection/connection.h +++ b/core/iwasm/lib/app-libs/extension/connection/connection.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _CONNECTION_H_ diff --git a/core/iwasm/lib/app-libs/extension/gui/inc/wgl_btn.h b/core/iwasm/lib/app-libs/extension/gui/inc/wgl_btn.h index 7cf8e9d6f..bbf364418 100644 --- a/core/iwasm/lib/app-libs/extension/gui/inc/wgl_btn.h +++ b/core/iwasm/lib/app-libs/extension/gui/inc/wgl_btn.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef WAMR_GRAPHIC_LIBRARY_BTN_H diff --git a/core/iwasm/lib/app-libs/extension/gui/inc/wgl_cb.h b/core/iwasm/lib/app-libs/extension/gui/inc/wgl_cb.h index 40604f466..5ff271ee2 100644 --- a/core/iwasm/lib/app-libs/extension/gui/inc/wgl_cb.h +++ b/core/iwasm/lib/app-libs/extension/gui/inc/wgl_cb.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef WAMR_GRAPHIC_LIBRARY_CB_H diff --git a/core/iwasm/lib/app-libs/extension/gui/inc/wgl_label.h b/core/iwasm/lib/app-libs/extension/gui/inc/wgl_label.h index 7cb06550e..3c7f07a32 100644 --- a/core/iwasm/lib/app-libs/extension/gui/inc/wgl_label.h +++ b/core/iwasm/lib/app-libs/extension/gui/inc/wgl_label.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef WAMR_GRAPHIC_LIBRARY_LABEL_H diff --git a/core/iwasm/lib/app-libs/extension/gui/inc/wgl_list.h b/core/iwasm/lib/app-libs/extension/gui/inc/wgl_list.h index c2c454b2f..fd83276ad 100644 --- a/core/iwasm/lib/app-libs/extension/gui/inc/wgl_list.h +++ b/core/iwasm/lib/app-libs/extension/gui/inc/wgl_list.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef WAMR_GRAPHIC_LIBRARY_LIST_H diff --git a/core/iwasm/lib/app-libs/extension/gui/inc/wgl_obj.h b/core/iwasm/lib/app-libs/extension/gui/inc/wgl_obj.h index 7bd8775fc..80d2cb09b 100644 --- a/core/iwasm/lib/app-libs/extension/gui/inc/wgl_obj.h +++ b/core/iwasm/lib/app-libs/extension/gui/inc/wgl_obj.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef WAMR_GRAPHIC_LIBRARY_OBJ_H diff --git a/core/iwasm/lib/app-libs/extension/gui/inc/wgl_types.h b/core/iwasm/lib/app-libs/extension/gui/inc/wgl_types.h index 30b115fae..8f6956526 100644 --- a/core/iwasm/lib/app-libs/extension/gui/inc/wgl_types.h +++ b/core/iwasm/lib/app-libs/extension/gui/inc/wgl_types.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef WAMR_GRAPHIC_LIBRARY_TYPES_H diff --git a/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_btn.h b/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_btn.h index 7aa2391fb..75337a4e7 100644 --- a/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_btn.h +++ b/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_btn.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef WAMR_GRAPHIC_LIBRARY_BTN_LVGL_COMPATIBLE_H diff --git a/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_cb.h b/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_cb.h index 04e5d85e9..edaa109bb 100644 --- a/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_cb.h +++ b/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_cb.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef WAMR_GRAPHIC_LIBRARY_CB_LVGL_COMPATIBLE_H diff --git a/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_label.h b/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_label.h index 060e115fe..264ae295d 100644 --- a/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_label.h +++ b/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_label.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef WAMR_GRAPHIC_LIBRARY_LABEL_LVGL_COMPATIBLE_H diff --git a/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_list.h b/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_list.h index 5f3c4b61f..cc9a35a88 100644 --- a/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_list.h +++ b/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_list.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef WAMR_GRAPHIC_LIBRARY_LIST_LVGL_COMPATIBLE_H diff --git a/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_obj.h b/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_obj.h index 1ea3ab853..b79ffb730 100644 --- a/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_obj.h +++ b/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_obj.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef WAMR_GRAPHIC_LIBRARY_OBJ_LVGL_COMPATIBLE_H diff --git a/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_types.h b/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_types.h index 36157d147..c8954b720 100644 --- a/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_types.h +++ b/core/iwasm/lib/app-libs/extension/gui/lvgl-compatible/lv_types.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef WAMR_GRAPHIC_LIBRARY_TYPES_LVGL_COMPATIBLE_H diff --git a/core/iwasm/lib/app-libs/extension/gui/lvgl.h b/core/iwasm/lib/app-libs/extension/gui/lvgl.h index b8eb99cec..8a8a3b7e7 100644 --- a/core/iwasm/lib/app-libs/extension/gui/lvgl.h +++ b/core/iwasm/lib/app-libs/extension/gui/lvgl.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef WAMR_GRAPHIC_LIBRARY_LVGL_COMPATIBLE_H diff --git a/core/iwasm/lib/app-libs/extension/gui/src/wgl_btn.c b/core/iwasm/lib/app-libs/extension/gui/src/wgl_btn.c index 2124892ee..bca1e4c00 100644 --- a/core/iwasm/lib/app-libs/extension/gui/src/wgl_btn.c +++ b/core/iwasm/lib/app-libs/extension/gui/src/wgl_btn.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wgl.h" diff --git a/core/iwasm/lib/app-libs/extension/gui/src/wgl_cb.c b/core/iwasm/lib/app-libs/extension/gui/src/wgl_cb.c index d089b58ab..ef60c2f9e 100644 --- a/core/iwasm/lib/app-libs/extension/gui/src/wgl_cb.c +++ b/core/iwasm/lib/app-libs/extension/gui/src/wgl_cb.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wgl.h" diff --git a/core/iwasm/lib/app-libs/extension/gui/src/wgl_label.c b/core/iwasm/lib/app-libs/extension/gui/src/wgl_label.c index cb45154e8..49019b13f 100644 --- a/core/iwasm/lib/app-libs/extension/gui/src/wgl_label.c +++ b/core/iwasm/lib/app-libs/extension/gui/src/wgl_label.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ diff --git a/core/iwasm/lib/app-libs/extension/gui/src/wgl_list.c b/core/iwasm/lib/app-libs/extension/gui/src/wgl_list.c index 4be3fe6f6..139a28a01 100644 --- a/core/iwasm/lib/app-libs/extension/gui/src/wgl_list.c +++ b/core/iwasm/lib/app-libs/extension/gui/src/wgl_list.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wgl.h" diff --git a/core/iwasm/lib/app-libs/extension/gui/src/wgl_obj.c b/core/iwasm/lib/app-libs/extension/gui/src/wgl_obj.c index 5798ca3dd..e7741edc5 100644 --- a/core/iwasm/lib/app-libs/extension/gui/src/wgl_obj.c +++ b/core/iwasm/lib/app-libs/extension/gui/src/wgl_obj.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wgl.h" diff --git a/core/iwasm/lib/app-libs/extension/gui/wgl.h b/core/iwasm/lib/app-libs/extension/gui/wgl.h index 2f1e79468..4a9266bf3 100644 --- a/core/iwasm/lib/app-libs/extension/gui/wgl.h +++ b/core/iwasm/lib/app-libs/extension/gui/wgl.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef WAMR_GRAPHIC_LIBRARY_H diff --git a/core/iwasm/lib/app-libs/extension/sensor/sensor.c b/core/iwasm/lib/app-libs/extension/sensor/sensor.c index 212b2e166..012479793 100644 --- a/core/iwasm/lib/app-libs/extension/sensor/sensor.c +++ b/core/iwasm/lib/app-libs/extension/sensor/sensor.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "sensor.h" diff --git a/core/iwasm/lib/app-libs/extension/sensor/sensor.h b/core/iwasm/lib/app-libs/extension/sensor/sensor.h index 7aa4cb62e..469349e51 100644 --- a/core/iwasm/lib/app-libs/extension/sensor/sensor.h +++ b/core/iwasm/lib/app-libs/extension/sensor/sensor.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _AEE_SENSOR_H_ diff --git a/core/iwasm/lib/app-libs/libc/lib_base.h b/core/iwasm/lib/app-libs/libc/lib_base.h index 35e4a83d2..4fbb0900a 100644 --- a/core/iwasm/lib/app-libs/libc/lib_base.h +++ b/core/iwasm/lib/app-libs/libc/lib_base.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _LIB_BASE_H_ diff --git a/core/iwasm/lib/native-interface/attr_container.c b/core/iwasm/lib/native-interface/attr_container.c index 535beb635..00bcf23a7 100644 --- a/core/iwasm/lib/native-interface/attr_container.c +++ b/core/iwasm/lib/native-interface/attr_container.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "attr_container.h" diff --git a/core/iwasm/lib/native-interface/attr_container.h b/core/iwasm/lib/native-interface/attr_container.h index 2b093bf0d..52e0ebcc0 100644 --- a/core/iwasm/lib/native-interface/attr_container.h +++ b/core/iwasm/lib/native-interface/attr_container.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _ATTR_CONTAINER_H_ diff --git a/core/iwasm/lib/native-interface/connection_api.h b/core/iwasm/lib/native-interface/connection_api.h index 21142b70a..5697c8361 100644 --- a/core/iwasm/lib/native-interface/connection_api.h +++ b/core/iwasm/lib/native-interface/connection_api.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef CONNECTION_API_H_ diff --git a/core/iwasm/lib/native-interface/gui_api.h b/core/iwasm/lib/native-interface/gui_api.h index 04031c1fa..991b079ee 100644 --- a/core/iwasm/lib/native-interface/gui_api.h +++ b/core/iwasm/lib/native-interface/gui_api.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _GUI_API_H_ diff --git a/core/iwasm/lib/native-interface/native_interface.cmake b/core/iwasm/lib/native-interface/native_interface.cmake index b7d442964..e4c89ac66 100644 --- a/core/iwasm/lib/native-interface/native_interface.cmake +++ b/core/iwasm/lib/native-interface/native_interface.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception set (NATIVE_INTERFACE_DIR ${CMAKE_CURRENT_LIST_DIR}) diff --git a/core/iwasm/lib/native-interface/native_interface.h b/core/iwasm/lib/native-interface/native_interface.h index 74422616f..2fb8e35c9 100644 --- a/core/iwasm/lib/native-interface/native_interface.h +++ b/core/iwasm/lib/native-interface/native_interface.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _NATIVE_INTERFACE_H_ diff --git a/core/iwasm/lib/native-interface/req_resp_api.h b/core/iwasm/lib/native-interface/req_resp_api.h index 8b2235712..cbddab5f7 100644 --- a/core/iwasm/lib/native-interface/req_resp_api.h +++ b/core/iwasm/lib/native-interface/req_resp_api.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _REQ_RESP_API_H_ diff --git a/core/iwasm/lib/native-interface/restful_utils.c b/core/iwasm/lib/native-interface/restful_utils.c index e7afad469..d0ae1b3cb 100644 --- a/core/iwasm/lib/native-interface/restful_utils.c +++ b/core/iwasm/lib/native-interface/restful_utils.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include diff --git a/core/iwasm/lib/native-interface/sensor_api.h b/core/iwasm/lib/native-interface/sensor_api.h index 1adf93b1e..9f6767702 100644 --- a/core/iwasm/lib/native-interface/sensor_api.h +++ b/core/iwasm/lib/native-interface/sensor_api.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _SENSOR_API_H_ diff --git a/core/iwasm/lib/native-interface/shared_utils.h b/core/iwasm/lib/native-interface/shared_utils.h index d07271648..bc49758f8 100644 --- a/core/iwasm/lib/native-interface/shared_utils.h +++ b/core/iwasm/lib/native-interface/shared_utils.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _SHARED_UTILS_H_ diff --git a/core/iwasm/lib/native-interface/timer_api.h b/core/iwasm/lib/native-interface/timer_api.h index 1beabf8e4..0881bab95 100644 --- a/core/iwasm/lib/native-interface/timer_api.h +++ b/core/iwasm/lib/native-interface/timer_api.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _TIMER_API_H_ diff --git a/core/iwasm/lib/native-interface/wgl_shared_utils.h b/core/iwasm/lib/native-interface/wgl_shared_utils.h index 0d64b436b..1163d1b93 100644 --- a/core/iwasm/lib/native-interface/wgl_shared_utils.h +++ b/core/iwasm/lib/native-interface/wgl_shared_utils.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef WAMR_GRAPHIC_LIBRARY_SHARED_UTILS_H diff --git a/core/iwasm/lib/native/base/base_lib_export.c b/core/iwasm/lib/native/base/base_lib_export.c index fb62e7bea..e22f46359 100644 --- a/core/iwasm/lib/native/base/base_lib_export.c +++ b/core/iwasm/lib/native/base/base_lib_export.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include diff --git a/core/iwasm/lib/native/base/base_lib_export.h b/core/iwasm/lib/native/base/base_lib_export.h index c3456b184..db9922ec8 100644 --- a/core/iwasm/lib/native/base/base_lib_export.h +++ b/core/iwasm/lib/native/base/base_lib_export.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _BASE_LIB_EXPORT_H_ diff --git a/core/iwasm/lib/native/base/request_response.c b/core/iwasm/lib/native/base/request_response.c index 7efccb90e..97491e507 100644 --- a/core/iwasm/lib/native/base/request_response.c +++ b/core/iwasm/lib/native/base/request_response.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "app_manager_export.h" diff --git a/core/iwasm/lib/native/base/runtime_lib.h b/core/iwasm/lib/native/base/runtime_lib.h index 972d9df83..ef5aa3af2 100644 --- a/core/iwasm/lib/native/base/runtime_lib.h +++ b/core/iwasm/lib/native/base/runtime_lib.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef LIB_BASE_RUNTIME_LIB_H_ diff --git a/core/iwasm/lib/native/base/timer_wrapper.c b/core/iwasm/lib/native/base/timer_wrapper.c index 7c7e1e057..ce9bacd9a 100644 --- a/core/iwasm/lib/native/base/timer_wrapper.c +++ b/core/iwasm/lib/native/base/timer_wrapper.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "runtime_timer.h" diff --git a/core/iwasm/lib/native/base/wasm_lib_base.cmake b/core/iwasm/lib/native/base/wasm_lib_base.cmake index de80a5784..e7976d0e4 100644 --- a/core/iwasm/lib/native/base/wasm_lib_base.cmake +++ b/core/iwasm/lib/native/base/wasm_lib_base.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception set (WASM_LIB_BASE_DIR ${CMAKE_CURRENT_LIST_DIR}) diff --git a/core/iwasm/lib/native/extension/connection/connection.inl b/core/iwasm/lib/native/extension/connection/connection.inl index e73665093..2956e2696 100644 --- a/core/iwasm/lib/native/extension/connection/connection.inl +++ b/core/iwasm/lib/native/extension/connection/connection.inl @@ -1,18 +1,7 @@ /* -* Copyright (C) 2019 Intel Corporation. All rights reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (C) 2019 Intel Corporation. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + */ EXPORT_WASM_API(wasm_open_connection), EXPORT_WASM_API(wasm_close_connection), diff --git a/core/iwasm/lib/native/extension/connection/connection_lib.h b/core/iwasm/lib/native/extension/connection/connection_lib.h index 15b6d0356..9a09a10bb 100644 --- a/core/iwasm/lib/native/extension/connection/connection_lib.h +++ b/core/iwasm/lib/native/extension/connection/connection_lib.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef CONNECTION_LIB_H_ diff --git a/core/iwasm/lib/native/extension/connection/connection_wrapper.c b/core/iwasm/lib/native/extension/connection/connection_wrapper.c index d74d37ce1..1d408d571 100644 --- a/core/iwasm/lib/native/extension/connection/connection_wrapper.c +++ b/core/iwasm/lib/native/extension/connection/connection_wrapper.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "connection_lib.h" diff --git a/core/iwasm/lib/native/extension/connection/linux/conn_tcp.c b/core/iwasm/lib/native/extension/connection/linux/conn_tcp.c index 3a6bded26..e676e53a0 100644 --- a/core/iwasm/lib/native/extension/connection/linux/conn_tcp.c +++ b/core/iwasm/lib/native/extension/connection/linux/conn_tcp.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "conn_tcp.h" diff --git a/core/iwasm/lib/native/extension/connection/linux/conn_tcp.h b/core/iwasm/lib/native/extension/connection/linux/conn_tcp.h index 84caf2a13..c1b560e32 100644 --- a/core/iwasm/lib/native/extension/connection/linux/conn_tcp.h +++ b/core/iwasm/lib/native/extension/connection/linux/conn_tcp.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef CONN_LINUX_TCP_H_ diff --git a/core/iwasm/lib/native/extension/connection/linux/conn_uart.c b/core/iwasm/lib/native/extension/connection/linux/conn_uart.c index 6ca848b6e..06318c2c3 100644 --- a/core/iwasm/lib/native/extension/connection/linux/conn_uart.c +++ b/core/iwasm/lib/native/extension/connection/linux/conn_uart.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "conn_uart.h" diff --git a/core/iwasm/lib/native/extension/connection/linux/conn_uart.h b/core/iwasm/lib/native/extension/connection/linux/conn_uart.h index 1e67811d6..9d40fb004 100644 --- a/core/iwasm/lib/native/extension/connection/linux/conn_uart.h +++ b/core/iwasm/lib/native/extension/connection/linux/conn_uart.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef CONN_LINUX_UART_H_ diff --git a/core/iwasm/lib/native/extension/connection/linux/conn_udp.c b/core/iwasm/lib/native/extension/connection/linux/conn_udp.c index d93c23f8c..e7093a71c 100644 --- a/core/iwasm/lib/native/extension/connection/linux/conn_udp.c +++ b/core/iwasm/lib/native/extension/connection/linux/conn_udp.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "conn_udp.h" diff --git a/core/iwasm/lib/native/extension/connection/linux/conn_udp.h b/core/iwasm/lib/native/extension/connection/linux/conn_udp.h index f3cbf4b19..37b9db79a 100644 --- a/core/iwasm/lib/native/extension/connection/linux/conn_udp.h +++ b/core/iwasm/lib/native/extension/connection/linux/conn_udp.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef CONN_LINUX_UDP_H_ diff --git a/core/iwasm/lib/native/extension/connection/linux/connection_mgr.c b/core/iwasm/lib/native/extension/connection/linux/connection_mgr.c index ad1f68c42..786906668 100644 --- a/core/iwasm/lib/native/extension/connection/linux/connection_mgr.c +++ b/core/iwasm/lib/native/extension/connection/linux/connection_mgr.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ /* @@ -28,7 +17,6 @@ #include "conn_tcp.h" #include "conn_udp.h" #include "conn_uart.h" -#include "bh_definition.h" #include #include @@ -545,7 +533,7 @@ bool init_connection_framework() if (epollfd == -1) return false; - if (vm_mutex_init(&g_lock) != BH_SUCCESS) { + if (vm_mutex_init(&g_lock) != 0) { close(epollfd); return false; } @@ -562,7 +550,7 @@ bool init_connection_framework() if (vm_thread_create(&tid, polling_thread_routine, NULL, - BH_APPLET_PRESERVED_STACK_SIZE) != BH_SUCCESS) { + BH_APPLET_PRESERVED_STACK_SIZE) != 0) { goto fail; } diff --git a/core/iwasm/lib/native/extension/connection/linux/connection_mgr.cmake b/core/iwasm/lib/native/extension/connection/linux/connection_mgr.cmake index 72ab4554d..c8f2b487e 100644 --- a/core/iwasm/lib/native/extension/connection/linux/connection_mgr.cmake +++ b/core/iwasm/lib/native/extension/connection/linux/connection_mgr.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception set (WASM_LIB_CONN_MGR_DIR ${CMAKE_CURRENT_LIST_DIR}) diff --git a/core/iwasm/lib/native/extension/connection/wasm_lib_conn.cmake b/core/iwasm/lib/native/extension/connection/wasm_lib_conn.cmake index 2018706e8..66582c92d 100644 --- a/core/iwasm/lib/native/extension/connection/wasm_lib_conn.cmake +++ b/core/iwasm/lib/native/extension/connection/wasm_lib_conn.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception set (WASM_LIB_CONN_DIR ${CMAKE_CURRENT_LIST_DIR}) diff --git a/core/iwasm/lib/native/extension/connection/zephyr/connection_lib_impl.c b/core/iwasm/lib/native/extension/connection/zephyr/connection_lib_impl.c index 379437076..9c30edcaf 100644 --- a/core/iwasm/lib/native/extension/connection/zephyr/connection_lib_impl.c +++ b/core/iwasm/lib/native/extension/connection/zephyr/connection_lib_impl.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ /* diff --git a/core/iwasm/lib/native/extension/gui/wamr_gui.inl b/core/iwasm/lib/native/extension/gui/wamr_gui.inl index 49ce5bff2..908a19155 100644 --- a/core/iwasm/lib/native/extension/gui/wamr_gui.inl +++ b/core/iwasm/lib/native/extension/gui/wamr_gui.inl @@ -1,18 +1,7 @@ /* -* Copyright (C) 2019 Intel Corporation. All rights reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (C) 2019 Intel Corporation. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + */ /* button */ EXPORT_WASM_API(wasm_btn_native_call), diff --git a/core/iwasm/lib/native/extension/gui/wasm_lib_gui.cmake b/core/iwasm/lib/native/extension/gui/wasm_lib_gui.cmake index d8af8c9e0..3658cd442 100644 --- a/core/iwasm/lib/native/extension/gui/wasm_lib_gui.cmake +++ b/core/iwasm/lib/native/extension/gui/wasm_lib_gui.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception set (WASM_LIB_GUI_DIR ${CMAKE_CURRENT_LIST_DIR}) diff --git a/core/iwasm/lib/native/extension/gui/wgl_btn_wrapper.c b/core/iwasm/lib/native/extension/gui/wgl_btn_wrapper.c index 9b5c85a9d..5abd7578a 100644 --- a/core/iwasm/lib/native/extension/gui/wgl_btn_wrapper.c +++ b/core/iwasm/lib/native/extension/gui/wgl_btn_wrapper.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "native_interface.h" diff --git a/core/iwasm/lib/native/extension/gui/wgl_cb_wrapper.c b/core/iwasm/lib/native/extension/gui/wgl_cb_wrapper.c index 90abbc409..4f238afdc 100644 --- a/core/iwasm/lib/native/extension/gui/wgl_cb_wrapper.c +++ b/core/iwasm/lib/native/extension/gui/wgl_cb_wrapper.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "lvgl.h" diff --git a/core/iwasm/lib/native/extension/gui/wgl_cont_wrapper.c b/core/iwasm/lib/native/extension/gui/wgl_cont_wrapper.c index 709ed753f..70eeb0f48 100644 --- a/core/iwasm/lib/native/extension/gui/wgl_cont_wrapper.c +++ b/core/iwasm/lib/native/extension/gui/wgl_cont_wrapper.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "lvgl.h" diff --git a/core/iwasm/lib/native/extension/gui/wgl_label_wrapper.c b/core/iwasm/lib/native/extension/gui/wgl_label_wrapper.c index 0a7062ded..a844b7245 100644 --- a/core/iwasm/lib/native/extension/gui/wgl_label_wrapper.c +++ b/core/iwasm/lib/native/extension/gui/wgl_label_wrapper.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "lvgl.h" diff --git a/core/iwasm/lib/native/extension/gui/wgl_list_wrapper.c b/core/iwasm/lib/native/extension/gui/wgl_list_wrapper.c index df9ba3d39..8e6c601dc 100644 --- a/core/iwasm/lib/native/extension/gui/wgl_list_wrapper.c +++ b/core/iwasm/lib/native/extension/gui/wgl_list_wrapper.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "native_interface.h" diff --git a/core/iwasm/lib/native/extension/gui/wgl_obj_wrapper.c b/core/iwasm/lib/native/extension/gui/wgl_obj_wrapper.c index cd15dab2d..14bad3a2d 100644 --- a/core/iwasm/lib/native/extension/gui/wgl_obj_wrapper.c +++ b/core/iwasm/lib/native/extension/gui/wgl_obj_wrapper.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "lvgl.h" diff --git a/core/iwasm/lib/native/extension/sensor/runtime_sensor.c b/core/iwasm/lib/native/extension/sensor/runtime_sensor.c index 3dd0cf624..1a01993c9 100644 --- a/core/iwasm/lib/native/extension/sensor/runtime_sensor.c +++ b/core/iwasm/lib/native/extension/sensor/runtime_sensor.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "runtime_sensor.h" diff --git a/core/iwasm/lib/native/extension/sensor/runtime_sensor.h b/core/iwasm/lib/native/extension/sensor/runtime_sensor.h index f19b4f09d..2ba4859e7 100644 --- a/core/iwasm/lib/native/extension/sensor/runtime_sensor.h +++ b/core/iwasm/lib/native/extension/sensor/runtime_sensor.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef LIB_EXTENSION_RUNTIME_SENSOR_H_ diff --git a/core/iwasm/lib/native/extension/sensor/runtime_sensor.inl b/core/iwasm/lib/native/extension/sensor/runtime_sensor.inl index ea8a6d3a8..1b7af765b 100644 --- a/core/iwasm/lib/native/extension/sensor/runtime_sensor.inl +++ b/core/iwasm/lib/native/extension/sensor/runtime_sensor.inl @@ -1,18 +1,7 @@ /* -* Copyright (C) 2019 Intel Corporation. All rights reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright (C) 2019 Intel Corporation. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + */ EXPORT_WASM_API(wasm_sensor_open), EXPORT_WASM_API(wasm_sensor_config), diff --git a/core/iwasm/lib/native/extension/sensor/sensor_mgr_ref.c b/core/iwasm/lib/native/extension/sensor/sensor_mgr_ref.c index a50931352..adac713df 100644 --- a/core/iwasm/lib/native/extension/sensor/sensor_mgr_ref.c +++ b/core/iwasm/lib/native/extension/sensor/sensor_mgr_ref.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_common.h" diff --git a/core/iwasm/lib/native/extension/sensor/wasm_lib_sensor.cmake b/core/iwasm/lib/native/extension/sensor/wasm_lib_sensor.cmake index 9461f841b..49ce5564c 100644 --- a/core/iwasm/lib/native/extension/sensor/wasm_lib_sensor.cmake +++ b/core/iwasm/lib/native/extension/sensor/wasm_lib_sensor.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception set (WASM_LIB_SENSOR_DIR ${CMAKE_CURRENT_LIST_DIR}) diff --git a/core/iwasm/lib/native/extension/template/lib_export_template.c b/core/iwasm/lib/native/extension/template/lib_export_template.c index 6becf41c5..35159728b 100644 --- a/core/iwasm/lib/native/extension/template/lib_export_template.c +++ b/core/iwasm/lib/native/extension/template/lib_export_template.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include diff --git a/core/iwasm/lib/native/libc/libc_wrapper.c b/core/iwasm/lib/native/libc/libc_wrapper.c index 4127f4f4d..22f848f70 100644 --- a/core/iwasm/lib/native/libc/libc_wrapper.c +++ b/core/iwasm/lib/native/libc/libc_wrapper.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wasm_native.h" diff --git a/core/iwasm/lib/native/libc/wasm_libc.cmake b/core/iwasm/lib/native/libc/wasm_libc.cmake index 52e55123f..f84c3ac63 100644 --- a/core/iwasm/lib/native/libc/wasm_libc.cmake +++ b/core/iwasm/lib/native/libc/wasm_libc.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception set (WASM_LIBC_DIR ${CMAKE_CURRENT_LIST_DIR}) diff --git a/core/iwasm/products/alios-things/iwasm.mk b/core/iwasm/products/alios-things/iwasm.mk index 803578c15..297738129 100644 --- a/core/iwasm/products/alios-things/iwasm.mk +++ b/core/iwasm/products/alios-things/iwasm.mk @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception NAME := iwasm IWASM_ROOT := iwasm diff --git a/core/iwasm/products/alios-things/src/ext_lib_export.c b/core/iwasm/products/alios-things/src/ext_lib_export.c index 8d78f3ae1..8813f0dbf 100644 --- a/core/iwasm/products/alios-things/src/ext_lib_export.c +++ b/core/iwasm/products/alios-things/src/ext_lib_export.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "lib_export.h" diff --git a/core/iwasm/products/alios-things/src/main.c b/core/iwasm/products/alios-things/src/main.c index 336247856..e4f42f1c5 100644 --- a/core/iwasm/products/alios-things/src/main.c +++ b/core/iwasm/products/alios-things/src/main.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include diff --git a/core/iwasm/products/alios-things/src/test_wasm.h b/core/iwasm/products/alios-things/src/test_wasm.h index aa9572b0c..a2f12706e 100644 --- a/core/iwasm/products/alios-things/src/test_wasm.h +++ b/core/iwasm/products/alios-things/src/test_wasm.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ unsigned char wasm_test_file[] = { 0x00, 0x61, 0x73, 0x6D, 0x01, 0x00, 0x00, diff --git a/core/iwasm/products/darwin/CMakeLists.txt b/core/iwasm/products/darwin/CMakeLists.txt index a88b155ac..868ba37aa 100644 --- a/core/iwasm/products/darwin/CMakeLists.txt +++ b/core/iwasm/products/darwin/CMakeLists.txt @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception cmake_minimum_required (VERSION 2.8) @@ -22,32 +11,59 @@ set (PLATFORM "darwin") set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") set (CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") -# Enable repl mode if want to test spec cases -# add_definitions(-DWASM_ENABLE_REPL) - if (NOT ("$ENV{VALGRIND}" STREQUAL "YES")) add_definitions(-DNVALGRIND) endif () -# Currently build as 64-bit by default. -set (BUILD_AS_64BIT_SUPPORT "YES") +# Set BUILD_TARGET, currently values supported: +# "X86_64", "AMD_64", "X86_32", "ARM_32", "MIPS_32", "XTENSA_32" +if (NOT BUILD_TARGET) + if (CMAKE_SIZEOF_VOID_P EQUAL 8) + # Build as X86_64 by default in 64-bit platform + set (BUILD_TARGET "X86_64") + else () + # Build as X86_32 by default in 32-bit platform + set (BUILD_TARGET "X86_32") + endif () +endif () + +string(TOUPPER ${BUILD_TARGET} BUILD_TARGET) + +# Add definitions for the build target +if (BUILD_TARGET STREQUAL "X86_64") + add_definitions(-DBUILD_TARGET_X86_64) +elseif (BUILD_TARGET STREQUAL "AMD_64") + add_definitions(-DBUILD_TARGET_AMD_64) +elseif (BUILD_TARGET STREQUAL "X86_32") + add_definitions(-DBUILD_TARGET_X86_32) +elseif (BUILD_TARGET STREQUAL "ARM_32") + add_definitions(-DBUILD_TARGET_ARM_32) +elseif (BUILD_TARGET STREQUAL "MIPS_32") + add_definitions(-DBUILD_TARGET_MIPS_32) +elseif (BUILD_TARGET STREQUAL "XTENSA_32") + add_definitions(-DBUILD_TARGET_XTENSA_32) +else () + message (FATAL_ERROR "-- Build target isn't set") +endif () + +message ("-- Build as target ${BUILD_TARGET}") if (CMAKE_SIZEOF_VOID_P EQUAL 8) -if (${BUILD_AS_64BIT_SUPPORT} STREQUAL "YES") - # Add -fPIC flag if build as 64-bit - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") - set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -fPIC") -else () - add_definitions (-m32) - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32") - set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32") -endif () + if (BUILD_TARGET STREQUAL "X86_64" OR BUILD_TARGET STREQUAL "AMD_64") + # Add -fPIC flag if build as 64-bit + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") + set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -fPIC") + else () + add_definitions (-m32) + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32") + set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32") + endif () endif () if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif (NOT CMAKE_BUILD_TYPE) -message ("CMAKE_BUILD_TYPE = " ${CMAKE_BUILD_TYPE}) +message ("-- CMAKE_BUILD_TYPE = " ${CMAKE_BUILD_TYPE}) set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections -Wall -Wno-unused-parameter -Wno-pedantic") diff --git a/core/iwasm/products/darwin/ext_lib_export.c b/core/iwasm/products/darwin/ext_lib_export.c index 8d78f3ae1..8813f0dbf 100644 --- a/core/iwasm/products/darwin/ext_lib_export.c +++ b/core/iwasm/products/darwin/ext_lib_export.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "lib_export.h" diff --git a/core/iwasm/products/darwin/main.c b/core/iwasm/products/darwin/main.c index 65f464c0b..f6b04c0e0 100644 --- a/core/iwasm/products/darwin/main.c +++ b/core/iwasm/products/darwin/main.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _GNU_SOURCE diff --git a/core/iwasm/products/linux-sgx/CMakeLists.txt b/core/iwasm/products/linux-sgx/CMakeLists.txt index 4d590a8ef..698abfac8 100644 --- a/core/iwasm/products/linux-sgx/CMakeLists.txt +++ b/core/iwasm/products/linux-sgx/CMakeLists.txt @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception cmake_minimum_required (VERSION 2.8) @@ -28,32 +17,50 @@ add_definitions(-DOPS_UNSAFE_BUFFERS=0) add_definitions(-DWASM_ENABLE_LOG=0) add_definitions(-Dbh_printf=bh_printf_sgx) -# Enable repl mode if want to test spec cases -# add_definitions(-DWASM_ENABLE_REPL) - if (NOT ("$ENV{VALGRIND}" STREQUAL "YES")) add_definitions(-DNVALGRIND) endif () -# Currently build as 64-bit by default. -set (BUILD_AS_64BIT_SUPPORT "YES") +# Set BUILD_TARGET, currently values supported: +if (NOT BUILD_TARGET) + if (CMAKE_SIZEOF_VOID_P EQUAL 8) + # Build as X86_64 by default in 64-bit platform + set (BUILD_TARGET "X86_64") + else () + # Build as X86_32 by default in 32-bit platform + set (BUILD_TARGET "X86_32") + endif () +endif () -if (CMAKE_SIZEOF_VOID_P EQUAL 8) -if (${BUILD_AS_64BIT_SUPPORT} STREQUAL "YES") - # Add -fPIC flag if build as 64-bit - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") - set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -fPIC") +string(TOUPPER ${BUILD_TARGET} BUILD_TARGET) + +# Add definitions for the build target +if (BUILD_TARGET STREQUAL "X86_64") + add_definitions(-DBUILD_TARGET_X86_64) +elseif (BUILD_TARGET STREQUAL "X86_32") + add_definitions(-DBUILD_TARGET_X86_32) else () - add_definitions (-m32) - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32") - set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32") -endif () + message (FATAL_ERROR "-- Build target isn't set") endif () +message ("-- Build as target ${BUILD_TARGET}") + if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif (NOT CMAKE_BUILD_TYPE) -message ("CMAKE_BUILD_TYPE = " ${CMAKE_BUILD_TYPE}) +message ("-- CMAKE_BUILD_TYPE = " ${CMAKE_BUILD_TYPE}) + +if (CMAKE_SIZEOF_VOID_P EQUAL 8) + if (BUILD_TARGET STREQUAL "X86_64") + # Add -fPIC flag if build as 64-bit + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") + set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -fPIC") + else () + add_definitions (-m32) + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32") + set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32") + endif () +endif () set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections -Wall -Wno-unused-parameter -Wno-pedantic") diff --git a/core/iwasm/products/linux-sgx/ext_lib_export.c b/core/iwasm/products/linux-sgx/ext_lib_export.c index 8d78f3ae1..8813f0dbf 100644 --- a/core/iwasm/products/linux-sgx/ext_lib_export.c +++ b/core/iwasm/products/linux-sgx/ext_lib_export.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "lib_export.h" diff --git a/core/iwasm/products/linux/CMakeLists.txt b/core/iwasm/products/linux/CMakeLists.txt index 6e8936707..ab36f22e8 100644 --- a/core/iwasm/products/linux/CMakeLists.txt +++ b/core/iwasm/products/linux/CMakeLists.txt @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception cmake_minimum_required (VERSION 2.8) @@ -22,32 +11,59 @@ set (PLATFORM "linux") set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") set (CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") -# Enable repl mode if want to test spec cases -# add_definitions(-DWASM_ENABLE_REPL) - if (NOT ("$ENV{VALGRIND}" STREQUAL "YES")) add_definitions(-DNVALGRIND) endif () -# Currently build as 64-bit by default. -set (BUILD_AS_64BIT_SUPPORT "YES") +# Set BUILD_TARGET, currently values supported: +# "X86_64", "AMD_64", "X86_32", "ARM_32", "MIPS_32", "XTENSA_32" +if (NOT BUILD_TARGET) + if (CMAKE_SIZEOF_VOID_P EQUAL 8) + # Build as X86_64 by default in 64-bit platform + set (BUILD_TARGET "X86_64") + else () + # Build as X86_32 by default in 32-bit platform + set (BUILD_TARGET "X86_32") + endif () +endif () + +string(TOUPPER ${BUILD_TARGET} BUILD_TARGET) + +# Add definitions for the build target +if (BUILD_TARGET STREQUAL "X86_64") + add_definitions(-DBUILD_TARGET_X86_64) +elseif (BUILD_TARGET STREQUAL "AMD_64") + add_definitions(-DBUILD_TARGET_AMD_64) +elseif (BUILD_TARGET STREQUAL "X86_32") + add_definitions(-DBUILD_TARGET_X86_32) +elseif (BUILD_TARGET STREQUAL "ARM_32") + add_definitions(-DBUILD_TARGET_ARM_32) +elseif (BUILD_TARGET STREQUAL "MIPS_32") + add_definitions(-DBUILD_TARGET_MIPS_32) +elseif (BUILD_TARGET STREQUAL "XTENSA_32") + add_definitions(-DBUILD_TARGET_XTENSA_32) +else () + message (FATAL_ERROR "-- Build target isn't set") +endif () + +message ("-- Build as target ${BUILD_TARGET}") if (CMAKE_SIZEOF_VOID_P EQUAL 8) -if (${BUILD_AS_64BIT_SUPPORT} STREQUAL "YES") - # Add -fPIC flag if build as 64-bit - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") - set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -fPIC") -else () - add_definitions (-m32) - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32") - set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32") -endif () + if (BUILD_TARGET STREQUAL "X86_64" OR BUILD_TARGET STREQUAL "AMD_64") + # Add -fPIC flag if build as 64-bit + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") + set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -fPIC") + else () + add_definitions (-m32) + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32") + set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32") + endif () endif () if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif (NOT CMAKE_BUILD_TYPE) -message ("CMAKE_BUILD_TYPE = " ${CMAKE_BUILD_TYPE}) +message ("-- CMAKE_BUILD_TYPE = " ${CMAKE_BUILD_TYPE}) set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections -Wall -Wno-unused-parameter -Wno-pedantic") diff --git a/core/iwasm/products/linux/ext_lib_export.c b/core/iwasm/products/linux/ext_lib_export.c index 8d78f3ae1..8813f0dbf 100644 --- a/core/iwasm/products/linux/ext_lib_export.c +++ b/core/iwasm/products/linux/ext_lib_export.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "lib_export.h" diff --git a/core/iwasm/products/linux/main.c b/core/iwasm/products/linux/main.c index 86c6e5e75..481e8365c 100644 --- a/core/iwasm/products/linux/main.c +++ b/core/iwasm/products/linux/main.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _GNU_SOURCE diff --git a/core/iwasm/products/vxworks/CMakeLists.txt b/core/iwasm/products/vxworks/CMakeLists.txt index d8019e981..20e2fcf10 100644 --- a/core/iwasm/products/vxworks/CMakeLists.txt +++ b/core/iwasm/products/vxworks/CMakeLists.txt @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception cmake_minimum_required (VERSION 2.8) @@ -27,32 +16,71 @@ SET(CMAKE_RANLIB vx-ranlib) set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") set (CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") -# Enable repl mode if want to test spec cases -# add_definitions(-DWASM_ENABLE_REPL) - if (NOT ("$ENV{VALGRIND}" STREQUAL "YES")) add_definitions(-DNVALGRIND) endif () -# Currently build as 64-bit by default. -set (BUILD_AS_64BIT_SUPPORT "YES") +# Set BUILD_TARGET, currently values supported: +# "X86_64", "AMD_64", "X86_32", "ARM_32", "MIPS_32", "XTENSA_32", "GENERAL" +#set (BUILD_TARGET "X86_64") + +if (NOT BUILD_TARGET) + if (CMAKE_SIZEOF_VOID_P EQUAL 8) + # Build as X86_64 by default in 64-bit platform + # if BUILD_TARGET isn't set + set (BUILD_TARGET "X86_64") + else () + # Build as X86_32 by default in 32-bit platform + # if BUILD_TARGET isn't set + set (BUILD_TARGET "X86_32") + endif () +endif () + +string(TOUPPER ${BUILD_TARGET} BUILD_TARGET) + +# Add definitions for the build target +if (BUILD_TARGET STREQUAL "X86_64") + add_definitions(-DBUILD_TARGET_X86_64) +elseif (BUILD_TARGET STREQUAL "AMD_64") + add_definitions(-DBUILD_TARGET_AMD_64) +elseif (BUILD_TARGET STREQUAL "X86_32") + add_definitions(-DBUILD_TARGET_X86_32) +elseif (BUILD_TARGET STREQUAL "ARM_32") + add_definitions(-DBUILD_TARGET_ARM_32) +elseif (BUILD_TARGET STREQUAL "MIPS_32") + add_definitions(-DBUILD_TARGET_MIPS_32) +elseif (BUILD_TARGET STREQUAL "XTENSA_32") + add_definitions(-DBUILD_TARGET_XTENSA_32) +elseif (BUILD_TARGET STREQUAL "GENERAL") + # Will use invokeNative_general.c instead of assembly code, + # but the maximum number of native arguments is limited to 20, + # and there are possible issues when passing arguments to + # native function for some cpus, e.g. int64 and double arguments + # in arm and mips need to be 8-bytes aligned, and some arguments + # of x86_64 are passed by registers but not stack + add_definitions(-DBUILD_TARGET_GENERAL) +else () + message (FATAL_ERROR "-- Build target isn't set") +endif () + +message ("-- Build as target ${BUILD_TARGET}") if (CMAKE_SIZEOF_VOID_P EQUAL 8) -if (${BUILD_AS_64BIT_SUPPORT} STREQUAL "YES") - # Add -fPIC flag if build as 64-bit - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") - set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -fPIC") -else () - add_definitions (-m32) - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32") - set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32") -endif () + if (BUILD_TARGET STREQUAL "X86_64" OR BUILD_TARGET STREQUAL "AMD_64") + # Add -fPIC flag if build as 64-bit + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") + set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -fPIC") + else () + add_definitions (-m32) + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32") + set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32") + endif () endif () if (NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif (NOT CMAKE_BUILD_TYPE) -message ("CMAKE_BUILD_TYPE = " ${CMAKE_BUILD_TYPE}) +message ("-- CMAKE_BUILD_TYPE = " ${CMAKE_BUILD_TYPE}) set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections -Wall -Wno-unused-parameter -Wno-pedantic") @@ -64,6 +92,8 @@ include_directories (. ../../runtime/platform/include ${SHARED_LIB_DIR}/include) +enable_language (ASM) + include (../../runtime/platform/${PLATFORM}/platform.cmake) include (../../runtime/utils/utils.cmake) include (../../runtime/vmcore-wasm/vmcore.cmake) diff --git a/core/iwasm/products/vxworks/ext_lib_export.c b/core/iwasm/products/vxworks/ext_lib_export.c index 8d78f3ae1..8813f0dbf 100644 --- a/core/iwasm/products/vxworks/ext_lib_export.c +++ b/core/iwasm/products/vxworks/ext_lib_export.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "lib_export.h" diff --git a/core/iwasm/products/vxworks/main.c b/core/iwasm/products/vxworks/main.c index a1a503f31..df8513be2 100644 --- a/core/iwasm/products/vxworks/main.c +++ b/core/iwasm/products/vxworks/main.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _GNU_SOURCE @@ -19,9 +8,9 @@ #endif #include #include +#include "bh_platform.h" #include "wasm_assert.h" #include "wasm_log.h" -#include "wasm_platform.h" #include "wasm_platform_log.h" #include "wasm_thread.h" #include "wasm_export.h" diff --git a/core/iwasm/products/zephyr/simple/CMakeLists.txt b/core/iwasm/products/zephyr/simple/CMakeLists.txt index 0363741ba..1ba22bff6 100644 --- a/core/iwasm/products/zephyr/simple/CMakeLists.txt +++ b/core/iwasm/products/zephyr/simple/CMakeLists.txt @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception cmake_minimum_required(VERSION 3.8.2) @@ -21,6 +10,28 @@ enable_language (ASM) add_definitions (-DNVALGRIND) +# Build as X86_32 by default, change to "ARM_32", "MIPS_32" or "XTENSA_32" +# if we want to support arm, mips or xtensa +if (NOT BUILD_TARGET) + set (BUILD_TARGET "X86_32") +endif () + +string(TOUPPER ${BUILD_TARGET} BUILD_TARGET) + +if (BUILD_TARGET STREQUAL "X86_32") + add_definitions(-DBUILD_TARGET_X86_32) +elseif (BUILD_TARGET STREQUAL "ARM_32") + add_definitions(-DBUILD_TARGET_ARM_32) +elseif (BUILD_TARGET STREQUAL "MIPS_32") + add_definitions(-DBUILD_TARGET_MIPS_32) +elseif (BUILD_TARGET STREQUAL "XTENSA_32") + add_definitions(-DBUILD_TARGET_XTENSA_32) +else () + message (FATAL_ERROR "-- Build target isn't set") +endif () + +message ("-- Build as target ${BUILD_TARGET}") + set (IWASM_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/iwasm) set (SHARED_LIB_ROOT ${IWASM_ROOT}/../shared-lib) diff --git a/core/iwasm/products/zephyr/simple/src/ext_lib_export.c b/core/iwasm/products/zephyr/simple/src/ext_lib_export.c index 8d78f3ae1..8813f0dbf 100644 --- a/core/iwasm/products/zephyr/simple/src/ext_lib_export.c +++ b/core/iwasm/products/zephyr/simple/src/ext_lib_export.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "lib_export.h" diff --git a/core/iwasm/products/zephyr/simple/src/main.c b/core/iwasm/products/zephyr/simple/src/main.c index da85a3bba..42e21d107 100644 --- a/core/iwasm/products/zephyr/simple/src/main.c +++ b/core/iwasm/products/zephyr/simple/src/main.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include diff --git a/core/iwasm/products/zephyr/simple/src/test_wasm.h b/core/iwasm/products/zephyr/simple/src/test_wasm.h index aa9572b0c..a2f12706e 100644 --- a/core/iwasm/products/zephyr/simple/src/test_wasm.h +++ b/core/iwasm/products/zephyr/simple/src/test_wasm.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ unsigned char wasm_test_file[] = { 0x00, 0x61, 0x73, 0x6D, 0x01, 0x00, 0x00, diff --git a/core/iwasm/runtime/include/bh_memory.h b/core/iwasm/runtime/include/bh_memory.h index 352137a34..b2c091d2f 100644 --- a/core/iwasm/runtime/include/bh_memory.h +++ b/core/iwasm/runtime/include/bh_memory.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _BH_MEMORY_H diff --git a/core/iwasm/runtime/include/ext_lib_export.h b/core/iwasm/runtime/include/ext_lib_export.h index a2f111fcc..fbf8d17d4 100644 --- a/core/iwasm/runtime/include/ext_lib_export.h +++ b/core/iwasm/runtime/include/ext_lib_export.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _EXT_LIB_EXPORT_H_ diff --git a/core/iwasm/runtime/include/lib_export.h b/core/iwasm/runtime/include/lib_export.h index e5eb6b7ee..2d3de1722 100644 --- a/core/iwasm/runtime/include/lib_export.h +++ b/core/iwasm/runtime/include/lib_export.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _LIB_EXPORT_H_ diff --git a/core/iwasm/runtime/include/wasm_application.h b/core/iwasm/runtime/include/wasm_application.h index 31813b2ee..635ed26d3 100644 --- a/core/iwasm/runtime/include/wasm_application.h +++ b/core/iwasm/runtime/include/wasm_application.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Taobao (China) Inc. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _WASM_APPLICATION_H diff --git a/core/iwasm/runtime/include/wasm_dlfcn.h b/core/iwasm/runtime/include/wasm_dlfcn.h index ce45de2b1..eeddef61c 100644 --- a/core/iwasm/runtime/include/wasm_dlfcn.h +++ b/core/iwasm/runtime/include/wasm_dlfcn.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _WASM_DLFCN_H diff --git a/core/iwasm/runtime/include/wasm_export.h b/core/iwasm/runtime/include/wasm_export.h index 2322cc579..98be2c915 100644 --- a/core/iwasm/runtime/include/wasm_export.h +++ b/core/iwasm/runtime/include/wasm_export.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _WASM_EXPORT_H diff --git a/core/iwasm/runtime/include/wasm_hashmap.h b/core/iwasm/runtime/include/wasm_hashmap.h index f90c0cc1d..93988810d 100644 --- a/core/iwasm/runtime/include/wasm_hashmap.h +++ b/core/iwasm/runtime/include/wasm_hashmap.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef WASM_HASHMAP_H diff --git a/core/iwasm/runtime/include/wasm_log.h b/core/iwasm/runtime/include/wasm_log.h index cba03b044..38243803c 100644 --- a/core/iwasm/runtime/include/wasm_log.h +++ b/core/iwasm/runtime/include/wasm_log.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ /** diff --git a/core/iwasm/runtime/include/wasm_vector.h b/core/iwasm/runtime/include/wasm_vector.h index e11832ede..a18588c4d 100644 --- a/core/iwasm/runtime/include/wasm_vector.h +++ b/core/iwasm/runtime/include/wasm_vector.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _WASM_VECTOR_H diff --git a/core/iwasm/runtime/platform/alios/wasm_native.c b/core/iwasm/runtime/platform/alios/wasm_native.c index 43276fe6e..70f87d38a 100644 --- a/core/iwasm/runtime/platform/alios/wasm_native.c +++ b/core/iwasm/runtime/platform/alios/wasm_native.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wasm_native.h" diff --git a/core/iwasm/runtime/platform/darwin/platform.cmake b/core/iwasm/runtime/platform/darwin/platform.cmake index ea7f7497e..887a4fc5e 100644 --- a/core/iwasm/runtime/platform/darwin/platform.cmake +++ b/core/iwasm/runtime/platform/darwin/platform.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception add_definitions (-D__POSIX__ -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=200809L) diff --git a/core/iwasm/runtime/platform/darwin/wasm_native.c b/core/iwasm/runtime/platform/darwin/wasm_native.c index 8feb8412b..fc3303eae 100644 --- a/core/iwasm/runtime/platform/darwin/wasm_native.c +++ b/core/iwasm/runtime/platform/darwin/wasm_native.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wasm_native.h" diff --git a/core/iwasm/runtime/platform/include/wa_thread.h b/core/iwasm/runtime/platform/include/wa_thread.h index 245dc5d63..2873bc821 100644 --- a/core/iwasm/runtime/platform/include/wa_thread.h +++ b/core/iwasm/runtime/platform/include/wa_thread.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ /** diff --git a/core/iwasm/runtime/platform/include/wasm_assert.h b/core/iwasm/runtime/platform/include/wasm_assert.h index 687c8e590..f0f8b0dc7 100644 --- a/core/iwasm/runtime/platform/include/wasm_assert.h +++ b/core/iwasm/runtime/platform/include/wasm_assert.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _WASM_ASSERT_H diff --git a/core/iwasm/runtime/platform/include/wasm_config.h b/core/iwasm/runtime/platform/include/wasm_config.h index 06aa5e107..bb2732570 100644 --- a/core/iwasm/runtime/platform/include/wasm_config.h +++ b/core/iwasm/runtime/platform/include/wasm_config.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _WASM_CONFIG_H diff --git a/core/iwasm/runtime/platform/include/wasm_memory.h b/core/iwasm/runtime/platform/include/wasm_memory.h index 549ba4768..b1f04a200 100644 --- a/core/iwasm/runtime/platform/include/wasm_memory.h +++ b/core/iwasm/runtime/platform/include/wasm_memory.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _WASM_MEMORY_H diff --git a/core/iwasm/runtime/platform/include/wasm_platform_log.h b/core/iwasm/runtime/platform/include/wasm_platform_log.h index e74de3ff2..489838409 100644 --- a/core/iwasm/runtime/platform/include/wasm_platform_log.h +++ b/core/iwasm/runtime/platform/include/wasm_platform_log.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _WASM_PLATFORM_LOG diff --git a/core/iwasm/runtime/platform/linux-sgx/platform.cmake b/core/iwasm/runtime/platform/linux-sgx/platform.cmake index c01fd0e57..e687f8305 100644 --- a/core/iwasm/runtime/platform/linux-sgx/platform.cmake +++ b/core/iwasm/runtime/platform/linux-sgx/platform.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception add_definitions (-D__POSIX__ -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199309L) diff --git a/core/iwasm/runtime/platform/linux-sgx/wasm_native.c b/core/iwasm/runtime/platform/linux-sgx/wasm_native.c index b8d64b08c..40e70e15c 100644 --- a/core/iwasm/runtime/platform/linux-sgx/wasm_native.c +++ b/core/iwasm/runtime/platform/linux-sgx/wasm_native.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _GNU_SOURCE diff --git a/core/iwasm/runtime/platform/linux/platform.cmake b/core/iwasm/runtime/platform/linux/platform.cmake index c01fd0e57..e687f8305 100644 --- a/core/iwasm/runtime/platform/linux/platform.cmake +++ b/core/iwasm/runtime/platform/linux/platform.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception add_definitions (-D__POSIX__ -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199309L) diff --git a/core/iwasm/runtime/platform/linux/wasm_native.c b/core/iwasm/runtime/platform/linux/wasm_native.c index 638f57344..22c68151c 100644 --- a/core/iwasm/runtime/platform/linux/wasm_native.c +++ b/core/iwasm/runtime/platform/linux/wasm_native.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _GNU_SOURCE diff --git a/core/iwasm/runtime/platform/vxworks/platform.cmake b/core/iwasm/runtime/platform/vxworks/platform.cmake index c01fd0e57..e687f8305 100644 --- a/core/iwasm/runtime/platform/vxworks/platform.cmake +++ b/core/iwasm/runtime/platform/vxworks/platform.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception add_definitions (-D__POSIX__ -D_XOPEN_SOURCE=600 -D_POSIX_C_SOURCE=199309L) diff --git a/core/iwasm/runtime/platform/vxworks/wasm_native.c b/core/iwasm/runtime/platform/vxworks/wasm_native.c index 43276fe6e..70f87d38a 100644 --- a/core/iwasm/runtime/platform/vxworks/wasm_native.c +++ b/core/iwasm/runtime/platform/vxworks/wasm_native.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wasm_native.h" diff --git a/core/iwasm/runtime/platform/zephyr/wasm_native.c b/core/iwasm/runtime/platform/zephyr/wasm_native.c index 43276fe6e..70f87d38a 100644 --- a/core/iwasm/runtime/platform/zephyr/wasm_native.c +++ b/core/iwasm/runtime/platform/zephyr/wasm_native.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wasm_native.h" diff --git a/core/iwasm/runtime/utils/utils.cmake b/core/iwasm/runtime/utils/utils.cmake index a636cb4c8..cc39b97d5 100644 --- a/core/iwasm/runtime/utils/utils.cmake +++ b/core/iwasm/runtime/utils/utils.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception set (UTILS_LIB_DIR ${CMAKE_CURRENT_LIST_DIR}) diff --git a/core/iwasm/runtime/utils/wasm_dlfcn.c b/core/iwasm/runtime/utils/wasm_dlfcn.c index 56439c71f..d4d1dc40d 100644 --- a/core/iwasm/runtime/utils/wasm_dlfcn.c +++ b/core/iwasm/runtime/utils/wasm_dlfcn.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_platform.h" diff --git a/core/iwasm/runtime/utils/wasm_hashmap.c b/core/iwasm/runtime/utils/wasm_hashmap.c index f0a24a41b..adaef5d80 100644 --- a/core/iwasm/runtime/utils/wasm_hashmap.c +++ b/core/iwasm/runtime/utils/wasm_hashmap.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wasm_hashmap.h" diff --git a/core/iwasm/runtime/utils/wasm_log.c b/core/iwasm/runtime/utils/wasm_log.c index 0bbb877b5..e551c94b5 100644 --- a/core/iwasm/runtime/utils/wasm_log.c +++ b/core/iwasm/runtime/utils/wasm_log.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wasm_log.h" diff --git a/core/iwasm/runtime/utils/wasm_vector.c b/core/iwasm/runtime/utils/wasm_vector.c index f04f4b3fb..5e90a7a6f 100644 --- a/core/iwasm/runtime/utils/wasm_vector.c +++ b/core/iwasm/runtime/utils/wasm_vector.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wasm_log.h" @@ -52,7 +41,7 @@ extend_vector(Vector *vector, uint32 length) } memcpy(data, vector->data, vector->size_elem * vector->max_elements); - free(vector->data); + wasm_free(vector->data); vector->data = data; vector->max_elements = length; return true; diff --git a/core/iwasm/runtime/vmcore-wasm/invokeNative_arm.s b/core/iwasm/runtime/vmcore-wasm/invokeNative_arm.s index 8d9091449..3618c5826 100644 --- a/core/iwasm/runtime/vmcore-wasm/invokeNative_arm.s +++ b/core/iwasm/runtime/vmcore-wasm/invokeNative_arm.s @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ .text .align 2 diff --git a/core/iwasm/runtime/vmcore-wasm/invokeNative_em64.s b/core/iwasm/runtime/vmcore-wasm/invokeNative_em64.s index c031f8262..26a0a8b85 100644 --- a/core/iwasm/runtime/vmcore-wasm/invokeNative_em64.s +++ b/core/iwasm/runtime/vmcore-wasm/invokeNative_em64.s @@ -1,23 +1,17 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ .text .align 2 +#ifndef OS_MACOSX .globl invokeNative .type invokeNative, @function invokeNative: +#else +.globl _invokeNative +_invokeNative: +#endif /* end of OS_MACOSX */ /* rdi - function ptr */ /* rsi - argv */ /* rdx - n_stacks */ diff --git a/core/iwasm/runtime/vmcore-wasm/invokeNative_general.c b/core/iwasm/runtime/vmcore-wasm/invokeNative_general.c index 09e1b6228..dc2db2db3 100644 --- a/core/iwasm/runtime/vmcore-wasm/invokeNative_general.c +++ b/core/iwasm/runtime/vmcore-wasm/invokeNative_general.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wasm_runtime.h" diff --git a/core/iwasm/runtime/vmcore-wasm/invokeNative_ia32.s b/core/iwasm/runtime/vmcore-wasm/invokeNative_ia32.s index 6c41d211a..8a1216093 100644 --- a/core/iwasm/runtime/vmcore-wasm/invokeNative_ia32.s +++ b/core/iwasm/runtime/vmcore-wasm/invokeNative_ia32.s @@ -1,24 +1,18 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ .text .align 2 +#ifndef OS_MACOSX .globl invokeNative .type invokeNative, @function invokeNative: +#else +.globl _invokeNative +_invokeNative: +#endif /* end of OS_MACOSX */ push %ebp movl %esp, %ebp movl 16(%ebp), %ecx /* ecx = argc */ diff --git a/core/iwasm/runtime/vmcore-wasm/invokeNative_mips.s b/core/iwasm/runtime/vmcore-wasm/invokeNative_mips.s index 78a212b2e..645f4f2ec 100644 --- a/core/iwasm/runtime/vmcore-wasm/invokeNative_mips.s +++ b/core/iwasm/runtime/vmcore-wasm/invokeNative_mips.s @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ .text diff --git a/core/iwasm/runtime/vmcore-wasm/vmcore.cmake b/core/iwasm/runtime/vmcore-wasm/vmcore.cmake index 7af218ee6..00cd35dfc 100644 --- a/core/iwasm/runtime/vmcore-wasm/vmcore.cmake +++ b/core/iwasm/runtime/vmcore-wasm/vmcore.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception set (VMCORE_LIB_DIR ${CMAKE_CURRENT_LIST_DIR}) @@ -20,10 +9,20 @@ include_directories(${VMCORE_LIB_DIR}/../include) file (GLOB_RECURSE c_source_all ${VMCORE_LIB_DIR}/*.c) list (REMOVE_ITEM c_source_all ${VMCORE_LIB_DIR}/invokeNative_general.c) -if (${BUILD_AS_64BIT_SUPPORT} STREQUAL "YES") -set (source_all ${c_source_all} ${VMCORE_LIB_DIR}/invokeNative_em64.s) +if (${BUILD_TARGET} STREQUAL "X86_64" OR ${BUILD_TARGET} STREQUAL "AMD_64") + set (source_all ${c_source_all} ${VMCORE_LIB_DIR}/invokeNative_em64.s) +elseif (${BUILD_TARGET} STREQUAL "X86_32") + set (source_all ${c_source_all} ${VMCORE_LIB_DIR}/invokeNative_ia32.s) +elseif (${BUILD_TARGET} STREQUAL "ARM_32") + set (source_all ${c_source_all} ${VMCORE_LIB_DIR}/invokeNative_arm.s) +elseif (${BUILD_TARGET} STREQUAL "MIPS_32") + set (source_all ${c_source_all} ${VMCORE_LIB_DIR}/invokeNative_mips.s) +elseif (${BUILD_TARGET} STREQUAL "XTENSA_32") + set (source_all ${c_source_all} ${VMCORE_LIB_DIR}/invokeNative_xtensa.s) +elseif (${BUILD_TARGET} STREQUAL "GENERAL") + set (source_all ${c_source_all} ${VMCORE_LIB_DIR}/invokeNative_general.c) else () -set (source_all ${c_source_all} ${VMCORE_LIB_DIR}/invokeNative_ia32.s) + message (FATAL_ERROR "Build target isn't set") endif () set (VMCORE_LIB_SOURCE ${source_all}) diff --git a/core/iwasm/runtime/vmcore-wasm/wasm.h b/core/iwasm/runtime/vmcore-wasm/wasm.h index 06b655e29..f90771031 100644 --- a/core/iwasm/runtime/vmcore-wasm/wasm.h +++ b/core/iwasm/runtime/vmcore-wasm/wasm.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _WASM_H_ diff --git a/core/iwasm/runtime/vmcore-wasm/wasm_application.c b/core/iwasm/runtime/vmcore-wasm/wasm_application.c index d3aef0c6d..8fcabde72 100644 --- a/core/iwasm/runtime/vmcore-wasm/wasm_application.c +++ b/core/iwasm/runtime/vmcore-wasm/wasm_application.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include diff --git a/core/iwasm/runtime/vmcore-wasm/wasm_interp.c b/core/iwasm/runtime/vmcore-wasm/wasm_interp.c index 0b2198636..47e51e75b 100644 --- a/core/iwasm/runtime/vmcore-wasm/wasm_interp.c +++ b/core/iwasm/runtime/vmcore-wasm/wasm_interp.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wasm_interp.h" diff --git a/core/iwasm/runtime/vmcore-wasm/wasm_interp.h b/core/iwasm/runtime/vmcore-wasm/wasm_interp.h index 50bb3d719..e7a1d779e 100644 --- a/core/iwasm/runtime/vmcore-wasm/wasm_interp.h +++ b/core/iwasm/runtime/vmcore-wasm/wasm_interp.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _WASM_INTERP_H diff --git a/core/iwasm/runtime/vmcore-wasm/wasm_loader.c b/core/iwasm/runtime/vmcore-wasm/wasm_loader.c index 0b2760be3..81144c31b 100644 --- a/core/iwasm/runtime/vmcore-wasm/wasm_loader.c +++ b/core/iwasm/runtime/vmcore-wasm/wasm_loader.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wasm_loader.h" diff --git a/core/iwasm/runtime/vmcore-wasm/wasm_loader.h b/core/iwasm/runtime/vmcore-wasm/wasm_loader.h index 1a3939605..c0a982ebe 100644 --- a/core/iwasm/runtime/vmcore-wasm/wasm_loader.h +++ b/core/iwasm/runtime/vmcore-wasm/wasm_loader.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _WASM_LOADER_H #define _WASM_LOADER_H diff --git a/core/iwasm/runtime/vmcore-wasm/wasm_native.h b/core/iwasm/runtime/vmcore-wasm/wasm_native.h index 74b0fb054..8efd0efe2 100644 --- a/core/iwasm/runtime/vmcore-wasm/wasm_native.h +++ b/core/iwasm/runtime/vmcore-wasm/wasm_native.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _WASM_NATIVE_H diff --git a/core/iwasm/runtime/vmcore-wasm/wasm_opcode.h b/core/iwasm/runtime/vmcore-wasm/wasm_opcode.h index 2917bf429..4868be34d 100644 --- a/core/iwasm/runtime/vmcore-wasm/wasm_opcode.h +++ b/core/iwasm/runtime/vmcore-wasm/wasm_opcode.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _WASM_OPCODE_H diff --git a/core/iwasm/runtime/vmcore-wasm/wasm_runtime.c b/core/iwasm/runtime/vmcore-wasm/wasm_runtime.c index 77c7bb9ed..f6f4ef038 100644 --- a/core/iwasm/runtime/vmcore-wasm/wasm_runtime.c +++ b/core/iwasm/runtime/vmcore-wasm/wasm_runtime.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wasm_runtime.h" @@ -1458,7 +1447,7 @@ word_copy(uint32 *dest, uint32 *src, unsigned num) (addr)[1] = u.parts[1]; \ } while (0) -#if !defined(__x86_64__) && !defined(__amd_64__) +#if !defined(BUILD_TARGET_X86_64) && !defined(BUILD_TARGET_AMD_64) typedef void (*GenericFunctionPointer)(); int64 invokeNative(GenericFunctionPointer f, uint32 *args, uint32 sz); @@ -1483,7 +1472,7 @@ wasm_runtime_invoke_native(void *func_ptr, WASMType *func_type, uint32 argv_buf[32], *argv1 = argv_buf, argc1, i, j = 0; uint64 size; -#if !defined(__arm__) && !defined(__mips__) +#if !defined(BUILD_TARGET_ARM_32) && !defined(BUILD_TARGET_MIPS_32) argc1 = argc + 2; #else argc1 = func_type->param_count * 2 + 2; @@ -1501,7 +1490,7 @@ wasm_runtime_invoke_native(void *func_ptr, WASMType *func_type, for (i = 0; i < sizeof(WASMModuleInstance*) / sizeof(uint32); i++) argv1[j++] = ((uint32*)&module_inst)[i]; -#if !defined(__arm__) && !defined(__mips__) +#if !defined(BUILD_TARGET_ARM_32) && !defined(BUILD_TARGET_MIPS_32) word_copy(argv1 + j, argv, argc); j += argc; #else @@ -1526,7 +1515,7 @@ wasm_runtime_invoke_native(void *func_ptr, WASMType *func_type, break; } } -#endif +#endif /* end of !defined(BUILD_TARGET_ARM_32) && !defined(BUILD_TARGET_MIPS_32) */ argc1 = j; if (func_type->result_count == 0) { @@ -1557,7 +1546,7 @@ wasm_runtime_invoke_native(void *func_ptr, WASMType *func_type, return true; } -#else /* else of !defined(__x86_64__) && !defined(__amd_64__) */ +#else /* else of !defined(BUILD_TARGET_X86_64) && !defined(BUILD_TARGET_AMD_64) */ typedef void (*GenericFunctionPointer)(); int64 invokeNative(GenericFunctionPointer f, uint64 *args, uint64 n_stacks); @@ -1675,5 +1664,5 @@ wasm_runtime_invoke_native(void *func_ptr, WASMType *func_type, return true; } -#endif /* end of !defined(__x86_64__) && !defined(__amd_64__) */ +#endif /* end of !defined(BUILD_TARGET_X86_64) && !defined(BUILD_TARGET_AMD_64) */ diff --git a/core/iwasm/runtime/vmcore-wasm/wasm_runtime.h b/core/iwasm/runtime/vmcore-wasm/wasm_runtime.h index 2eb12b75d..47cc201ea 100644 --- a/core/iwasm/runtime/vmcore-wasm/wasm_runtime.h +++ b/core/iwasm/runtime/vmcore-wasm/wasm_runtime.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _WASM_RUNTIME_H diff --git a/core/iwasm/runtime/vmcore-wasm/wasm_thread.h b/core/iwasm/runtime/vmcore-wasm/wasm_thread.h index a1844f141..0bdb3f50a 100644 --- a/core/iwasm/runtime/vmcore-wasm/wasm_thread.h +++ b/core/iwasm/runtime/vmcore-wasm/wasm_thread.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _WASM_RUNTIME_THREAD_H diff --git a/core/shared-lib/coap/Makefile b/core/shared-lib/coap/Makefile index 913532689..efb3b6a14 100644 --- a/core/shared-lib/coap/Makefile +++ b/core/shared-lib/coap/Makefile @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception COAP_ROOT=${ZEPHYR_BASE}/subsys/aee/Beihai/runtime/utils/coap subdir-ccflags-y += -I${COAP_ROOT}/er-coap -I${COAP_ROOT}/extension diff --git a/core/shared-lib/coap/er-coap/Makefile b/core/shared-lib/coap/er-coap/Makefile index d2ba2cdc3..1defea13e 100644 --- a/core/shared-lib/coap/er-coap/Makefile +++ b/core/shared-lib/coap/er-coap/Makefile @@ -1,15 +1,4 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception obj-y += er-coap.o diff --git a/core/shared-lib/coap/extension/Makefile b/core/shared-lib/coap/extension/Makefile index 69f887388..32d65d0be 100644 --- a/core/shared-lib/coap/extension/Makefile +++ b/core/shared-lib/coap/extension/Makefile @@ -1,15 +1,4 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception obj-y += coap_over_tcp.o diff --git a/core/shared-lib/coap/extension/coap_conversion.c b/core/shared-lib/coap/extension/coap_conversion.c index 4c0819c98..6251499db 100644 --- a/core/shared-lib/coap/extension/coap_conversion.c +++ b/core/shared-lib/coap/extension/coap_conversion.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "coap_ext.h" diff --git a/core/shared-lib/coap/extension/coap_ext.h b/core/shared-lib/coap/extension/coap_ext.h index a71596b54..416393f15 100755 --- a/core/shared-lib/coap/extension/coap_ext.h +++ b/core/shared-lib/coap/extension/coap_ext.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef COAP_EXTENSION_COAP_EXT_H_ diff --git a/core/shared-lib/coap/extension/coap_over_tcp.c b/core/shared-lib/coap/extension/coap_over_tcp.c index ae50e4c22..ee0dbd27a 100755 --- a/core/shared-lib/coap/extension/coap_over_tcp.c +++ b/core/shared-lib/coap/extension/coap_over_tcp.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include diff --git a/core/shared-lib/coap/extension/coap_platforms.h b/core/shared-lib/coap/extension/coap_platforms.h index e3a1ac4c6..be5302b07 100755 --- a/core/shared-lib/coap/extension/coap_platforms.h +++ b/core/shared-lib/coap/extension/coap_platforms.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef COAP_PLATFORMS_H_ diff --git a/core/shared-lib/coap/lib_coap.cmake b/core/shared-lib/coap/lib_coap.cmake index 8a35f3cb7..8970e5d6c 100644 --- a/core/shared-lib/coap/lib_coap.cmake +++ b/core/shared-lib/coap/lib_coap.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception set (LIB_COAP_DIR ${CMAKE_CURRENT_LIST_DIR}) diff --git a/core/shared-lib/include/bh_common.h b/core/shared-lib/include/bh_common.h old mode 100755 new mode 100644 index a8176dc7f..8e309ad78 --- a/core/shared-lib/include/bh_common.h +++ b/core/shared-lib/include/bh_common.h @@ -1,24 +1,12 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _BH_COMMON_H #define _BH_COMMON_H #include "bh_assert.h" -#include "bh_definition.h" #include "bh_platform.h" #include "bh_log.h" #include "bh_list.h" diff --git a/core/shared-lib/include/bh_list.h b/core/shared-lib/include/bh_list.h index 01644dc04..2e429c69b 100644 --- a/core/shared-lib/include/bh_list.h +++ b/core/shared-lib/include/bh_list.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _BH_LIST_H @@ -21,7 +10,7 @@ extern "C" { #endif -#include "korp_types.h" /*For bool type*/ +#include "bh_types.h" /*For bool type*/ #include "bh_platform.h" /* List user should embedded bh_list_link into list elem data structure diff --git a/core/shared-lib/include/bh_log.h b/core/shared-lib/include/bh_log.h index c2e45fe06..66837ac5d 100644 --- a/core/shared-lib/include/bh_log.h +++ b/core/shared-lib/include/bh_log.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ /** * @file bh_log.h @@ -34,7 +23,7 @@ #include -#include "korp_types.h" +#include "bh_types.h" #ifdef __cplusplus extern "C" { diff --git a/core/shared-lib/include/bh_memory.h b/core/shared-lib/include/bh_memory.h index 352137a34..b2c091d2f 100644 --- a/core/shared-lib/include/bh_memory.h +++ b/core/shared-lib/include/bh_memory.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _BH_MEMORY_H diff --git a/core/shared-lib/include/bh_queue.h b/core/shared-lib/include/bh_queue.h index f45b90149..56f8b8560 100644 --- a/core/shared-lib/include/bh_queue.h +++ b/core/shared-lib/include/bh_queue.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _BH_QUEUE_H @@ -21,7 +10,7 @@ extern "C" { #endif -#include "korp_types.h" /*For bool type*/ +#include "bh_types.h" /*For bool type*/ #include "bh_platform.h" struct _bh_queue_node; diff --git a/core/shared-lib/include/bni.h b/core/shared-lib/include/bni.h index 36e797fd6..437cf41d7 100644 --- a/core/shared-lib/include/bni.h +++ b/core/shared-lib/include/bni.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ /** * @file bni.h diff --git a/core/shared-lib/include/config.h b/core/shared-lib/include/config.h index 565db6c09..4bd0de225 100644 --- a/core/shared-lib/include/config.h +++ b/core/shared-lib/include/config.h @@ -1,21 +1,33 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _CONFIG_H_ +#if !defined(BUILD_TARGET_X86_64) \ + && !defined(BUILD_TARGET_AMD_64) \ + && !defined(BUILD_TARGET_X86_32) \ + && !defined(BUILD_TARGET_ARM_32) \ + && !defined(BUILD_TARGET_MIPS_32) \ + && !defined(BUILD_TARGET_XTENSA_32) +#if defined(__x86_64__) || defined(__x86_64) +#define BUILD_TARGET_X86_64 +#elif defined(__amd64__) || defined(__amd64) +#define BUILD_TARGET_AMD_64 +#elif defined(__i386__) || defined(__i386) || defined(i386) +#define BUILD_TARGET_X86_32 +#elif defined(__arm__) +#define BUILD_TARGET_ARM_32 +#elif defined(__mips__) || defined(__mips) || defined(mips) +#define BUILD_TARGET_MIPS_32 +#elif defined(__XTENSA__) +#define BUILD_TARGET_XTENSA +#else +#error "Build target isn't set" +#endif +#endif + /* Memory allocator ems */ #define MEM_ALLOCATOR_EMS 0 @@ -100,7 +112,7 @@ #define APP_HEAP_SIZE_MAX (1024 * 1024) /* Default wasm stack size of each app */ -#ifdef __x86_64__ +#if defined(BUILD_TARGET_X86_64) || defined(BUILD_TARGET_AMD_64) #define DEFAULT_WASM_STACK_SIZE (12 * 1024) #else #define DEFAULT_WASM_STACK_SIZE (8 * 1024) @@ -116,7 +128,6 @@ #define APP_THREAD_STACK_SIZE_MIN (2 * 1024) #define APP_THREAD_STACK_SIZE_MAX (256 * 1024) #endif -#endif /* External memory space provided by user, but not wasm memory space and app heap space */ @@ -134,3 +145,6 @@ #ifndef WASM_ENABLE_GUI #define WASM_ENABLE_GUI 0 #endif + +#endif /* end of _CONFIG_H_ */ + diff --git a/core/shared-lib/include/errcode.h b/core/shared-lib/include/errcode.h deleted file mode 100755 index 5fc81cb8d..000000000 --- a/core/shared-lib/include/errcode.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -/** - * @file errcode.h - * @date Wed Feb 29 18:58:30 2012 - * - * @brief Host-visible error code definition - */ - -#ifndef BEIHAI_ERRCODE_H -#define BEIHAI_ERRCODE_H - -/** - * Responses to all remote requests from host to Beihai runtime has a - * return error code, which is used to indicate the processing result: - * successful or any error occurs. The following definitions include - * all those error codes that may be returned to host. - */ -enum { - BHE_SUCCESS = 0x000, /* Successful */ - - /* General errors: 0x100 */ - BHE_OUT_OF_MEMORY = 0x101, /* Out of memory */ - BHE_BAD_PARAMETER = 0x102, /* Bad parameters to native */ - BHE_INSUFFICIENT_BUFFER = 0x103, - BHE_MUTEX_INIT_FAIL = 0x104, - BHE_COND_INIT_FAIL = 0x105, /* Cond init fail is not return to - * host now, it may be used later. - */ - BHE_WD_TIMEOUT = 0x106, /* Watchdog time out */ - - /* Communication: 0x200 */ - BHE_MAILBOX_NOT_FOUND = 0x201, /* Mailbox not found */ - BHE_MSG_QUEUE_IS_FULL = 0x202, /* Message queue is full */ - BHE_MAILBOX_DENIED = 0x203, /* Mailbox is denied by firewall */ - - /* Applet manager: 0x300 */ - BHE_LOAD_JEFF_FAIL = 0x303, /* JEFF file load fail, OOM or file - * format error not distinct by - * current JEFF loading - * process (bool jeff_loader_load). - */ - BHE_PACKAGE_NOT_FOUND = 0x304, /* Request operation on a package, - * but it does not exist. - */ - BHE_EXIST_LIVE_SESSION = 0x305, /* Uninstall package fail because of - * live session exist. - */ - BHE_VM_INSTANCE_INIT_FAIL = 0x306, /* VM instance init fail when create - * session. - */ - BHE_QUERY_PROP_NOT_SUPPORT = 0x307, /* Query applet property that Beihai - * does not support. - */ - BHE_INVALID_BPK_FILE = 0x308, /* Incorrect Beihai package format */ - - BHE_VM_INSTNACE_NOT_FOUND = 0x312, /* VM instance not found */ - BHE_STARTING_JDWP_FAIL = 0x313, /* JDWP agent starting fail */ - BHE_GROUP_CHECK_FAIL = 0x314, /* Group access checking fail*/ - - /* Applet instance: 0x400 */ - BHE_UNCAUGHT_EXCEPTION = 0x401, /* uncaught exception */ - BHE_APPLET_BAD_PARAMETER = 0x402, /* Bad parameters to applet */ - BHE_APPLET_SMALL_BUFFER = 0x403, /* Small response buffer */ - - /*TODO: Should be removed these UI error code when integrate with ME 9 */ - /* UI: 0x500 */ - BHE_UI_EXCEPTION = 0x501, - BHE_UI_ILLEGAL_USE = 0x502, - BHE_UI_ILLEGAL_PARAMETER = 0x503, - BHE_UI_NOT_INITIALIZED = 0x504, - BHE_UI_NOT_SUPPORTED = 0x505, - BHE_UI_OUT_OF_RESOURCES = 0x506 -}; - -#endif diff --git a/core/shared-lib/include/jeff_export.h b/core/shared-lib/include/jeff_export.h old mode 100755 new mode 100644 index 360bba7db..e9f4128dc --- a/core/shared-lib/include/jeff_export.h +++ b/core/shared-lib/include/jeff_export.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ /** * @file jeff-export.h @@ -26,7 +15,7 @@ #define JEFF_EXPORT_H #include "bni.h" -#include "korp_types.h" +#include "bh_types.h" /******************************************************************** * Exported internal types diff --git a/core/shared-lib/include/korp_types.h b/core/shared-lib/include/korp_types.h deleted file mode 100755 index daf6d6f4d..000000000 --- a/core/shared-lib/include/korp_types.h +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _KORP_TYPES_H -#define _KORP_TYPES_H - -#include "bh_platform.h" -/* all types used in kORP should be explicit sized */ -typedef struct _korp_object korp_object; - -typedef unsigned int obj_info; -typedef korp_object* ref; - -#define BYTES_OF_OBJ_INFO 4 -#define BYTES_OF_REF 4 - -/* don't change the number, it's hardcoded in kORP */ -enum _korp_array_type { - ARRAY_UINT8 = 0, /* bytes_of_uint8 = 1 << ARRAY_UINT8 */ - ARRAY_UINT16 = 1, /* bytes_of_uint16 = 1 << ARRAY_UINT16 */ - ARRAY_UINT32 = 2, /* bytes_of_uint32 = 1 << ARRAY_UINT32 */ - ARRAY_UINT64 = 3, /* bytes_of_uint64 = 1 << ARRAY_UINT64 */ - ARRAY_BOOLEAN = 4, - ARRAY_CHAR = 5, - ARRAY_FLOAT = 6, - ARRAY_DOUBLE = 7, - ARRAY_BYTE = 8, - ARRAY_SHORT = 9, - ARRAY_INT = 10, - ARRAY_LONG = 11, - ARRAY_REF = 12 /* for calculation */ -}; - -enum _korp_java_type { - JAVA_TYPE_WRONG = 0, - JAVA_TYPE_BYTE = 'B', - JAVA_TYPE_CHAR = 'C', - JAVA_TYPE_DOUBLE = 'D', - JAVA_TYPE_FLOAT = 'F', - JAVA_TYPE_INT = 'I', - JAVA_TYPE_LONG = 'J', - JAVA_TYPE_SHORT = 'S', - JAVA_TYPE_BOOLEAN = 'Z', - JAVA_TYPE_CLASS = 'L', - JAVA_TYPE_ARRAY = '[', - JAVA_TYPE_VOID = 'V', - JAVA_TYPE_STRING = '$' /* for TAG_String const value */ -}; - -enum korp_modifier_type { - MOD_PUBLIC = 0x0001, /* Class Field Method */ - MOD_PRIVATE = 0x0002, /* Field Method */ - MOD_PROTECTED = 0x0004, /* Field Method */ - MOD_STATIC = 0x0008, /* Field Method */ - MOD_FINAL = 0x0010, /* Class Field Method */ - MOD_SUPER = 0x0020, /* Class */ - MOD_SYNCHRONIZED = 0x0020, /* Method */ - MOD_VOLATILE = 0x0040, /* Field */ - MOD_TRANSIENT = 0x0080, /* Field */ - MOD_NATIVE = 0x0100, /* Method */ - MOD_INTERFACE = 0x0200, /* Class */ - MOD_ABSTRACT = 0x0400, /* Class Method */ - MOD_STRICT = 0x0800 /* Method */ -}; - -/* object header, used to access object info */ -struct _korp_object { - obj_info header; /* object header (I) */ -}; - -#define HASH_TABLE_SIZE 359 - -#ifndef NULL -#define NULL (void*)0 -#endif - -#define KORP_ERROR (-1) - -#ifndef __cplusplus -#define true 1 -#define false 0 -#define inline __inline -#endif - -/* forwarded declarations */ -typedef struct _korp_string_pool korp_string_pool; -typedef struct _korp_class_table korp_class_table; - -typedef enum _korp_loader_exception { - LD_OK = 0, - LD_NoClassDefFoundError, - LD_ClassFormatError, - LD_ClassCircularityError, - LD_IncompatibleClassChangeError, - LD_AbstractMethodError, /* occurs during preparation */ - LD_IllegalAccessError, - LD_InstantiationError, - LD_NoSuchFieldError, - LD_NoSuchMethodError, - LD_UnsatisfiedLinkError, - LD_VerifyError -} korp_loader_exception; - -typedef enum _korp_java_type korp_java_type; -typedef enum _korp_array_type korp_array_type; - -/* typedef struct _korp_thread korp_thread; */ -typedef struct _korp_method korp_method; -typedef struct _korp_field korp_field; -typedef struct _korp_class korp_class; -typedef struct _korp_string korp_string; -typedef struct _korp_package korp_package; -typedef struct _korp_class_loader korp_class_loader; -typedef struct _korp_ref_array korp_ref_array; - -typedef struct _korp_entry korp_entry; -typedef struct _korp_preloaded korp_preloaded; -typedef struct _korp_env korp_env; - -typedef struct _korp_java_array korp_java_array; -typedef struct _korp_uint8_array korp_uint8_array; - -typedef struct _korp_vm_thread_list korp_vm_thread_list; - -#define korp_uint8 korp_uint32 -#define korp_uint16 korp_uint32 -#define korp_boolean korp_uint32 -#define korp_char korp_uint32 -#define korp_short korp_uint32 -#define korp_int korp_uint32 -#define korp_float korp_uint32 - -#define korp_long korp_uint64 -#define korp_double korp_uint64 - -#define korp_boolean_array korp_uint8_array -#define korp_char_array korp_uint8_array -#define korp_short_array korp_uint16_array -#define korp_int_array korp_uint32_array -#define korp_float_array korp_uint32_array -#define korp_double_array korp_uint64_array -#define korp_long_array korp_uint64_array - -#define korp_code korp_uint8_array - -#endif /* #ifndef _KORP_TYPES_H */ - diff --git a/core/shared-lib/include/mem_alloc.h b/core/shared-lib/include/mem_alloc.h index acda4a911..3e1cf9577 100644 --- a/core/shared-lib/include/mem_alloc.h +++ b/core/shared-lib/include/mem_alloc.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef __MEM_ALLOC_H diff --git a/core/shared-lib/mem-alloc/bh_memory.c b/core/shared-lib/mem-alloc/bh_memory.c index f0a6641e5..45c252b12 100644 --- a/core/shared-lib/mem-alloc/bh_memory.c +++ b/core/shared-lib/mem-alloc/bh_memory.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_config.h" diff --git a/core/shared-lib/mem-alloc/ems/ems_alloc.c b/core/shared-lib/mem-alloc/ems/ems_alloc.c index ca575f35b..a9c5c6e74 100644 --- a/core/shared-lib/mem-alloc/ems/ems_alloc.c +++ b/core/shared-lib/mem-alloc/ems/ems_alloc.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "ems_gc_internal.h" diff --git a/core/shared-lib/mem-alloc/ems/ems_gc.h b/core/shared-lib/mem-alloc/ems/ems_gc.h index 38aba489b..9c705db19 100644 --- a/core/shared-lib/mem-alloc/ems/ems_gc.h +++ b/core/shared-lib/mem-alloc/ems/ems_gc.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ /** diff --git a/core/shared-lib/mem-alloc/ems/ems_gc_internal.h b/core/shared-lib/mem-alloc/ems/ems_gc_internal.h index 51308d2a9..9ee66921a 100644 --- a/core/shared-lib/mem-alloc/ems/ems_gc_internal.h +++ b/core/shared-lib/mem-alloc/ems/ems_gc_internal.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _EMS_GC_INTERNAL_H diff --git a/core/shared-lib/mem-alloc/ems/ems_hmu.c b/core/shared-lib/mem-alloc/ems/ems_hmu.c index 6b612d8fa..0a6d1abc3 100644 --- a/core/shared-lib/mem-alloc/ems/ems_hmu.c +++ b/core/shared-lib/mem-alloc/ems/ems_hmu.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "ems_gc_internal.h" diff --git a/core/shared-lib/mem-alloc/ems/ems_kfc.c b/core/shared-lib/mem-alloc/ems/ems_kfc.c index 4409d65db..8b619fdbb 100644 --- a/core/shared-lib/mem-alloc/ems/ems_kfc.c +++ b/core/shared-lib/mem-alloc/ems/ems_kfc.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "ems_gc_internal.h" diff --git a/core/shared-lib/mem-alloc/mem_alloc.c b/core/shared-lib/mem-alloc/mem_alloc.c index c19d669ed..72670ff5f 100644 --- a/core/shared-lib/mem-alloc/mem_alloc.c +++ b/core/shared-lib/mem-alloc/mem_alloc.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "mem_alloc.h" diff --git a/core/shared-lib/mem-alloc/mem_alloc.cmake b/core/shared-lib/mem-alloc/mem_alloc.cmake index 28372ade5..2a224bf52 100644 --- a/core/shared-lib/mem-alloc/mem_alloc.cmake +++ b/core/shared-lib/mem-alloc/mem_alloc.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception set (MEM_ALLOC_DIR ${CMAKE_CURRENT_LIST_DIR}) diff --git a/core/shared-lib/platform/CMakeLists.txt b/core/shared-lib/platform/CMakeLists.txt index 036ad4e5b..0161f67c2 100755 --- a/core/shared-lib/platform/CMakeLists.txt +++ b/core/shared-lib/platform/CMakeLists.txt @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception include_directories (./include ../include ./${PLATFORM}) diff --git a/core/shared-lib/platform/Makefile b/core/shared-lib/platform/Makefile index 6e8435d47..cd10597a1 100644 --- a/core/shared-lib/platform/Makefile +++ b/core/shared-lib/platform/Makefile @@ -1,15 +1,4 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception obj-y += zephyr/ diff --git a/core/shared-lib/platform/alios/bh_assert.c b/core/shared-lib/platform/alios/bh_assert.c index ba8016690..60f3b2deb 100644 --- a/core/shared-lib/platform/alios/bh_assert.c +++ b/core/shared-lib/platform/alios/bh_assert.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_platform.h" diff --git a/core/shared-lib/platform/alios/bh_definition.c b/core/shared-lib/platform/alios/bh_definition.c index 635e8fe53..1bd85b125 100644 --- a/core/shared-lib/platform/alios/bh_definition.c +++ b/core/shared-lib/platform/alios/bh_definition.c @@ -1,27 +1,10 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ -#include "bh_definition.h" #include "bh_platform.h" -int bh_return(int ret) -{ - return ret; -} - #define RSIZE_MAX 0x7FFFFFFF int b_memcpy_s(void * s1, unsigned int s1max, diff --git a/core/shared-lib/platform/alios/bh_platform.c b/core/shared-lib/platform/alios/bh_platform.c index f8ca5735f..9e0be0bf5 100644 --- a/core/shared-lib/platform/alios/bh_platform.c +++ b/core/shared-lib/platform/alios/bh_platform.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_platform.h" diff --git a/core/shared-lib/platform/alios/bh_platform.h b/core/shared-lib/platform/alios/bh_platform.h index e23958c95..d15eacd5d 100644 --- a/core/shared-lib/platform/alios/bh_platform.h +++ b/core/shared-lib/platform/alios/bh_platform.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _BH_PLATFORM_H diff --git a/core/shared-lib/platform/alios/bh_platform_log.c b/core/shared-lib/platform/alios/bh_platform_log.c index db0ac60fd..8c9e114d2 100644 --- a/core/shared-lib/platform/alios/bh_platform_log.c +++ b/core/shared-lib/platform/alios/bh_platform_log.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_platform.h" diff --git a/core/shared-lib/platform/alios/bh_thread.c b/core/shared-lib/platform/alios/bh_thread.c index edd51ad85..a17751914 100644 --- a/core/shared-lib/platform/alios/bh_thread.c +++ b/core/shared-lib/platform/alios/bh_thread.c @@ -1,18 +1,7 @@ /* - * INTEL CONFIDENTIAL - * - * Copyright 2017-2018 Intel Corporation - * - * This software and the related documents are Intel copyrighted materials, - * and your use of them is governed by the express license under which they - * were provided to you (License). Unless the License provides otherwise, you - * may not use, modify, copy, publish, distribute, disclose or transmit this - * software or the related documents without Intel's prior written permission. - * - * This software and the related documents are provided as is, with no express - * or implied warranties, other than those that are expressly stated in the - * License. -*/ + * Copyright (C) 2019 Intel Corporation. All rights reserved. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + */ #include "bh_thread.h" #include "bh_assert.h" diff --git a/core/shared-lib/platform/alios/bh_time.c b/core/shared-lib/platform/alios/bh_time.c index e66590bc9..cd827477a 100644 --- a/core/shared-lib/platform/alios/bh_time.c +++ b/core/shared-lib/platform/alios/bh_time.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_time.h" diff --git a/core/shared-lib/platform/alios/shared_platform.cmake b/core/shared-lib/platform/alios/shared_platform.cmake index 102ec9c78..cce0df72a 100644 --- a/core/shared-lib/platform/alios/shared_platform.cmake +++ b/core/shared-lib/platform/alios/shared_platform.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception set (PLATFORM_SHARED_DIR ${CMAKE_CURRENT_LIST_DIR}) diff --git a/core/shared-lib/platform/android/bh_assert.c b/core/shared-lib/platform/android/bh_assert.c deleted file mode 100755 index b52a9aa5b..000000000 --- a/core/shared-lib/platform/android/bh_assert.c +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "bh_platform.h" -#include "bh_assert.h" -#include -#include -#include - -#ifdef BH_TEST -#include -#endif - -#ifdef BH_TEST -/* for exception throwing */ -jmp_buf bh_test_jb; -#endif - -void bh_assert_internal(int v, const char *file_name, int line_number, - const char *expr_string) -{ - if (v) - return; - - if (!file_name) - file_name = "NULL FILENAME"; - if (!expr_string) - expr_string = "NULL EXPR_STRING"; - - printf("\nASSERTION FAILED: %s, at FILE=%s, LINE=%d\n", expr_string, - file_name, line_number); - -#ifdef BH_TEST - longjmp(bh_test_jb, 1); -#endif - - abort(); -} - -void bh_debug_internal(const char *file_name, int line_number, const char *fmt, - ...) -{ -#ifndef JEFF_TEST_VERIFIER - va_list args; - - va_start(args, fmt); - bh_assert(file_name); - - printf("\nDebug info FILE=%s, LINE=%d: ", file_name, line_number); - vprintf(fmt, args); - - va_end(args); - printf("\n"); -#endif -} - diff --git a/core/shared-lib/platform/android/bh_definition.c b/core/shared-lib/platform/android/bh_definition.c deleted file mode 100755 index 47ee11ed2..000000000 --- a/core/shared-lib/platform/android/bh_definition.c +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "bh_definition.h" -#include "bh_platform.h" - -int bh_return(int ret) -{ - return ret; -} - -#define RSIZE_MAX 0x7FFFFFFF -int b_memcpy_s(void * s1, unsigned int s1max, const void * s2, unsigned int n) -{ - char *dest = (char*) s1; - char *src = (char*) s2; - if (n == 0) { - return 0; - } - - if (s1 == NULL || s1max > RSIZE_MAX) { - return -1; - } - if (s2 == NULL || n > s1max) { - memset(dest, 0, s1max); - return -1; - } - memcpy(dest, src, n); - return 0; -} - -int b_strcat_s(char * s1, size_t s1max, const char * s2) -{ - if (NULL - == s1|| NULL == s2 || s1max < (strlen(s1) + strlen(s2) + 1) || s1max > RSIZE_MAX) { - return -1; - } - - strcat(s1, s2); - - return 0; -} - -int b_strcpy_s(char * s1, size_t s1max, const char * s2) -{ - if (NULL - == s1|| NULL == s2 || s1max < (strlen(s2) + 1) || s1max > RSIZE_MAX) { - return -1; - } - - strcpy(s1, s2); - - return 0; -} - -int fopen_s(FILE ** pFile, const char *filename, const char *mode) -{ - if (NULL == pFile || NULL == filename || NULL == mode) { - return -1; - } - - *pFile = fopen(filename, mode); - - if (NULL == *pFile) - return -1; - - return 0; -} diff --git a/core/shared-lib/platform/android/bh_platform.h b/core/shared-lib/platform/android/bh_platform.h deleted file mode 100755 index eff38612d..000000000 --- a/core/shared-lib/platform/android/bh_platform.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _BH_PLATFORM_H -#define _BH_PLATFORM_H - -#include "bh_config.h" -#include "bh_types.h" - -#include -#include -typedef uint64_t uint64; -typedef int64_t int64; - -extern void DEBUGME(void); - -#define DIE do{bh_debug("Die here\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); DEBUGME(void); while(1);}while(0) - -#define BH_PLATFORM "Linux" - -/* NEED qsort */ - -#include -#include -#include -#include -#include -#include - -#define _STACK_SIZE_ADJUSTMENT (32 * 1024) - -/* Stack size of applet manager thread. */ -#define BH_APPLET_MANAGER_THREAD_STACK_SIZE (8 * 1024 + _STACK_SIZE_ADJUSTMENT) - -/* Stack size of HMC thread. */ -#define BH_HMC_THREAD_STACK_SIZE (4 * 1024 + _STACK_SIZE_ADJUSTMENT) - -/* Stack size of watchdog thread. */ -#define BH_WATCHDOG_THREAD_SIZE (4 * 1024 + _STACK_SIZE_ADJUSTMENT) - -/* Stack size of applet threads's native part. */ -#define BH_APPLET_PRESERVED_STACK_SIZE (8 * 1024 + _STACK_SIZE_ADJUSTMENT) - -/* Stack size of remote invoke listen thread. */ -#define BH_REMOTE_INVOKE_THREAD_STACK_SIZE (4 * 1024 + _STACK_SIZE_ADJUSTMENT) - -/* Stack size of remote post listen thread. */ -#define BH_REMOTE_POST_THREAD_STACK_SIZE (4 * 1024 + _STACK_SIZE_ADJUSTMENT) - -/* Maximal recursion depth of interpreter. */ -#define BH_MAX_INTERP_RECURSION_DEPTH 8 - -#define BH_ROUTINE_MODIFIER -#define BHT_TIMEDOUT ETIMEDOUT - -#define INVALID_THREAD_ID 0xFFffFFff -#define INVALID_SEM_ID SEM_FAILED - -typedef pthread_t korp_tid; -typedef pthread_mutex_t korp_mutex; -typedef sem_t korp_sem; -typedef pthread_cond_t korp_cond; -typedef void* (*thread_start_routine_t)(void*); - -#include -#include - -/* The following operations declared in string.h may be defined as - macros on Linux, so don't declare them as functions here. */ -/* memset */ -/* memcpy */ -/* memmove */ - -/* #include */ - -/* Unit test framework is based on C++, where the declaration of - snprintf is different. */ -#ifndef __cplusplus -int snprintf(char *buffer, size_t count, const char *format, ...); -#endif - -/* #include */ - -double fmod(double x, double y); -float fmodf(float x, float y); - -/* Definitions for applet debugging */ -#define APPLET_DEBUG_LISTEN_PORT 8000 -#define BH_SOCKET_INVALID_SOCK -1 -#define BH_WAIT_FOREVER 0xFFFFFFFF -typedef int bh_socket_t; - -#ifndef NULL -# define NULL ((void*) 0) -#endif - -extern int b_memcpy_s(void * s1, unsigned int s1max, const void * s2, - unsigned int n); -extern int strcat_s(char * s1, size_t s1max, const char * s2); -extern int strcpy_s(char * s1, size_t s1max, const char * s2); -#include -extern int fopen_s(FILE ** pFile, const char *filename, const char *mode); - -#endif diff --git a/core/shared-lib/platform/android/bh_platform_log.c b/core/shared-lib/platform/android/bh_platform_log.c deleted file mode 100755 index 4ff03192a..000000000 --- a/core/shared-lib/platform/android/bh_platform_log.c +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "bh_platform.h" -#include - -void bh_log_emit(const char *fmt, va_list ap) -{ - vprintf(fmt, ap); - fflush(stdout); -} - -int bh_fprintf(FILE *stream, const char *fmt, ...) -{ - va_list ap; - int ret; - - va_start(ap, fmt); - ret = vfprintf(stream ? stream : stdout, fmt, ap); - va_end(ap); - - return ret; -} - -int bh_fflush(void *stream) -{ - return fflush(stream ? stream : stdout); -} diff --git a/core/shared-lib/platform/android/bh_thread.c b/core/shared-lib/platform/android/bh_thread.c deleted file mode 100755 index 6e4f4a573..000000000 --- a/core/shared-lib/platform/android/bh_thread.c +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "bh_thread.h" -#include "bh_assert.h" -#include "bh_log.h" -#include "bh_memory.h" -#include -#include -#include - -static korp_mutex thread_list_lock; -static pthread_key_t thread_local_storage_key[BH_MAX_TLS_NUM]; - -int _vm_thread_sys_init() -{ - unsigned i; - - for (i = 0; i < BH_MAX_TLS_NUM; i++) - pthread_key_create(&thread_local_storage_key[i], NULL); - - return vm_mutex_init(&thread_list_lock); -} - -korp_tid _vm_self_thread() -{ - return (korp_tid) pthread_self(); -} - -void *_vm_tls_get(unsigned idx) -{ - bh_assert(idx < BH_MAX_TLS_NUM); - return pthread_getspecific(thread_local_storage_key[idx]); -} - -int _vm_tls_put(unsigned idx, void * tls) -{ - bh_assert(idx < BH_MAX_TLS_NUM); - pthread_setspecific(thread_local_storage_key[idx], tls); - return BHT_OK; -} - -int _vm_mutex_init(korp_mutex *mutex) -{ - return pthread_mutex_init(mutex, NULL) == 0 ? BHT_OK : BHT_ERROR; -} - -int _vm_recursive_mutex_init(korp_mutex *mutex) -{ - int ret; - - pthread_mutexattr_t mattr; - - bh_assert(mutex); - ret = pthread_mutexattr_init(&mattr); - if (ret) - return BHT_ERROR; - - pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_RECURSIVE_NP); - ret = pthread_mutex_init(mutex, &mattr); - pthread_mutexattr_destroy(&mattr); - - return ret == 0 ? BHT_OK : BHT_ERROR; -} - -int _vm_mutex_destroy(korp_mutex *mutex) -{ - int ret; - - bh_assert(mutex); - ret = pthread_mutex_destroy(mutex); - - return ret == 0 ? BHT_OK : BHT_ERROR; -} - -/* Returned error (EINVAL, EAGAIN and EDEADLK) from - locking the mutex indicates some logic error present in - the program somewhere. - Don't try to recover error for an existing unknown error.*/ -void vm_mutex_lock(korp_mutex *mutex) -{ - int ret; - - bh_assert(mutex); - ret = pthread_mutex_lock(mutex); - if (0 != ret) { - LOG_FATAL("vm mutex lock failed (ret=%d)!\n", ret); - exit(-1); - } -} - -int vm_mutex_trylock(korp_mutex *mutex) -{ - int ret; - - bh_assert(mutex); - ret = pthread_mutex_trylock(mutex); - - return ret == 0 ? BHT_OK : BHT_ERROR; -} - -/* Returned error (EINVAL, EAGAIN and EPERM) from - unlocking the mutex indicates some logic error present - in the program somewhere. - Don't try to recover error for an existing unknown error.*/ -void vm_mutex_unlock(korp_mutex *mutex) -{ - int ret; - - bh_assert(mutex); - ret = pthread_mutex_unlock(mutex); - if (0 != ret) { - LOG_FATAL("vm mutex unlock failed (ret=%d)!\n", ret); - exit(-1); - } -} - -int _vm_cond_init(korp_cond *cond) -{ - bh_assert(cond); - - if (pthread_cond_init(cond, NULL) != BHT_OK) - return BHT_ERROR; - - return BHT_OK; -} - -int _vm_cond_destroy(korp_cond *cond) -{ - bh_assert(cond); - - if (pthread_cond_destroy(cond) != BHT_OK) - return BHT_ERROR; - - return BHT_OK; -} - diff --git a/core/shared-lib/platform/android/bh_time.c b/core/shared-lib/platform/android/bh_time.c deleted file mode 100755 index 6dad59620..000000000 --- a/core/shared-lib/platform/android/bh_time.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "bh_time.h" - -#include -#include -//#include -#include - -/* - * This function returns milliseconds per tick. - * @return milliseconds per tick. - */ -uint64 _bh_time_get_tick_millisecond() -{ - return sysconf(_SC_CLK_TCK); -} - -/* - * This function returns milliseconds after boot. - * @return milliseconds after boot. - */ -uint64 _bh_time_get_boot_millisecond() -{ - struct timespec ts; - if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) { - return 0; - } - - return ((uint64) ts.tv_sec) * 1000 + ts.tv_nsec / (1000 * 1000); -} - -/* - * This function returns GMT time milliseconds since from 1970.1.1, AKA UNIX time. - * @return milliseconds since from 1970.1.1. - */ -uint64 _bh_time_get_millisecond_from_1970() -{ - struct timeval tv; - gettimeofday(&tv, NULL); - uint64 millisecondsSinceEpoch = (uint64_t)(tv.tv_sec) * 1000 - + (uint64_t)(tv.tv_usec) / 1000; - return millisecondsSinceEpoch; -} - -size_t _bh_time_strftime(char *s, size_t max, const char *format, int64 time) -{ - time_t time_sec = time / 1000; - struct tm *ltp; - - ltp = localtime(&time_sec); - if (ltp == NULL) { - return 0; - } - return strftime(s, max, format, ltp); -} - diff --git a/core/shared-lib/platform/darwin/bh_assert.c b/core/shared-lib/platform/darwin/bh_assert.c index b52a9aa5b..c609fb93d 100644 --- a/core/shared-lib/platform/darwin/bh_assert.c +++ b/core/shared-lib/platform/darwin/bh_assert.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_platform.h" diff --git a/core/shared-lib/platform/darwin/bh_definition.c b/core/shared-lib/platform/darwin/bh_definition.c index 47ee11ed2..8fb58d2f8 100644 --- a/core/shared-lib/platform/darwin/bh_definition.c +++ b/core/shared-lib/platform/darwin/bh_definition.c @@ -1,28 +1,12 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ -#include "bh_definition.h" #include "bh_platform.h" -int bh_return(int ret) -{ - return ret; -} - #define RSIZE_MAX 0x7FFFFFFF + int b_memcpy_s(void * s1, unsigned int s1max, const void * s2, unsigned int n) { char *dest = (char*) s1; @@ -44,8 +28,9 @@ int b_memcpy_s(void * s1, unsigned int s1max, const void * s2, unsigned int n) int b_strcat_s(char * s1, size_t s1max, const char * s2) { - if (NULL - == s1|| NULL == s2 || s1max < (strlen(s1) + strlen(s2) + 1) || s1max > RSIZE_MAX) { + if (NULL == s1 || NULL == s2 + || s1max < (strlen(s1) + strlen(s2) + 1) + || s1max > RSIZE_MAX) { return -1; } @@ -56,8 +41,9 @@ int b_strcat_s(char * s1, size_t s1max, const char * s2) int b_strcpy_s(char * s1, size_t s1max, const char * s2) { - if (NULL - == s1|| NULL == s2 || s1max < (strlen(s2) + 1) || s1max > RSIZE_MAX) { + if (NULL == s1 || NULL == s2 + || s1max < (strlen(s2) + 1) + || s1max > RSIZE_MAX) { return -1; } diff --git a/core/shared-lib/platform/darwin/bh_platform.c b/core/shared-lib/platform/darwin/bh_platform.c index 3ff600cfc..a1c35233e 100644 --- a/core/shared-lib/platform/darwin/bh_platform.c +++ b/core/shared-lib/platform/darwin/bh_platform.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_platform.h" diff --git a/core/shared-lib/platform/darwin/bh_platform.h b/core/shared-lib/platform/darwin/bh_platform.h index 2715670b6..b25e1a88e 100644 --- a/core/shared-lib/platform/darwin/bh_platform.h +++ b/core/shared-lib/platform/darwin/bh_platform.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _BH_PLATFORM_H diff --git a/core/shared-lib/platform/darwin/bh_platform_log.c b/core/shared-lib/platform/darwin/bh_platform_log.c index 4ff03192a..902ca7d60 100644 --- a/core/shared-lib/platform/darwin/bh_platform_log.c +++ b/core/shared-lib/platform/darwin/bh_platform_log.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_platform.h" diff --git a/core/shared-lib/platform/darwin/bh_thread.c b/core/shared-lib/platform/darwin/bh_thread.c index 97879aa77..8619a7ad0 100644 --- a/core/shared-lib/platform/darwin/bh_thread.c +++ b/core/shared-lib/platform/darwin/bh_thread.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_thread.h" diff --git a/core/shared-lib/platform/darwin/bh_time.c b/core/shared-lib/platform/darwin/bh_time.c index 0627b08d0..b8d9e8f8c 100644 --- a/core/shared-lib/platform/darwin/bh_time.c +++ b/core/shared-lib/platform/darwin/bh_time.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_time.h" diff --git a/core/shared-lib/platform/darwin/shared_platform.cmake b/core/shared-lib/platform/darwin/shared_platform.cmake index 5b403a09c..2fdc1330e 100644 --- a/core/shared-lib/platform/darwin/shared_platform.cmake +++ b/core/shared-lib/platform/darwin/shared_platform.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception set (PLATFORM_SHARED_DIR ${CMAKE_CURRENT_LIST_DIR}) diff --git a/core/shared-lib/platform/include/bh_assert.h b/core/shared-lib/platform/include/bh_assert.h index 08cea79c7..370f6cea8 100644 --- a/core/shared-lib/platform/include/bh_assert.h +++ b/core/shared-lib/platform/include/bh_assert.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _BH_ASSERT_H @@ -39,37 +28,31 @@ extern "C" { #ifdef BH_DEBUG -extern void bh_assert_internal(int v, const char *file_name, int line_number, const char *expr_string); -#define bh_assert(expr) bh_assert_internal((int)(expr), __FILE__, __LINE__, # expr) -extern void bh_debug_internal(const char *file_name, int line_number, const char *fmt, ...); +void bh_assert_internal(int v, const char *file_name, int line_number, + const char *expr_string); +#define bh_assert(expr) bh_assert_internal((int)(expr), __FILE__, __LINE__, #expr) -#if defined(WIN32) || defined(EMU) -# define bh_debug(fmt, ...) bh_debug_internal(__FILE__, __LINE__, fmt, __VA_ARGS__) +void bh_debug_internal(const char *file_name, int line_number, + const char *fmt, ...); +#if defined(WIN32) + #define bh_debug(fmt, ...) bh_debug_internal(__FILE__, __LINE__, fmt, __VA_ARGS__) #elif defined(__linux__) -/*# define bh_debug(...) bh_debug_internal(__FILE__, __LINE__, ## __VA_ARGS__)*/ -# define bh_debug bh_debug_internal(__FILE__, __LINE__, "");printf -#elif defined(PLATFORM_SEC) -# define bh_debug(fmt, ...) bh_debug_internal(__FILE__, __LINE__, fmt, __VA_ARGS__) + #define bh_debug bh_debug_internal(__FILE__, __LINE__, "");printf #else -# error "Unsupported platform" + #error "Unsupported platform" #endif -#else +#else /* else of BH_DEBUG */ #define bh_debug if(0)printf -#endif - -#define bh_assert_abort(x) do { \ - if (!x) \ - abort(); \ - } while (0) +#endif /* end of BH_DEBUG */ #ifdef BH_TEST -# define BH_STATIC + #define BH_STATIC #else -# define BH_STATIC static -#endif + #define BH_STATIC static +#endif /* end of BH_TEST */ #ifdef __cplusplus } @@ -77,8 +60,3 @@ extern void bh_debug_internal(const char *file_name, int line_number, const char #endif -/* Local Variables: */ -/* mode:c */ -/* c-basic-offset: 4 */ -/* indent-tabs-mode: nil */ -/* End: */ diff --git a/core/shared-lib/platform/include/bh_config.h b/core/shared-lib/platform/include/bh_config.h index 37904311f..0069194d1 100644 --- a/core/shared-lib/platform/include/bh_config.h +++ b/core/shared-lib/platform/include/bh_config.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ /** diff --git a/core/shared-lib/platform/include/bh_definition.h b/core/shared-lib/platform/include/bh_definition.h deleted file mode 100755 index 7780f4132..000000000 --- a/core/shared-lib/platform/include/bh_definition.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _BH_DEFINITION_H -#define _BH_DEFINITION_H - -#include "bh_config.h" - -typedef enum { - BH_FAILED = -100, - BH_UNKOWN = -99, - BH_MAGIC_UNMATCH = -12, - BH_UNIMPLEMENTED = -11, - BH_INTR = -10, - BH_CLOSED = -9, - BH_BUFFER_OVERFLOW = -8, /* TODO: no used error, should remove*/ - BH_NOT_SUPPORTED = -7, - BH_WEAR_OUT_VIOLATION = -6, - BH_NOT_FOUND = -5, - BH_INVALID_PARAMS = -4, - BH_ACCESS_DENIED = -3, - BH_OUT_OF_MEMORY = -2, - BH_INVALID = -1, - BH_SUCCESS = 0, - BH_TIMEOUT = 2 -} bh_status; - -#endif diff --git a/core/shared-lib/platform/include/bh_platform_log.h b/core/shared-lib/platform/include/bh_platform_log.h index 9f2bac2c4..2513055e7 100644 --- a/core/shared-lib/platform/include/bh_platform_log.h +++ b/core/shared-lib/platform/include/bh_platform_log.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef BH_PLATFORM_LOG diff --git a/core/shared-lib/platform/include/bh_thread.h b/core/shared-lib/platform/include/bh_thread.h index a573f3f1d..901e615eb 100644 --- a/core/shared-lib/platform/include/bh_thread.h +++ b/core/shared-lib/platform/include/bh_thread.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _BH_THREAD_H @@ -38,7 +27,7 @@ extern "C" { * vm_thread_sys_init * initiation function for beihai thread system. Invoked at the beginning of beihai intiation. * - * @return BH_SUCCESS if succuess. + * @return 0 if succuess. */ int _vm_thread_sys_init(void); #ifdef _INSTRUMENT_TEST_ENABLED @@ -58,7 +47,7 @@ void vm_thread_sys_destroy(void); * @param arg argument passed to main routine * @param stack_size bytes of stack size * - * @return BH_SUCCESS if success. + * @return 0 if success. */ int _vm_thread_create(korp_tid *p_tid, thread_start_routine_t start, void *arg, unsigned int stack_size); @@ -78,7 +67,7 @@ int vm_thread_create_instr(korp_tid *p_tid, thread_start_routine_t start, void * * @param stack_size bytes of stack size * @param prio the priority * - * @return BH_SUCCESS if success. + * @return 0 if success. */ int _vm_thread_create_with_prio(korp_tid *p_tid, thread_start_routine_t start, void *arg, unsigned int stack_size, int prio); @@ -115,7 +104,7 @@ korp_tid vm_self_thread_instr(const char*func_name); * @param idx tls array index * @param ptr pointer need save as TLS * - * @return BH_SUCCESS if success + * @return 0 if success */ int _vm_tls_put(unsigned idx, void *ptr); #ifdef _INSTRUMENT_TEST_ENABLED @@ -147,7 +136,7 @@ void *vm_tls_get_instr(unsigned idx, const char*func_name); * * @param mutex [OUTPUT] pointer to mutex initialized. * - * @return BH_SUCCESS if success + * @return 0 if success */ int _vm_mutex_init(korp_mutex *mutex); #ifdef INSTRUMENT_TEST_ENABLED @@ -162,7 +151,7 @@ int vm_mutex_init_instr(korp_mutex *mutex, const char*func_name); * * @param mutex [OUTPUT] pointer to mutex initialized. * - * @return BH_SUCCESS if success + * @return 0 if success */ int _vm_recursive_mutex_init(korp_mutex *mutex); #ifdef INSTRUMENT_TEST_ENABLED @@ -177,7 +166,7 @@ int vm_recursive_mutex_init_instr(korp_mutex *mutex, const char*func_name); * * @param mutex pointer to mutex need destroy * - * @return BH_SUCCESS if success + * @return 0 if success */ int _vm_mutex_destroy(korp_mutex *mutex); #ifdef _INSTRUMENT_TEST_ENABLED @@ -201,7 +190,7 @@ void vm_mutex_lock(korp_mutex *mutex); * * @param mutex pointer to mutex need lock * - * @return BH_SUCCESS if success + * @return 0 if success */ int vm_mutex_trylock(korp_mutex *mutex); @@ -220,7 +209,7 @@ void vm_mutex_unlock(korp_mutex *mutex); * @param sem [OUTPUT] pointer to semaphone * @param c counter of semaphone * - * @return BH_SUCCESS if success + * @return 0 if success */ int _vm_sem_init(korp_sem *sem, unsigned int c); #ifdef _INSTRUMENT_TEST_ENABLED @@ -235,7 +224,7 @@ int vm_sem_init_instr(korp_sem *sem, unsigned int c, const char*func_name); * * @param sem pointer to semaphone need destroy * - * @return BH_SUCCESS if success + * @return 0 if success */ int _vm_sem_destroy(korp_sem *sem); #ifdef _INSTRUMENT_TEST_ENABLED @@ -250,7 +239,7 @@ int vm_sem_destroy_instr(korp_sem *sem, const char*func_name); * * @param sem pointer to semaphone need perform wait operation * - * @return BH_SUCCESS if success + * @return 0 if success */ int _vm_sem_wait(korp_sem *sem); #ifdef _INSTRUMENT_TEST_ENABLED @@ -266,7 +255,7 @@ int vm_sem_wait_instr(korp_sem *sem, const char*func_name); * @param sem pointer to semaphone need perform wait operation * @param mills wait milliseconds to return * - * @return BH_SUCCESS if success + * @return 0 if success * @return BH_TIMEOUT if time out */ int _vm_sem_reltimedwait(korp_sem *sem, int mills); @@ -282,7 +271,7 @@ int vm_sem_reltimedwait_instr(korp_sem *sem, int mills, const char*func_name); * * @param sem pointer to semaphone need perform post operation * - * @return BH_SUCCESS if success + * @return 0 if success */ int _vm_sem_post(korp_sem *sem); #ifdef _INSTRUMENT_TEST_ENABLED @@ -297,7 +286,7 @@ int vm_sem_post_instr(korp_sem *sem, const char*func_name); * * @param cond [OUTPUT] pointer to condition variable * - * @return BH_SUCCESS if success + * @return 0 if success */ int _vm_cond_init(korp_cond *cond); #ifdef INSTRUMENT_TEST_ENABLED @@ -312,7 +301,7 @@ int vm_cond_init_instr(korp_cond *cond, const char*func_name); * * @param cond pointer to condition variable * - * @return BH_SUCCESS if success + * @return 0 if success */ int _vm_cond_destroy(korp_cond *cond); #ifdef _INSTRUMENT_TEST_ENABLED @@ -328,7 +317,7 @@ int vm_cond_destroy_instr(korp_cond *cond, const char*func_name); * @param cond pointer to condition variable * @param mutex pointer to mutex to protect the condition variable * - * @return BH_SUCCESS if success + * @return 0 if success */ int _vm_cond_wait(korp_cond *cond, korp_mutex *mutex); #ifdef _INSTRUMENT_TEST_ENABLED @@ -345,7 +334,7 @@ int vm_cond_wait_instr(korp_cond *cond, korp_mutex *mutex, const char*func_name) * @param mutex pointer to mutex to protect the condition variable * @param mills milliseconds to wait * - * @return BH_SUCCESS if success + * @return 0 if success */ int _vm_cond_reltimedwait(korp_cond *cond, korp_mutex *mutex, int mills); #ifdef _INSTRUMENT_TEST_ENABLED @@ -360,7 +349,7 @@ int vm_cond_reltimedwait_instr(korp_cond *cond, korp_mutex *mutex, int mills, co * * @param cond condition variable * - * @return BH_SUCCESS if success + * @return 0 if success */ int _vm_cond_signal(korp_cond *cond); #ifdef _INSTRUMENT_TEST_ENABLED diff --git a/core/shared-lib/platform/include/bh_time.h b/core/shared-lib/platform/include/bh_time.h index 31e1454a8..e2fafbd5e 100644 --- a/core/shared-lib/platform/include/bh_time.h +++ b/core/shared-lib/platform/include/bh_time.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _BH_TIME_H @@ -22,7 +11,6 @@ extern "C" { #endif #include "bh_config.h" -#include "bh_definition.h" #include "bh_types.h" #include "bh_platform.h" diff --git a/core/shared-lib/platform/include/bh_types.h b/core/shared-lib/platform/include/bh_types.h index da26c7dc5..4c4214e0f 100644 --- a/core/shared-lib/platform/include/bh_types.h +++ b/core/shared-lib/platform/include/bh_types.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _BH_TYPES_H @@ -28,25 +17,16 @@ typedef int int32; typedef float float32; typedef double float64; -#define BYTES_OF_UINT8 1 -#define BYTES_OF_UINT16 2 -#define BYTES_OF_UINT32 4 -#define BYTES_OF_UINT64 8 - -#define BYTES_OF_BOOLEAN 1 -#define BYTES_OF_BYTE 1 -#define BYTES_OF_CHAR 2 -#define BYTES_OF_SHORT 2 -#define BYTES_OF_INT 4 -#define BYTES_OF_FLOAT 4 -#define BYTES_OF_LONG 8 -#define BYTES_OF_DOUBLE 8 - #include "bh_platform.h" +#ifndef NULL +#define NULL (void*)0 +#endif + #ifndef __cplusplus #define true 1 #define false 0 +#define inline __inline #endif #endif diff --git a/core/shared-lib/platform/linux-sgx/bh_assert.c b/core/shared-lib/platform/linux-sgx/bh_assert.c index b52a9aa5b..c609fb93d 100644 --- a/core/shared-lib/platform/linux-sgx/bh_assert.c +++ b/core/shared-lib/platform/linux-sgx/bh_assert.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_platform.h" diff --git a/core/shared-lib/platform/linux-sgx/bh_definition.c b/core/shared-lib/platform/linux-sgx/bh_definition.c index 5105d0ff8..5460c5a5d 100644 --- a/core/shared-lib/platform/linux-sgx/bh_definition.c +++ b/core/shared-lib/platform/linux-sgx/bh_definition.c @@ -1,28 +1,12 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ -#include "bh_definition.h" #include "bh_platform.h" -int bh_return(int ret) -{ - return ret; -} - #define RSIZE_MAX 0x7FFFFFFF + int b_memcpy_s(void * s1, unsigned int s1max, const void * s2, unsigned int n) { char *dest = (char*) s1; @@ -44,8 +28,9 @@ int b_memcpy_s(void * s1, unsigned int s1max, const void * s2, unsigned int n) int b_strcat_s(char * s1, size_t s1max, const char * s2) { - if (NULL - == s1|| NULL == s2 || s1max < (strlen(s1) + strlen(s2) + 1) || s1max > RSIZE_MAX) { + if (NULL == s1 || NULL == s2 + || s1max < (strlen(s1) + strlen(s2) + 1) + || s1max > RSIZE_MAX) { return -1; } @@ -56,8 +41,9 @@ int b_strcat_s(char * s1, size_t s1max, const char * s2) int b_strcpy_s(char * s1, size_t s1max, const char * s2) { - if (NULL - == s1|| NULL == s2 || s1max < (strlen(s2) + 1) || s1max > RSIZE_MAX) { + if (NULL == s1 || NULL == s2 + || s1max < (strlen(s2) + 1) + || s1max > RSIZE_MAX) { return -1; } diff --git a/core/shared-lib/platform/linux-sgx/bh_platform.c b/core/shared-lib/platform/linux-sgx/bh_platform.c index d6f4c29ce..10c2aecf4 100644 --- a/core/shared-lib/platform/linux-sgx/bh_platform.c +++ b/core/shared-lib/platform/linux-sgx/bh_platform.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_common.h" diff --git a/core/shared-lib/platform/linux-sgx/bh_platform.h b/core/shared-lib/platform/linux-sgx/bh_platform.h index 7a835ef84..e4f726b6c 100644 --- a/core/shared-lib/platform/linux-sgx/bh_platform.h +++ b/core/shared-lib/platform/linux-sgx/bh_platform.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _BH_PLATFORM_H diff --git a/core/shared-lib/platform/linux-sgx/bh_platform_log.c b/core/shared-lib/platform/linux-sgx/bh_platform_log.c index 4ff03192a..902ca7d60 100644 --- a/core/shared-lib/platform/linux-sgx/bh_platform_log.c +++ b/core/shared-lib/platform/linux-sgx/bh_platform_log.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_platform.h" diff --git a/core/shared-lib/platform/linux-sgx/bh_thread.c b/core/shared-lib/platform/linux-sgx/bh_thread.c index 8730e13cd..cfd6aff25 100644 --- a/core/shared-lib/platform/linux-sgx/bh_thread.c +++ b/core/shared-lib/platform/linux-sgx/bh_thread.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_thread.h" diff --git a/core/shared-lib/platform/linux-sgx/bh_time.c b/core/shared-lib/platform/linux-sgx/bh_time.c index 0627b08d0..b8d9e8f8c 100644 --- a/core/shared-lib/platform/linux-sgx/bh_time.c +++ b/core/shared-lib/platform/linux-sgx/bh_time.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_time.h" diff --git a/core/shared-lib/platform/linux-sgx/shared_platform.cmake b/core/shared-lib/platform/linux-sgx/shared_platform.cmake index 5b403a09c..2fdc1330e 100644 --- a/core/shared-lib/platform/linux-sgx/shared_platform.cmake +++ b/core/shared-lib/platform/linux-sgx/shared_platform.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception set (PLATFORM_SHARED_DIR ${CMAKE_CURRENT_LIST_DIR}) diff --git a/core/shared-lib/platform/linux/bh_assert.c b/core/shared-lib/platform/linux/bh_assert.c index b52a9aa5b..c609fb93d 100644 --- a/core/shared-lib/platform/linux/bh_assert.c +++ b/core/shared-lib/platform/linux/bh_assert.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_platform.h" diff --git a/core/shared-lib/platform/linux/bh_definition.c b/core/shared-lib/platform/linux/bh_definition.c index 47ee11ed2..8fb58d2f8 100644 --- a/core/shared-lib/platform/linux/bh_definition.c +++ b/core/shared-lib/platform/linux/bh_definition.c @@ -1,28 +1,12 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ -#include "bh_definition.h" #include "bh_platform.h" -int bh_return(int ret) -{ - return ret; -} - #define RSIZE_MAX 0x7FFFFFFF + int b_memcpy_s(void * s1, unsigned int s1max, const void * s2, unsigned int n) { char *dest = (char*) s1; @@ -44,8 +28,9 @@ int b_memcpy_s(void * s1, unsigned int s1max, const void * s2, unsigned int n) int b_strcat_s(char * s1, size_t s1max, const char * s2) { - if (NULL - == s1|| NULL == s2 || s1max < (strlen(s1) + strlen(s2) + 1) || s1max > RSIZE_MAX) { + if (NULL == s1 || NULL == s2 + || s1max < (strlen(s1) + strlen(s2) + 1) + || s1max > RSIZE_MAX) { return -1; } @@ -56,8 +41,9 @@ int b_strcat_s(char * s1, size_t s1max, const char * s2) int b_strcpy_s(char * s1, size_t s1max, const char * s2) { - if (NULL - == s1|| NULL == s2 || s1max < (strlen(s2) + 1) || s1max > RSIZE_MAX) { + if (NULL == s1 || NULL == s2 + || s1max < (strlen(s2) + 1) + || s1max > RSIZE_MAX) { return -1; } diff --git a/core/shared-lib/platform/linux/bh_platform.c b/core/shared-lib/platform/linux/bh_platform.c index 3ff600cfc..a1c35233e 100755 --- a/core/shared-lib/platform/linux/bh_platform.c +++ b/core/shared-lib/platform/linux/bh_platform.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_platform.h" diff --git a/core/shared-lib/platform/linux/bh_platform.h b/core/shared-lib/platform/linux/bh_platform.h index 47172c1f6..ddd77a2fc 100644 --- a/core/shared-lib/platform/linux/bh_platform.h +++ b/core/shared-lib/platform/linux/bh_platform.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _BH_PLATFORM_H diff --git a/core/shared-lib/platform/linux/bh_platform_log.c b/core/shared-lib/platform/linux/bh_platform_log.c index 4ff03192a..902ca7d60 100644 --- a/core/shared-lib/platform/linux/bh_platform_log.c +++ b/core/shared-lib/platform/linux/bh_platform_log.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_platform.h" diff --git a/core/shared-lib/platform/linux/bh_thread.c b/core/shared-lib/platform/linux/bh_thread.c index d2cdd087c..de865a3c4 100755 --- a/core/shared-lib/platform/linux/bh_thread.c +++ b/core/shared-lib/platform/linux/bh_thread.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_thread.h" diff --git a/core/shared-lib/platform/linux/bh_time.c b/core/shared-lib/platform/linux/bh_time.c index 0627b08d0..b8d9e8f8c 100755 --- a/core/shared-lib/platform/linux/bh_time.c +++ b/core/shared-lib/platform/linux/bh_time.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_time.h" diff --git a/core/shared-lib/platform/linux/shared_platform.cmake b/core/shared-lib/platform/linux/shared_platform.cmake index 5b403a09c..2fdc1330e 100644 --- a/core/shared-lib/platform/linux/shared_platform.cmake +++ b/core/shared-lib/platform/linux/shared_platform.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception set (PLATFORM_SHARED_DIR ${CMAKE_CURRENT_LIST_DIR}) diff --git a/core/shared-lib/platform/vxworks/bh_assert.c b/core/shared-lib/platform/vxworks/bh_assert.c index b52a9aa5b..c609fb93d 100644 --- a/core/shared-lib/platform/vxworks/bh_assert.c +++ b/core/shared-lib/platform/vxworks/bh_assert.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_platform.h" diff --git a/core/shared-lib/platform/vxworks/bh_definition.c b/core/shared-lib/platform/vxworks/bh_definition.c index 19e10d55e..1af69e134 100644 --- a/core/shared-lib/platform/vxworks/bh_definition.c +++ b/core/shared-lib/platform/vxworks/bh_definition.c @@ -1,26 +1,11 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ -#include "bh_definition.h" #include "bh_platform.h" -int bh_return(int ret) -{ - return ret; -} +#define RSIZE_MAX 0x7FFFFFFF int b_memcpy_s(void * s1, unsigned int s1max, const void * s2, unsigned int n) { @@ -43,8 +28,9 @@ int b_memcpy_s(void * s1, unsigned int s1max, const void * s2, unsigned int n) int b_strcat_s(char * s1, size_t s1max, const char * s2) { - if (NULL - == s1|| NULL == s2 || s1max < (strlen(s1) + strlen(s2) + 1) || s1max > RSIZE_MAX) { + if (NULL == s1 || NULL == s2 + || s1max < (strlen(s1) + strlen(s2) + 1) + || s1max > RSIZE_MAX) { return -1; } @@ -55,8 +41,8 @@ int b_strcat_s(char * s1, size_t s1max, const char * s2) int b_strcpy_s(char * s1, size_t s1max, const char * s2) { - if (NULL - == s1|| NULL == s2 || s1max < (strlen(s2) + 1) || s1max > RSIZE_MAX) { + if (NULL == s1|| NULL == s2 + || s1max < (strlen(s2) + 1) || s1max > RSIZE_MAX) { return -1; } diff --git a/core/shared-lib/platform/vxworks/bh_platform.c b/core/shared-lib/platform/vxworks/bh_platform.c index 981124228..698c8574a 100644 --- a/core/shared-lib/platform/vxworks/bh_platform.c +++ b/core/shared-lib/platform/vxworks/bh_platform.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_platform.h" @@ -65,7 +54,7 @@ bh_read_file_to_buffer(const char *filename, int *ret_size) file_size = stat_buf.st_size; - if (!(buffer = wasm_malloc(file_size))) { + if (!(buffer = bh_malloc(file_size))) { printf("Read file to buffer failed: alloc memory failed.\n"); close(file); return NULL; @@ -76,7 +65,7 @@ bh_read_file_to_buffer(const char *filename, int *ret_size) if (read_size < file_size) { printf("Read file to buffer failed: read file content failed.\n"); - wasm_free(buffer); + bh_free(buffer); return NULL; } diff --git a/core/shared-lib/platform/vxworks/bh_platform.h b/core/shared-lib/platform/vxworks/bh_platform.h index 142583e5b..acc8ae4da 100644 --- a/core/shared-lib/platform/vxworks/bh_platform.h +++ b/core/shared-lib/platform/vxworks/bh_platform.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _BH_PLATFORM_H @@ -26,6 +15,8 @@ #include #include #include +#include +#include #include #include #include diff --git a/core/shared-lib/platform/vxworks/bh_platform_log.c b/core/shared-lib/platform/vxworks/bh_platform_log.c index 4ff03192a..902ca7d60 100644 --- a/core/shared-lib/platform/vxworks/bh_platform_log.c +++ b/core/shared-lib/platform/vxworks/bh_platform_log.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_platform.h" diff --git a/core/shared-lib/platform/vxworks/bh_thread.c b/core/shared-lib/platform/vxworks/bh_thread.c index 8883c37bf..b8ddb97d0 100644 --- a/core/shared-lib/platform/vxworks/bh_thread.c +++ b/core/shared-lib/platform/vxworks/bh_thread.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_thread.h" diff --git a/core/shared-lib/platform/vxworks/bh_time.c b/core/shared-lib/platform/vxworks/bh_time.c index 4cae3588d..696c994d3 100644 --- a/core/shared-lib/platform/vxworks/bh_time.c +++ b/core/shared-lib/platform/vxworks/bh_time.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_time.h" diff --git a/core/shared-lib/platform/vxworks/shared_platform.cmake b/core/shared-lib/platform/vxworks/shared_platform.cmake index 5b403a09c..2fdc1330e 100644 --- a/core/shared-lib/platform/vxworks/shared_platform.cmake +++ b/core/shared-lib/platform/vxworks/shared_platform.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception set (PLATFORM_SHARED_DIR ${CMAKE_CURRENT_LIST_DIR}) diff --git a/core/shared-lib/platform/win32/bh_assert.c b/core/shared-lib/platform/win32/bh_assert.c deleted file mode 100644 index b0bbbcbe1..000000000 --- a/core/shared-lib/platform/win32/bh_assert.c +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "bh_platform.h" -#include "bh_assert.h" -#include - -#ifdef BH_TEST -#include -#endif - -#ifdef BH_TEST -/* for exception throwing */ -jmp_buf bh_test_jb; -#endif - -void bh_assert_internal(int v, const char *file_name, int line_number, - const char *expr_string) -{ - if (v) - return; - - if (!file_name) - file_name = "NULL FILENAME"; - if (!expr_string) - expr_string = "NULL EXPR_STRING"; - - printf("\nASSERTION FAILED: %s, at FILE=%s, LINE=%d\n", expr_string, - file_name, line_number); - -#ifdef BH_TEST - longjmp(bh_test_jb, 1); -#endif - - abort(); -} - -void bh_debug_internal(const char *file_name, int line_number, const char *fmt, - ...) -{ -#ifndef JEFF_TEST_VERIFIER - va_list args; - - va_start(args, fmt); - bh_assert(file_name); - - printf("\nDebug info FILE=%s, LINE=%d: ", file_name, line_number); - vprintf(fmt, args); - - va_end(args); - printf("\n"); -#endif -} - diff --git a/core/shared-lib/platform/win32/bh_definition.c b/core/shared-lib/platform/win32/bh_definition.c deleted file mode 100644 index 058804c68..000000000 --- a/core/shared-lib/platform/win32/bh_definition.c +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "bh_definition.h" - -int bh_return(int ret) -{ - return ret; -} diff --git a/core/shared-lib/platform/win32/bh_platform.h b/core/shared-lib/platform/win32/bh_platform.h deleted file mode 100755 index c898a747d..000000000 --- a/core/shared-lib/platform/win32/bh_platform.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#ifndef _BH_PLATFORM_H -#define _BH_PLATFORM_H - -#include "bh_config.h" -#include "bh_types.h" - -#ifndef NVALGRIND -#define NVALGRIND -#endif - -/* Reserve bytes on applet stack for native functions called from - * Java methods to avoid undetectable stack overflow. - */ -#ifndef APPLET_PRESERVED_STACK_SIZE -#define APPLET_PRESERVED_STACK_SIZE (16 * BH_KB) -#endif - -typedef unsigned __int64 uint64; -typedef __int64 int64; - -extern void DEBUGME(void); - -#define DIE do{bh_debug("Die here\n\n\n\n\n\n\n\n\n\n\n\n\n\n"); DEBUGME(void); while(1);}while(0) - -#ifndef BH_INVALID_HANDLE -#define BH_INVALID_HANDLE NULL -#endif - -#define BH_PLATFORM "AMULET" - -#include -#include -#include -#include -#include - -#include - -#define _STACK_SIZE_ADJUSTMENT (32 * 1024) - -/* Stack size of applet manager thread. */ -#define BH_APPLET_MANAGER_THREAD_STACK_SIZE (8 * 1024 + _STACK_SIZE_ADJUSTMENT) - -/* Stack size of HMC thread. */ -#define BH_HMC_THREAD_STACK_SIZE (4 * 1024 + _STACK_SIZE_ADJUSTMENT) - -/* Stack size of watchdog thread. */ -#define BH_WATCHDOG_THREAD_SIZE (4 * 1024 + _STACK_SIZE_ADJUSTMENT) - -/* Stack size of applet threads's native part. */ -#define BH_APPLET_PRESERVED_STACK_SIZE (8 * 1024 + _STACK_SIZE_ADJUSTMENT) - -/* Maximal recursion depth of interpreter. */ -#define BH_MAX_INTERP_RECURSION_DEPTH 8 - -#define wa_malloc bh_malloc -#define wa_free bh_free - -#define snprintf _snprintf - -#define BH_ROUTINE_MODIFIER __stdcall - -typedef void *korp_tid; -#define INVALID_THREAD_ID 0 - -typedef void *korp_mutex; -typedef void *korp_sem; - -typedef struct { - korp_sem s; - unsigned waiting_count; -} korp_cond; - -typedef void* (BH_ROUTINE_MODIFIER *thread_start_routine_t)(void*); - -#endif - diff --git a/core/shared-lib/platform/win32/bh_platform_log.c b/core/shared-lib/platform/win32/bh_platform_log.c deleted file mode 100755 index 80bec06c5..000000000 --- a/core/shared-lib/platform/win32/bh_platform_log.c +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include "bh_platform.h" - -void bh_log_emit(const char *fmt, va_list ap) -{ - vprintf(fmt, ap); - fflush(stdout); -} - -int bh_fprintf(FILE *stream, const char *fmt, ...) -{ - int ret; - va_list ap; - va_start(ap, fmt); - ret = vfprintf(stream ? stream : stdout, fmt, ap); - va_end(ap); - return ret; -} - -int bh_fflush(void *stream) -{ - return fflush(stream ? stream : stdout); -} diff --git a/core/shared-lib/platform/win32/bh_thread.c b/core/shared-lib/platform/win32/bh_thread.c deleted file mode 100755 index ab7e783b5..000000000 --- a/core/shared-lib/platform/win32/bh_thread.c +++ /dev/null @@ -1,342 +0,0 @@ -/* - * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "bh_thread.h" -#include "bh_assert.h" -#include "bh_log.h" -#include "bh_memory.h" - -#include -#include - -#ifdef _DEBUG -#define THREAD_STACK_ADJUSTMENT (32 * 1024) -#else -#define THREAD_STACK_ADJUSTMENT 0 -#endif - -static korp_mutex thread_list_lock; -static DWORD tls_indexes[BH_MAX_TLS_NUM]; - -typedef struct { - int zero_padding; - thread_start_routine_t start; - void* stack; - void* args; - int stack_size; -} vm_thread_block; - -static DWORD tb_index; - -int _vm_thread_sys_init() -{ - unsigned int i; - for (i = 0; i < BH_MAX_TLS_NUM; i++) { - tls_indexes[i] = TlsAlloc(); - if (tls_indexes[i] == TLS_OUT_OF_INDEXES) - return BHT_ERROR; - } - - tb_index = TlsAlloc(); - if (tb_index == TLS_OUT_OF_INDEXES) - return BHT_ERROR; - - return vm_mutex_init(&thread_list_lock); -} - -static unsigned int BH_ROUTINE_MODIFIER beihai_starter(void* arg) -{ - vm_thread_block* tb = (vm_thread_block*) arg; - TlsSetValue(tb_index, tb); - tb->stack = (void *) &arg; - tb->start(tb->args); - - return 0; -} - -int _vm_thread_create(korp_tid *tid, thread_start_routine_t start, void *arg, - unsigned int stack_size) -{ - unsigned int default_stack_size = 20 * 1024; - vm_thread_block* tb; - bh_assert(tid); - bh_assert(start); - - if (stack_size == 0) - stack_size = default_stack_size; - -#ifdef _DEBUG - stack_size = THREAD_STACK_ADJUSTMENT + stack_size*3; -#endif - - tb = (vm_thread_block*) bh_malloc(sizeof(*tb)); - if (tb == NULL) - return BHT_ERROR; - - memset(tb, 0, sizeof(*tb)); - - tb->start = start; - tb->stack_size = stack_size; - tb->args = arg; - - *tid = (korp_tid) _beginthreadex(NULL, stack_size, beihai_starter, - (void*) tb, 0, NULL); - - /* TODO: to deal with the handle; how to close it? */ - return (*tid == INVALID_THREAD_ID) ? BHT_ERROR : BHT_OK; -} - -korp_tid _vm_self_thread() -{ - return (korp_tid) GetCurrentThread(); -} - -void vm_thread_exit(void *code) -{ - vm_thread_block *tb = (vm_thread_block*) TlsGetValue(tb_index); - bh_free(tb); - _endthreadex((unsigned int) code); -} - -void* vm_get_stackaddr() -{ - vm_thread_block *tb = (vm_thread_block*) TlsGetValue(tb_index); - return (char *) tb->stack + THREAD_STACK_ADJUSTMENT - tb->stack_size; -} - -void *_vm_tls_get(unsigned idx) -{ - bh_assert(idx < BH_MAX_TLS_NUM); - return TlsGetValue(tls_indexes[idx]); -} - -int _vm_tls_put(unsigned idx, void *tls) -{ - BOOL r; - - bh_assert(idx < BH_MAX_TLS_NUM); - r = TlsSetValue(tls_indexes[idx], tls); - return (r == FALSE) ? BHT_ERROR : BHT_OK; -} - -int _vm_mutex_init(korp_mutex *mutex) -{ - bh_assert(mutex); - *mutex = CreateMutex(NULL, FALSE, NULL); - return (*mutex == 0) ? BHT_ERROR : BHT_OK; -} - -int _vm_mutex_destroy(korp_mutex *mutex) -{ - return BHT_OK; -} - -/* Returned error (e.g. ERROR_INVALID_HANDLE) from - locking the mutex indicates some logic error present in - the program somewhere. - Don't try to recover error for an existing unknown error.*/ -void vm_mutex_lock(korp_mutex *mutex) -{ - DWORD ret; - - bh_assert(mutex); - ret = WaitForSingleObject(*mutex, INFINITE); - if (WAIT_FAILED == ret) { - LOG_FATAL("vm mutex lock failed (ret=%d)!\n", GetLastError()); - exit(-1); - } -} - -int vm_mutex_trylock(korp_mutex *mutex) -{ - DWORD ret; - - bh_assert(mutex); - ret = WaitForSingleObject(*mutex, 0); - if (WAIT_FAILED == ret) { - LOG_FATAL("vm mutex lock failed (ret=%d)!\n", GetLastError()); - exit(-1); - } - return ret == WAIT_OBJECT_0 ? BHT_OK : BHT_ERROR; -} - -/* Returned error (e.g. ERROR_INVALID_HANDLE) from - unlocking the mutex indicates some logic error present - in the program somewhere. - Don't try to recover error for an existing unknown error.*/ -void vm_mutex_unlock(korp_mutex *mutex) -{ - BOOL ret; - - bh_assert(mutex); - ret = ReleaseMutex(*mutex); - if (FALSE == ret) { - LOG_FATAL("vm mutex unlock failed (ret=%d)!\n", GetLastError()); - exit(-1); - } -} - -#define BH_SEM_COUNT_MAX 0xFFFF - -int _vm_sem_init(korp_sem *sem, unsigned int count) -{ - bh_assert(sem); - bh_assert(count <= BH_SEM_COUNT_MAX); - *sem = CreateSemaphore(NULL, count, BH_SEM_COUNT_MAX, NULL); - - return (*sem == NULL) ? BHT_ERROR : BHT_OK; -} - -int _vm_sem_destroy(korp_sem *sem) -{ - return BHT_OK; -} - -int _vm_sem_P(korp_sem *sem) -{ - DWORD r; - bh_assert(sem); - r = WaitForSingleObject(*sem, INFINITE); - - return (r == WAIT_FAILED) ? BHT_ERROR : BHT_OK; -} - -int _vm_sem_reltimedP(korp_sem *sem, int mills) -{ - DWORD r; - bh_assert(sem); - - if (mills == BHT_WAIT_FOREVER) - mills = INFINITE; - - r = WaitForSingleObject(*sem, (unsigned int) mills); - - switch (r) { - case WAIT_OBJECT_0: - return BHT_OK; - case WAIT_TIMEOUT: - return BHT_TIMEDOUT; - default: - return BHT_ERROR; - } -} - -int _vm_sem_V(korp_sem *sem) -{ - BOOL r; - bh_assert(sem); - r = ReleaseSemaphore(*sem, 1, NULL); - return (r == FALSE) ? BHT_ERROR : BHT_OK; -} - -int _vm_cond_init(korp_cond *cond) -{ - bh_assert(cond); - cond->waiting_count = 0; - return vm_sem_init(&cond->s, 0); -} - -int _vm_cond_destroy(korp_cond *cond) -{ - bh_assert(cond); - return vm_sem_destroy(&cond->s); -} - -int _vm_cond_wait(korp_cond *cond, korp_mutex *mutex) -{ - bh_assert(cond); - bh_assert(mutex); - - cond->waiting_count++; - - vm_mutex_unlock(mutex); - - if (vm_sem_P(&cond->s) != BHT_OK) - return BHT_ERROR; - - vm_mutex_lock(mutex); - - cond->waiting_count--; - - return BHT_OK; -} - -int _vm_cond_reltimedwait(korp_cond *cond, korp_mutex *mutex, int mills) -{ - int r; - - bh_assert(cond); - bh_assert(mutex); - - cond->waiting_count++; - - vm_mutex_unlock(mutex); - - r = vm_sem_reltimedP(&cond->s, mills); - - if ((r != BHT_OK) && (r != BHT_TIMEDOUT)) - return BHT_ERROR; - - vm_mutex_lock(mutex); - - cond->waiting_count--; - - return r; -} - -int _vm_cond_signal(korp_cond *cond) -{ - bh_assert(cond); - - if (cond->waiting_count == 0) - return BHT_OK; - - if (vm_sem_V(&cond->s) != BHT_OK) - return BHT_ERROR; - - return BHT_OK; -} - -int _vm_cond_broadcast(korp_cond *cond) -{ - /* FIXME: use pthread's API to implement this and above - functions. */ - - unsigned count = cond->waiting_count; - - for (; count > 0; count--) - vm_sem_V(&cond->s); - - return BHT_OK; -} - -int _vm_thread_cancel(korp_tid thread) -{ - /* FIXME: implement this with Windows API. */ - return 0; -} - -int _vm_thread_join(korp_tid thread, void **value_ptr) -{ - /* FIXME: implement this with Windows API. */ - return 0; -} - -int _vm_thread_detach(korp_tid thread) -{ - /* FIXME: implement this with Windows API. */ - return 0; -} diff --git a/core/shared-lib/platform/win32/bh_time.c b/core/shared-lib/platform/win32/bh_time.c deleted file mode 100755 index c8d426c4d..000000000 --- a/core/shared-lib/platform/win32/bh_time.c +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include "bh_time.h" - -#include -#include - -/* Since GetTickCount64 is not supported on Windows XP, use a temporary method - * to solve the issue. However, GetTickCount return a DWORD value and overflow - * may happen (http://msdn.microsoft.com/en-us/library/ms724408(v=vs.85).aspx). - * - * TODO: Implement GetTickCount64 on Windows XP by self or check overflow issues. - */ -#if (WINVER >= 0x0600) -extern uint64 __stdcall GetTickCount64(void); -#else -extern uint32 __stdcall GetTickCount(void); -#endif - -/* - * This function returns milliseconds per tick. - * @return milliseconds per tick. - */ -uint64 _bh_time_get_tick_millisecond() -{ - return 5; -} - -/* - * This function returns milliseconds after boot. - * @return milliseconds after boot. - */ -uint64 _bh_time_get_boot_millisecond() -{ - /* Since GetTickCount64 is not supported on Windows XP, use a temporary method - * to solve the issue. However, GetTickCount return a DWORD value and overflow - * may happen (http://msdn.microsoft.com/en-us/library/ms724408(v=vs.85).aspx). - * - * TODO: Implement GetTickCount64 on Windows XP by self or check overflow issues. - */ -#if (WINVER >= 0x0600) - return GetTickCount64(); -#else - return GetTickCount(); -#endif -} - -/* - * This function returns GMT time milliseconds since from 1970.1.1, AKA UNIX time. - * @return milliseconds since from 1970.1.1. - */ -uint64 _bh_time_get_millisecond_from_1970() -{ - struct timeb tp; - ftime(&tp); - - return ((uint64) tp.time) * 1000 + tp.millitm - - (tp.dstflag == 0 ? 0 : 60 * 60 * 1000) + tp.timezone * 60 * 1000; -} - -size_t bh_time_strftime(char *s, size_t max, const char *format, int64 time) -{ - time_t time_sec = time / 1000; - struct timeb tp; - struct tm local_time; - - if (NULL == s) - return 0; - - ftime(&tp); - time_sec -= tp.timezone * 60; - if (localtime_s(&local_time, &time_sec) != 0) - return 0; - - return strftime(s, max, format, &local_time); -} - -int bh_time_get(uint8 *timeoff_info, int16 timeoff_info_len, uint32* time) -{ - return BH_UNIMPLEMENTED; -} - -int bh_time_set(uint32 ntp, uint8 *timeoff_info) -{ - return BH_UNIMPLEMENTED; -} diff --git a/core/shared-lib/platform/zephyr/Makefile b/core/shared-lib/platform/zephyr/Makefile index 4528ff531..c1520f363 100644 --- a/core/shared-lib/platform/zephyr/Makefile +++ b/core/shared-lib/platform/zephyr/Makefile @@ -1,15 +1,4 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception obj-y += bh_assert.o bh_definition.o bh_memory.o bh_platform_log.o bh_thread.o bh_time.o diff --git a/core/shared-lib/platform/zephyr/bh_assert.c b/core/shared-lib/platform/zephyr/bh_assert.c index 121adddfd..ad3205984 100644 --- a/core/shared-lib/platform/zephyr/bh_assert.c +++ b/core/shared-lib/platform/zephyr/bh_assert.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_platform.h" diff --git a/core/shared-lib/platform/zephyr/bh_definition.c b/core/shared-lib/platform/zephyr/bh_definition.c index 0c9d3fc6c..aae3ed823 100644 --- a/core/shared-lib/platform/zephyr/bh_definition.c +++ b/core/shared-lib/platform/zephyr/bh_definition.c @@ -1,28 +1,12 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ -#include "bh_definition.h" #include "bh_platform.h" -int bh_return(int ret) -{ - return ret; -} - #define RSIZE_MAX 0x7FFFFFFF + int b_memcpy_s(void * s1, unsigned int s1max, const void * s2, unsigned int n) { char *dest = (char*) s1; @@ -44,8 +28,9 @@ int b_memcpy_s(void * s1, unsigned int s1max, const void * s2, unsigned int n) int b_strcat_s(char * s1, size_t s1max, const char * s2) { - if (NULL - == s1|| NULL == s2 || s1max < (strlen(s1) + strlen(s2) + 1) || s1max > RSIZE_MAX) { + if (NULL == s1 || NULL == s2 + || s1max < (strlen(s1) + strlen(s2) + 1) + || s1max > RSIZE_MAX) { return -1; } @@ -56,8 +41,8 @@ int b_strcat_s(char * s1, size_t s1max, const char * s2) int b_strcpy_s(char * s1, size_t s1max, const char * s2) { - if (NULL - == s1|| NULL == s2 || s1max < (strlen(s2) + 1) || s1max > RSIZE_MAX) { + if (NULL == s1|| NULL == s2 + || s1max < (strlen(s2) + 1) || s1max > RSIZE_MAX) { return -1; } diff --git a/core/shared-lib/platform/zephyr/bh_platform.c b/core/shared-lib/platform/zephyr/bh_platform.c index 7c4263b31..dd0e6b50e 100755 --- a/core/shared-lib/platform/zephyr/bh_platform.c +++ b/core/shared-lib/platform/zephyr/bh_platform.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_platform.h" diff --git a/core/shared-lib/platform/zephyr/bh_platform.h b/core/shared-lib/platform/zephyr/bh_platform.h index 2602bee31..44614a150 100644 --- a/core/shared-lib/platform/zephyr/bh_platform.h +++ b/core/shared-lib/platform/zephyr/bh_platform.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef _BH_PLATFORM_H diff --git a/core/shared-lib/platform/zephyr/bh_platform_log.c b/core/shared-lib/platform/zephyr/bh_platform_log.c index c418cd819..aab7a7957 100644 --- a/core/shared-lib/platform/zephyr/bh_platform_log.c +++ b/core/shared-lib/platform/zephyr/bh_platform_log.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_platform.h" diff --git a/core/shared-lib/platform/zephyr/bh_thread.c b/core/shared-lib/platform/zephyr/bh_thread.c index 99dd1a246..63586c73e 100755 --- a/core/shared-lib/platform/zephyr/bh_thread.c +++ b/core/shared-lib/platform/zephyr/bh_thread.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_thread.h" diff --git a/core/shared-lib/platform/zephyr/bh_time.c b/core/shared-lib/platform/zephyr/bh_time.c index 9fe2bdbb8..b6db78ead 100755 --- a/core/shared-lib/platform/zephyr/bh_time.c +++ b/core/shared-lib/platform/zephyr/bh_time.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_time.h" diff --git a/core/shared-lib/platform/zephyr/shared_platform.cmake b/core/shared-lib/platform/zephyr/shared_platform.cmake index 102ec9c78..cce0df72a 100644 --- a/core/shared-lib/platform/zephyr/shared_platform.cmake +++ b/core/shared-lib/platform/zephyr/shared_platform.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception set (PLATFORM_SHARED_DIR ${CMAKE_CURRENT_LIST_DIR}) diff --git a/core/shared-lib/shared_lib.cmake b/core/shared-lib/shared_lib.cmake index 7c131940e..e933d1162 100644 --- a/core/shared-lib/shared_lib.cmake +++ b/core/shared-lib/shared_lib.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception include (${CMAKE_CURRENT_LIST_DIR}/utils/shared_utils.cmake) include (${CMAKE_CURRENT_LIST_DIR}/mem-alloc/mem_alloc.cmake) diff --git a/core/shared-lib/utils/CMakeLists.txt b/core/shared-lib/utils/CMakeLists.txt index 1f2e561c7..e2b37b9e8 100644 --- a/core/shared-lib/utils/CMakeLists.txt +++ b/core/shared-lib/utils/CMakeLists.txt @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception include_directories (. ../include ../platform/include ../platform/${PLATFORM} coap/er-coap coap/extension) diff --git a/core/shared-lib/utils/Makefile b/core/shared-lib/utils/Makefile index 0a2104cff..b5612a07b 100644 --- a/core/shared-lib/utils/Makefile +++ b/core/shared-lib/utils/Makefile @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception obj-y += bh_list.o bh_log.o attr-container.o bh_queue.o obj-y += coap/ diff --git a/core/shared-lib/utils/bh_list.c b/core/shared-lib/utils/bh_list.c index 0c15ff513..9d6727af0 100644 --- a/core/shared-lib/utils/bh_list.c +++ b/core/shared-lib/utils/bh_list.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_list.h" diff --git a/core/shared-lib/utils/bh_log.c b/core/shared-lib/utils/bh_log.c index 58591fb66..0a7de0339 100644 --- a/core/shared-lib/utils/bh_log.c +++ b/core/shared-lib/utils/bh_log.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ /** * @file bh_log.c diff --git a/core/shared-lib/utils/bh_queue.c b/core/shared-lib/utils/bh_queue.c index 980fb2ed9..1a4379959 100644 --- a/core/shared-lib/utils/bh_queue.c +++ b/core/shared-lib/utils/bh_queue.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_queue.h" diff --git a/core/shared-lib/utils/runtime_timer.c b/core/shared-lib/utils/runtime_timer.c index 5b9c344f6..341e434f8 100644 --- a/core/shared-lib/utils/runtime_timer.c +++ b/core/shared-lib/utils/runtime_timer.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "runtime_timer.h" diff --git a/core/shared-lib/utils/runtime_timer.h b/core/shared-lib/utils/runtime_timer.h index efe25bbb7..eb0ea9bc7 100644 --- a/core/shared-lib/utils/runtime_timer.h +++ b/core/shared-lib/utils/runtime_timer.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef LIB_BASE_RUNTIME_TIMER_H_ diff --git a/core/shared-lib/utils/shared_utils.cmake b/core/shared-lib/utils/shared_utils.cmake index 910ea8711..ceaf02c74 100644 --- a/core/shared-lib/utils/shared_utils.cmake +++ b/core/shared-lib/utils/shared_utils.cmake @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception set (UTILS_SHARED_DIR ${CMAKE_CURRENT_LIST_DIR}) diff --git a/samples/gui/lvgl-native-ui-app/CMakeLists.txt b/samples/gui/lvgl-native-ui-app/CMakeLists.txt index 95550afcc..ed73b2a47 100644 --- a/samples/gui/lvgl-native-ui-app/CMakeLists.txt +++ b/samples/gui/lvgl-native-ui-app/CMakeLists.txt @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception cmake_minimum_required (VERSION 2.8.2) message ("lvgl_native_ui_app...") @@ -22,15 +11,15 @@ project (lvgl_native_ui_app) set (BUILD_AS_64BIT_SUPPORT "YES") if (CMAKE_SIZEOF_VOID_P EQUAL 8) - if (${BUILD_AS_64BIT_SUPPORT} STREQUAL "YES") - # Add -fPIC flag if build as 64-bit - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") - set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -fPIC") - else () - add_definitions (-m32) - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32") - set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32") - endif () + if (${BUILD_AS_64BIT_SUPPORT} STREQUAL "YES") + # Add -fPIC flag if build as 64-bit + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") + set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -fPIC") + else () + add_definitions (-m32) + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32") + set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32") + endif () endif () set(THIRDPARTY_DIR ../../../core/iwasm/lib/3rdparty) diff --git a/samples/gui/lvgl-native-ui-app/main.c b/samples/gui/lvgl-native-ui-app/main.c index 1e7783850..aeff2f784 100644 --- a/samples/gui/lvgl-native-ui-app/main.c +++ b/samples/gui/lvgl-native-ui-app/main.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ /** diff --git a/samples/gui/lvgl-native-ui-app/system_header.h b/samples/gui/lvgl-native-ui-app/system_header.h index 9c8b1d238..41d923864 100644 --- a/samples/gui/lvgl-native-ui-app/system_header.h +++ b/samples/gui/lvgl-native-ui-app/system_header.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include diff --git a/samples/gui/wasm-apps/lvgl-compatible/Makefile b/samples/gui/wasm-apps/lvgl-compatible/Makefile index 4cea928a8..77dfff72e 100644 --- a/samples/gui/wasm-apps/lvgl-compatible/Makefile +++ b/samples/gui/wasm-apps/lvgl-compatible/Makefile @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception CC = emcc APP_DIR = ${shell pwd} diff --git a/samples/gui/wasm-apps/lvgl-compatible/src/main.c b/samples/gui/wasm-apps/lvgl-compatible/src/main.c index 8f2c37a5b..bb8fe035c 100644 --- a/samples/gui/wasm-apps/lvgl-compatible/src/main.c +++ b/samples/gui/wasm-apps/lvgl-compatible/src/main.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include diff --git a/samples/gui/wasm-apps/wgl/Makefile b/samples/gui/wasm-apps/wgl/Makefile index 4df65bf8a..73c9a9f50 100644 --- a/samples/gui/wasm-apps/wgl/Makefile +++ b/samples/gui/wasm-apps/wgl/Makefile @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception CC = emcc APP_DIR = ${shell pwd} diff --git a/samples/gui/wasm-apps/wgl/src/main.c b/samples/gui/wasm-apps/wgl/src/main.c index bcd9f8cea..feebd060b 100644 --- a/samples/gui/wasm-apps/wgl/src/main.c +++ b/samples/gui/wasm-apps/wgl/src/main.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include diff --git a/samples/gui/wasm-runtime-wgl/linux-build/CMakeLists.txt b/samples/gui/wasm-runtime-wgl/linux-build/CMakeLists.txt index ce3e1cd09..002b19441 100644 --- a/samples/gui/wasm-runtime-wgl/linux-build/CMakeLists.txt +++ b/samples/gui/wasm-runtime-wgl/linux-build/CMakeLists.txt @@ -18,37 +18,64 @@ set (TARGET_PLATFORM "linux") set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") set (CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") -# Enable repl mode if want to test spec cases -# add_definitions(-DWASM_ENABLE_REPL) - if (NOT ("$ENV{VALGRIND}" STREQUAL "YES")) add_definitions(-DNVALGRIND) endif () -# Currently build as 64-bit by default. -set (BUILD_AS_64BIT_SUPPORT "YES") +# Set BUILD_TARGET, currently values supported: +# "X86_64", "AMD_64", "X86_32", "ARM_32", "MIPS_32", "XTENSA_32" +if (NOT BUILD_TARGET) + if (CMAKE_SIZEOF_VOID_P EQUAL 8) + # Build as X86_64 by default in 64-bit platform + set (BUILD_TARGET "X86_64") + else () + # Build as X86_32 by default in 32-bit platform + set (BUILD_TARGET "X86_32") + endif () +endif () + +string(TOUPPER ${BUILD_TARGET} BUILD_TARGET) + +# Add definitions for the build target +if (BUILD_TARGET STREQUAL "X86_64") + add_definitions(-DBUILD_TARGET_X86_64) +elseif (BUILD_TARGET STREQUAL "AMD_64") + add_definitions(-DBUILD_TARGET_AMD_64) +elseif (BUILD_TARGET STREQUAL "X86_32") + add_definitions(-DBUILD_TARGET_X86_32) +elseif (BUILD_TARGET STREQUAL "ARM_32") + add_definitions(-DBUILD_TARGET_ARM_32) +elseif (BUILD_TARGET STREQUAL "MIPS_32") + add_definitions(-DBUILD_TARGET_MIPS_32) +elseif (BUILD_TARGET STREQUAL "XTENSA_32") + add_definitions(-DBUILD_TARGET_XTENSA_32) +else () + message (FATAL_ERROR "-- Build target isn't set") +endif () + +message ("-- Build as target ${BUILD_TARGET}") if (CMAKE_SIZEOF_VOID_P EQUAL 8) -if (${BUILD_AS_64BIT_SUPPORT} STREQUAL "YES") - # Add -fPIC flag if build as 64-bit - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") - set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -fPIC") -else () - add_definitions (-m32) - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32") - set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32") -endif () + if (BUILD_TARGET STREQUAL "X86_64" OR BUILD_TARGET STREQUAL "AMD_64") + # Add -fPIC flag if build as 64-bit + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") + set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -fPIC") + else () + add_definitions (-m32) + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32") + set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32") + endif () endif () if (NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE Debug) endif (NOT CMAKE_BUILD_TYPE) -message ("CMAKE_BUILD_TYPE = " ${CMAKE_BUILD_TYPE}) +message ("-- CMAKE_BUILD_TYPE = " ${CMAKE_BUILD_TYPE}) if (NOT PLATFORM) SET(PLATFORM linux) endif (NOT PLATFORM) -message ("PLATFORM = " ${PLATFORM}) +message ("-- PLATFORM = " ${PLATFORM}) set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections -Wall -Wno-unused-parameter -Wno-pedantic") diff --git a/samples/gui/wasm-runtime-wgl/src/platform/linux/main.c b/samples/gui/wasm-runtime-wgl/src/platform/linux/main.c index 24cae03d8..e86715324 100644 --- a/samples/gui/wasm-runtime-wgl/src/platform/linux/main.c +++ b/samples/gui/wasm-runtime-wgl/src/platform/linux/main.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ extern void iwasm_main(int argc, char *argv[]); int main(int argc, char *argv[]) diff --git a/samples/gui/wasm-runtime-wgl/src/platform/zephyr/board_config.h b/samples/gui/wasm-runtime-wgl/src/platform/zephyr/board_config.h index 1233c300a..d7ea279a9 100644 --- a/samples/gui/wasm-runtime-wgl/src/platform/zephyr/board_config.h +++ b/samples/gui/wasm-runtime-wgl/src/platform/zephyr/board_config.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef __BOARD_CONFIG_H__ #define __BOARD_CONFIG_H__ diff --git a/samples/gui/wasm-runtime-wgl/src/platform/zephyr/iwasm_main.c b/samples/gui/wasm-runtime-wgl/src/platform/zephyr/iwasm_main.c index 486815504..65ae26a8a 100644 --- a/samples/gui/wasm-runtime-wgl/src/platform/zephyr/iwasm_main.c +++ b/samples/gui/wasm-runtime-wgl/src/platform/zephyr/iwasm_main.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_platform.h" #include "runtime_lib.h" diff --git a/samples/gui/wasm-runtime-wgl/src/platform/zephyr/main.c b/samples/gui/wasm-runtime-wgl/src/platform/zephyr/main.c index 708c8ffab..81a8f6bc9 100644 --- a/samples/gui/wasm-runtime-wgl/src/platform/zephyr/main.c +++ b/samples/gui/wasm-runtime-wgl/src/platform/zephyr/main.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include diff --git a/samples/gui/wasm-runtime-wgl/src/platform/zephyr/pin_config_jlf.h b/samples/gui/wasm-runtime-wgl/src/platform/zephyr/pin_config_jlf.h index 5381b72db..3cde4ec14 100644 --- a/samples/gui/wasm-runtime-wgl/src/platform/zephyr/pin_config_jlf.h +++ b/samples/gui/wasm-runtime-wgl/src/platform/zephyr/pin_config_jlf.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef __PIN_CONFIG_JLF_H__ #define __PIN_CONFIG_JLF_H__ diff --git a/samples/gui/wasm-runtime-wgl/src/platform/zephyr/pin_config_stm32.h b/samples/gui/wasm-runtime-wgl/src/platform/zephyr/pin_config_stm32.h index 0ab295eb0..fba36fab4 100644 --- a/samples/gui/wasm-runtime-wgl/src/platform/zephyr/pin_config_stm32.h +++ b/samples/gui/wasm-runtime-wgl/src/platform/zephyr/pin_config_stm32.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef __PIN_CONFIG_STM32_H__ #define __PIN_CONFIG_STM32_H__ diff --git a/samples/gui/wasm-runtime-wgl/zephyr-build/CMakeLists.txt b/samples/gui/wasm-runtime-wgl/zephyr-build/CMakeLists.txt index c00eadeed..e2fca2cf2 100644 --- a/samples/gui/wasm-runtime-wgl/zephyr-build/CMakeLists.txt +++ b/samples/gui/wasm-runtime-wgl/zephyr-build/CMakeLists.txt @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception cmake_minimum_required(VERSION 3.8.2) @@ -27,6 +16,28 @@ zephyr_compile_definitions (-DNVALGRIND -Dattr_container_free=bh_free -DWASM_ENABLE_GUI=1) +# Build as ARM_32 by default, change to "X86_32", "MIPS_32" or "XTENSA_32" +# if we want to support x86, mips or xtensa +if (NOT BUILD_TARGET) + set (BUILD_TARGET "ARM_32") +endif () + +string(TOUPPER ${BUILD_TARGET} BUILD_TARGET) + +if (BUILD_TARGET STREQUAL "X86_32") + add_definitions(-DBUILD_TARGET_X86_32) +elseif (BUILD_TARGET STREQUAL "ARM_32") + add_definitions(-DBUILD_TARGET_ARM_32) +elseif (BUILD_TARGET STREQUAL "MIPS_32") + add_definitions(-DBUILD_TARGET_MIPS_32) +elseif (BUILD_TARGET STREQUAL "XTENSA_32") + add_definitions(-DBUILD_TARGET_XTENSA_32) +else () + message (FATAL_ERROR "-- Build target isn't set") +endif () + +message ("-- Build as target ${BUILD_TARGET}") + set (IWASM_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/core/iwasm) set (APP_MGR_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/core/app-mgr) set (SHARED_LIB_ROOT ${IWASM_ROOT}/../shared-lib) diff --git a/samples/littlevgl/vgl-native-ui-app/CMakeLists.txt b/samples/littlevgl/vgl-native-ui-app/CMakeLists.txt index 78f64645d..6c8ee67bb 100644 --- a/samples/littlevgl/vgl-native-ui-app/CMakeLists.txt +++ b/samples/littlevgl/vgl-native-ui-app/CMakeLists.txt @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception cmake_minimum_required (VERSION 2.8.2) message ("vgl_native_ui_app...") @@ -23,15 +12,15 @@ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DLV_CONF_INCLUDE_SIMPLE -DPLATFORM_NATIVE_L set (BUILD_AS_64BIT_SUPPORT "YES") if (CMAKE_SIZEOF_VOID_P EQUAL 8) - if (${BUILD_AS_64BIT_SUPPORT} STREQUAL "YES") - # Add -fPIC flag if build as 64-bit - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") - set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -fPIC") - else () - add_definitions (-m32) - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32") - set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32") - endif () + if (${BUILD_AS_64BIT_SUPPORT} STREQUAL "YES") + # Add -fPIC flag if build as 64-bit + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") + set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -fPIC") + else () + add_definitions (-m32) + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32") + set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32") + endif () endif () set(lv_name lvgl) diff --git a/samples/littlevgl/vgl-native-ui-app/CMakeLists.txt.in b/samples/littlevgl/vgl-native-ui-app/CMakeLists.txt.in index 225af16bf..bce7b16b7 100644 --- a/samples/littlevgl/vgl-native-ui-app/CMakeLists.txt.in +++ b/samples/littlevgl/vgl-native-ui-app/CMakeLists.txt.in @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception cmake_minimum_required(VERSION 2.8.2) diff --git a/samples/littlevgl/vgl-native-ui-app/lv-drivers/display_indev.h b/samples/littlevgl/vgl-native-ui-app/lv-drivers/display_indev.h index f1b966e0b..3aa6e1613 100644 --- a/samples/littlevgl/vgl-native-ui-app/lv-drivers/display_indev.h +++ b/samples/littlevgl/vgl-native-ui-app/lv-drivers/display_indev.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef DISPLAY_INDEV_H_ diff --git a/samples/littlevgl/vgl-native-ui-app/lv-drivers/linux_display_indev.c b/samples/littlevgl/vgl-native-ui-app/lv-drivers/linux_display_indev.c index e8bbc5218..cf6ff82a1 100644 --- a/samples/littlevgl/vgl-native-ui-app/lv-drivers/linux_display_indev.c +++ b/samples/littlevgl/vgl-native-ui-app/lv-drivers/linux_display_indev.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include diff --git a/samples/littlevgl/vgl-native-ui-app/lv-drivers/system_header.h b/samples/littlevgl/vgl-native-ui-app/lv-drivers/system_header.h index 9c8b1d238..41d923864 100644 --- a/samples/littlevgl/vgl-native-ui-app/lv-drivers/system_header.h +++ b/samples/littlevgl/vgl-native-ui-app/lv-drivers/system_header.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include diff --git a/samples/littlevgl/vgl-native-ui-app/main.c b/samples/littlevgl/vgl-native-ui-app/main.c index 59d0e6b6d..ef26e5e37 100644 --- a/samples/littlevgl/vgl-native-ui-app/main.c +++ b/samples/littlevgl/vgl-native-ui-app/main.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ /** diff --git a/samples/littlevgl/vgl-wasm-runtime/CMakeLists.txt b/samples/littlevgl/vgl-wasm-runtime/CMakeLists.txt index 691140701..7518688fd 100644 --- a/samples/littlevgl/vgl-wasm-runtime/CMakeLists.txt +++ b/samples/littlevgl/vgl-wasm-runtime/CMakeLists.txt @@ -8,37 +8,64 @@ set (TARGET_PLATFORM "linux") set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") set (CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") -# Enable repl mode if want to test spec cases -# add_definitions(-DWASM_ENABLE_REPL) - if (NOT ("$ENV{VALGRIND}" STREQUAL "YES")) add_definitions(-DNVALGRIND) endif () -# Currently build as 64-bit by default. -set (BUILD_AS_64BIT_SUPPORT "YES") +# Set BUILD_TARGET, currently values supported: +# "X86_64", "AMD_64", "X86_32", "ARM_32", "MIPS_32", "XTENSA_32" +if (NOT BUILD_TARGET) + if (CMAKE_SIZEOF_VOID_P EQUAL 8) + # Build as X86_64 by default in 64-bit platform + set (BUILD_TARGET "X86_64") + else () + # Build as X86_32 by default in 32-bit platform + set (BUILD_TARGET "X86_32") + endif () +endif () + +string(TOUPPER ${BUILD_TARGET} BUILD_TARGET) + +# Add definitions for the build target +if (BUILD_TARGET STREQUAL "X86_64") + add_definitions(-DBUILD_TARGET_X86_64) +elseif (BUILD_TARGET STREQUAL "AMD_64") + add_definitions(-DBUILD_TARGET_AMD_64) +elseif (BUILD_TARGET STREQUAL "X86_32") + add_definitions(-DBUILD_TARGET_X86_32) +elseif (BUILD_TARGET STREQUAL "ARM_32") + add_definitions(-DBUILD_TARGET_ARM_32) +elseif (BUILD_TARGET STREQUAL "MIPS_32") + add_definitions(-DBUILD_TARGET_MIPS_32) +elseif (BUILD_TARGET STREQUAL "XTENSA_32") + add_definitions(-DBUILD_TARGET_XTENSA_32) +else () + message (FATAL_ERROR "-- Build target isn't set") +endif () + +message ("-- Build as target ${BUILD_TARGET}") if (CMAKE_SIZEOF_VOID_P EQUAL 8) -if (${BUILD_AS_64BIT_SUPPORT} STREQUAL "YES") - # Add -fPIC flag if build as 64-bit - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") - set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -fPIC") -else () - add_definitions (-m32) - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32") - set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32") -endif () + if (BUILD_TARGET STREQUAL "X86_64" OR BUILD_TARGET STREQUAL "AMD_64") + # Add -fPIC flag if build as 64-bit + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") + set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -fPIC") + else () + add_definitions (-m32) + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32") + set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32") + endif () endif () if (NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE Debug) endif (NOT CMAKE_BUILD_TYPE) -message ("CMAKE_BUILD_TYPE = " ${CMAKE_BUILD_TYPE}) +message ("-- CMAKE_BUILD_TYPE = " ${CMAKE_BUILD_TYPE}) if (NOT PLATFORM) SET(PLATFORM linux) endif (NOT PLATFORM) -message ("PLATFORM = " ${PLATFORM}) +message ("-- PLATFORM = " ${PLATFORM}) set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections -Wall -Wno-unused-parameter -Wno-pedantic") diff --git a/samples/littlevgl/vgl-wasm-runtime/src/platform/linux/display_indev.c b/samples/littlevgl/vgl-wasm-runtime/src/platform/linux/display_indev.c index 5fe98d429..b9334fbf9 100644 --- a/samples/littlevgl/vgl-wasm-runtime/src/platform/linux/display_indev.c +++ b/samples/littlevgl/vgl-wasm-runtime/src/platform/linux/display_indev.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include diff --git a/samples/littlevgl/vgl-wasm-runtime/src/platform/linux/main.c b/samples/littlevgl/vgl-wasm-runtime/src/platform/linux/main.c index 24cae03d8..e86715324 100644 --- a/samples/littlevgl/vgl-wasm-runtime/src/platform/linux/main.c +++ b/samples/littlevgl/vgl-wasm-runtime/src/platform/linux/main.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ extern void iwasm_main(int argc, char *argv[]); int main(int argc, char *argv[]) diff --git a/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/board_config.h b/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/board_config.h index 1233c300a..d7ea279a9 100644 --- a/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/board_config.h +++ b/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/board_config.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef __BOARD_CONFIG_H__ #define __BOARD_CONFIG_H__ diff --git a/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/display_indev.c b/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/display_indev.c index 58ac43f72..c1d827295 100644 --- a/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/display_indev.c +++ b/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/display_indev.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include #include diff --git a/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/iwasm_main.c b/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/iwasm_main.c index 64e27d715..c77a96c6c 100644 --- a/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/iwasm_main.c +++ b/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/iwasm_main.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "bh_platform.h" #include "runtime_lib.h" diff --git a/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/main.c b/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/main.c index 2b91f0b4c..c44c54d92 100644 --- a/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/main.c +++ b/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/main.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include diff --git a/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/pin_config_jlf.h b/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/pin_config_jlf.h index 5381b72db..3cde4ec14 100644 --- a/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/pin_config_jlf.h +++ b/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/pin_config_jlf.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef __PIN_CONFIG_JLF_H__ #define __PIN_CONFIG_JLF_H__ diff --git a/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/pin_config_stm32.h b/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/pin_config_stm32.h index 0ab295eb0..fba36fab4 100644 --- a/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/pin_config_stm32.h +++ b/samples/littlevgl/vgl-wasm-runtime/src/platform/zephyr/pin_config_stm32.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef __PIN_CONFIG_STM32_H__ #define __PIN_CONFIG_STM32_H__ diff --git a/samples/littlevgl/vgl-wasm-runtime/zephyr-build/CMakeLists.txt b/samples/littlevgl/vgl-wasm-runtime/zephyr-build/CMakeLists.txt index a564c6aab..511048d62 100644 --- a/samples/littlevgl/vgl-wasm-runtime/zephyr-build/CMakeLists.txt +++ b/samples/littlevgl/vgl-wasm-runtime/zephyr-build/CMakeLists.txt @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception cmake_minimum_required(VERSION 3.8.2) @@ -26,6 +15,27 @@ zephyr_compile_definitions (-DNVALGRIND -Dattr_container_malloc=bh_malloc -Dattr_container_free=bh_free) +# Build as ARM_32 by default, change to "X86_32", "MIPS_32" or "XTENSA_32" +# if we want to support x86, mips or xtensa +if (NOT BUILD_TARGET) + set (BUILD_TARGET "ARM_32") +endif () + +string(TOUPPER ${BUILD_TARGET} BUILD_TARGET) + +if (BUILD_TARGET STREQUAL "X86_32") + add_definitions(-DBUILD_TARGET_X86_32) +elseif (BUILD_TARGET STREQUAL "ARM_32") + add_definitions(-DBUILD_TARGET_ARM_32) +elseif (BUILD_TARGET STREQUAL "MIPS_32") + add_definitions(-DBUILD_TARGET_MIPS_32) +elseif (BUILD_TARGET STREQUAL "XTENSA_32") + add_definitions(-DBUILD_TARGET_XTENSA_32) +else () + message (FATAL_ERROR "-- Build target isn't set") +endif () + +message ("-- Build as target ${BUILD_TARGET}") set (IWASM_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/core/iwasm) set (APP_MGR_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/core/app-mgr) set (SHARED_LIB_ROOT ${IWASM_ROOT}/../shared-lib) diff --git a/samples/littlevgl/wasm-apps/Makefile_wasm_app b/samples/littlevgl/wasm-apps/Makefile_wasm_app index 225a7a87b..97046d914 100644 --- a/samples/littlevgl/wasm-apps/Makefile_wasm_app +++ b/samples/littlevgl/wasm-apps/Makefile_wasm_app @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception CC = emcc LVGL_DIR = ${shell pwd} @@ -47,7 +36,7 @@ SRCS += lvgl/lv_misc/lv_task.c lvgl/lv_misc/lv_circ.c lvgl/lv_misc/lv_anim.c SRCS += lvgl/lv_misc/lv_color.c lvgl/lv_misc/lv_txt.c lvgl/lv_misc/lv_math.c SRCS += lvgl/lv_misc/lv_mem.c lvgl/lv_misc/lv_font.c lvgl/lv_misc/lv_ll.c SRCS += lvgl/lv_misc/lv_area.c lvgl/lv_misc/lv_templ.c lvgl/lv_misc/lv_ufs.c -SRCS += lvgl/lv_misc/lv_area.c lvgl/lv_misc/lv_templ.c lvgl/lv_misc/lv_gc.c +SRCS += lvgl/lv_misc/lv_gc.c SRCS += lvgl/lv_hal/lv_hal_tick.c lvgl/lv_hal/lv_hal_indev.c lvgl/lv_hal/lv_hal_disp.c SRCS += lvgl/lv_themes/lv_theme_mono.c lvgl/lv_themes/lv_theme_templ.c SRCS += lvgl/lv_themes/lv_theme_material.c lvgl/lv_themes/lv_theme.c diff --git a/samples/littlevgl/wasm-apps/build_wasm_app.sh b/samples/littlevgl/wasm-apps/build_wasm_app.sh index a88d2a76b..1bb59e02a 100755 --- a/samples/littlevgl/wasm-apps/build_wasm_app.sh +++ b/samples/littlevgl/wasm-apps/build_wasm_app.sh @@ -1,16 +1,5 @@ # Copyright (C) 2019 Intel Corporation. All rights reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception #!/bin/sh if [ ! -d "lvgl" ]; then diff --git a/samples/littlevgl/wasm-apps/src/display_indev.h b/samples/littlevgl/wasm-apps/src/display_indev.h index 7188bd444..fe07d9ab6 100644 --- a/samples/littlevgl/wasm-apps/src/display_indev.h +++ b/samples/littlevgl/wasm-apps/src/display_indev.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #ifndef DISPLAY_INDEV_H_ diff --git a/samples/littlevgl/wasm-apps/src/main.c b/samples/littlevgl/wasm-apps/src/main.c index 7bb50c20b..c5187d3f6 100644 --- a/samples/littlevgl/wasm-apps/src/main.c +++ b/samples/littlevgl/wasm-apps/src/main.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ /** diff --git a/samples/littlevgl/wasm-apps/src/system_header.h b/samples/littlevgl/wasm-apps/src/system_header.h index 5333432b3..8d943c871 100644 --- a/samples/littlevgl/wasm-apps/src/system_header.h +++ b/samples/littlevgl/wasm-apps/src/system_header.h @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include diff --git a/samples/simple/CMakeLists.txt b/samples/simple/CMakeLists.txt index 34bc1b709..698433493 100644 --- a/samples/simple/CMakeLists.txt +++ b/samples/simple/CMakeLists.txt @@ -8,37 +8,70 @@ set (TARGET_PLATFORM "linux") set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") set (CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "") -# Enable repl mode if want to test spec cases -# add_definitions(-DWASM_ENABLE_REPL) - if (NOT ("$ENV{VALGRIND}" STREQUAL "YES")) add_definitions(-DNVALGRIND) endif () -# Currently build as 64-bit by default. set (BUILD_AS_64BIT_SUPPORT "YES") -if (CMAKE_SIZEOF_VOID_P EQUAL 8) -if (${BUILD_AS_64BIT_SUPPORT} STREQUAL "YES") - # Add -fPIC flag if build as 64-bit - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") - set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -fPIC") -else () - add_definitions (-m32) - set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32") - set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32") +# Set BUILD_TARGET, currently values supported: +# "X86_64", "AMD_64", "X86_32", "ARM_32", "MIPS_32", "XTENSA_32" +if (NOT BUILD_TARGET) + if (CMAKE_SIZEOF_VOID_P EQUAL 8) + if (BUILD_AS_64BIT_SUPPORT STREQUAL "YES") + # Build as X86_64 by default in 64-bit platform + set (BUILD_TARGET "X86_64") + else () + set (BUILD_TARGET "X86_32") + endif () + else () + # Build as X86_32 by default in 32-bit platform + set (BUILD_TARGET "X86_32") + endif () endif () + +string(TOUPPER ${BUILD_TARGET} BUILD_TARGET) + +# Add definitions for the build target +if (BUILD_TARGET STREQUAL "X86_64") + add_definitions(-DBUILD_TARGET_X86_64) +elseif (BUILD_TARGET STREQUAL "AMD_64") + add_definitions(-DBUILD_TARGET_AMD_64) +elseif (BUILD_TARGET STREQUAL "X86_32") + add_definitions(-DBUILD_TARGET_X86_32) +elseif (BUILD_TARGET STREQUAL "ARM_32") + add_definitions(-DBUILD_TARGET_ARM_32) +elseif (BUILD_TARGET STREQUAL "MIPS_32") + add_definitions(-DBUILD_TARGET_MIPS_32) +elseif (BUILD_TARGET STREQUAL "XTENSA_32") + add_definitions(-DBUILD_TARGET_XTENSA_32) +else () + message (FATAL_ERROR "-- Build target isn't set") +endif () + +message ("-- Build as target ${BUILD_TARGET}") + +if (CMAKE_SIZEOF_VOID_P EQUAL 8) + if (BUILD_TARGET STREQUAL "X86_64" OR BUILD_TARGET STREQUAL "AMD_64") + # Add -fPIC flag if build as 64-bit + set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") + set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS} -fPIC") + else () + add_definitions (-m32) + set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m32") + set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -m32") + endif () endif () if (NOT CMAKE_BUILD_TYPE) SET(CMAKE_BUILD_TYPE Debug) endif (NOT CMAKE_BUILD_TYPE) -message ("CMAKE_BUILD_TYPE = " ${CMAKE_BUILD_TYPE}) +message ("-- CMAKE_BUILD_TYPE = " ${CMAKE_BUILD_TYPE}) if (NOT PLATFORM) SET(PLATFORM linux) endif (NOT PLATFORM) -message ("PLATFORM = " ${PLATFORM}) +message ("-- PLATFORM = " ${PLATFORM}) set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections") set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections -Wall -Wno-unused-parameter -Wno-pedantic") diff --git a/samples/simple/wasm-apps/connection.c b/samples/simple/wasm-apps/connection.c index 89aed5170..cfaa5ad45 100644 --- a/samples/simple/wasm-apps/connection.c +++ b/samples/simple/wasm-apps/connection.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wasm_app.h" diff --git a/samples/simple/wasm-apps/event_publisher.c b/samples/simple/wasm-apps/event_publisher.c index 96717eeca..d86fe1d22 100644 --- a/samples/simple/wasm-apps/event_publisher.c +++ b/samples/simple/wasm-apps/event_publisher.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wasm_app.h" diff --git a/samples/simple/wasm-apps/event_subscriber.c b/samples/simple/wasm-apps/event_subscriber.c index aea0d77ff..f7d393fc4 100644 --- a/samples/simple/wasm-apps/event_subscriber.c +++ b/samples/simple/wasm-apps/event_subscriber.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wasm_app.h" diff --git a/samples/simple/wasm-apps/gui.c b/samples/simple/wasm-apps/gui.c index b3beb9d0a..0ab1a7be5 100644 --- a/samples/simple/wasm-apps/gui.c +++ b/samples/simple/wasm-apps/gui.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ diff --git a/samples/simple/wasm-apps/gui_lvgl_compatible.c b/samples/simple/wasm-apps/gui_lvgl_compatible.c index 8f2c37a5b..bb8fe035c 100644 --- a/samples/simple/wasm-apps/gui_lvgl_compatible.c +++ b/samples/simple/wasm-apps/gui_lvgl_compatible.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include diff --git a/samples/simple/wasm-apps/request_handler.c b/samples/simple/wasm-apps/request_handler.c index b4820930d..230637d56 100644 --- a/samples/simple/wasm-apps/request_handler.c +++ b/samples/simple/wasm-apps/request_handler.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wasm_app.h" diff --git a/samples/simple/wasm-apps/request_sender.c b/samples/simple/wasm-apps/request_sender.c index f1a9952bd..1e885e57b 100644 --- a/samples/simple/wasm-apps/request_sender.c +++ b/samples/simple/wasm-apps/request_sender.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wasm_app.h" diff --git a/samples/simple/wasm-apps/sensor.c b/samples/simple/wasm-apps/sensor.c index 32705889a..efdd8bdee 100644 --- a/samples/simple/wasm-apps/sensor.c +++ b/samples/simple/wasm-apps/sensor.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wasm_app.h" diff --git a/samples/simple/wasm-apps/timer.c b/samples/simple/wasm-apps/timer.c index d6605fe4e..b6119d976 100644 --- a/samples/simple/wasm-apps/timer.c +++ b/samples/simple/wasm-apps/timer.c @@ -1,17 +1,6 @@ /* * Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ #include "wasm_app.h" diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/application.html b/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/application.html index 55852977c..0b2ea7faf 100644 --- a/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/application.html +++ b/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/application.html @@ -1,17 +1,9 @@ - + + {% load static %} @@ -147,6 +139,3 @@ var search_node ={{search_node|safe}};/*THe queried app node*/ - - - \ No newline at end of file diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/appstore.html b/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/appstore.html index 36f1fb8da..46ecedf15 100644 --- a/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/appstore.html +++ b/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/appstore.html @@ -1,17 +1,9 @@ - + + {% load static %} diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/empty.html b/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/empty.html index 6aef0f2a7..5610a2d84 100644 --- a/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/empty.html +++ b/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/empty.html @@ -1,3 +1,9 @@ + + diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/help.html b/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/help.html index 2e77cfadb..bc834634c 100755 --- a/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/help.html +++ b/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/help.html @@ -1,17 +1,9 @@ - + + {% load static %} @@ -107,4 +99,4 @@ - \ No newline at end of file + diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/mysite.html b/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/mysite.html index 88f0e9234..3832791d1 100644 --- a/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/mysite.html +++ b/test-tools/IoT-APP-Store-Demo/wasm_django/devices/templates/mysite.html @@ -1,17 +1,9 @@ - + + {% load static %} @@ -96,4 +88,4 @@ var dlist = {{dlist|safe}};/*Devices List that render to the current page*/ - \ No newline at end of file + diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/devices/views.py b/test-tools/IoT-APP-Store-Demo/wasm_django/devices/views.py index 4fd4c09c2..cc11a27a0 100755 --- a/test-tools/IoT-APP-Store-Demo/wasm_django/devices/views.py +++ b/test-tools/IoT-APP-Store-Demo/wasm_django/devices/views.py @@ -1,17 +1,6 @@ ''' /* Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ ''' diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/server/wasm_server.py b/test-tools/IoT-APP-Store-Demo/wasm_django/server/wasm_server.py index 1754b368e..5edeb90aa 100755 --- a/test-tools/IoT-APP-Store-Demo/wasm_django/server/wasm_server.py +++ b/test-tools/IoT-APP-Store-Demo/wasm_django/server/wasm_server.py @@ -1,17 +1,6 @@ ''' /* Copyright (C) 2019 Intel Corporation. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ ''' import select diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/static/css/application.css b/test-tools/IoT-APP-Store-Demo/wasm_django/static/css/application.css index 5876b9426..220d4b618 100644 --- a/test-tools/IoT-APP-Store-Demo/wasm_django/static/css/application.css +++ b/test-tools/IoT-APP-Store-Demo/wasm_django/static/css/application.css @@ -1,16 +1,5 @@ /* Copyright (C) 2019 Intel Corporation. All rights reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. +* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ {% load static %} diff --git a/test-tools/IoT-APP-Store-Demo/wasm_django/static/css/appstore.css b/test-tools/IoT-APP-Store-Demo/wasm_django/static/css/appstore.css index 2c49aa16e..1cebcefe9 100644 --- a/test-tools/IoT-APP-Store-Demo/wasm_django/static/css/appstore.css +++ b/test-tools/IoT-APP-Store-Demo/wasm_django/static/css/appstore.css @@ -1,16 +1,5 @@ /* Copyright (C) 2019 Intel Corporation. All rights reserved. -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. +* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception */ {% load static %}