updated to 6.0.1 and added additional processors/toolchains

This commit is contained in:
tameraw
2020-07-16 14:32:40 -07:00
parent f8e91d4762
commit 2c35570dc9
1285 changed files with 550383 additions and 50 deletions

View File

@@ -0,0 +1,3 @@
location=_tx_thread_system_return
condition_enabled=0
cond=

View File

@@ -0,0 +1,13 @@
#Debugger engine properties
#Fri Oct 02 16:50:37 PDT 2015
ARG_ACTION={"location\=_tx_thread_system_return" "condition_enabled\=0" "cond\=" }
docTitle=break_dialog
LOCATION=_tx_thread_system_return
on_push=bpsaved
TYPE=either
TEMPORARY=false
OK_ON_ENTER=1
OK_ENABLED=1
ReadingXML=false
THREAD_SPECIFIC=false
CONDITION_ENABLED=false

View File

@@ -0,0 +1,143 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="com.arc.cdt.toolchain.av2hs.exeDebugConfig.585788724">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.arc.cdt.toolchain.av2hs.exeDebugConfig.585788724" moduleId="org.eclipse.cdt.core.settings" name="Debug">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="com.arc.cdt.toolchain.ARCLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="com.arc.cdt.toolchain.ARCCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="com.arc.cdt.toolchain.ARCAssemblerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" cleanCommand="rm -rf" description="" errorParsers="com.arc.cdt.toolchain.ARCCompilerErrorParser;com.arc.cdt.toolchain.ARCLinkerErrorParser;com.arc.cdt.toolchain.ARCAssemblerErrorParser;org.eclipse.cdt.core.MakeErrorParser" id="com.arc.cdt.toolchain.av2hs.exeDebugConfig.585788724" name="Debug" parent="com.arc.cdt.toolchain.av2hs.exeDebugConfig">
<folderInfo id="com.arc.cdt.toolchain.av2hs.exeDebugConfig.585788724." name="/" resourcePath="">
<toolChain id="com.arc.cdt.toolchain.av2hs.exeToolChainDebug.1358823635" superClass="com.arc.cdt.toolchain.av2hs.exeToolChainDebug">
<targetPlatform id="hcTargetPlatform.1681683287" isAbstract="false" name="Generic platform" superClass="hcTargetPlatform"/>
<builder buildPath="${workspace_loc:/sample_threadx}/Debug" id="makeBuilder.698856797" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" parallelBuildOn="true" parallelizationNumber="optimal" superClass="makeBuilder"/>
<tool id="av2hs.exe.debug.exeCompilerDebug.1743110770" superClass="av2hs.exe.debug.exeCompilerDebug">
<option id="arc.compiler.options.target.version.1719429849" name="ARC Core Version" superClass="arc.compiler.options.target.version" value="arc.compiler.options.target.arcv2hs" valueType="enumerated"/>
<option id="arc.compiler.options.bs.1459483714" name="Barrel shifter (-Xbs/-Xbarrel_shifter)" superClass="arc.compiler.options.bs" value="true" valueType="boolean"/>
<option id="arc.compiler.options.pc_width.1230771954" name="PC register width (-Hpc_width=)" superClass="arc.compiler.options.pc_width" value="32" valueType="enumerated"/>
<option id="arc.compiler.options.lpc_width.898161522" name="LP_COUNT register width (-Hlpc_width=)" superClass="arc.compiler.options.lpc_width" value="32" valueType="enumerated"/>
<option id="arc.compiler.options.include_dirs.688677620" isActive="false" isDefinedList="false" name="Include Directories (one per line)" superClass="arc.compiler.options.include_dirs" useByScannerDiscovery="false" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/tx/inc_generic}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/tx/inc_port}&quot;"/>
</option>
<option id="arc.compiler.options.timers.timer0.92712328" name="Use Timer 0 (-Xtimer0)" superClass="arc.compiler.options.timers.timer0" useByScannerDiscovery="true" value="true" valueType="boolean"/>
<option id="arc.compiler.options.timers.timer1.1544799494" name="Use timer 1 (-Xtimer1)" superClass="arc.compiler.options.timers.timer1" useByScannerDiscovery="true" value="true" valueType="boolean"/>
<inputType id="com.arc.cdt.toolchain.arc.ccac.inputTypeCPP.1372491410" name="MetaWare C++ Input" superClass="com.arc.cdt.toolchain.arc.ccac.inputTypeCPP"/>
<inputType id="com.arc.cdt.toolchain.arc.ccac.inputTypeC.1185403415" name="MetaWare C Input" superClass="com.arc.cdt.toolchain.arc.ccac.inputTypeC"/>
<inputType id="com.arc.cdt.toolchain.arc.inputTypeCL.504312272" name="MetaWare OpenCL" superClass="com.arc.cdt.toolchain.arc.inputTypeCL"/>
</tool>
<tool id="com.arc.cdt.toolchain.av2hs.asmDebugExe.1483523628" superClass="com.arc.cdt.toolchain.av2hs.asmDebugExe">
<option id="arc.asm.options.bs.2039952525" name="Barrel shifter (-Xbs/-Xbarrel_shifter)" superClass="arc.asm.options.bs" value="true" valueType="boolean"/>
<option id="arc.compiler.options.target.asm.version.1049307893" name="ARC Core Version" superClass="arc.compiler.options.target.asm.version" value="arc.compiler.options.target.arcv2hs" valueType="enumerated"/>
<option id="arc.asm.options.timers.timer0.458114208" name="Use Timer 0 (-Xtimer0)" superClass="arc.asm.options.timers.timer0" value="true" valueType="boolean"/>
<option id="arc.asm.options.timers.timer1.820508735" name="Use timer 1 (-Xtimer1)" superClass="arc.asm.options.timers.timer1" value="true" valueType="boolean"/>
<inputType id="com.arc.cdt.toolchain.asminput.252581411" name="Assembler Inputs" superClass="com.arc.cdt.toolchain.asminput"/>
</tool>
<tool id="com.arc.cdt.toolchain.av2hs.exeLinkerDebug.672502322" superClass="com.arc.cdt.toolchain.av2hs.exeLinkerDebug">
<option id="arc.linker.options.bs.294741042" name="Barrel shifter (-Xbs/-Xbarrel_shifter)" superClass="arc.linker.options.bs" value="true" valueType="boolean"/>
<option id="arc.linker.options.pc_width.759198939" name="PC register width (-Bpc_width=)" superClass="arc.linker.options.pc_width" value="com.arc.cdt.toolchain.arc.pcwidth.32" valueType="enumerated"/>
<option id="arc.linker.options.target.version.1387084665" name="Target Runtime Libraries" superClass="arc.linker.options.target.version" value="arc.compiler.options.target.arcv2hs" valueType="enumerated"/>
<option id="arc.link.ld.user_objs.2071654961" name="Additional Object Files &amp;&amp; Libraries" superClass="arc.link.ld.user_objs" valueType="userObjs">
<listOptionValue builtIn="false" value="&quot;..\..\tx\Debug\tx.a&quot;"/>
</option>
<option id="com.arc.cdt.toolchain.option.linker.svr3.979336812" name="SVR3-style command files" superClass="com.arc.cdt.toolchain.option.linker.svr3" valueType="userObjs">
<listOptionValue builtIn="false" value="../sample_threadx.cmd"/>
</option>
<inputType id="com.arc.cdt.toolchain.linker.input.2034293670" name="Linker Input" superClass="com.arc.cdt.toolchain.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="com.arc.cdt.toolchain.arc.archiver.886382681" superClass="com.arc.cdt.toolchain.arc.archiver"/>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
<cconfiguration id="com.arc.cdt.toolchain.av2hs.exeReleaseConfig.2024992869">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="com.arc.cdt.toolchain.av2hs.exeReleaseConfig.2024992869" moduleId="org.eclipse.cdt.core.settings" name="Release">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="com.arc.cdt.toolchain.ARCLinkerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="com.arc.cdt.toolchain.ARCCompilerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="com.arc.cdt.toolchain.ARCAssemblerErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" cleanCommand="rm -rf" description="" errorParsers="com.arc.cdt.toolchain.ARCCompilerErrorParser;com.arc.cdt.toolchain.ARCLinkerErrorParser;com.arc.cdt.toolchain.ARCAssemblerErrorParser;org.eclipse.cdt.core.MakeErrorParser" id="com.arc.cdt.toolchain.av2hs.exeReleaseConfig.2024992869" name="Release" parent="com.arc.cdt.toolchain.av2hs.exeReleaseConfig">
<folderInfo id="com.arc.cdt.toolchain.av2hs.exeReleaseConfig.2024992869." name="/" resourcePath="">
<toolChain id="com.arc.cdt.toolchain.av2hs.exeReleaseToolChain.202924782" superClass="com.arc.cdt.toolchain.av2hs.exeReleaseToolChain">
<targetPlatform id="hcTargetPlatform.325929801" isAbstract="false" name="Generic platform" superClass="hcTargetPlatform"/>
<builder buildPath="${workspace_loc:/sample_threadx}/Release" id="makeBuilder.1770123329" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Gnu Make Builder" superClass="makeBuilder"/>
<tool id="arc.cdt.toolchain.av2hs.exeCompilerRelease.1463268267" superClass="arc.cdt.toolchain.av2hs.exeCompilerRelease">
<inputType id="com.arc.cdt.toolchain.arc.ccac.inputTypeCPP.731007051" name="MetaWare C++ Input" superClass="com.arc.cdt.toolchain.arc.ccac.inputTypeCPP"/>
<inputType id="com.arc.cdt.toolchain.arc.ccac.inputTypeC.1969841336" name="MetaWare C Input" superClass="com.arc.cdt.toolchain.arc.ccac.inputTypeC"/>
<inputType id="com.arc.cdt.toolchain.arc.inputTypeCL.1543064671" name="MetaWare OpenCL" superClass="com.arc.cdt.toolchain.arc.inputTypeCL"/>
</tool>
<tool id="com.arc.cdt.toolchain.av2hs.asmReleaseExe.813382130" superClass="com.arc.cdt.toolchain.av2hs.asmReleaseExe">
<inputType id="com.arc.cdt.toolchain.asminput.2013443758" name="Assembler Inputs" superClass="com.arc.cdt.toolchain.asminput"/>
</tool>
<tool id="com.arc.cdt.toolchain.av2hs.exelinkerRelease.934772409" superClass="com.arc.cdt.toolchain.av2hs.exelinkerRelease">
<inputType id="com.arc.cdt.toolchain.linker.input.1687968329" name="Linker Input" superClass="com.arc.cdt.toolchain.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="com.arc.cdt.toolchain.arc.archiver.990750758" superClass="com.arc.cdt.toolchain.arc.archiver"/>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="sample_threadx.com.arc.cdt.toolchain.arc.av2hs.exeProject.1700533761" name="Executable" projectType="com.arc.cdt.toolchain.arc.av2hs.exeProject"/>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
<storageModule moduleId="refreshScope" versionNumber="2">
<configuration configurationName="Debug">
<resource resourceType="PROJECT" workspacePath="/sample_threadx"/>
</configuration>
<configuration configurationName="Release">
<resource resourceType="PROJECT" workspacePath="/sample_threadx"/>
</configuration>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<scannerConfigBuildInfo instanceId="com.arc.cdt.toolchain.av2hs.exeDebugConfig.585788724;com.arc.cdt.toolchain.av2hs.exeDebugConfig.585788724.;av2hs.exe.debug.exeCompilerDebug.1743110770;com.arc.cdt.toolchain.arc.ccac.inputTypeCPP.1372491410">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.arc.cdt.toolchain.av2hs.exeDebugConfig.585788724;com.arc.cdt.toolchain.av2hs.exeDebugConfig.585788724.;av2hs.exe.debug.exeCompilerDebug.1743110770;com.arc.cdt.toolchain.arc.inputTypeCL.504312272">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.arc.cdt.toolchain.av2hs.exeDebugConfig.585788724;com.arc.cdt.toolchain.av2hs.exeDebugConfig.585788724.;av2hs.exe.debug.exeCompilerDebug.1743110770;com.arc.cdt.toolchain.arc.ccac.inputTypeC.1185403415">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.arc.cdt.toolchain.av2hs.exeReleaseConfig.2024992869;com.arc.cdt.toolchain.av2hs.exeReleaseConfig.2024992869.;arc.cdt.toolchain.av2hs.exeCompilerRelease.1463268267;com.arc.cdt.toolchain.arc.ccac.inputTypeC.1969841336">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.arc.cdt.toolchain.av2hs.exeReleaseConfig.2024992869;com.arc.cdt.toolchain.av2hs.exeReleaseConfig.2024992869.;arc.cdt.toolchain.av2hs.exeCompilerRelease.1463268267;com.arc.cdt.toolchain.arc.ccac.inputTypeCPP.731007051">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="com.arc.cdt.toolchain.av2hs.exeReleaseConfig.2024992869;com.arc.cdt.toolchain.av2hs.exeReleaseConfig.2024992869.;arc.cdt.toolchain.av2hs.exeCompilerRelease.1463268267;com.arc.cdt.toolchain.arc.inputTypeCL.1543064671">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
</scannerConfigBuildInfo>
</storageModule>
</cproject>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>sample_threadx</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<triggers>full,incremental,</triggers>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<configuration id="com.arc.cdt.toolchain.av2hs.exeDebugConfig.585788724" name="Debug">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider copy-of="extension" id="com.arc.cdt.toolchain.arc.language.settings.providers.MccBuildCommandParser"/>
<provider class="com.arc.cdt.toolchain.arc.language.settings.providers.MccBuiltinSpecsDetector" console="false" env-hash="1734832501520030440" id="com.arc.cdt.toolchain.arc.language.settings.providers.MccBuiltinSpecsDetector" keep-relative-paths="false" name="MetaWare MCC Built-in Compiler Settings" parameter="mcc ${FLAGS} -Hbatchnotmp -Hnoobj &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
<provider class="com.arc.cdt.toolchain.arc.language.settings.providers.ClangBuildCommandParser" id="com.arc.cdt.toolchain.arc.language.settings.providers.ClangBuildCommandParser" keep-relative-paths="false" name="MetaWare CCAC Build Output Parser" parameter="ccac" prefer-non-shared="true"/>
<provider class="com.arc.cdt.toolchain.arc.language.settings.providers.ClangBuiltinSpecsDetector" console="false" env-hash="1673674853901204072" id="com.arc.cdt.toolchain.arc.language.settings.providers.ClangBuiltinSpecsDetector" keep-relative-paths="false" name="MetaWare CCAC Built-in Compiler Settings" parameter="ccac ${FLAGS} -v -dM -E &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
</extension>
</configuration>
<configuration id="com.arc.cdt.toolchain.av2hs.exeReleaseConfig.2024992869" name="Release">
<extension point="org.eclipse.cdt.core.LanguageSettingsProvider">
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
<provider copy-of="extension" id="com.arc.cdt.toolchain.arc.language.settings.providers.MccBuildCommandParser"/>
<provider class="com.arc.cdt.toolchain.arc.language.settings.providers.MccBuiltinSpecsDetector" console="false" env-hash="1684062019059214440" id="com.arc.cdt.toolchain.arc.language.settings.providers.MccBuiltinSpecsDetector" keep-relative-paths="false" name="MetaWare MCC Built-in Compiler Settings" parameter="mcc ${FLAGS} -Hbatchnotmp -Hnoobj &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
<provider copy-of="extension" id="com.arc.cdt.toolchain.arc.language.settings.providers.ClangBuildCommandParser"/>
<provider class="com.arc.cdt.toolchain.arc.language.settings.providers.ClangBuiltinSpecsDetector" console="false" env-hash="1673550871635467816" id="com.arc.cdt.toolchain.arc.language.settings.providers.ClangBuiltinSpecsDetector" keep-relative-paths="false" name="MetaWare CCAC Built-in Compiler Settings" parameter="ccac ${FLAGS} -v -dM -E &quot;${INPUTS}&quot;" prefer-non-shared="true">
<language-scope id="org.eclipse.cdt.core.gcc"/>
<language-scope id="org.eclipse.cdt.core.g++"/>
</provider>
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
</extension>
</configuration>
</project>

