diff options
Diffstat (limited to 'Tests/GhsMulti/GhsMultiIntegrity')
16 files changed, 118 insertions, 0 deletions
diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/CMakeLists.txt b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/CMakeLists.txt new file mode 100644 index 0000000..d4cbf04 --- /dev/null +++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/CMakeLists.txt @@ -0,0 +1,19 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +cmake_minimum_required(VERSION 3.12 FATAL_ERROR) + +project(test C) + +add_link_options("-non_shared") + +# create virtual AS +add_executable(vas exe.c) +target_link_libraries(vas lib) +add_library(lib func.c) + +# create dynamic download INTEGRITY application +add_executable(dynamic) +set_target_properties(dynamic PROPERTIES ghs_integrity_app ON) +target_compile_options(dynamic PRIVATE -dynamic) +add_dependencies(dynamic vas) diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/exe.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/exe.c new file mode 100644 index 0000000..29ad70a --- /dev/null +++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/exe.c @@ -0,0 +1,5 @@ +extern int func(void); +int main(void) +{ + return func(); +} diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/func.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/func.c new file mode 100644 index 0000000..b35e9cc --- /dev/null +++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDD/func.c @@ -0,0 +1,4 @@ +int func(void) +{ + return 2; +} diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/App/CMakeLists.txt b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/App/CMakeLists.txt new file mode 100644 index 0000000..e431217 --- /dev/null +++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/App/CMakeLists.txt @@ -0,0 +1,4 @@ +add_executable(App Main.c) +target_include_directories(App PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../Lib) +target_link_libraries(App Lib) +target_compile_options(App PUBLIC "-non_shared") diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/App/Main.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/App/Main.c new file mode 100644 index 0000000..db8d658 --- /dev/null +++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/App/Main.c @@ -0,0 +1,8 @@ +#include "HelperFun.h" + +int main(int argc, const char* argv[]) +{ + int out; + out = giveNum(); + return out; +} diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/CMakeLists.txt b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/CMakeLists.txt new file mode 100644 index 0000000..92254e6 --- /dev/null +++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/CMakeLists.txt @@ -0,0 +1,6 @@ +cmake_minimum_required(VERSION 3.1) +project(test) + +add_subdirectory(App) +add_subdirectory(Int) +add_subdirectory(Lib) diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/AppDD.int b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/AppDD.int new file mode 100644 index 0000000..5035d58 --- /dev/null +++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/AppDD.int @@ -0,0 +1,12 @@ +# Input File for the Integrate utility for use with the INTEGRITY real-time +# operating system by Green Hills Software. +# Before editing this file, refer to the Integrate Reference Manual. + +Kernel + Filename DynamicDownload +EndKernel + +AddressSpace App + Filename "App/App" + Language C +EndAddressSpace diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/CMakeLists.txt b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/CMakeLists.txt new file mode 100644 index 0000000..d173c01 --- /dev/null +++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Int/CMakeLists.txt @@ -0,0 +1 @@ +add_executable(AppDD AppDD.int) diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/CMakeLists.txt b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/CMakeLists.txt new file mode 100644 index 0000000..00e0f59 --- /dev/null +++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/CMakeLists.txt @@ -0,0 +1 @@ +add_library(Lib HelperFun.c HelperFun.h) diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/HelperFun.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/HelperFun.c new file mode 100644 index 0000000..61922bb --- /dev/null +++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/HelperFun.c @@ -0,0 +1,4 @@ +int giveNum(void) +{ + return 1; +} diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/HelperFun.h b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/HelperFun.h new file mode 100644 index 0000000..00971b0 --- /dev/null +++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityDDInt/Lib/HelperFun.h @@ -0,0 +1 @@ +int giveNum(void); diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/CMakeLists.txt b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/CMakeLists.txt new file mode 100644 index 0000000..c5db155 --- /dev/null +++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/CMakeLists.txt @@ -0,0 +1,20 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +cmake_minimum_required(VERSION 3.12 FATAL_ERROR) + +add_link_options("-non_shared") + +project(test C) + +# create virtual AS +add_executable(vas exe.c) +target_link_libraries(vas lib) +add_library(lib func.c) + +# create kernel +add_executable(kernel kernel.c) +target_link_options(kernel PRIVATE -kernel) + +# create monolith INTEGRITY application +add_executable(monolith test.int) diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/exe.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/exe.c new file mode 100644 index 0000000..29ad70a --- /dev/null +++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/exe.c @@ -0,0 +1,5 @@ +extern int func(void); +int main(void) +{ + return func(); +} diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/func.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/func.c new file mode 100644 index 0000000..c302418 --- /dev/null +++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/func.c @@ -0,0 +1,5 @@ + +int func(void) +{ + return 2; +} diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/kernel.c b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/kernel.c new file mode 100644 index 0000000..d1bce33 --- /dev/null +++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/kernel.c @@ -0,0 +1,15 @@ +#include "INTEGRITY.h" +#include "boottable.h" + +void main() +{ + Exit(0); +} + +/* This global table will be filled in during the Integrate phase with */ +/* information about the AddressSpaces, Tasks, and Objects that are to be */ +/* created. If you do not plan to use Integrate, you may omit this file from + */ +/* the kernel, and the boot table code will then not be included. */ + +GlobalTable TheGlobalTable = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1 }; diff --git a/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/test.int b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/test.int new file mode 100644 index 0000000..361793a --- /dev/null +++ b/Tests/GhsMulti/GhsMultiIntegrity/GhsMultiIntegrityMonolith/test.int @@ -0,0 +1,8 @@ +Kernel + Filename kernel +EndKernel + +AddressSpace App + Filename vas + Language C +EndAddressSpace |