View File

@@ -0,0 +1,370 @@
/* This is a small demo of the high-performance ThreadX kernel. It includes examples of eight
threads of different priorities, using a message queue, semaphore, mutex, event flags group,
byte pool, and block pool. */
#include "tx_api.h"
#define DEMO_STACK_SIZE 1024
#define DEMO_BYTE_POOL_SIZE 9120
#define DEMO_BLOCK_POOL_SIZE 100
#define DEMO_QUEUE_SIZE 100
/* Define the ThreadX object control blocks... */
TX_THREAD thread_0;
TX_THREAD thread_1;
TX_THREAD thread_2;
TX_THREAD thread_3;
TX_THREAD thread_4;
TX_THREAD thread_5;
TX_THREAD thread_6;
TX_THREAD thread_7;
TX_QUEUE queue_0;
TX_SEMAPHORE semaphore_0;
TX_MUTEX mutex_0;
TX_EVENT_FLAGS_GROUP event_flags_0;
TX_BYTE_POOL byte_pool_0;
TX_BLOCK_POOL block_pool_0;
/* Define the counters used in the demo application... */
ULONG thread_0_counter;
ULONG thread_1_counter;
ULONG thread_1_messages_sent;
ULONG thread_2_counter;
ULONG thread_2_messages_received;
ULONG thread_3_counter;
ULONG thread_4_counter;
ULONG thread_5_counter;
ULONG thread_6_counter;
ULONG thread_7_counter;
/* Define thread prototypes. */
void thread_0_entry(ULONG thread_input);
void thread_1_entry(ULONG thread_input);
void thread_2_entry(ULONG thread_input);
void thread_3_and_4_entry(ULONG thread_input);
void thread_5_entry(ULONG thread_input);
void thread_6_and_7_entry(ULONG thread_input);
/* Define main entry point. */
int main()
{
/* Enter the ThreadX kernel. */
tx_kernel_enter();
return(0);
}
/* Define what the initial system looks like. */
void tx_application_define(void *first_unused_memory)
{
CHAR *pointer = TX_NULL;
/* Create a byte memory pool from which to allocate the thread stacks. */
tx_byte_pool_create(&byte_pool_0, "byte pool 0", first_unused_memory, DEMO_BYTE_POOL_SIZE);
/* Put system definition stuff in here, e.g. thread creates and other assorted
create information. */
/* Allocate the stack for thread 0. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
/* Create the main thread. */
tx_thread_create(&thread_0, "thread 0", thread_0_entry, 0,
pointer, DEMO_STACK_SIZE,
1, 1, TX_NO_TIME_SLICE, TX_AUTO_START);
/* Allocate the stack for thread 1. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
/* Create threads 1 and 2. These threads pass information through a ThreadX
message queue. It is also interesting to note that these threads have a time
slice. */
tx_thread_create(&thread_1, "thread 1", thread_1_entry, 1,
pointer, DEMO_STACK_SIZE,
16, 16, 4, TX_AUTO_START);
/* Allocate the stack for thread 2. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
tx_thread_create(&thread_2, "thread 2", thread_2_entry, 2,
pointer, DEMO_STACK_SIZE,
16, 16, 4, TX_AUTO_START);
/* Allocate the stack for thread 3. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
/* Create threads 3 and 4. These threads compete for a ThreadX counting semaphore.
An interesting thing here is that both threads share the same instruction area. */
tx_thread_create(&thread_3, "thread 3", thread_3_and_4_entry, 3,
pointer, DEMO_STACK_SIZE,
8, 8, TX_NO_TIME_SLICE, TX_AUTO_START);
/* Allocate the stack for thread 4. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
tx_thread_create(&thread_4, "thread 4", thread_3_and_4_entry, 4,
pointer, DEMO_STACK_SIZE,
8, 8, TX_NO_TIME_SLICE, TX_AUTO_START);
/* Allocate the stack for thread 5. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
/* Create thread 5. This thread simply pends on an event flag which will be set
by thread_0. */
tx_thread_create(&thread_5, "thread 5", thread_5_entry, 5,
pointer, DEMO_STACK_SIZE,
4, 4, TX_NO_TIME_SLICE, TX_AUTO_START);
/* Allocate the stack for thread 6. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
/* Create threads 6 and 7. These threads compete for a ThreadX mutex. */
tx_thread_create(&thread_6, "thread 6", thread_6_and_7_entry, 6,
pointer, DEMO_STACK_SIZE,
8, 8, TX_NO_TIME_SLICE, TX_AUTO_START);
/* Allocate the stack for thread 7. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_STACK_SIZE, TX_NO_WAIT);
tx_thread_create(&thread_7, "thread 7", thread_6_and_7_entry, 7,
pointer, DEMO_STACK_SIZE,
8, 8, TX_NO_TIME_SLICE, TX_AUTO_START);
/* Allocate the message queue. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_QUEUE_SIZE*sizeof(ULONG), TX_NO_WAIT);
/* Create the message queue shared by threads 1 and 2. */
tx_queue_create(&queue_0, "queue 0", TX_1_ULONG, pointer, DEMO_QUEUE_SIZE*sizeof(ULONG));
/* Create the semaphore used by threads 3 and 4. */
tx_semaphore_create(&semaphore_0, "semaphore 0", 1);
/* Create the event flags group used by threads 1 and 5. */
tx_event_flags_create(&event_flags_0, "event flags 0");
/* Create the mutex used by thread 6 and 7 without priority inheritance. */
tx_mutex_create(&mutex_0, "mutex 0", TX_NO_INHERIT);
/* Allocate the memory for a small block pool. */
tx_byte_allocate(&byte_pool_0, (VOID **) &pointer, DEMO_BLOCK_POOL_SIZE, TX_NO_WAIT);
/* Create a block memory pool to allocate a message buffer from. */
tx_block_pool_create(&block_pool_0, "block pool 0", sizeof(ULONG), pointer, DEMO_BLOCK_POOL_SIZE);
/* Allocate a block and release the block memory. */
tx_block_allocate(&block_pool_0, (VOID **) &pointer, TX_NO_WAIT);
/* Release the block back to the pool. */
tx_block_release(pointer);
}
/* Define the test threads. */
void thread_0_entry(ULONG thread_input)
{
UINT status;
/* This thread simply sits in while-forever-sleep loop. */
while(1)
{
/* Increment the thread counter. */
thread_0_counter++;
/* Sleep for 10 ticks. */
tx_thread_sleep(10);
/* Set event flag 0 to wakeup thread 5. */
status = tx_event_flags_set(&event_flags_0, 0x1, TX_OR);
/* Check status. */
if (status != TX_SUCCESS)
break;
}
}
void thread_1_entry(ULONG thread_input)
{
UINT status;
/* This thread simply sends messages to a queue shared by thread 2. */
while(1)
{
/* Increment the thread counter. */
thread_1_counter++;
/* Send message to queue 0. */
status = tx_queue_send(&queue_0, &thread_1_messages_sent, TX_WAIT_FOREVER);
/* Check completion status. */
if (status != TX_SUCCESS)
break;
/* Increment the message sent. */
thread_1_messages_sent++;
}
}
void thread_2_entry(ULONG thread_input)
{
ULONG received_message;
UINT status;
/* This thread retrieves messages placed on the queue by thread 1. */
while(1)
{
/* Increment the thread counter. */
thread_2_counter++;
/* Retrieve a message from the queue. */
status = tx_queue_receive(&queue_0, &received_message, TX_WAIT_FOREVER);
/* Check completion status and make sure the message is what we
expected. */
if ((status != TX_SUCCESS) || (received_message != thread_2_messages_received))
break;
/* Otherwise, all is okay. Increment the received message count. */
thread_2_messages_received++;
}
}
void thread_3_and_4_entry(ULONG thread_input)
{
UINT status;
/* This function is executed from thread 3 and thread 4. As the loop
below shows, these function compete for ownership of semaphore_0. */
while(1)
{
/* Increment the thread counter. */
if (thread_input == 3)
thread_3_counter++;
else
thread_4_counter++;
/* Get the semaphore with suspension. */
status = tx_semaphore_get(&semaphore_0, TX_WAIT_FOREVER);
/* Check status. */
if (status != TX_SUCCESS)
break;
/* Sleep for 2 ticks to hold the semaphore. */
tx_thread_sleep(2);
/* Release the semaphore. */
status = tx_semaphore_put(&semaphore_0);
/* Check status. */
if (status != TX_SUCCESS)
break;
}
}
void thread_5_entry(ULONG thread_input)
{
UINT status;
ULONG actual_flags;
/* This thread simply waits for an event in a forever loop. */
while(1)
{
/* Increment the thread counter. */
thread_5_counter++;
/* Wait for event flag 0. */
status = tx_event_flags_get(&event_flags_0, 0x1, TX_OR_CLEAR,
&actual_flags, TX_WAIT_FOREVER);
/* Check status. */
if ((status != TX_SUCCESS) || (actual_flags != 0x1))
break;
}
}
void thread_6_and_7_entry(ULONG thread_input)
{
UINT status;
/* This function is executed from thread 6 and thread 7. As the loop
below shows, these function compete for ownership of mutex_0. */
while(1)
{
/* Increment the thread counter. */
if (thread_input == 6)
thread_6_counter++;
else
thread_7_counter++;
/* Get the mutex with suspension. */
status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER);
/* Check status. */
if (status != TX_SUCCESS)
break;
/* Get the mutex again with suspension. This shows
that an owning thread may retrieve the mutex it
owns multiple times. */
status = tx_mutex_get(&mutex_0, TX_WAIT_FOREVER);
/* Check status. */
if (status != TX_SUCCESS)
break;
/* Sleep for 2 ticks to hold the mutex. */
tx_thread_sleep(2);
/* Release the mutex. */
status = tx_mutex_put(&mutex_0);
/* Check status. */
if (status != TX_SUCCESS)
break;
/* Release the mutex again. This will actually
release ownership since it was obtained twice. */
status = tx_mutex_put(&mutex_0);
/* Check status. */
if (status != TX_SUCCESS)
break;
}
}

View File

@@ -0,0 +1,54 @@
//
// This is the linker script example (SRV3-style).
// (c) Synopsys, 2013
//
//
//number of exceptions and interrupts
NUMBER_OF_EXCEPTIONS = 16;//it is fixed (16)
NUMBER_OF_INTERRUPTS = 5;//depends on HW configuration
//define Interrupt Vector Table size
IVT_SIZE_ITEMS = (NUMBER_OF_EXCEPTIONS + NUMBER_OF_INTERRUPTS);//the total IVT size (in "items")
IVT_SIZE_BYTES = IVT_SIZE_ITEMS * 4;//in bytes
//define ICCM and DCCM locations
MEMORY {
ICCM: ORIGIN = 0x00000000, LENGTH = 128K
DCCM: ORIGIN = 0x80000000, LENGTH = 128K
}
//define sections and groups
SECTIONS {
GROUP: {
.ivt (TEXT) : # Interrupt table
{
___ivt1 = .;
* (.ivt)
___ivt2 = .;
// Make the IVT at least IVT_SIZE_BYTES
. += (___ivt2 - ___ivt1 < IVT_SIZE_BYTES) ? (IVT_SIZE_BYTES - (___ivt2 - ___ivt1)) : 0;
}
.ivh (TEXT) : // Interrupt handlers
//TEXT sections
.text? : { *('.text$crt*') }
* (TEXT): {}
//Literals
* (LIT): {}
} > ICCM
GROUP: {
//data sections
.sdata?: {}
.sbss?: {}
*(DATA): {}
*(BSS): {}
//stack
.stack ALIGN(4) SIZE(DEFINED _STACKSIZE?_STACKSIZE:4096): {}
//heap (empty)
.heap? ALIGN(4) SIZE(DEFINED _HEAPSIZE?_HEAPSIZE:0): {}
.free_memory: {}
} > DCCM
}

View File

@@ -0,0 +1,328 @@
;/**************************************************************************/
;/* */
;/* Copyright (c) Microsoft Corporation. All rights reserved. */
;/* */
;/* This software is licensed under the Microsoft Software License */
;/* Terms for Microsoft Azure RTOS. Full text of the license can be */
;/* found in the LICENSE file at https://aka.ms/AzureRTOS_EULA */
;/* and in the root directory of this software. */
;/* */
;/**************************************************************************/
;
;
;/**************************************************************************/
;/**************************************************************************/
;/** */
;/** ThreadX Component */
;/** */
;/** Initialize */
;/** */
;/**************************************************************************/
;/**************************************************************************/
;
.equ IRQ_SELECT, 0x40B
;
;
; /* Define section for placement after all linker allocated RAM memory. This
; is used to calculate the first free address that is passed to
; tx_appication_define, soley for the ThreadX application's use. */
;
.section ".free_memory","aw"
.align 4
.global _tx_first_free_address
_tx_first_free_address:
.space 4
;
;
.text
;/**************************************************************************/
;/* */
;/* FUNCTION RELEASE */
;/* */
;/* _tx_initialize_low_level ARC_HS/MetaWare */
;/* 6.0.1 */
;/* AUTHOR */
;/* */
;/* William E. Lamie, Microsoft Corporation */
;/* */
;/* DESCRIPTION */
;/* */
;/* This function is responsible for any low-level processor */
;/* initialization, including setting up interrupt vectors, setting */
;/* up a periodic timer interrupt source, saving the system stack */
;/* pointer for use in ISR processing later, and finding the first */
;/* available RAM memory address for tx_application_define. */
;/* */
;/* INPUT */
;/* */
;/* None */
;/* */
;/* OUTPUT */
;/* */
;/* None */
;/* */
;/* CALLS */
;/* */
;/* None */
;/* */
;/* CALLED BY */
;/* */
;/* _tx_initialize_kernel_enter ThreadX entry function */
;/* */
;/* RELEASE HISTORY */
;/* */
;/* DATE NAME DESCRIPTION */
;/* */
;/* 06-30-2020 William E. Lamie Initial Version 6.0.1 */
;/* */
;/**************************************************************************/
;VOID _tx_initialize_low_level(VOID)
;{
.global _tx_initialize_low_level
.type _tx_initialize_low_level, @function
_tx_initialize_low_level:
;
; /* Save the system stack pointer. */
; _tx_thread_system_stack_ptr = (VOID_PTR) (sp);
;
st sp, [gp, _tx_thread_system_stack_ptr@sda] ; Save system stack pointer
;
;
; /* Pickup the first available memory address. */
;
mov r0, _tx_first_free_address ; Pickup first free memory address
;
; /* Save the first available memory address. */
; _tx_initialize_unused_memory = (VOID_PTR) _end;
;
st r0, [gp, _tx_initialize_unused_memory@sda]
;
;
; /* Setup Timer 0 for periodic interrupts at interrupt vector 16. */
;
mov r0, 0 ; Disable additional ISR reg saving/restoring
sr r0, [AUX_IRQ_CTRL] ;
mov r0, 16 ; Select timer 0
sr r0, [IRQ_SELECT] ;
mov r0, 15 ; Set timer 0 to priority 15
sr r0, [IRQ_PRIORITY] ;
mov r0, 1 ; Enable this interrupt
sr r0, [IRQ_ENABLE] ;
mov r0, 0x10000 ; Setup timer period
sr r0, [LIMIT0] ;
mov r0, 0 ; Clear timer 0 current count
sr r0, [COUNT0] ;
mov r0, 3 ; Enable timer 0
sr r0, [CONTROL0] ;
.ifdef TX_TIMER_1_SETUP
mov r0, 17 ; Select timer 1
sr r0, [IRQ_SELECT] ;
mov r0, 0 ; Set timer 1 to priority 0
sr r0, [IRQ_PRIORITY] ;
mov r0, 1 ; Enable this interrupt
sr r0, [IRQ_ENABLE] ;
mov r0, 0x10020 ; Setup timer period
sr r0, [LIMIT1] ;
mov r0, 0 ; Clear timer 0 current count
sr r0, [COUNT1] ;
mov r0, 3 ; Enable timer 0
sr r0, [CONTROL1] ;
.endif
;
; /* Done, return to caller. */
;
j_s.d [blink] ; Return to caller
nop
;}
;
;
; /* Define default vector table entries. */
;
.global _tx_memory_error
_tx_memory_error:
flag 1
nop
nop
nop
b _tx_memory_error
.global _tx_instruction_error
_tx_instruction_error:
flag 1
nop
nop
nop
b _tx_instruction_error
.global _tx_ev_machine_check
_tx_ev_machine_check:
flag 1
nop
nop
nop
b _tx_ev_machine_check
.global _tx_ev_tblmiss_inst
_tx_ev_tblmiss_inst:
flag 1
nop
nop
nop
b _tx_ev_tblmiss_inst
.global _tx_ev_tblmiss_data
_tx_ev_tblmiss_data:
flag 1
nop
nop
nop
b _tx_ev_tblmiss_data
.global _tx_ev_protection_viol
_tx_ev_protection_viol:
flag 1
nop
nop
nop
b _tx_ev_protection_viol
.global _tx_ev_privilege_viol
_tx_ev_privilege_viol:
flag 1
nop
nop
nop
b _tx_ev_privilege_viol
.global _tx_ev_software_int
_tx_ev_software_int:
flag 1
nop
nop
nop
b _tx_ev_software_int
.global _tx_ev_trap
_tx_ev_trap:
flag 1
nop
nop
nop
b _tx_ev_trap
.global _tx_ev_extension
_tx_ev_extension:
flag 1
nop
nop
nop
b _tx_ev_extension
.global _tx_ev_divide_by_zero
_tx_ev_divide_by_zero:
flag 1
nop
nop
nop
b _tx_ev_divide_by_zero
.global _tx_ev_dc_error
_tx_ev_dc_error:
flag 1
nop
nop
nop
b _tx_ev_dc_error
.global _tx_ev_maligned
_tx_ev_maligned:
flag 1
nop
nop
nop
b _tx_ev_maligned
.global _tx_unsued_0
_tx_unsued_0:
flag 1
nop
nop
nop
b _tx_unsued_0
.global _tx_unused_1
_tx_unused_1:
flag 1
nop
nop
nop
b _tx_unused_1
.global _tx_timer_0
_tx_timer_0:
;
; /* By default, setup Timer 0 as the ThreadX timer interrupt. */
;
sub sp, sp, 160 ; Allocate an interrupt stack frame
st r0, [sp, 0] ; Save r0
st r1, [sp, 4] ; Save r1
st r2, [sp, 8] ; Save r2
mov r0, 3
sr r0, [CONTROL0]
b _tx_timer_interrupt ; Jump to generic ThreadX timer interrupt
; handler
; flag 1
; nop
; nop
; nop
; b _tx_timer_0
.global _tx_timer_1
_tx_timer_1:
flag 1
nop
nop
nop
b _tx_timer_1
; bl _tx_thread_context_fast_save
; mov r0, 3
; sr r0, [CONTROL1]
;
; /* Fast ISR processing goes here. Interrupts must not be re-enabled
; in the fast interrupt mode. Also note that multiple register banks
; are available and the fast interrupt processing always maps to
; register bank 1. */
;
; b _tx_thread_context_fast_restore
.global _tx_undefined_0
_tx_undefined_0:
flag 1
nop
nop
nop
b _tx_undefined_0
.global _tx_undefined_1
_tx_undefined_1:
flag 1
nop
nop
nop
b _tx_undefined_1
.global _tx_undefined_2
_tx_undefined_2:
flag 1
nop
nop
nop
b _tx_undefined_2
.end

View File

@@ -0,0 +1,29 @@
.file "vectors.s"
.section .ivt,text
;; This directive forces this section to stay resident even if stripped out by the -zpurgetext linker option
.sectflag .ivt,include
;// handler's name type number name offset in IVT (hex/dec)
.long _start ; exception 0 program entry point offset 0x0 0
.long _tx_memory_error ; exception 1 memory_error offset 0x4 4
.long _tx_instruction_error ; exception 2 instruction_error offset 0x8 8
.long _tx_ev_machine_check ; exception 3 EV_MachineCheck offset 0xC 12
.long _tx_ev_tblmiss_inst ; exception 4 EV_TLBMissI offset 0x10 16
.long _tx_ev_tblmiss_data ; exception 5 EV_TLBMissD offset 0x14 20
.long _tx_ev_protection_viol ; exception 6 EV_ProtV offset 0x18 24
.long _tx_ev_privilege_viol ; exception 7 EV_PrivilegeV offset 0x1C 28
.long _tx_ev_software_int ; exception 8 EV_SWI offset 0x20 32
.long _tx_ev_trap ; exception 9 EV_Trap offset 0x24 36
.long _tx_ev_extension ; exception 10 EV_Extension offset 0x28 40
.long _tx_ev_divide_by_zero ; exception 11 EV_DivZero offset 0x2C 44
.long _tx_ev_dc_error ; exception 12 EV_DCError offset 0x30 48
.long _tx_ev_maligned ; exception 13 EV_Maligned offset 0x34 52
.long _tx_unsued_0 ; exception 14 unused offset 0x38 56
.long _tx_unused_1 ; exception 15 unused offset 0x3C 60
.long _tx_timer_0 ; IRQ 16 Timer 0 offset 0x40 64
.long _tx_timer_1 ; IRQ 17 Timer 1 offset 0x44 68
.long _tx_undefined_0 ; IRQ 18 offset 0x48 72
.long _tx_undefined_1 ; IRQ 19 offset 0x4C 76
.long _tx_undefined_2 ; IRQ 20 offset 0x50 80