forked from Imagelibrary/threadx
Compare commits
57 Commits
v6.1.10_re
...
v6.3.0_rel
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
13b700fd3e | ||
|
|
9ee2738aec | ||
|
|
bc4bd804d5 | ||
|
|
d43cba10b2 | ||
|
|
a0a0ef9385 | ||
|
|
6aeefea8e6 | ||
|
|
cd9007712b | ||
|
|
bc8bed494d | ||
|
|
7fa087d061 | ||
|
|
1ffd7c2cde | ||
|
|
fd2bf7c19a | ||
|
|
8ff9910ddc | ||
|
|
08380caa77 | ||
|
|
1b2995cea8 | ||
|
|
25a8fa2362 | ||
|
|
71cc95eaed | ||
|
|
361590dc40 | ||
|
|
d66a519685 | ||
|
|
6b8ece0ff2 | ||
|
|
6d9f25fac9 | ||
|
|
e2a8334f96 | ||
|
|
7a3bb8311b | ||
|
|
b11d1be6ac | ||
|
|
390c5ce1b7 | ||
|
|
672c5e953e | ||
|
|
23680f5e5f | ||
|
|
d64ef2ab06 | ||
|
|
4c4547d5d5 | ||
|
|
0d308c7ae6 | ||
|
|
487ca45752 | ||
|
|
5f430f22e2 | ||
|
|
ebeb02b958 | ||
|
|
ac3b6b326c | ||
|
|
dac41f6015 | ||
|
|
f4d6b638de | ||
|
|
2aa19f3de0 | ||
|
|
745395d6a2 | ||
|
|
9bf9fbd86f | ||
|
|
37f6d0b39c | ||
|
|
4e62226eea | ||
|
|
b42c5acd8b | ||
|
|
35a301ad3b | ||
|
|
e23b09fe0b | ||
|
|
aea1a3d8f9 | ||
|
|
ee892502ec | ||
|
|
3e8e85cdc1 | ||
|
|
b871c33620 | ||
|
|
b6fb0b8e09 | ||
|
|
35cfbfbd58 | ||
|
|
8c3c08f108 | ||
|
|
54cda6ee9e | ||
|
|
83b57acde9 | ||
|
|
e11c166a40 | ||
|
|
408f9fa1b7 | ||
|
|
cef9cb22a5 | ||
|
|
f851772ce0 | ||
|
|
cd4e736a44 |
13
.devcontainer/devcontainer.json
Normal file
13
.devcontainer/devcontainer.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"image": "ghcr.io/tiejunms/azure_rtos_docker",
|
||||
|
||||
// Add the IDs of extensions you want installed when the container is created.
|
||||
"extensions": [
|
||||
"ms-vscode.cpptools",
|
||||
"ms-vscode.cmake-tools"
|
||||
],
|
||||
|
||||
"remoteUser": "vscode",
|
||||
|
||||
"runArgs": [ "--cap-add=NET_ADMIN"]
|
||||
}
|
||||
1
.github/CODEOWNERS
vendored
Normal file
1
.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1 @@
|
||||
@azure-rtos/admins
|
||||
35
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
35
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve Azure RTOS.
|
||||
title: ''
|
||||
labels: bug, hardware
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
Please also mention any information which could help others to understand
|
||||
the problem you're facing:
|
||||
- What target device are you using?
|
||||
- Which version of Azure RTOS?
|
||||
- What toolchain and environment?
|
||||
- What have you tried to diagnose or workaround this issue?
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Build my project in IAR Workbench.
|
||||
1. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Impact**
|
||||
What impact does this issue have on your progress (e.g., annoyance, showstopper)
|
||||
|
||||
**Logs and console output**
|
||||
If applicable, add console logs or other types of debug information like Wireshark capture as `.zip` file.
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea or enhancement to existing feature for Azure RTOS.
|
||||
title: ''
|
||||
labels: feature
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
19
.github/ISSUE_TEMPLATE/hardware-or-architecture-support.md
vendored
Normal file
19
.github/ISSUE_TEMPLATE/hardware-or-architecture-support.md
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
---
|
||||
name: Hardware or architecture support
|
||||
about: Suggest adding hardware or new architecture support.
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is this request related to a particular hardware platform, SoC, board? Please describe.**
|
||||
Describe in details the hardware support being requested and why this support benefits Azure RTOS.
|
||||
|
||||
**Describe why you are asking for this support?**
|
||||
Describe why you are asking for this support.
|
||||
|
||||
If this is a new board or SoC, please state whether you are willing to maintain the Azure RTOS support together with you.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or graphics (drag-and-drop an image) about the hardware here.
|
||||
5
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
5
.github/PULL_REQUEST_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
## PR checklist
|
||||
<!--- Put an `x` in all the boxes that apply. -->
|
||||
- [ ] Updated function header with a short description and version number
|
||||
- [ ] Added test case for bug fix or new feature
|
||||
- [ ] Validated on real hardware <!-- hardware - toolchain -->
|
||||
5
.github/workflows/ci_cortex_m0.yml
vendored
5
.github/workflows/ci_cortex_m0.yml
vendored
@@ -9,6 +9,11 @@ on:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- ".github/workflows/ci_cortex_m0.yml"
|
||||
- 'common/**'
|
||||
- 'utility/**'
|
||||
- 'ports/cortex_m0/gnu/**'
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
|
||||
5
.github/workflows/ci_cortex_m3.yml
vendored
5
.github/workflows/ci_cortex_m3.yml
vendored
@@ -9,6 +9,11 @@ on:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- ".github/workflows/ci_cortex_m3.yml"
|
||||
- 'common/**'
|
||||
- 'utility/**'
|
||||
- 'ports/cortex_m3/gnu/**'
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
|
||||
5
.github/workflows/ci_cortex_m4.yml
vendored
5
.github/workflows/ci_cortex_m4.yml
vendored
@@ -9,6 +9,11 @@ on:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- ".github/workflows/ci_cortex_m4.yml"
|
||||
- 'common/**'
|
||||
- 'utility/**'
|
||||
- 'ports/cortex_m4/gnu/**'
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
|
||||
5
.github/workflows/ci_cortex_m7.yml
vendored
5
.github/workflows/ci_cortex_m7.yml
vendored
@@ -9,6 +9,11 @@ on:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- ".github/workflows/ci_cortex_m7.yml"
|
||||
- 'common/**'
|
||||
- 'utility/**'
|
||||
- 'ports/cortex_m7/gnu/**'
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
|
||||
110
.github/workflows/codeql.yml
vendored
Normal file
110
.github/workflows/codeql.yml
vendored
Normal file
@@ -0,0 +1,110 @@
|
||||
# For most projects, this workflow file will not need changing; you simply need
|
||||
# to commit it to your repository.
|
||||
#
|
||||
# You may wish to alter this file to override the set of languages analyzed,
|
||||
# or to provide custom queries or build logic.
|
||||
#
|
||||
# ******** NOTE ********
|
||||
# We have attempted to detect the languages in your repository. Please check
|
||||
# the `language` matrix defined below to confirm you have the correct set of
|
||||
# supported CodeQL languages.
|
||||
#
|
||||
name: "CodeQL"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: '33 1 * * 6'
|
||||
|
||||
jobs:
|
||||
analyze:
|
||||
name: Analyze
|
||||
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
|
||||
timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }}
|
||||
permissions:
|
||||
actions: read
|
||||
contents: read
|
||||
security-events: write
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
language: [ 'cpp' ]
|
||||
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby', 'swift' ]
|
||||
# Use only 'java' to analyze code written in Java, Kotlin or both
|
||||
# Use only 'javascript' to analyze code written in JavaScript, TypeScript or both
|
||||
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support
|
||||
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v3
|
||||
|
||||
# Initializes the CodeQL tools for scanning.
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@v2
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
# If you wish to specify custom queries, you can do so here or in a config file.
|
||||
# By default, queries listed here will override any specified in a config file.
|
||||
# Prefix the list here with "+" to use these queries and those in the config file.
|
||||
|
||||
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
|
||||
# queries: security-extended,security-and-quality
|
||||
|
||||
|
||||
# Autobuild attempts to build any compiled languages (C/C++, C#, Go, Java, or Swift).
|
||||
# If this step fails, then you should remove it and run the build manually (see below)
|
||||
#- name: Autobuild
|
||||
# uses: github/codeql-action/autobuild@v2
|
||||
|
||||
|
||||
# ℹ️ Command-line programs to run using the OS shell.
|
||||
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
|
||||
|
||||
# If the Autobuild fails above, remove it and uncomment the following three lines.
|
||||
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.
|
||||
|
||||
#- run: |
|
||||
# echo "Run, Build Application using script"
|
||||
# ./scripts/install.sh
|
||||
# ./test/tx/cmake/run.sh build
|
||||
|
||||
# Store the arm compilers in the cache to speed up builds
|
||||
- name: Cache arm-none-eabi-gcc tools
|
||||
id: cache-arm-gcc
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: $HOME/arm-none-eabi-gcc-9-2019-q4
|
||||
key: ${{ runner.os }}-arm-gcc-9-2019-q4
|
||||
|
||||
# Get the arm-non-eabi-gcc toolchain
|
||||
- name: Install arm-none-eabi-gcc
|
||||
uses: fiam/arm-none-eabi-gcc@v1
|
||||
if: steps.cache-arm-gcc.outputs.cache-hit != 'true'
|
||||
with:
|
||||
release: '9-2019-q4' # The arm-none-eabi-gcc release to use.
|
||||
directory: $HOME/arm-none-eabi-gcc-9-2019-q4
|
||||
|
||||
# Get CMake into the environment
|
||||
- name: Install cmake 3.19.1
|
||||
uses: lukka/get-cmake@v3.19.1
|
||||
|
||||
# Get Ninja into the environment
|
||||
- name: Install ninja-build
|
||||
uses: seanmiddleditch/gha-setup-ninja@v3
|
||||
|
||||
# Prepare the build system
|
||||
- name: Prepare build system
|
||||
run: cmake -Bbuild -DCMAKE_TOOLCHAIN_FILE=./cmake/cortex_m0.cmake -GNinja .
|
||||
env:
|
||||
PATH: "$HOME/arm-none-eabi-gcc-9-2019-q4/bin:$PATH"
|
||||
|
||||
- name: Compile and link
|
||||
run: cmake --build ./build
|
||||
env:
|
||||
PATH: "$HOME/arm-none-eabi-gcc-9-2019-q4/bin:$PATH"
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@v2
|
||||
with:
|
||||
category: "/language:${{matrix.language}}"
|
||||
73
.github/workflows/ports_arch_check.yml
vendored
Normal file
73
.github/workflows/ports_arch_check.yml
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
# This is a basic workflow to help you get started with Actions
|
||||
|
||||
name: ports_arch_check
|
||||
|
||||
# Controls when the action will run. Triggers the workflow on push or pull request
|
||||
# events but only for the master branch
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
paths:
|
||||
- ".github/workflows/ports_arch_check.yml"
|
||||
- 'common/**'
|
||||
- 'common_modules/**'
|
||||
- 'common_smp/**'
|
||||
- 'ports/**'
|
||||
- 'ports_modules/**'
|
||||
- 'ports_smp/**'
|
||||
- 'ports_arch/**'
|
||||
|
||||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
|
||||
jobs:
|
||||
# Check ports for cortex-m
|
||||
cortex-m:
|
||||
# The type of runner that the job will run on
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- name: Checkout sources recursively
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.REPO_SCOPED_TOKEN }}
|
||||
submodules: true
|
||||
|
||||
# Copy ports arch
|
||||
- name: Copy ports arch
|
||||
run: |
|
||||
scripts/copy_armv7_m.sh && scripts/copy_armv8_m.sh && scripts/copy_module_armv7_m.sh
|
||||
if [[ -n $(git status --porcelain -uno) ]]; then
|
||||
echo "Ports for ARM architecture is not updated"
|
||||
git status
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cortex-a:
|
||||
# Check ports for cortex-a
|
||||
runs-on: windows-latest
|
||||
|
||||
# Steps represent a sequence of tasks that will be executed as part of the job
|
||||
steps:
|
||||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
|
||||
- name: Checkout sources recursively
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.REPO_SCOPED_TOKEN }}
|
||||
submodules: true
|
||||
|
||||
# Copy ports arch
|
||||
- name: Copy ports arch
|
||||
run: |
|
||||
cd ports_arch/ARMv7-A
|
||||
pwsh -Command ./update.ps1 -PortSets tx -CopyCommonFiles -CopyPortFiles -CopyExample -PatchFiles
|
||||
cd ../../ports_arch/ARMv8-A
|
||||
pwsh -Command ./update.ps1 -PortSets tx,tx_smp -CopyCommonFiles -CopyPortFiles -CopyExample -PatchFiles
|
||||
if ((git status --porcelain -uno) -ne $null) {
|
||||
Write-Host "Ports for ARM architecture is not updated"
|
||||
git status
|
||||
Exit 1
|
||||
}
|
||||
|
||||
|
||||
|
||||
9
.gitignore
vendored
9
.gitignore
vendored
@@ -1,6 +1,9 @@
|
||||
.vscode/
|
||||
.settings/
|
||||
.metadata/
|
||||
_deps/
|
||||
build/
|
||||
Debug/
|
||||
CMakeFiles/
|
||||
CMakeScripts/
|
||||
CMakeLists.txt.user
|
||||
@@ -11,4 +14,10 @@ cmake_install.cmake
|
||||
install_manifest.txt
|
||||
compile_commands.json
|
||||
CTestTestfile.cmake
|
||||
*.dep
|
||||
*.o
|
||||
*.axf
|
||||
*.map
|
||||
*.a
|
||||
*.htm
|
||||
|
||||
|
||||
80
.pipelines/smp.yml
Normal file
80
.pipelines/smp.yml
Normal file
@@ -0,0 +1,80 @@
|
||||
trigger:
|
||||
- master
|
||||
|
||||
pr:
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
paths:
|
||||
include:
|
||||
- ".pipelines/tx.yml"
|
||||
- "common_smp/**"
|
||||
- "samples/**"
|
||||
- "test/tx/**"
|
||||
- "utility/**"
|
||||
- "ports_smp/linux/gnu/**"
|
||||
|
||||
|
||||
pool:
|
||||
vmImage: "ubuntu-22.04"
|
||||
|
||||
steps:
|
||||
- task: PipAuthenticate@1
|
||||
displayName: 'Pip Authenticate'
|
||||
inputs:
|
||||
# Provide list of feed names which you want to authenticate.
|
||||
# Project scoped feeds must include the project name in addition to the feed name.
|
||||
artifactFeeds: 'X-Ware/X-Ware_PublicPackages'
|
||||
|
||||
- bash: sudo $(Build.SourcesDirectory)/scripts/install.sh
|
||||
displayName: 'Install softwares'
|
||||
|
||||
- task: Bash@3
|
||||
displayName: 'SDL check'
|
||||
inputs:
|
||||
filePath: '$(Build.SourcesDirectory)/scripts/sdl_check.sh'
|
||||
|
||||
- task: Bash@3
|
||||
displayName: 'Build'
|
||||
inputs:
|
||||
filePath: '$(Build.SourcesDirectory)/scripts/build_smp.sh'
|
||||
|
||||
- task: Bash@3
|
||||
displayName: 'Test'
|
||||
inputs:
|
||||
filePath: '$(Build.SourcesDirectory)/scripts/test_smp.sh'
|
||||
|
||||
- task: PublishTestResults@2
|
||||
condition: succeededOrFailed()
|
||||
displayName: 'PublishTestResults'
|
||||
inputs:
|
||||
testResultsFormat: 'cTest'
|
||||
testResultsFiles: '*/Testing/**/*.xml'
|
||||
searchFolder: '$(Build.SourcesDirectory)/test/smp/cmake/build'
|
||||
testRunTitle: 'SMP-Tests'
|
||||
buildConfiguration: 'Release'
|
||||
|
||||
- task: CopyFiles@2
|
||||
condition: succeededOrFailed()
|
||||
displayName: 'CopyTestReports'
|
||||
inputs:
|
||||
SourceFolder: '$(Build.SourcesDirectory)/test/smp/cmake'
|
||||
Contents: |
|
||||
build/*.txt
|
||||
build/*/Testing/**/*.xml
|
||||
coverage_report/**/*
|
||||
TargetFolder: '$(build.artifactstagingdirectory)/test_reports_SMP'
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
condition: succeededOrFailed()
|
||||
displayName: 'PublishBuildArtifacts'
|
||||
inputs:
|
||||
pathToPublish: $(build.artifactstagingdirectory)
|
||||
|
||||
- task: PublishCodeCoverageResults@1
|
||||
condition: succeededOrFailed()
|
||||
displayName: 'Test SMP (PublishCodeCoverageResults)'
|
||||
inputs:
|
||||
codeCoverageTool: 'Cobertura'
|
||||
summaryFileLocation: '$(Build.SourcesDirectory)/test/smp/cmake/coverage_report/default_build_coverage.xml'
|
||||
pathToSources: '$(Build.SourcesDirectory)/test/smp/cmake'
|
||||
79
.pipelines/tx.yml
Normal file
79
.pipelines/tx.yml
Normal file
@@ -0,0 +1,79 @@
|
||||
trigger:
|
||||
- master
|
||||
|
||||
pr:
|
||||
branches:
|
||||
include:
|
||||
- master
|
||||
paths:
|
||||
include:
|
||||
- ".pipelines/tx.yml"
|
||||
- "common/**"
|
||||
- "samples/**"
|
||||
- "test/tx/**"
|
||||
- "utility/**"
|
||||
- "ports/linux/gnu/**"
|
||||
|
||||
pool:
|
||||
vmImage: "ubuntu-22.04"
|
||||
|
||||
steps:
|
||||
- task: PipAuthenticate@1
|
||||
displayName: 'Pip Authenticate'
|
||||
inputs:
|
||||
# Provide list of feed names which you want to authenticate.
|
||||
# Project scoped feeds must include the project name in addition to the feed name.
|
||||
artifactFeeds: 'X-Ware/X-Ware_PublicPackages'
|
||||
|
||||
- bash: sudo $(Build.SourcesDirectory)/scripts/install.sh
|
||||
displayName: 'Install softwares'
|
||||
|
||||
- task: Bash@3
|
||||
displayName: 'SDL check'
|
||||
inputs:
|
||||
filePath: '$(Build.SourcesDirectory)/scripts/sdl_check.sh'
|
||||
|
||||
- task: Bash@3
|
||||
displayName: 'Build'
|
||||
inputs:
|
||||
filePath: '$(Build.SourcesDirectory)/scripts/build_tx.sh'
|
||||
|
||||
- task: Bash@3
|
||||
displayName: 'Test'
|
||||
inputs:
|
||||
filePath: '$(Build.SourcesDirectory)/scripts/test_tx.sh'
|
||||
|
||||
- task: PublishTestResults@2
|
||||
condition: succeededOrFailed()
|
||||
displayName: 'PublishTestResults'
|
||||
inputs:
|
||||
testResultsFormat: 'cTest'
|
||||
testResultsFiles: '*/Testing/**/*.xml'
|
||||
searchFolder: '$(Build.SourcesDirectory)/test/tx/cmake/build'
|
||||
testRunTitle: 'TX-Tests'
|
||||
buildConfiguration: 'Release'
|
||||
|
||||
- task: CopyFiles@2
|
||||
condition: succeededOrFailed()
|
||||
displayName: 'CopyTestReports'
|
||||
inputs:
|
||||
SourceFolder: '$(Build.SourcesDirectory)/test/tx/cmake'
|
||||
Contents: |
|
||||
build/*.txt
|
||||
build/*/Testing/**/*.xml
|
||||
coverage_report/**/*
|
||||
TargetFolder: '$(build.artifactstagingdirectory)/test_reports_TX'
|
||||
|
||||
- task: PublishBuildArtifacts@1
|
||||
condition: succeededOrFailed()
|
||||
displayName: 'PublishBuildArtifacts'
|
||||
inputs:
|
||||
pathToPublish: $(build.artifactstagingdirectory)
|
||||
|
||||
- task: PublishCodeCoverageResults@1
|
||||
condition: succeededOrFailed()
|
||||
displayName: 'Test TX (PublishCodeCoverageResults)'
|
||||
inputs:
|
||||
codeCoverageTool: 'Cobertura'
|
||||
summaryFileLocation: '$(Build.SourcesDirectory)/test/tx/cmake/coverage_report/default_build_coverage.xml'
|
||||
pathToSources: '$(Build.SourcesDirectory)/test/tx/cmake'
|
||||
@@ -31,8 +31,17 @@ endif()
|
||||
# Pick up the common stuff
|
||||
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/common)
|
||||
|
||||
|
||||
|
||||
# Define the FreeRTOS adaptation layer
|
||||
add_library(freertos-threadx EXCLUDE_FROM_ALL)
|
||||
target_include_directories(freertos-threadx
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_LIST_DIR}/utility/rtos_compatibility_layers/FreeRTOS
|
||||
)
|
||||
target_sources(freertos-threadx
|
||||
PRIVATE
|
||||
${CMAKE_CURRENT_LIST_DIR}/utility/rtos_compatibility_layers/FreeRTOS/tx_freertos.c
|
||||
)
|
||||
target_link_libraries(freertos-threadx PUBLIC threadx)
|
||||
|
||||
# If the user provided an override, copy it to the custom directory
|
||||
if (NOT TX_USER_FILE)
|
||||
|
||||
45
LICENSE.txt
45
LICENSE.txt
@@ -2,7 +2,6 @@ MICROSOFT SOFTWARE LICENSE TERMS
|
||||
|
||||
MICROSOFT AZURE RTOS
|
||||
|
||||
Shape
|
||||
|
||||
These license terms are an agreement between you and Microsoft Corporation (or
|
||||
one of its affiliates). They apply to the software named above and any Microsoft
|
||||
@@ -14,10 +13,11 @@ HAVE THE RIGHTS BELOW. BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS.
|
||||
|
||||
1. INSTALLATION AND USE RIGHTS.
|
||||
|
||||
a) General. You may install and use the software and the included Microsoft
|
||||
applications solely for internal development, testing and evaluation purposes.
|
||||
Any distribution or production use requires a separate license as set forth in
|
||||
Section 2.
|
||||
a) General. You may (I) install, use and modify the software and (ii) install and use the included Microsoft
|
||||
Applications (if any), each solely for internal development, testing and evaluation purposes.
|
||||
Distribution or production use is governed by the license terms set forth in
|
||||
Section 2. You may also obtain distribution or production use rights through a separate agreement with
|
||||
Microsoft.
|
||||
|
||||
b) Contributions. Microsoft welcomes contributions to this software. In the event
|
||||
that you make a contribution to this software you will be required to agree to a
|
||||
@@ -25,7 +25,7 @@ Contributor License Agreement (CLA) declaring that you have the right to, and
|
||||
actually do, grant Microsoft the rights to use your contribution. For details,
|
||||
visit https://cla.microsoft.com.
|
||||
|
||||
c) Included Microsoft Applications. The software includes other Microsoft
|
||||
c) Included Microsoft Applications. The software may include other Microsoft
|
||||
applications which are governed by the licenses embedded in or made available
|
||||
with those applications.
|
||||
|
||||
@@ -57,7 +57,6 @@ i. You may use the software in production (e.g. program the modified or unmodifi
|
||||
software to devices you own or control) and distribute (i.e. make available to
|
||||
third parties) the modified or unmodified binary image produced from this code.
|
||||
|
||||
|
||||
ii. You may permit your device distributors or developers to copy and distribute the
|
||||
binary image as programmed or to be programmed to your devices.
|
||||
|
||||
@@ -70,17 +69,12 @@ b) Requirements. For any code you distribute, you must:
|
||||
|
||||
i. when distributed in binary form, except as embedded in a device, include with
|
||||
such distribution the terms of this agreement;
|
||||
|
||||
ii. when distributed in source code form to distributors or developers of your
|
||||
devices, include with such distribution the terms of this agreement; and
|
||||
|
||||
iii. indemnify, defend and hold harmless Microsoft from any claims, including
|
||||
attorneys’ fees, related to the distribution or use of your devices, except to
|
||||
the extent that any claim is based solely on the unmodified software.
|
||||
iii. indemnify, defend and hold harmless Microsoft from any claims, including claims arising from any High Risk Uses, and inclusive of attorneys’ fees, related to the distribution or use of your devices that include the software, except to the extent that any intellectual property claim is based solely on the unmodified software.
|
||||
|
||||
c) Restrictions. You may not:
|
||||
|
||||
i. use or modify the software to create a competing real time operating system
|
||||
i. use or modify the software to create competing real time operating system
|
||||
software;
|
||||
|
||||
ii. remove any copyright notices or licenses contained in the software;
|
||||
@@ -179,12 +173,13 @@ breach of which would endanger the purpose of this agreement and the compliance
|
||||
with which a party may constantly trust in (so-called "cardinal obligations").
|
||||
In other cases of slight negligence, Microsoft will not be liable for slight
|
||||
negligence.
|
||||
|
||||
12. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS IS.” YOU BEAR THE RISK OF
|
||||
12. DISCLAIMER OF WARRANTY.
|
||||
a) THE SOFTWARE IS LICENSED “AS IS.” YOU BEAR THE RISK OF
|
||||
USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES, OR CONDITIONS. TO
|
||||
THE EXTENT PERMITTED UNDER APPLICABLE LAWS, MICROSOFT EXCLUDES ALL IMPLIED
|
||||
WARRANTIES, INCLUDING MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
|
||||
NON-INFRINGEMENT.
|
||||
b) HIGH RISK USE DISCLAIMER. WARNING: THE SOFTWARE IS NOT DESIGNED OR INTENDED FOR USE WHERE FAILURE OR FAULT OF ANY KIND OF THE SOFTWARE COULD RESULT IN DEATH OR SERIOUS BODILY INJURY, OR IN PHYSICAL OR ENVIRONMENTAL DAMAGE (“collectively High Risk Use”). Accordingly, You must design and implement your hardware and software such that, in the event of any interruption, defect, error, or other failure of the software, the safety of people, property, and the environment are not reduced below a level that is reasonable, appropriate, and legal, whether in general or for a specific industry. Your High Risk Use of the software is at Your own risk.
|
||||
|
||||
13. LIMITATION ON AND EXCLUSION OF DAMAGES. IF YOU HAVE ANY BASIS FOR RECOVERING
|
||||
DAMAGES DESPITE THE PRECEDING DISCLAIMER OF WARRANTY, YOU CAN RECOVER FROM
|
||||
@@ -203,21 +198,29 @@ possibility of the damages. The above limitation or exclusion may not apply to
|
||||
you because your state, province, or country may not allow the exclusion or
|
||||
limitation of incidental, consequential, or other damages.
|
||||
|
||||
|
||||
|
||||
Please note: As this software is distributed in Canada, some of the clauses in
|
||||
Please note: As this software is distributed in Canada, some of the clauses in
|
||||
this agreement are provided below in French.
|
||||
|
||||
Remarque: Ce logiciel étant distribué au Canada, certaines des clauses dans ce
|
||||
contrat sont fournies ci-dessous en français.
|
||||
|
||||
EXONÉRATION DE GARANTIE. Le logiciel visé par une licence est offert « tel quel
|
||||
EXONÉRATION DE GARANTIE.
|
||||
a) Le logiciel visé par une licence est offert « tel quel
|
||||
». Toute utilisation de ce logiciel est à votre seule risque et péril. Microsoft
|
||||
n’accorde aucune autre garantie expresse. Vous pouvez bénéficier de droits
|
||||
additionnels en vertu du droit local sur la protection des consommateurs, que ce
|
||||
contrat ne peut modifier. La ou elles sont permises par le droit locale, les
|
||||
garanties implicites de qualité marchande, d’adéquation à un usage particulier
|
||||
et d’absence de contrefaçon sont exclues.
|
||||
b) CLAUSE D’EXCLUSION DE RESPONSABILITÉ RELATIVE À L’UTILISATION À HAUT RISQUE.
|
||||
AVERTISSEMENT: LE LOGICIEL N’EST PAS CONÇU OU DESTINÉ À ÊTRE UTILISÉ LORSQU’UNE
|
||||
DÉFAILLANCE OU UN DÉFAUT DE QUELQUE NATURE QUE CE SOIT POURRAIT ENTRAÎNER LA
|
||||
MORT OU DES BLESSURES CORPORELLES GRAVES, OU DES DOMMAGES PHYSIQUES OU
|
||||
ENVIRONNEMENTAUX (« Utilisation à haut risque »). Par conséquent, vous devez concevoir et mettre en
|
||||
œuvre votre équipement et votre logiciel de manière à ce que, en cas d’interruption, de défaut, d’erreur
|
||||
ou de toute autre défaillance du logiciel, la sécurité des personnes, des biens et de l’environnement ne
|
||||
soit pas réduite en dessous d’un niveau raisonnable, approprié et légal, que ce soit en général ou pour
|
||||
un secteur spécifique. Votre utilisation à haut risque du logiciel est à vos propres risques.
|
||||
|
||||
LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES
|
||||
DOMMAGES. Vous pouvez obtenir de Microsoft et de ses fournisseurs une
|
||||
@@ -243,4 +246,4 @@ ci-dessus ne s’appliquera pas à votre égard.
|
||||
EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous
|
||||
pourriez avoir d’autres droits prévus par les lois de votre pays. Le présent
|
||||
contrat ne modifie pas les droits que vous confèrent les lois de votre pays si
|
||||
celles-ci ne le permettent pas.
|
||||
celles-ci ne le permettent pas.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
LICENSED HARDWARE LIST
|
||||
|
||||
Last Updated: 2021-04-01
|
||||
Last Updated: 2023-02-10
|
||||
|
||||
Microsoft has entered into OEM Agreements with manufacturers of the following
|
||||
microprocessors and microcontrollers (the “hardware”) to enable those
|
||||
@@ -31,7 +31,7 @@ NXP:
|
||||
|
||||
i.MX RT10xx and RT116x/7x series crossover MCUs
|
||||
LPC5500 series
|
||||
|
||||
MCX N series
|
||||
|
||||
Renesas:
|
||||
|
||||
|
||||
311
README.md
311
README.md
@@ -1,115 +1,236 @@
|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
# Azure RTOS ThreadX
|
||||
|
||||
This advanced real-time operating system (RTOS) is designed specifically for deeply embedded applications. Among the multiple benefits it provides are advanced scheduling facilities, message passing, interrupt management, and messaging services. Azure RTOS ThreadX has many advanced features, including picokernel architecture, preemption threshold, event chaining, and a rich set of system services.
|
||||
|
||||
## Documentation
|
||||
Here are the key features and modules of ThreadX:
|
||||
|
||||
Documentation for this library can be found here: http://docs.microsoft.com/azure/rtos/threadx
|
||||

|
||||
|
||||
## Getting Started
|
||||
|
||||
Azure RTOS has been integrated to the semiconductor's SDKs and development environment. You can develop using the tools of choice from [STMicroelectronics](https://www.st.com/content/st_com/en/campaigns/x-cube-azrtos-azure-rtos-stm32.html), [NXP](https://www.nxp.com/design/software/embedded-software/azure-rtos-for-nxp-microcontrollers:AZURE-RTOS), [Renesas](https://github.com/renesas/azure-rtos) and [Microchip](https://mu.microchip.com/get-started-simplifying-your-iot-design-with-azure-rtos).
|
||||
|
||||
We also provide [getting started guide](https://github.com/azure-rtos/getting-started) and [samples](https://github.com/azure-rtos/samples) using hero development boards from semiconductors you can build and test with.
|
||||
|
||||
See [Overview of Azure RTOS ThreadX](https://learn.microsoft.com/en-us/azure/rtos/threadx/overview-threadx) for the high-level overview, and all documentation and APIs can be found in: [Azure RTOS ThreadX documentation](https://learn.microsoft.com/en-us/azure/rtos/threadx/).
|
||||
|
||||
Also there is dedicated [learning path of Azure RTOS ThreadX](https://learn.microsoft.com/training/paths/azure-rtos-threadx/) for learning systematically.
|
||||
|
||||
|
||||
# Understanding inter-component dependencies
|
||||
## Repository Structure and Usage
|
||||
### Directory layout
|
||||
|
||||
The main components of Azure RTOS are each provided in their own repository, but there are dependencies between them--shown in the following graph--that are important to understand when setting up your builds.
|
||||
.
|
||||
├── cmake # CMakelist files for building the project
|
||||
├── common # Core ThreadX files
|
||||
├── common_modules # Core ThreadX module files
|
||||
├── common_smp # Core ThreadX SMP files
|
||||
├── docs # Documentation supplements
|
||||
├── ports # Architecture and compiler specific files. See below for directory breakdown
|
||||
│ ├── cortex_m7
|
||||
│ │ ├── iar # Example IAR compiler sample project
|
||||
│ │ │ ├── example build # IAR workspace and sample project files
|
||||
│ │ │ ├── inc # tx_port.h for this architecture
|
||||
│ │ │ └── src # Source files for this architecture
|
||||
│ │ ├── ac6 # Example ac6/Keil sample project
|
||||
│ │ ├── gnu # Example gnu sample project
|
||||
│ │ └── ...
|
||||
│ └── ...
|
||||
├── ports_modules # Architecture and compiler specific files for threadX modules
|
||||
├── ports_smp # Architecture and compiler specific files for threadX SMP
|
||||
├── samples # demo_threadx.c
|
||||
└── utility # Test cases and utilities
|
||||
|
||||

|
||||
|
||||
# Building and using the library
|
||||
|
||||
## Prerequisites
|
||||
|
||||
Install the following tools:
|
||||
|
||||
* [CMake](https://cmake.org/download/) version 3.0 or later
|
||||
* [GCC compilers for arm-none-eabi](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads)
|
||||
* [Ninja](https://ninja-build.org/)
|
||||
|
||||
## Cloning the repo
|
||||
|
||||
```bash
|
||||
$ git clone https://github.com/azure-rtos/threadx.git
|
||||
```
|
||||
|
||||
## Building as a static library
|
||||
|
||||
Each component of Azure RTOS comes with a composable CMake-based build system that supports many different MCUs and host systems. Integrating any of these components into your device app code is as simple as adding a git submodule and then including it in your build using the CMake command `add_subdirectory()`.
|
||||
|
||||
While the typical usage pattern is to include threadx into your device code source tree to be built & linked with your code, you can compile this project as a standalone static library to confirm your build is set up correctly.
|
||||
|
||||
```bash
|
||||
$ cmake -Bbuild -DCMAKE_TOOLCHAIN_FILE=cmake/cortex_m4.cmake -GNinja .
|
||||
|
||||
$ cmake --build ./build
|
||||
```
|
||||
|
||||
NOTE: You will have to take the dependency graph above into account when building anything other than threadx itself.
|
||||
|
||||
# Repository Structure and Usage
|
||||
|
||||
## Branches & Releases
|
||||
|
||||
The master branch has the most recent code with all new features and bug fixes. It does not represent the latest General Availability (GA) release of the library.
|
||||
|
||||
## Releases
|
||||
|
||||
Each official release (preview or GA) will be tagged to mark the commit and push it into the Github releases tab, e.g. `v6.0-rel`.
|
||||
|
||||
## Directory layout
|
||||
The master branch has the most recent code with all new features and bug fixes. It does not represent the latest General Availability (GA) release of the library. Each official release (preview or GA) will be tagged to mark the commit and push it into the Github releases tab, e.g. `v6.2-rel`.
|
||||
|
||||
> When you see xx-xx-xxxx, 6.x or x.x in function header, this means the file is not officially released yet. They will be updated in the next release. See example below.
|
||||
```
|
||||
- cmake
|
||||
- common
|
||||
- inc
|
||||
- src
|
||||
- ports
|
||||
- cortex_m0/gnu
|
||||
- inc
|
||||
- src
|
||||
- cortex_m3/gnu
|
||||
- inc
|
||||
- src
|
||||
- cortex_m4/gnu
|
||||
- inc
|
||||
- src
|
||||
- cortex_m7/gnu
|
||||
- inc
|
||||
- src
|
||||
- samples
|
||||
/**************************************************************************/
|
||||
/* */
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _tx_initialize_low_level Cortex-M23/GNU */
|
||||
/* 6.x */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* Scott Larson, 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 */
|
||||
/* */
|
||||
/* 09-30-2020 Scott Larson Initial Version 6.1 */
|
||||
/* xx-xx-xxxx Scott Larson Include tx_user.h, */
|
||||
/* resulting in version 6.x */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
```
|
||||
|
||||
# Security
|
||||
## Supported Architecture Ports
|
||||
|
||||
### ThreadX
|
||||
```
|
||||
arc_em cortex_a12 cortex_m0 cortex_r4
|
||||
arc_hs cortex_a15 cortex_m23 cortex_r5
|
||||
arm11 cortex_a17 cortex_m3 cortex_r7
|
||||
arm9 cortex_a34 cortex_m33
|
||||
c667x cortex_a35 cortex_m4
|
||||
linux cortex_a5 cortex_m55
|
||||
risc-v32 cortex_a53 cortex_m7
|
||||
rxv1 cortex_a55 cortex_m85
|
||||
rxv2 cortex_a57
|
||||
rxv3 cortex_a5x
|
||||
win32 cortex_a65
|
||||
xtensa cortex_a65ae
|
||||
cortex_a7
|
||||
cortex_a72
|
||||
cortex_a73
|
||||
cortex_a75
|
||||
cortex_a76
|
||||
cortex_a76ae
|
||||
cortex_a77
|
||||
cortex_a8
|
||||
cortex_a9
|
||||
```
|
||||
|
||||
### ThreadX Modules
|
||||
[Azure RTOS ThreadX Modules](https://learn.microsoft.com/azure/rtos/threadx-modules/chapter1) component provides an infrastructure for applications to dynamically load modules that are built separately from the resident portion of the application.
|
||||
```
|
||||
cortex_a35
|
||||
cortex_a35_smp
|
||||
cortex_a7
|
||||
cortex_m0+
|
||||
cortex_m23
|
||||
cortex_m3
|
||||
cortex_m33
|
||||
cortex_m4
|
||||
cortex_m7
|
||||
cortex_r4
|
||||
rxv2
|
||||
```
|
||||
|
||||
### ThreadX SMP
|
||||
[Azure RTOS ThreadX SMP](https://learn.microsoft.com/azure/rtos/threadx/threadx-smp/chapter1) is a high-performance real-time SMP kernel designed specifically for embedded applications.
|
||||
```
|
||||
arc_hs_smp
|
||||
cortex_a34_smp
|
||||
cortex_a35_smp
|
||||
cortex_a53_smp
|
||||
cortex_a55_smp
|
||||
cortex_a57_smp
|
||||
cortex_a5x_smp
|
||||
cortex_a5_smp
|
||||
cortex_a65ae_smp
|
||||
cortex_a65_smp
|
||||
cortex_a72_smp
|
||||
cortex_a73_smp
|
||||
cortex_a75_smp
|
||||
cortex_a76ae_smp
|
||||
cortex_a76_smp
|
||||
cortex_a77_smp
|
||||
cortex_a78_smp
|
||||
cortex_a7_smp
|
||||
cortex_a9_smp
|
||||
linux
|
||||
```
|
||||
|
||||
## Adaptation layer for ThreadX
|
||||
|
||||
Azure RTOS ThreadX is an advanced real-time operating system (RTOS) designed specifically for deeply embedded applications. To help ease application migration to Azure RTOS, ThreadX provides [adaption layers](https://github.com/azure-rtos/threadx/tree/master/utility/rtos_compatibility_layers) for various legacy RTOS APIs (FreeRTOS, POSIX, OSEK, etc.).
|
||||
|
||||
## Component dependencies
|
||||
|
||||
The main components of Azure RTOS are each provided in their own repository, but there are dependencies between them, as shown in the following graph. This is important to understand when setting up your builds.
|
||||
|
||||

|
||||
|
||||
> You will have to take the dependency graph above into account when building anything other than ThreadX itself.
|
||||
|
||||
### Building and using the library
|
||||
|
||||
Instruction for building the ThreadX as static library using Arm GNU Toolchain and CMake. If you are using toolchain and IDE from semiconductor, you might follow its own instructions to use Azure RTOS components as explained in the [Getting Started](#getting-started) section.
|
||||
|
||||
1. Install the following tools:
|
||||
|
||||
* [CMake](https://cmake.org/download/) version 3.0 or later
|
||||
* [Arm GNU Toolchain for arm-none-eabi](https://developer.arm.com/downloads/-/arm-gnu-toolchain-downloads)
|
||||
* [Ninja](https://ninja-build.org/)
|
||||
|
||||
1. Cloning the repo
|
||||
|
||||
```bash
|
||||
$ git clone https://github.com/azure-rtos/threadx.git
|
||||
```
|
||||
|
||||
1. Define the features and addons you need in `tx_user.h` and build together with the component source code. You can refer to [`tx_user_sample.h`](https://github.com/azure-rtos/threadx/blob/master/common/inc/tx_user_sample.h) as an example.
|
||||
|
||||
1. Building as a static library
|
||||
|
||||
Each component of Azure RTOS comes with a composable CMake-based build system that supports many different MCUs and host systems. Integrating any of these components into your device app code is as simple as adding a git submodule and then including it in your build using the CMake `add_subdirectory()`.
|
||||
|
||||
While the typical usage pattern is to include ThreadX into your device code source tree to be built & linked with your code, you can compile this project as a standalone static library to confirm your build is set up correctly.
|
||||
|
||||
An example of building the library for Cortex-M4:
|
||||
|
||||
```bash
|
||||
$ cmake -Bbuild -GNinja -DCMAKE_TOOLCHAIN_FILE=cmake/cortex_m4.cmake .
|
||||
|
||||
$ cmake --build ./build
|
||||
```
|
||||
|
||||
## Professional support
|
||||
|
||||
[Professional support plans](https://azure.microsoft.com/support/options/) are available from Microsoft. For community support and others, see the [Resources](#resources) section below.
|
||||
|
||||
## Licensing
|
||||
|
||||
License terms for using Azure RTOS are defined in the LICENSE.txt file of this repo. Please refer to this file for all definitive licensing information. No additional license fees are required for deploying Azure RTOS on hardware defined in the LICENSED-HARDWARE.txt file. If you are using hardware not defined in the LICENSED-HARDWARE.txt file or have licensing questions in general, please contact Microsoft directly at https://aka.ms/azrtos-license.
|
||||
|
||||
## Resources
|
||||
|
||||
The following are references to additional Azure RTOS resources:
|
||||
|
||||
- **Product introduction and white papers**: https://azure.com/rtos
|
||||
- **General technical questions**: https://aka.ms/QnA/azure-rtos
|
||||
- **Product issues and bugs, or feature requests**: https://github.com/azure-rtos/threadx/issues
|
||||
- **Licensing and sales questions**: https://aka.ms/azrtos-license
|
||||
- **Product roadmap and support policy**: https://aka.ms/azrtos/lts
|
||||
- **Blogs and videos**: http://msiotblog.com and https://aka.ms/iotshow
|
||||
- **Azure RTOS TraceX Installer**: https://aka.ms/azrtos-tracex-installer
|
||||
|
||||
You can also check [previous questions](https://stackoverflow.com/questions/tagged/azure-rtos+threadx) or ask new ones on StackOverflow using the `azure-rtos` and `threadx` tags.
|
||||
|
||||
## Security
|
||||
|
||||
Azure RTOS provides OEMs with components to secure communication and to create code and data isolation using underlying MCU/MPU hardware protection mechanisms. It is ultimately the responsibility of the device builder to ensure the device fully meets the evolving security requirements associated with its specific use case.
|
||||
|
||||
# Adaptation layer for ThreadX
|
||||
## Contribution
|
||||
|
||||
Azure RTOS ThreadX is an advanced real-time operating system (RTOS) designed specifically for deeply embedded applications. To help ease application migration to Auzre RTOS, ThreadX provides [adaption layers](https://github.com/azure-rtos/threadx/tree/master/utility/rtos_compatibility_layers) for various legacy RTOS APIs (FreeRTOS, POSIX, OSEK, etc.).
|
||||
|
||||
# Licensing
|
||||
|
||||
License terms for using Azure RTOS are defined in the LICENSE.txt file of this repo. Please refer to this file for all definitive licensing information. No additional license fees are required for deploying Azure RTOS on hardware defined in the LICENSED-HARDWARE.txt file. If you are using hardware not defined in the LICENSED-HARDWARE.txt file or have licensing questions in general, please contact Microsoft directly at https://azure-rtos.ms-iot-contact.com/
|
||||
|
||||
# Contribution, feedback, issues, and professional support
|
||||
|
||||
If you encounter any bugs, have suggestions for new features, or if you would like to become an active contributor to this project, please follow the instructions provided in the contribution guideline for the corresponding repo.
|
||||
|
||||
For basic support, click Issues in the command bar or post a question to [Stack Overflow](http://stackoverflow.com/questions/tagged/azure-rtos+threadx) using the `threadx` and `azure-rtos` tags.
|
||||
|
||||
Professional support plans (https://azure.microsoft.com/en-us/support/options/) are available from Microsoft.
|
||||
|
||||
# Additional Resources
|
||||
|
||||
The following are references to additional Azure RTOS and Azure IoT in general:
|
||||
| | |
|
||||
|---|---|
|
||||
| TraceX Installer | https://aka.ms/azrtos-tracex-installer |
|
||||
| Azure RTOS Documentation and Guides: | https://docs.microsoft.com/azure/rtos |
|
||||
| Azure RTOS Website: | https://azure.microsoft.com/services/rtos/ |
|
||||
| Azure RTOS Sales Questions: | https://azure-rtos.ms-iot-contact.com/ |
|
||||
| For technical questions check out Microsoft Q/A for Azure IoT: | https://aka.ms/QnA/azure-rtos |
|
||||
| Internet of Things Show for latest announcements and online training: | https://aka.ms/iotshow |
|
||||
| IoT Tech Community: | https://aka.ms/community/azure-rtos |
|
||||
Please follow the instructions provided in the [CONTRIBUTING.md](./CONTRIBUTING.md) for the corresponding repository.
|
||||
@@ -202,6 +202,7 @@ target_sources(${PROJECT_NAME}
|
||||
|
||||
# Add the Common/inc directory to the project include list
|
||||
target_include_directories(${PROJECT_NAME}
|
||||
SYSTEM
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_LIST_DIR}/inc
|
||||
)
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/* APPLICATION INTERFACE DEFINITION RELEASE */
|
||||
/* */
|
||||
/* tx_api.h PORTABLE C */
|
||||
/* 6.1.10 */
|
||||
/* 6.3.0 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -82,6 +82,25 @@
|
||||
/* add unused parameter macro, */
|
||||
/* update patch number, */
|
||||
/* resulting in version 6.1.10 */
|
||||
/* 04-25-2022 Wenhui Xie Modified comment(s), */
|
||||
/* optimized the definition of */
|
||||
/* TX_TIMER_TICKS_PER_SECOND, */
|
||||
/* resulting in version 6.1.11 */
|
||||
/* 07-29-2022 Scott Larson Modified comment(s), */
|
||||
/* update patch number, */
|
||||
/* resulting in version 6.1.12 */
|
||||
/* 10-31-2022 Scott Larson Modified comment(s), */
|
||||
/* add extension macros, */
|
||||
/* update EPK typedef, */
|
||||
/* update version numbers, */
|
||||
/* resulting in version 6.2.0 */
|
||||
/* 03-08-2023 Tiejun Zhou Modified comment(s), */
|
||||
/* update patch number, */
|
||||
/* resulting in version 6.2.1 */
|
||||
/* 10-31-2023 Xiuwen Cai Modified comment(s), */
|
||||
/* added option for random */
|
||||
/* number stack filling, */
|
||||
/* resulting in version 6.3.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
|
||||
@@ -108,6 +127,9 @@ extern "C" {
|
||||
|
||||
#include "tx_port.h"
|
||||
|
||||
#if (defined(TX_EXECUTION_PROFILE_ENABLE) && !defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY))
|
||||
#include "tx_execution_profile.h"
|
||||
#endif
|
||||
|
||||
/* Define basic constants for the ThreadX kernel. */
|
||||
|
||||
@@ -117,8 +139,8 @@ extern "C" {
|
||||
|
||||
#define AZURE_RTOS_THREADX
|
||||
#define THREADX_MAJOR_VERSION 6
|
||||
#define THREADX_MINOR_VERSION 1
|
||||
#define THREADX_PATCH_VERSION 10
|
||||
#define THREADX_MINOR_VERSION 3
|
||||
#define THREADX_PATCH_VERSION 0
|
||||
|
||||
/* Define the following symbol for backward compatibility */
|
||||
#define EL_PRODUCT_THREADX
|
||||
@@ -153,7 +175,11 @@ extern "C" {
|
||||
#define TX_NO_MESSAGES ((UINT) 0)
|
||||
#define TX_EMPTY ((ULONG) 0)
|
||||
#define TX_CLEAR_ID ((ULONG) 0)
|
||||
#if defined(TX_ENABLE_RANDOM_NUMBER_STACK_FILLING) && defined(TX_ENABLE_STACK_CHECKING)
|
||||
#define TX_STACK_FILL (thread_ptr -> tx_thread_stack_fill_value)
|
||||
#else
|
||||
#define TX_STACK_FILL ((ULONG) 0xEFEFEFEFUL)
|
||||
#endif
|
||||
|
||||
|
||||
/* Thread execution state values. */
|
||||
@@ -216,12 +242,82 @@ extern "C" {
|
||||
#define TX_FEATURE_NOT_ENABLED ((UINT) 0xFF)
|
||||
|
||||
|
||||
#ifdef TX_64_BIT
|
||||
|
||||
#ifndef TX_THREAD_EXTENSION_PTR_SET
|
||||
#define TX_THREAD_EXTENSION_PTR_SET(a, b) { \
|
||||
TX_THREAD *thread_ptr; \
|
||||
thread_ptr = (TX_THREAD *) (a); \
|
||||
(thread_ptr -> tx_thread_extension_ptr) = (VOID *)(b); \
|
||||
}
|
||||
#endif /* TX_THREAD_EXTENSION_PTR_SET */
|
||||
|
||||
#ifndef TX_THREAD_EXTENSION_PTR_GET
|
||||
#define TX_THREAD_EXTENSION_PTR_GET(a, b, c) { \
|
||||
TX_PARAMETER_NOT_USED(c); \
|
||||
TX_THREAD *thread_ptr; \
|
||||
thread_ptr = tx_thread_identify(); \
|
||||
while(1)\
|
||||
{ \
|
||||
if (thread_ptr -> tx_thread_extension_ptr) \
|
||||
{ \
|
||||
(a) = (b *)(thread_ptr -> tx_thread_extension_ptr); \
|
||||
break; \
|
||||
} \
|
||||
tx_thread_sleep(1); \
|
||||
} \
|
||||
}
|
||||
#endif /* TX_THREAD_EXTENSION_PTR_GET */
|
||||
|
||||
#ifndef TX_TIMER_EXTENSION_PTR_SET
|
||||
#define TX_TIMER_EXTENSION_PTR_SET(a, b) { \
|
||||
TX_TIMER *timer_ptr; \
|
||||
timer_ptr = (TX_TIMER *) (a); \
|
||||
(timer_ptr -> tx_timer_internal.tx_timer_internal_extension_ptr) = (VOID *)(b); \
|
||||
}
|
||||
#endif /* TX_TIMER_EXTENSION_PTR_SET */
|
||||
|
||||
#ifndef TX_TIMER_EXTENSION_PTR_GET
|
||||
#define TX_TIMER_EXTENSION_PTR_GET(a, b, c) { \
|
||||
TX_PARAMETER_NOT_USED(c); \
|
||||
if (!_tx_timer_expired_timer_ptr -> tx_timer_internal_extension_ptr) \
|
||||
return; \
|
||||
(a) = (b *)(_tx_timer_expired_timer_ptr -> tx_timer_internal_extension_ptr); \
|
||||
}
|
||||
#endif /* TX_TIMER_EXTENSION_PTR_GET */
|
||||
|
||||
#else /* not 64 bit */
|
||||
|
||||
#ifndef TX_THREAD_EXTENSION_PTR_SET
|
||||
#define TX_THREAD_EXTENSION_PTR_SET(a, b)
|
||||
#endif /* TX_THREAD_EXTENSION_PTR_SET */
|
||||
|
||||
#ifndef TX_THREAD_EXTENSION_PTR_GET
|
||||
#define TX_THREAD_EXTENSION_PTR_GET(a, b, c) { \
|
||||
(a) = (b *)(c); \
|
||||
}
|
||||
#endif /* TX_THREAD_EXTENSION_PTR_GET */
|
||||
|
||||
#ifndef TX_TIMER_EXTENSION_PTR_SET
|
||||
#define TX_TIMER_EXTENSION_PTR_SET(a, b)
|
||||
#endif /* TX_TIMER_EXTENSION_PTR_SET */
|
||||
|
||||
#ifndef TX_TIMER_EXTENSION_PTR_GET
|
||||
#define TX_TIMER_EXTENSION_PTR_GET(a, b, c) { \
|
||||
(a) = (b *)(c); \
|
||||
}
|
||||
#endif /* TX_TIMER_EXTENSION_PTR_GET */
|
||||
|
||||
#endif /* TX_64_BIT */
|
||||
|
||||
|
||||
|
||||
/* Define the common timer tick reference for use by other middleware components. The default
|
||||
value is 10ms, but may be replaced by a port specific version in tx_port.h or by the user
|
||||
as a compilation option. */
|
||||
|
||||
#ifndef TX_TIMER_TICKS_PER_SECOND
|
||||
#define TX_TIMER_TICKS_PER_SECOND ((ULONG) 100)
|
||||
#define TX_TIMER_TICKS_PER_SECOND (100UL)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -522,14 +618,20 @@ typedef struct TX_THREAD_STRUCT
|
||||
For Azure RTOS 6, user shall use TX_EXECUTION_PROFILE_ENABLE instead of TX_ENABLE_EXECUTION_CHANGE_NOTIFY,
|
||||
and SHALL NOT add variables to TX_THREAD_EXTENSION_3. */
|
||||
#if (defined(TX_EXECUTION_PROFILE_ENABLE) && !defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY))
|
||||
unsigned long long tx_thread_execution_time_total;
|
||||
unsigned long long tx_thread_execution_time_last_start;
|
||||
EXECUTION_TIME tx_thread_execution_time_total;
|
||||
EXECUTION_TIME_SOURCE_TYPE tx_thread_execution_time_last_start;
|
||||
#endif
|
||||
|
||||
/* Define suspension sequence number. This is used to ensure suspension is still valid when
|
||||
cleanup routine executes. */
|
||||
ULONG tx_thread_suspension_sequence;
|
||||
|
||||
#if defined(TX_ENABLE_RANDOM_NUMBER_STACK_FILLING) && defined(TX_ENABLE_STACK_CHECKING)
|
||||
|
||||
/* Define the random stack fill number. This can be used to detect stack overflow. */
|
||||
ULONG tx_thread_stack_fill_value;
|
||||
#endif
|
||||
|
||||
/* Define the user extension field. This typically is defined
|
||||
to white space, but some ports of ThreadX may need to have
|
||||
additional fields in the thread control block. This is
|
||||
@@ -1804,6 +1906,21 @@ UINT _tx_trace_interrupt_control(UINT new_posture);
|
||||
#endif
|
||||
|
||||
|
||||
/* Add a default macro that can be re-defined in tx_port.h to add processing to the initialize random number generator.
|
||||
By default, this is simply defined as whitespace. */
|
||||
|
||||
#ifndef TX_INITIALIZE_RANDOM_GENERATOR_INITIALIZATION
|
||||
#define TX_INITIALIZE_RANDOM_GENERATOR_INITIALIZATION
|
||||
#endif
|
||||
|
||||
|
||||
/* Define the TX_RAND macro to the standard library function, if not already defined. */
|
||||
|
||||
#ifndef TX_RAND
|
||||
#define TX_RAND() rand()
|
||||
#endif
|
||||
|
||||
|
||||
/* Check for MISRA compliance requirements. */
|
||||
|
||||
#ifdef TX_MISRA_ENABLE
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/* PORT SPECIFIC C INFORMATION RELEASE */
|
||||
/* */
|
||||
/* tx_user.h PORTABLE C */
|
||||
/* 6.1.9 */
|
||||
/* 6.3.0 */
|
||||
/* */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
@@ -58,6 +58,14 @@
|
||||
/* user-configurable symbol */
|
||||
/* TX_TIMER_TICKS_PER_SECOND */
|
||||
/* resulting in version 6.1.9 */
|
||||
/* 04-25-2022 Wenhui Xie Modified comment(s), */
|
||||
/* optimized the definition of */
|
||||
/* TX_TIMER_TICKS_PER_SECOND, */
|
||||
/* resulting in version 6.1.11 */
|
||||
/* 10-31-2023 Xiuwen Cai Modified comment(s), */
|
||||
/* added option for random */
|
||||
/* number stack filling, */
|
||||
/* resulting in version 6.3.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
|
||||
@@ -116,7 +124,7 @@
|
||||
Note: the actual hardware timer value may need to be changed (usually in tx_initialize_low_level). */
|
||||
|
||||
/*
|
||||
#define TX_TIMER_TICKS_PER_SECOND ((ULONG) 100)
|
||||
#define TX_TIMER_TICKS_PER_SECOND (100UL)
|
||||
*/
|
||||
|
||||
/* Determine if there is a FileX pointer in the thread control block.
|
||||
@@ -166,6 +174,14 @@
|
||||
#define TX_ENABLE_STACK_CHECKING
|
||||
*/
|
||||
|
||||
/* Determine if random number is used for stack filling. By default, ThreadX uses a fixed
|
||||
pattern for stack filling. When the following is defined, ThreadX uses a random number
|
||||
for stack filling. This is effective only when TX_ENABLE_STACK_CHECKING is defined. */
|
||||
|
||||
/*
|
||||
#define TX_ENABLE_RANDOM_NUMBER_STACK_FILLING
|
||||
*/
|
||||
|
||||
/* Determine if preemption-threshold should be disabled. By default, preemption-threshold is
|
||||
enabled. If the application does not use preemption-threshold, it may be disabled to reduce
|
||||
code size and improve performance. */
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _tx_event_flags_get PORTABLE C */
|
||||
/* 6.1 */
|
||||
/* 6.2.0 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -73,9 +73,15 @@
|
||||
/* */
|
||||
/* DATE NAME DESCRIPTION */
|
||||
/* */
|
||||
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
|
||||
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
|
||||
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
|
||||
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
|
||||
/* resulting in version 6.1 */
|
||||
/* 04-25-2022 Scott Larson Modified comment(s), */
|
||||
/* handle 0 flags case, */
|
||||
/* resulting in version 6.1.11 */
|
||||
/* 10-31-2022 Scott Larson Modified comment(s), always */
|
||||
/* return actual flags, */
|
||||
/* resulting in version 6.2.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
UINT _tx_event_flags_get(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG requested_flags,
|
||||
@@ -122,6 +128,9 @@ UINT interrupted_set_request;
|
||||
/* Pickup current flags. */
|
||||
current_flags = group_ptr -> tx_event_flags_group_current;
|
||||
|
||||
/* Return the actual event flags and apply delayed clearing. */
|
||||
*actual_flags_ptr = current_flags & ~group_ptr -> tx_event_flags_group_delayed_clear;
|
||||
|
||||
/* Apply the event flag option mask. */
|
||||
and_request = (get_option & TX_AND);
|
||||
|
||||
@@ -155,9 +164,6 @@ UINT interrupted_set_request;
|
||||
if (flags_satisfied != ((ULONG) 0))
|
||||
{
|
||||
|
||||
/* Return the actual event flags that satisfied the request. */
|
||||
*actual_flags_ptr = current_flags;
|
||||
|
||||
/* Pickup the clear bit. */
|
||||
clear_request = (get_option & TX_EVENT_FLAGS_CLEAR_MASK);
|
||||
|
||||
@@ -218,9 +224,6 @@ UINT interrupted_set_request;
|
||||
|
||||
/* Yes, this request can be handled immediately. */
|
||||
|
||||
/* Return the actual event flags that satisfied the request. */
|
||||
*actual_flags_ptr = current_flags;
|
||||
|
||||
/* Pickup the clear bit. */
|
||||
clear_request = (get_option & TX_EVENT_FLAGS_CLEAR_MASK);
|
||||
|
||||
@@ -271,16 +274,17 @@ UINT interrupted_set_request;
|
||||
#endif
|
||||
else
|
||||
{
|
||||
|
||||
/* flags_satisfied is 0. */
|
||||
/* Determine if the request specifies suspension. */
|
||||
if (wait_option != TX_NO_WAIT)
|
||||
{
|
||||
|
||||
/* Determine if the preempt disable flag is non-zero. */
|
||||
if (_tx_thread_preempt_disable != ((UINT) 0))
|
||||
/* Determine if the preempt disable flag is non-zero OR the requested events is 0. */
|
||||
if ((_tx_thread_preempt_disable != ((UINT) 0)) || (requested_flags == (UINT) 0))
|
||||
{
|
||||
|
||||
/* Suspension is not allowed if the preempt disable flag is non-zero at this point, return error completion. */
|
||||
/* Suspension is not allowed if the preempt disable flag is non-zero at this point,
|
||||
or if requested_flags is 0, return error completion. */
|
||||
status = TX_NO_EVENTS;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _tx_event_flags_set PORTABLE C */
|
||||
/* 6.1 */
|
||||
/* 6.1.11 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -72,9 +72,13 @@
|
||||
/* */
|
||||
/* DATE NAME DESCRIPTION */
|
||||
/* */
|
||||
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
|
||||
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
|
||||
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
|
||||
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
|
||||
/* resulting in version 6.1 */
|
||||
/* 04-25-2022 William E. Lamie Modified comment(s), and */
|
||||
/* added corrected preemption */
|
||||
/* check logic, resulting in */
|
||||
/* version 6.1.11 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
UINT _tx_event_flags_set(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG flags_to_set, UINT set_option)
|
||||
@@ -264,9 +268,6 @@ VOID (*events_set_notify)(struct TX_EVENT_FLAGS_GROUP_STRUCT *notify_
|
||||
/* Yes, resume the thread and apply any event flag
|
||||
clearing. */
|
||||
|
||||
/* Set the preempt check flag. */
|
||||
preempt_check = TX_TRUE;
|
||||
|
||||
/* Return the actual event flags that satisfied the request. */
|
||||
suspend_info_ptr = TX_VOID_TO_ULONG_POINTER_CONVERT(thread_ptr -> tx_thread_additional_suspend_info);
|
||||
*suspend_info_ptr = current_event_flags;
|
||||
@@ -336,6 +337,11 @@ VOID (*events_set_notify)(struct TX_EVENT_FLAGS_GROUP_STRUCT *notify_
|
||||
/* Disable preemption while we process the suspended list. */
|
||||
_tx_thread_preempt_disable++;
|
||||
|
||||
/* Since we have temporarily disabled preemption globally, set the preempt
|
||||
check flag to check for any preemption condition - including from
|
||||
unrelated ISR processing. */
|
||||
preempt_check = TX_TRUE;
|
||||
|
||||
/* Loop to examine all of the suspended threads. */
|
||||
do
|
||||
{
|
||||
@@ -419,9 +425,6 @@ VOID (*events_set_notify)(struct TX_EVENT_FLAGS_GROUP_STRUCT *notify_
|
||||
|
||||
/* Yes, this request can be handled now. */
|
||||
|
||||
/* Set the preempt check flag. */
|
||||
preempt_check = TX_TRUE;
|
||||
|
||||
/* Determine if the thread is still suspended on the event flag group. If not, a wait
|
||||
abort must have been done from an ISR. */
|
||||
if (thread_ptr -> tx_thread_state == TX_EVENT_FLAG)
|
||||
|
||||
@@ -30,6 +30,9 @@
|
||||
#include "tx_thread.h"
|
||||
#include "tx_timer.h"
|
||||
|
||||
#if defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)
|
||||
extern VOID _tx_execution_initialize(VOID);
|
||||
#endif
|
||||
|
||||
/* Define any port-specific scheduling data structures. */
|
||||
|
||||
@@ -46,7 +49,7 @@ TX_SAFETY_CRITICAL_EXCEPTION_HANDLER
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _tx_initialize_kernel_enter PORTABLE C */
|
||||
/* 6.1 */
|
||||
/* 6.3.0 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -84,9 +87,16 @@ TX_SAFETY_CRITICAL_EXCEPTION_HANDLER
|
||||
/* */
|
||||
/* DATE NAME DESCRIPTION */
|
||||
/* */
|
||||
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
|
||||
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
|
||||
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
|
||||
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
|
||||
/* resulting in version 6.1 */
|
||||
/* 04-25-2022 Scott Larson Modified comment(s), */
|
||||
/* added EPK initialization, */
|
||||
/* resulting in version 6.1.11 */
|
||||
/* 10-31-2023 Xiuwen Cai Modified comment(s), */
|
||||
/* added random generator */
|
||||
/* initialization, */
|
||||
/* resulting in version 6.3.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
VOID _tx_initialize_kernel_enter(VOID)
|
||||
@@ -127,6 +137,9 @@ VOID _tx_initialize_kernel_enter(VOID)
|
||||
later used to represent interrupt nesting. */
|
||||
_tx_thread_system_state = TX_INITIALIZE_IN_PROGRESS;
|
||||
|
||||
/* Optional random number generator initialization. */
|
||||
TX_INITIALIZE_RANDOM_GENERATOR_INITIALIZATION
|
||||
|
||||
/* Call the application provided initialization function. Pass the
|
||||
first available memory address to it. */
|
||||
tx_application_define(_tx_initialize_unused_memory);
|
||||
@@ -138,6 +151,11 @@ VOID _tx_initialize_kernel_enter(VOID)
|
||||
/* Call any port specific pre-scheduler processing. */
|
||||
TX_PORT_SPECIFIC_PRE_SCHEDULER_INITIALIZATION
|
||||
|
||||
#if defined(TX_ENABLE_EXECUTION_CHANGE_NOTIFY) || defined(TX_EXECUTION_PROFILE_ENABLE)
|
||||
/* Initialize Execution Profile Kit. */
|
||||
_tx_execution_initialize();
|
||||
#endif
|
||||
|
||||
/* Enter the scheduling loop to start executing threads! */
|
||||
_tx_thread_schedule();
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _tx_thread_create PORTABLE C */
|
||||
/* 6.1.8 */
|
||||
/* 6.3.0 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -88,6 +88,10 @@
|
||||
/* supported TX_MISRA_ENABLE, */
|
||||
/* 08-02-2021 Scott Larson Removed unneeded cast, */
|
||||
/* resulting in version 6.1.8 */
|
||||
/* 10-31-2023 Xiuwen Cai Modified comment(s), */
|
||||
/* added option for random */
|
||||
/* number stack filling, */
|
||||
/* resulting in version 6.3.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
UINT _tx_thread_create(TX_THREAD *thread_ptr, CHAR *name_ptr, VOID (*entry_function)(ULONG id), ULONG entry_input,
|
||||
@@ -109,6 +113,17 @@ ALIGN_TYPE updated_stack_start;
|
||||
#endif
|
||||
|
||||
#ifndef TX_DISABLE_STACK_FILLING
|
||||
#if defined(TX_ENABLE_RANDOM_NUMBER_STACK_FILLING) && defined(TX_ENABLE_STACK_CHECKING)
|
||||
|
||||
/* Initialize the stack fill value to a 8-bit random value. */
|
||||
thread_ptr -> tx_thread_stack_fill_value = ((ULONG) TX_RAND()) & 0xFFUL;
|
||||
|
||||
/* Duplicate the random value in each of the 4 bytes of the stack fill value. */
|
||||
thread_ptr -> tx_thread_stack_fill_value = thread_ptr -> tx_thread_stack_fill_value |
|
||||
(thread_ptr -> tx_thread_stack_fill_value << 8) |
|
||||
(thread_ptr -> tx_thread_stack_fill_value << 16) |
|
||||
(thread_ptr -> tx_thread_stack_fill_value << 24);
|
||||
#endif
|
||||
|
||||
/* Set the thread stack to a pattern prior to creating the initial
|
||||
stack frame. This pattern is used by the stack checking routines
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _tx_thread_wait_abort PORTABLE C */
|
||||
/* 6.1 */
|
||||
/* 6.2.1 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -68,9 +68,12 @@
|
||||
/* */
|
||||
/* DATE NAME DESCRIPTION */
|
||||
/* */
|
||||
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
|
||||
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
|
||||
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
|
||||
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
|
||||
/* resulting in version 6.1 */
|
||||
/* 03-08-2023 Scott Larson Check if thread is coming out */
|
||||
/* of suspension elsewhere, */
|
||||
/* resulting in version 6.2.1 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
UINT _tx_thread_wait_abort(TX_THREAD *thread_ptr)
|
||||
@@ -131,6 +134,18 @@ ULONG suspension_sequence;
|
||||
/* Restore interrupts. */
|
||||
TX_RESTORE
|
||||
#endif
|
||||
}
|
||||
else if(thread_ptr -> tx_thread_suspend_cleanup == TX_NULL)
|
||||
{
|
||||
/* Thread is coming out of suspension elsewhere. */
|
||||
|
||||
#ifndef TX_NOT_INTERRUPTABLE
|
||||
/* Increment the disable preemption flag. */
|
||||
_tx_thread_preempt_disable++;
|
||||
|
||||
/* Restore interrupts. */
|
||||
TX_RESTORE
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -167,13 +182,8 @@ ULONG suspension_sequence;
|
||||
TX_RESTORE
|
||||
#endif
|
||||
|
||||
/* Call any cleanup routines. */
|
||||
if (suspend_cleanup != TX_NULL)
|
||||
{
|
||||
|
||||
/* Yes, there is a function to call. */
|
||||
(suspend_cleanup)(thread_ptr, suspension_sequence);
|
||||
}
|
||||
/* Call cleanup routine. */
|
||||
(suspend_cleanup)(thread_ptr, suspension_sequence);
|
||||
}
|
||||
|
||||
/* If the abort of the thread wait was successful, if so resume the thread. */
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _tx_trace_object_register PORTABLE C */
|
||||
/* 6.1 */
|
||||
/* 6.1.12 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -69,9 +69,12 @@
|
||||
/* */
|
||||
/* DATE NAME DESCRIPTION */
|
||||
/* */
|
||||
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
|
||||
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
|
||||
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
|
||||
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
|
||||
/* resulting in version 6.1 */
|
||||
/* 07-29-2022 Scott Larson Modified comment(s), */
|
||||
/* check for null name, */
|
||||
/* resulting in version 6.1.12 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
VOID _tx_trace_object_register(UCHAR object_type, VOID *object_ptr, CHAR *object_name, ULONG parameter_1, ULONG parameter_2)
|
||||
@@ -223,6 +226,12 @@ TX_TRACE_OBJECT_ENTRY *entry_ptr;
|
||||
work_ptr = TX_CHAR_TO_UCHAR_POINTER_CONVERT(object_name);
|
||||
work_ptr = TX_UCHAR_POINTER_ADD(work_ptr, i);
|
||||
|
||||
/* Determine if object_name (work_ptr) is null. */
|
||||
if (work_ptr == TX_NULL)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
/* Copy a character of the name. */
|
||||
entry_ptr -> tx_trace_object_entry_name[i] = (UCHAR) *work_ptr;
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/* COMPONENT DEFINITION RELEASE */
|
||||
/* */
|
||||
/* txm_module_manager_util.h PORTABLE C */
|
||||
/* 6.1.6 */
|
||||
/* 6.3.0 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* Scott Larson, Microsoft Corporation */
|
||||
@@ -44,6 +44,9 @@
|
||||
/* 04-02-2021 Scott Larson Modified comment(s) and */
|
||||
/* optimized object checks, */
|
||||
/* resulting in version 6.1.6 */
|
||||
/* 10-31-2023 Tiejun Zhou Modified comment(s) and */
|
||||
/* improved object check, */
|
||||
/* resulting in version 6.3.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
|
||||
@@ -100,13 +103,15 @@
|
||||
|
||||
/* Kernel objects should be outside the module at the very least. */
|
||||
#define TXM_MODULE_MANAGER_PARAM_CHECK_OBJECT_FOR_USE(module_instance, obj_ptr, obj_size) \
|
||||
((TXM_MODULE_MANAGER_ENSURE_OUTSIDE_MODULE(module_instance, obj_ptr, obj_size)) || \
|
||||
(TXM_MODULE_MANAGER_ENSURE_OUTSIDE_MODULE(module_instance, obj_ptr, obj_size) || \
|
||||
(_txm_module_manager_created_object_check(module_instance, (void *)obj_ptr) == TX_FALSE) || \
|
||||
((void *) (obj_ptr) == TX_NULL))
|
||||
|
||||
/* When creating an object, the object must be inside the object pool. */
|
||||
#define TXM_MODULE_MANAGER_PARAM_CHECK_OBJECT_FOR_CREATION(module_instance, obj_ptr, obj_size) \
|
||||
((TXM_MODULE_MANAGER_ENSURE_INSIDE_OBJ_POOL(module_instance, obj_ptr, obj_size) && \
|
||||
(_txm_module_manager_object_size_check(obj_ptr, obj_size) == TX_SUCCESS)) || \
|
||||
(_txm_module_manager_created_object_check(module_instance, (void *)obj_ptr) == TX_FALSE) || \
|
||||
((void *) (obj_ptr) == TX_NULL))
|
||||
|
||||
/* Strings we dereference can be in RW/RO/Shared areas. */
|
||||
|
||||
@@ -35,6 +35,10 @@
|
||||
#include "txm_module.h"
|
||||
#include "txm_module_manager_util.h"
|
||||
|
||||
#ifdef TX_ENABLE_EVENT_TRACE
|
||||
#include "tx_trace.h"
|
||||
#endif
|
||||
|
||||
#ifdef TXM_MODULE_ENABLE_FILEX
|
||||
extern UINT _txm_module_manager_filex_stop(TXM_MODULE_INSTANCE *module_instance);
|
||||
#endif
|
||||
@@ -60,7 +64,7 @@ extern UINT _txm_module_manager_usbx_stop(TXM_MODULE_INSTANCE *module_instance)
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _txm_module_manager_stop PORTABLE C */
|
||||
/* 6.1.5 */
|
||||
/* 6.2.1 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* Scott Larson, Microsoft Corporation */
|
||||
@@ -112,6 +116,8 @@ extern UINT _txm_module_manager_usbx_stop(TXM_MODULE_INSTANCE *module_instance)
|
||||
/* 03-02-2021 Scott Larson Modified comments, fix */
|
||||
/* object delete underflow, */
|
||||
/* resulting in version 6.1.5 */
|
||||
/* 03-08-2023 Scott Larson Added tx_trace.h include, */
|
||||
/* resulting in version 6.2.1 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
UINT _txm_module_manager_stop(TXM_MODULE_INSTANCE *module_instance)
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _txm_module_manager_thread_create PORTABLE C */
|
||||
/* 6.1.3 */
|
||||
/* 6.3.0 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* Scott Larson, Microsoft Corporation */
|
||||
@@ -91,6 +91,15 @@
|
||||
/* added 64-bit support, */
|
||||
/* added SMP support, */
|
||||
/* resulting in version 6.1.3 */
|
||||
/* 03-08-2023 Scott Larson Check module stack for */
|
||||
/* overlap, */
|
||||
/* resulting in version 6.2.1 */
|
||||
/* 10-31-2023 Xiuwen Cai, Yajun xia Modified comment(s), */
|
||||
/* added option for random */
|
||||
/* number stack filling, */
|
||||
/* fixed the kernel stack */
|
||||
/* allocation issue, */
|
||||
/* resulting in version 6.3.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
UINT _txm_module_manager_thread_create(TX_THREAD *thread_ptr, CHAR *name_ptr,
|
||||
@@ -158,8 +167,8 @@ ULONG i;
|
||||
}
|
||||
|
||||
/* Check the stack pointer to see if it overlaps with this thread's stack. */
|
||||
if ((((UCHAR *) ((VOID *) stack_start)) <= ((UCHAR *) ((VOID *) next_thread -> tx_thread_stack_end))) &&
|
||||
(((UCHAR *) ((VOID *) stack_end)) >= ((UCHAR *) ((VOID *) next_thread -> tx_thread_stack_start))))
|
||||
if ((((UCHAR *) ((VOID *) stack_start)) <= ((UCHAR *) ((VOID *) next_thread -> tx_thread_module_stack_end))) &&
|
||||
(((UCHAR *) ((VOID *) stack_end)) >= ((UCHAR *) ((VOID *) next_thread -> tx_thread_module_stack_start))))
|
||||
{
|
||||
/* Stacks overlap, clear the stack pointer to force a stack error below. */
|
||||
stack_start = TX_NULL;
|
||||
@@ -269,6 +278,17 @@ ULONG i;
|
||||
}
|
||||
|
||||
#ifndef TX_DISABLE_STACK_FILLING
|
||||
#if defined(TX_ENABLE_RANDOM_NUMBER_STACK_FILLING) && defined(TX_ENABLE_STACK_CHECKING)
|
||||
|
||||
/* Initialize the stack fill value to a 8-bit random value. */
|
||||
thread_ptr -> tx_thread_stack_fill_value = ((ULONG) TX_RAND()) & 0xFFUL;
|
||||
|
||||
/* Duplicate the random value in each of the 4 bytes of the stack fill value. */
|
||||
thread_ptr -> tx_thread_stack_fill_value = thread_ptr -> tx_thread_stack_fill_value |
|
||||
(thread_ptr -> tx_thread_stack_fill_value << 8) |
|
||||
(thread_ptr -> tx_thread_stack_fill_value << 16) |
|
||||
(thread_ptr -> tx_thread_stack_fill_value << 24);
|
||||
#endif
|
||||
|
||||
/* Set the thread stack to a pattern prior to creating the initial
|
||||
stack frame. This pattern is used by the stack checking routines
|
||||
@@ -309,9 +329,8 @@ ULONG i;
|
||||
/* Initialize thread control block to all zeros. */
|
||||
TX_MEMSET(thread_ptr, 0, sizeof(TX_THREAD));
|
||||
|
||||
#if TXM_MODULE_MEMORY_PROTECTION
|
||||
/* If this is a memory protected module, allocate a kernel stack. */
|
||||
if((module_instance -> txm_module_instance_property_flags) & TXM_MODULE_MEMORY_PROTECTION)
|
||||
/* If the thread runs on user mode, allocate the kernel stack for syscall. */
|
||||
if((module_instance -> txm_module_instance_property_flags) & TXM_MODULE_USER_MODE)
|
||||
{
|
||||
ULONG status;
|
||||
|
||||
@@ -336,6 +355,7 @@ ULONG i;
|
||||
thread_ptr -> tx_thread_module_kernel_stack_size = TXM_MODULE_KERNEL_STACK_SIZE;
|
||||
}
|
||||
|
||||
#if TXM_MODULE_MEMORY_PROTECTION
|
||||
/* Place the stack parameters into the thread's control block. */
|
||||
thread_ptr -> tx_thread_module_stack_start = stack_start;
|
||||
thread_ptr -> tx_thread_module_stack_size = stack_size;
|
||||
|
||||
@@ -0,0 +1,139 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
/* Define the file handles. */
|
||||
|
||||
FILE *source_file;
|
||||
FILE *array_file;
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
||||
int alpha;
|
||||
int alpha1;
|
||||
int alpha2;
|
||||
int alpha3;
|
||||
unsigned long address;
|
||||
unsigned long column;
|
||||
|
||||
|
||||
/* Determine if the proper number of files are provided. */
|
||||
if (argc != 3)
|
||||
{
|
||||
|
||||
/* Print an error message out and wait for user key hit. */
|
||||
printf("module_binary_to_c_array.exe - Copyright (c) Microsoft Corporation v5.8\n");
|
||||
printf("**** Error: invalid input parameter for module_binary_to_c_array.exe **** \n");
|
||||
printf(" Command Line Should be:\n\n");
|
||||
printf(" > module_binary_to_c_array source_binary_file c_array_file <cr> \n\n");
|
||||
return(1);
|
||||
}
|
||||
|
||||
/* Attempt to open the source file for reading. */
|
||||
source_file = fopen(argv[1], "rb");
|
||||
|
||||
/* Determine if the source file was opened properly. */
|
||||
if (source_file == NULL)
|
||||
{
|
||||
|
||||
/* Print an error message out and wait for user key hit. */
|
||||
printf("**** Error: open failed on binary source file **** \n");
|
||||
printf(" File: %s ", argv[1]);
|
||||
return(2);
|
||||
}
|
||||
|
||||
/* Determine if the binary file is a valid ThreadX module. */
|
||||
alpha = fgetc(source_file);
|
||||
alpha1 = fgetc(source_file);
|
||||
alpha2 = fgetc(source_file);
|
||||
alpha3 = fgetc(source_file);
|
||||
|
||||
if ((alpha != 0x4D && alpha != 0x55) || (alpha1 != 0x4F && alpha1 != 0x44) || (alpha2 != 0x44 && alpha2 != 0x4F) || (alpha3 != 0x55 && alpha3 != 0x4D))
|
||||
{
|
||||
|
||||
/* Print an error message out and wait for user key hit. */
|
||||
printf("**** Error: invalid format of binary input file **** \n");
|
||||
printf(" File: %s ", argv[1]);
|
||||
return(3);
|
||||
}
|
||||
|
||||
/* Attempt to open the dump file for writing. */
|
||||
array_file = fopen(argv[2], "w");
|
||||
|
||||
/* Determine if the dump file was opened properly. */
|
||||
if (array_file == NULL)
|
||||
{
|
||||
|
||||
/* Print an error message out and wait for user key hit. */
|
||||
printf("**** Error: open failed on C array file **** \n");
|
||||
printf(" File: %s ", argv[2]);
|
||||
return(4);
|
||||
}
|
||||
|
||||
fprintf(array_file, "/**************************** Module-Binary-to-C-array Utility **********************************/\n");
|
||||
fprintf(array_file, "/* */\n");
|
||||
fprintf(array_file, "/* Copyright (c) Microsoft Corporation Version 5.4, build date: 03-01-2018 */\n");
|
||||
fprintf(array_file, "/* */\n");
|
||||
fprintf(array_file, "/************************************************************************************************/\n\n");
|
||||
fprintf(array_file, "/* \n");
|
||||
fprintf(array_file, " Input Binary file: %30s\n", argv[1]);
|
||||
fprintf(array_file, " Output C Array file: %30s\n", argv[2]);
|
||||
fprintf(array_file, "*/\n\n");
|
||||
|
||||
/* Now print out the sections in a C array. */
|
||||
fprintf(array_file, "unsigned char module_code[] = {\n\n");
|
||||
fprintf(array_file, "/* Address Contents */\n\n");
|
||||
|
||||
/* Seek to the beginning of the source file. */
|
||||
fseek(source_file, 0, SEEK_SET);
|
||||
|
||||
/* Initialize the variables. */
|
||||
address = 0;
|
||||
column = 0;
|
||||
|
||||
do
|
||||
{
|
||||
|
||||
/* Get character from the input file. */
|
||||
alpha = fgetc(source_file);
|
||||
|
||||
/* Have we reached EOF? */
|
||||
if (alpha == EOF)
|
||||
break;
|
||||
|
||||
/* Print out character with a leading comma, except on the first character. */
|
||||
if (column == 0)
|
||||
{
|
||||
if (address != 0)
|
||||
fprintf(array_file, ",\n");
|
||||
fprintf(array_file, "/* 0x%08X */ 0x%02X", address, (unsigned int) alpha);
|
||||
}
|
||||
else
|
||||
fprintf(array_file, ", 0x%02X", (unsigned int) alpha);
|
||||
|
||||
/* Move column forward. */
|
||||
column++;
|
||||
|
||||
/* Are we at the end of the column? */
|
||||
if (column >= 16)
|
||||
{
|
||||
|
||||
column = 0;
|
||||
}
|
||||
|
||||
/* Move address forward. */
|
||||
address++;
|
||||
} while (alpha != EOF);
|
||||
|
||||
/* Finally, finish the C array containing the module code. */
|
||||
fprintf(array_file, "};\n\n");
|
||||
|
||||
/* Close files. */
|
||||
fclose(source_file);
|
||||
fclose(array_file);
|
||||
|
||||
return 0;
|
||||
}
|
||||
332
common_modules/module_manager/utilities/module_to_binary.c
Normal file
332
common_modules/module_manager/utilities/module_to_binary.c
Normal file
@@ -0,0 +1,332 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
/* Define the file handles. */
|
||||
|
||||
FILE *source_file;
|
||||
FILE *binary_file;
|
||||
|
||||
|
||||
#define ELF_ID_STRING_SIZE 16
|
||||
#define ELF_ARM_MACHINE_TYPE 40
|
||||
#define ELF_EXECUTABLE 2
|
||||
|
||||
|
||||
typedef struct ELF_HEADER_STRUCT
|
||||
{
|
||||
unsigned char elf_header_id_string[ELF_ID_STRING_SIZE];
|
||||
unsigned short elf_header_file_type;
|
||||
unsigned short elf_header_machinge_type;
|
||||
unsigned long elf_header_version;
|
||||
unsigned long elf_header_entry_address;
|
||||
unsigned long elf_header_program_header_offset;
|
||||
unsigned long elf_header_section_header_offset;
|
||||
unsigned long elf_header_processor_flags;
|
||||
unsigned short elf_header_size;
|
||||
unsigned short elf_header_program_header_size;
|
||||
unsigned short elf_header_program_header_entries;
|
||||
unsigned short elf_header_section_header_size;
|
||||
unsigned short elf_header_section_header_entries;
|
||||
unsigned short elf_header_section_string_index;
|
||||
} ELF_HEADER;
|
||||
|
||||
|
||||
typedef struct ELF_PROGRAM_HEADER_STRUCT
|
||||
{
|
||||
unsigned long elf_program_header_type;
|
||||
unsigned long elf_program_header_offset;
|
||||
unsigned long elf_program_header_virtual_address;
|
||||
unsigned long elf_program_header_physical_address;
|
||||
unsigned long elf_program_header_file_size;
|
||||
unsigned long elf_program_header_memory_size;
|
||||
unsigned long elf_program_header_flags;
|
||||
unsigned long elf_program_header_alignment;
|
||||
} ELF_PROGRAM_HEADER;
|
||||
|
||||
|
||||
typedef struct ELF_SECTION_HEADER_STRUCT
|
||||
{
|
||||
unsigned long elf_section_header_name;
|
||||
unsigned long elf_section_header_type;
|
||||
unsigned long elf_section_header_flags;
|
||||
unsigned long elf_section_header_address;
|
||||
unsigned long elf_section_header_offset;
|
||||
unsigned long elf_section_header_size;
|
||||
unsigned long elf_section_header_link;
|
||||
unsigned long elf_section_header_info;
|
||||
unsigned long elf_section_header_alignment;
|
||||
unsigned long elf_section_header_entry_size;
|
||||
} ELF_SECTION_HEADER;
|
||||
|
||||
|
||||
typedef struct ELF_SYMBOL_TABLE_ENTRY_STRUCT
|
||||
{
|
||||
unsigned long elf_symbol_table_entry_name;
|
||||
unsigned long elf_symbol_table_entry_address;
|
||||
unsigned long elf_symbol_table_entry_size;
|
||||
unsigned char elf_symbol_table_entry_info;
|
||||
unsigned char elf_symbol_table_entry_other;
|
||||
unsigned short elf_symbol_table_entry_shndx;
|
||||
|
||||
} ELF_SYMBOL_TABLE_ENTRY;
|
||||
|
||||
|
||||
typedef struct CODE_SECTION_ENTRY_STRUCT
|
||||
{
|
||||
unsigned long code_section_index;
|
||||
unsigned long code_section_address;
|
||||
unsigned long code_section_size;
|
||||
} CODE_SECTION_ENTRY;
|
||||
|
||||
|
||||
/* Define global variables. */
|
||||
|
||||
ELF_HEADER header;
|
||||
ELF_PROGRAM_HEADER *program_header;
|
||||
ELF_SECTION_HEADER *section_header;
|
||||
unsigned char *section_string_table;
|
||||
unsigned char *main_string_table;
|
||||
unsigned long total_symbols;
|
||||
ELF_SYMBOL_TABLE_ENTRY *symbol_table;
|
||||
unsigned long total_functions;
|
||||
ELF_SYMBOL_TABLE_ENTRY *function_table;
|
||||
CODE_SECTION_ENTRY *code_section_array;
|
||||
|
||||
|
||||
/* Define helper functions. */
|
||||
|
||||
int elf_object_read(unsigned long offset, void *object_address, int object_size)
|
||||
{
|
||||
|
||||
int i;
|
||||
int alpha;
|
||||
unsigned char *buffer;
|
||||
|
||||
/* Setup the buffer pointer. */
|
||||
buffer = (unsigned char *) object_address;
|
||||
|
||||
/* Seek to the proper position in the file. */
|
||||
fseek(source_file, offset, SEEK_SET);
|
||||
|
||||
/* Read the ELF object. */
|
||||
for (i = 0; i < object_size; i++)
|
||||
{
|
||||
alpha = fgetc(source_file);
|
||||
|
||||
if (alpha == EOF)
|
||||
return(1);
|
||||
|
||||
buffer[i] = (unsigned char) alpha;
|
||||
}
|
||||
|
||||
/* Return success. */
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
||||
unsigned long i, j;
|
||||
unsigned long current_total;
|
||||
unsigned long address;
|
||||
unsigned long size;
|
||||
unsigned char *code_buffer;
|
||||
unsigned long code_section_index;
|
||||
CODE_SECTION_ENTRY code_section_temp;
|
||||
unsigned char zero_value;
|
||||
|
||||
|
||||
/* Determine if the proper number of files are provided. */
|
||||
if (argc != 3)
|
||||
{
|
||||
|
||||
/* Print an error message out and wait for user key hit. */
|
||||
printf("module_to_binary.exe - Copyright (c) Microsoft Corporation v5.8\n");
|
||||
printf("**** Error: invalid input parameter for module_to_binary.exe **** \n");
|
||||
printf(" Command Line Should be:\n\n");
|
||||
printf(" > module_to_binary source_elf_file c_binary_file <cr> \n\n");
|
||||
return(1);
|
||||
}
|
||||
|
||||
/* Attempt to open the source file for reading. */
|
||||
source_file = fopen(argv[1], "rb");
|
||||
|
||||
/* Determine if the source file was opened properly. */
|
||||
if (source_file == NULL)
|
||||
{
|
||||
|
||||
/* Print an error message out. */
|
||||
printf("**** Error: open failed on source elf file **** \n");
|
||||
printf(" File: %s ", argv[1]);
|
||||
return(2);
|
||||
}
|
||||
|
||||
/* Attempt to open the binary file for writing. */
|
||||
binary_file = fopen(argv[2], "wb");
|
||||
|
||||
/* Determine if the binary file was opened properly. */
|
||||
if (binary_file == NULL)
|
||||
{
|
||||
|
||||
/* Print an error message out and wait for user key hit. */
|
||||
printf("**** Error: open failed on binary output file **** \n");
|
||||
printf(" File: %s ", argv[2]);
|
||||
return(3);
|
||||
}
|
||||
|
||||
/* Read the ELF header. */
|
||||
elf_object_read(0, &header, sizeof(header));
|
||||
|
||||
/* Allocate memory for the program header(s). */
|
||||
program_header = malloc(sizeof(ELF_PROGRAM_HEADER)*header.elf_header_program_header_entries);
|
||||
|
||||
/* Read the program header(s). */
|
||||
elf_object_read(header.elf_header_program_header_offset, program_header, (sizeof(ELF_PROGRAM_HEADER)*header.elf_header_program_header_entries));
|
||||
|
||||
/* Allocate memory for the section header(s). */
|
||||
section_header = malloc(sizeof(ELF_SECTION_HEADER)*header.elf_header_section_header_entries);
|
||||
|
||||
/* Read the section header(s). */
|
||||
elf_object_read(header.elf_header_section_header_offset, section_header, (sizeof(ELF_SECTION_HEADER)*header.elf_header_section_header_entries));
|
||||
|
||||
|
||||
/* Alocate memory for the section string table. */
|
||||
section_string_table = malloc(section_header[header.elf_header_section_string_index].elf_section_header_size);
|
||||
|
||||
/* Read the section string table. */
|
||||
elf_object_read(section_header[header.elf_header_section_string_index].elf_section_header_offset, section_string_table, section_header[header.elf_header_section_string_index].elf_section_header_size);
|
||||
|
||||
/* Allocate memory for the code section array. */
|
||||
code_section_array = malloc(sizeof(CODE_SECTION_ENTRY)*header.elf_header_section_header_entries);
|
||||
code_section_index = 0;
|
||||
|
||||
/* Print out the section header(s). */
|
||||
for (i = 0; i < header.elf_header_section_header_entries; i++)
|
||||
{
|
||||
|
||||
/* Determine if this section is a code section and there is a size. */
|
||||
if ((section_header[i].elf_section_header_type == 1) && (section_header[i].elf_section_header_size))
|
||||
{
|
||||
|
||||
/* Check for an-instruction area. */
|
||||
if ((section_header[i].elf_section_header_flags & 0x4) || (section_header[i].elf_section_header_flags & 0x2))
|
||||
{
|
||||
|
||||
/* Determine if this new section overlaps with an existing section. */
|
||||
for (j = 0; j < code_section_index; j++)
|
||||
{
|
||||
/* Is there an overlap? */
|
||||
if ((section_header[i].elf_section_header_address >= code_section_array[j].code_section_address) &&
|
||||
((section_header[i].elf_section_header_address+section_header[i].elf_section_header_size + section_header[i].elf_section_header_offset) < (code_section_array[j].code_section_address+code_section_array[j].code_section_size)))
|
||||
{
|
||||
/* New section is within a current section, just disregard it. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Determine if we have an overlap. */
|
||||
if (j == code_section_index)
|
||||
{
|
||||
|
||||
/* Yes, we have a code section... save it! */
|
||||
code_section_array[code_section_index].code_section_index = i;
|
||||
code_section_array[code_section_index].code_section_address = section_header[i].elf_section_header_address;
|
||||
code_section_array[code_section_index].code_section_size = section_header[i].elf_section_header_size;
|
||||
|
||||
/* Move to next code section. */
|
||||
code_section_index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for no code sections. */
|
||||
if (code_section_index == 0)
|
||||
{
|
||||
|
||||
/* Close files. */
|
||||
fclose(source_file);
|
||||
fclose(binary_file);
|
||||
|
||||
return(4);
|
||||
}
|
||||
|
||||
/* One or more code sections have been found... let's put them in the correct order by address. */
|
||||
i = 0;
|
||||
while (i+1 < code_section_index)
|
||||
{
|
||||
|
||||
/* Make the "ith" entry the lowest address. */
|
||||
j = i + 1;
|
||||
do
|
||||
{
|
||||
/* Is there a new lowest address? */
|
||||
if (code_section_array[j].code_section_address < code_section_array[i].code_section_address)
|
||||
{
|
||||
/* Yes, swap them! */
|
||||
code_section_temp = code_section_array[i];
|
||||
code_section_array[i] = code_section_array[j];
|
||||
code_section_array[j] = code_section_temp;
|
||||
}
|
||||
|
||||
/* Move the inner index. */
|
||||
j++;
|
||||
} while (j < code_section_index);
|
||||
|
||||
/* Move top index. */
|
||||
i++;
|
||||
}
|
||||
|
||||
address = code_section_array[0].code_section_address;
|
||||
zero_value = 0;
|
||||
for (i = 0; i < code_section_index; i++)
|
||||
{
|
||||
|
||||
/* Determine if there is any fill characters between sections. */
|
||||
while (address < code_section_array[i].code_section_address)
|
||||
{
|
||||
|
||||
/* Write a zero value. */
|
||||
fwrite(&zero_value, 1, 1, binary_file);
|
||||
|
||||
/* Move address forward. */
|
||||
address++;
|
||||
}
|
||||
|
||||
/* Now allocate memory for the code section. */
|
||||
code_buffer = malloc(code_section_array[i].code_section_size);
|
||||
|
||||
/* Read in the code area. */
|
||||
j = code_section_array[i].code_section_index;
|
||||
elf_object_read(section_header[j].elf_section_header_offset, code_buffer, code_section_array[i].code_section_size);
|
||||
|
||||
/* Write out the contents of this program area. */
|
||||
size = code_section_array[i].code_section_size;
|
||||
|
||||
j = 0;
|
||||
while (size)
|
||||
{
|
||||
|
||||
/* Print out a byte. */
|
||||
fwrite(&code_buffer[j], 1, 1, binary_file);
|
||||
|
||||
/* Move address forward. */
|
||||
address++;
|
||||
|
||||
/* Decrement size. */
|
||||
size--;
|
||||
|
||||
/* Move index into buffer. */
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Close files. */
|
||||
fclose(source_file);
|
||||
fclose(binary_file);
|
||||
|
||||
return 0;
|
||||
}
|
||||
392
common_modules/module_manager/utilities/module_to_c_array.c
Normal file
392
common_modules/module_manager/utilities/module_to_c_array.c
Normal file
@@ -0,0 +1,392 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
|
||||
/* Define the file handles. */
|
||||
|
||||
FILE *source_file;
|
||||
FILE *array_file;
|
||||
|
||||
|
||||
#define ELF_ID_STRING_SIZE 16
|
||||
#define ELF_ARM_MACHINE_TYPE 40
|
||||
#define ELF_EXECUTABLE 2
|
||||
|
||||
|
||||
typedef struct ELF_HEADER_STRUCT
|
||||
{
|
||||
unsigned char elf_header_id_string[ELF_ID_STRING_SIZE];
|
||||
unsigned short elf_header_file_type;
|
||||
unsigned short elf_header_machinge_type;
|
||||
unsigned long elf_header_version;
|
||||
unsigned long elf_header_entry_address;
|
||||
unsigned long elf_header_program_header_offset;
|
||||
unsigned long elf_header_section_header_offset;
|
||||
unsigned long elf_header_processor_flags;
|
||||
unsigned short elf_header_size;
|
||||
unsigned short elf_header_program_header_size;
|
||||
unsigned short elf_header_program_header_entries;
|
||||
unsigned short elf_header_section_header_size;
|
||||
unsigned short elf_header_section_header_entries;
|
||||
unsigned short elf_header_section_string_index;
|
||||
} ELF_HEADER;
|
||||
|
||||
|
||||
typedef struct ELF_PROGRAM_HEADER_STRUCT
|
||||
{
|
||||
unsigned long elf_program_header_type;
|
||||
unsigned long elf_program_header_offset;
|
||||
unsigned long elf_program_header_virtual_address;
|
||||
unsigned long elf_program_header_physical_address;
|
||||
unsigned long elf_program_header_file_size;
|
||||
unsigned long elf_program_header_memory_size;
|
||||
unsigned long elf_program_header_flags;
|
||||
unsigned long elf_program_header_alignment;
|
||||
} ELF_PROGRAM_HEADER;
|
||||
|
||||
|
||||
typedef struct ELF_SECTION_HEADER_STRUCT
|
||||
{
|
||||
unsigned long elf_section_header_name;
|
||||
unsigned long elf_section_header_type;
|
||||
unsigned long elf_section_header_flags;
|
||||
unsigned long elf_section_header_address;
|
||||
unsigned long elf_section_header_offset;
|
||||
unsigned long elf_section_header_size;
|
||||
unsigned long elf_section_header_link;
|
||||
unsigned long elf_section_header_info;
|
||||
unsigned long elf_section_header_alignment;
|
||||
unsigned long elf_section_header_entry_size;
|
||||
} ELF_SECTION_HEADER;
|
||||
|
||||
|
||||
typedef struct ELF_SYMBOL_TABLE_ENTRY_STRUCT
|
||||
{
|
||||
unsigned long elf_symbol_table_entry_name;
|
||||
unsigned long elf_symbol_table_entry_address;
|
||||
unsigned long elf_symbol_table_entry_size;
|
||||
unsigned char elf_symbol_table_entry_info;
|
||||
unsigned char elf_symbol_table_entry_other;
|
||||
unsigned short elf_symbol_table_entry_shndx;
|
||||
|
||||
} ELF_SYMBOL_TABLE_ENTRY;
|
||||
|
||||
|
||||
typedef struct CODE_SECTION_ENTRY_STRUCT
|
||||
{
|
||||
unsigned long code_section_index;
|
||||
unsigned long code_section_address;
|
||||
unsigned long code_section_size;
|
||||
} CODE_SECTION_ENTRY;
|
||||
|
||||
|
||||
/* Define global variables. */
|
||||
|
||||
ELF_HEADER header;
|
||||
ELF_PROGRAM_HEADER *program_header;
|
||||
ELF_SECTION_HEADER *section_header;
|
||||
unsigned char *section_string_table;
|
||||
unsigned char *main_string_table;
|
||||
unsigned long total_symbols;
|
||||
ELF_SYMBOL_TABLE_ENTRY *symbol_table;
|
||||
unsigned long total_functions;
|
||||
ELF_SYMBOL_TABLE_ENTRY *function_table;
|
||||
CODE_SECTION_ENTRY *code_section_array;
|
||||
|
||||
|
||||
/* Define helper functions. */
|
||||
|
||||
int elf_object_read(unsigned long offset, void *object_address, int object_size)
|
||||
{
|
||||
|
||||
int i;
|
||||
int alpha;
|
||||
unsigned char *buffer;
|
||||
|
||||
/* Setup the buffer pointer. */
|
||||
buffer = (unsigned char *) object_address;
|
||||
|
||||
/* Seek to the proper position in the file. */
|
||||
fseek(source_file, offset, SEEK_SET);
|
||||
|
||||
/* Read the ELF object. */
|
||||
for (i = 0; i < object_size; i++)
|
||||
{
|
||||
alpha = fgetc(source_file);
|
||||
|
||||
if (alpha == EOF)
|
||||
return(1);
|
||||
|
||||
buffer[i] = (unsigned char) alpha;
|
||||
}
|
||||
|
||||
/* Return success. */
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
||||
unsigned long i, j, k;
|
||||
unsigned long current_total;
|
||||
unsigned long address;
|
||||
unsigned long size;
|
||||
unsigned long column;
|
||||
unsigned char *code_buffer;
|
||||
unsigned long code_section_index;
|
||||
CODE_SECTION_ENTRY code_section_temp;
|
||||
|
||||
|
||||
/* Determine if the proper number of files are provided. */
|
||||
if (argc != 3)
|
||||
{
|
||||
|
||||
/* Print an error message out and wait for user key hit. */
|
||||
printf("module_to_c_array.exe - Copyright (c) Microsoft Corporation v5.8\n");
|
||||
printf("**** Error: invalid input parameter for module_to_c_array.exe **** \n");
|
||||
printf(" Command Line Should be:\n\n");
|
||||
printf(" > module_to_c_array source_elf_file c_array_file <cr> \n\n");
|
||||
return(1);
|
||||
}
|
||||
|
||||
/* Attempt to open the source file for reading. */
|
||||
source_file = fopen(argv[1], "rb");
|
||||
|
||||
/* Determine if the source file was opened properly. */
|
||||
if (source_file == NULL)
|
||||
{
|
||||
|
||||
/* Print an error message out and wait for user key hit. */
|
||||
printf("**** Error: open failed on source elf file **** \n");
|
||||
printf(" File: %s ", argv[1]);
|
||||
return(2);
|
||||
}
|
||||
|
||||
/* Attempt to open the dump file for writing. */
|
||||
array_file = fopen(argv[2], "w");
|
||||
|
||||
/* Determine if the dump file was opened properly. */
|
||||
if (array_file == NULL)
|
||||
{
|
||||
|
||||
/* Print an error message out and wait for user key hit. */
|
||||
printf("**** Error: open failed on C array file **** \n");
|
||||
printf(" File: %s ", argv[2]);
|
||||
return(3);
|
||||
}
|
||||
|
||||
/* Read the ELF header. */
|
||||
elf_object_read(0, &header, sizeof(header));
|
||||
|
||||
fprintf(array_file, "/**************************** Module-to-C-array Utility *****************************************/\n");
|
||||
fprintf(array_file, "/* */\n");
|
||||
fprintf(array_file, "/* Copyright (c) Microsoft Corporation Version 5.8, build date: 03-01-2018 */\n");
|
||||
fprintf(array_file, "/* */\n");
|
||||
fprintf(array_file, "/************************************************************************************************/\n\n");
|
||||
fprintf(array_file, "/* \n");
|
||||
fprintf(array_file, " Input ELF file: %30s\n", argv[1]);
|
||||
fprintf(array_file, " Output C Array file: %30s\n", argv[2]);
|
||||
fprintf(array_file, "*/\n\n");
|
||||
|
||||
/* Allocate memory for the program header(s). */
|
||||
program_header = malloc(sizeof(ELF_PROGRAM_HEADER)*header.elf_header_program_header_entries);
|
||||
|
||||
/* Read the program header(s). */
|
||||
elf_object_read(header.elf_header_program_header_offset, program_header, (sizeof(ELF_PROGRAM_HEADER)*header.elf_header_program_header_entries));
|
||||
|
||||
/* Allocate memory for the section header(s). */
|
||||
section_header = malloc(sizeof(ELF_SECTION_HEADER)*header.elf_header_section_header_entries);
|
||||
|
||||
/* Read the section header(s). */
|
||||
elf_object_read(header.elf_header_section_header_offset, section_header, (sizeof(ELF_SECTION_HEADER)*header.elf_header_section_header_entries));
|
||||
|
||||
|
||||
/* Alocate memory for the section string table. */
|
||||
section_string_table = malloc(section_header[header.elf_header_section_string_index].elf_section_header_size);
|
||||
|
||||
/* Read the section string table. */
|
||||
elf_object_read(section_header[header.elf_header_section_string_index].elf_section_header_offset, section_string_table, section_header[header.elf_header_section_string_index].elf_section_header_size);
|
||||
|
||||
/* Allocate memory for the code section array. */
|
||||
code_section_array = malloc(sizeof(CODE_SECTION_ENTRY)*header.elf_header_section_header_entries);
|
||||
code_section_index = 0;
|
||||
|
||||
/* Print out the section header(s). */
|
||||
for (i = 0; i < header.elf_header_section_header_entries; i++)
|
||||
{
|
||||
|
||||
/* Determine if this section is a code section and there is a size. */
|
||||
if ((section_header[i].elf_section_header_type == 1) && (section_header[i].elf_section_header_size))
|
||||
{
|
||||
|
||||
/* Check for an-instruction area. */
|
||||
if ((section_header[i].elf_section_header_flags & 0x4) || (section_header[i].elf_section_header_flags & 0x2))
|
||||
{
|
||||
/* Determine if this new section overlaps with an existing section. */
|
||||
for (j = 0; j < code_section_index; j++)
|
||||
{
|
||||
/* Is there an overlap? */
|
||||
if ((section_header[i].elf_section_header_address >= code_section_array[j].code_section_address) &&
|
||||
((section_header[i].elf_section_header_address+section_header[i].elf_section_header_size + section_header[i].elf_section_header_offset) < (code_section_array[j].code_section_address+code_section_array[j].code_section_size)))
|
||||
{
|
||||
/* New section is within a current section, just disregard it. */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Determine if we have an overlap. */
|
||||
if (j == code_section_index)
|
||||
{
|
||||
|
||||
/* Yes, we have a code section... save it! */
|
||||
code_section_array[code_section_index].code_section_index = i;
|
||||
code_section_array[code_section_index].code_section_address = section_header[i].elf_section_header_address;
|
||||
code_section_array[code_section_index].code_section_size = section_header[i].elf_section_header_size;
|
||||
|
||||
/* Move to next code section. */
|
||||
code_section_index++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Check for no code sections. */
|
||||
if (code_section_index == 0)
|
||||
{
|
||||
|
||||
/* Print an error message out. */
|
||||
printf("**** Error: No code sections found! **** \n");
|
||||
|
||||
fprintf(array_file, "unsigned char module_code[] = {0x00};\n\n");
|
||||
|
||||
/* Close files. */
|
||||
fclose(source_file);
|
||||
fclose(array_file);
|
||||
|
||||
return(4);
|
||||
}
|
||||
|
||||
/* One or more code sections have been found... let's put them in the correct order by address. */
|
||||
i = 0;
|
||||
while (i+1 < code_section_index)
|
||||
{
|
||||
|
||||
/* Make the "ith" entry the lowest address. */
|
||||
j = i + 1;
|
||||
do
|
||||
{
|
||||
/* Is there a new lowest address? */
|
||||
if (code_section_array[j].code_section_address < code_section_array[i].code_section_address)
|
||||
{
|
||||
/* Yes, swap them! */
|
||||
code_section_temp = code_section_array[i];
|
||||
code_section_array[i] = code_section_array[j];
|
||||
code_section_array[j] = code_section_temp;
|
||||
}
|
||||
|
||||
/* Move the inner index. */
|
||||
j++;
|
||||
} while (j < code_section_index);
|
||||
|
||||
/* Move top index. */
|
||||
i++;
|
||||
}
|
||||
|
||||
/* Now print out the sections in a C array. */
|
||||
fprintf(array_file, "unsigned char module_code[] = {\n\n");
|
||||
fprintf(array_file, "/* Address Contents */\n\n");
|
||||
|
||||
address = code_section_array[0].code_section_address;
|
||||
column = 0;
|
||||
|
||||
for (i = 0; i < code_section_index; i++)
|
||||
{
|
||||
|
||||
/* Determine if there is any fill characters between sections. */
|
||||
while (address < code_section_array[i].code_section_address)
|
||||
{
|
||||
|
||||
/* Print out a character with a leading comma, except on the first character. */
|
||||
if (column == 0)
|
||||
fprintf(array_file, "/* 0x%08X */ 0x00", address);
|
||||
else
|
||||
fprintf(array_file, ", 0x00");
|
||||
|
||||
/* Move column forward. */
|
||||
column++;
|
||||
|
||||
/* Are we at the end of the column? */
|
||||
if (column >= 16)
|
||||
{
|
||||
fprintf(array_file, ",\n");
|
||||
column = 0;
|
||||
}
|
||||
|
||||
/* Move address forward. */
|
||||
address++;
|
||||
}
|
||||
|
||||
/* Now allocate memory for the code section. */
|
||||
code_buffer = malloc(code_section_array[i].code_section_size);
|
||||
|
||||
/* Read in the code area. */
|
||||
j = code_section_array[i].code_section_index;
|
||||
elf_object_read(section_header[j].elf_section_header_offset, code_buffer, code_section_array[i].code_section_size);
|
||||
|
||||
/* Write out the contents of this program area. */
|
||||
size = code_section_array[i].code_section_size;
|
||||
|
||||
j = 0;
|
||||
k = 0;
|
||||
while (size)
|
||||
{
|
||||
|
||||
/* Print out a character with a leading comma, except on the first character. */
|
||||
if (column == 0)
|
||||
fprintf(array_file, "/* 0x%08X */ 0x%02X", address, (unsigned int) code_buffer[j]);
|
||||
else
|
||||
fprintf(array_file, ", 0x%02X", (unsigned int) code_buffer[j]);
|
||||
|
||||
/* Move column forward. */
|
||||
column++;
|
||||
|
||||
/* Are we at the end of the column? */
|
||||
if (column >= 16)
|
||||
{
|
||||
|
||||
/* Is this the last byte of the image? */
|
||||
if ((size != 1) || (i+1 != code_section_index))
|
||||
{
|
||||
if (k == 0)
|
||||
{
|
||||
k = code_section_array[i].code_section_index;
|
||||
fprintf(array_file, ", /* SECTION: %s */\n", §ion_string_table[section_header[k].elf_section_header_name]);
|
||||
}
|
||||
else
|
||||
fprintf(array_file, ",\n");
|
||||
}
|
||||
column = 0;
|
||||
}
|
||||
|
||||
/* Move address forward. */
|
||||
address++;
|
||||
|
||||
/* Decrement size. */
|
||||
size--;
|
||||
|
||||
/* Move index into buffer. */
|
||||
j++;
|
||||
}
|
||||
}
|
||||
|
||||
/* Finally, finish the C array containing the module code. */
|
||||
fprintf(array_file, "};\n\n");
|
||||
|
||||
/* Close files. */
|
||||
fclose(source_file);
|
||||
fclose(array_file);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -26,7 +26,7 @@
|
||||
/* APPLICATION INTERFACE DEFINITION RELEASE */
|
||||
/* */
|
||||
/* tx_api.h PORTABLE SMP */
|
||||
/* 6.1.10 */
|
||||
/* 6.3.0 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -71,6 +71,24 @@
|
||||
/* add unused parameter macro, */
|
||||
/* update patch number, */
|
||||
/* resulting in version 6.1.10 */
|
||||
/* 04-25-2022 Wenhui Xie Modified comment(s), */
|
||||
/* optimized the definition of */
|
||||
/* TX_TIMER_TICKS_PER_SECOND, */
|
||||
/* resulting in version 6.1.11 */
|
||||
/* 07-29-2022 Scott Larson Modified comment(s), */
|
||||
/* update patch number, */
|
||||
/* resulting in version 6.1.12 */
|
||||
/* 10-31-2022 Scott Larson Modified comment(s), */
|
||||
/* add extension macros, */
|
||||
/* update version numbers, */
|
||||
/* resulting in version 6.2.0 */
|
||||
/* 03-08-2023 Tiejun Zhou Modified comment(s), */
|
||||
/* update patch number, */
|
||||
/* resulting in version 6.2.1 */
|
||||
/* 10-31-2023 Xiuwen Cai Modified comment(s), */
|
||||
/* added option for random */
|
||||
/* number stack filling, */
|
||||
/* resulting in version 6.3.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
|
||||
@@ -122,8 +140,8 @@ extern "C" {
|
||||
|
||||
#define AZURE_RTOS_THREADX
|
||||
#define THREADX_MAJOR_VERSION 6
|
||||
#define THREADX_MINOR_VERSION 1
|
||||
#define THREADX_PATCH_VERSION 10
|
||||
#define THREADX_MINOR_VERSION 3
|
||||
#define THREADX_PATCH_VERSION 0
|
||||
|
||||
/* Define the following symbol for backward compatibility */
|
||||
#define EL_PRODUCT_THREADX
|
||||
@@ -158,7 +176,11 @@ extern "C" {
|
||||
#define TX_NO_MESSAGES ((UINT) 0)
|
||||
#define TX_EMPTY ((ULONG) 0)
|
||||
#define TX_CLEAR_ID ((ULONG) 0)
|
||||
#if defined(TX_ENABLE_RANDOM_NUMBER_STACK_FILLING) && defined(TX_ENABLE_STACK_CHECKING)
|
||||
#define TX_STACK_FILL (thread_ptr -> tx_thread_stack_fill_value)
|
||||
#else
|
||||
#define TX_STACK_FILL ((ULONG) 0xEFEFEFEFUL)
|
||||
#endif
|
||||
|
||||
|
||||
/* Thread execution state values. */
|
||||
@@ -221,12 +243,82 @@ extern "C" {
|
||||
#define TX_FEATURE_NOT_ENABLED ((UINT) 0xFF)
|
||||
|
||||
|
||||
#ifdef TX_64_BIT
|
||||
|
||||
#ifndef TX_THREAD_EXTENSION_PTR_SET
|
||||
#define TX_THREAD_EXTENSION_PTR_SET(a, b) { \
|
||||
TX_THREAD *thread_ptr; \
|
||||
thread_ptr = (TX_THREAD *) (a); \
|
||||
(thread_ptr -> tx_thread_extension_ptr) = (VOID *)(b); \
|
||||
}
|
||||
#endif /* TX_THREAD_EXTENSION_PTR_SET */
|
||||
|
||||
#ifndef TX_THREAD_EXTENSION_PTR_GET
|
||||
#define TX_THREAD_EXTENSION_PTR_GET(a, b, c) { \
|
||||
TX_PARAMETER_NOT_USED(c); \
|
||||
TX_THREAD *thread_ptr; \
|
||||
thread_ptr = tx_thread_identify(); \
|
||||
while(1)\
|
||||
{ \
|
||||
if (thread_ptr -> tx_thread_extension_ptr) \
|
||||
{ \
|
||||
(a) = (b *)(thread_ptr -> tx_thread_extension_ptr); \
|
||||
break; \
|
||||
} \
|
||||
tx_thread_sleep(1); \
|
||||
} \
|
||||
}
|
||||
#endif /* TX_THREAD_EXTENSION_PTR_GET */
|
||||
|
||||
#ifndef TX_TIMER_EXTENSION_PTR_SET
|
||||
#define TX_TIMER_EXTENSION_PTR_SET(a, b) { \
|
||||
TX_TIMER *timer_ptr; \
|
||||
timer_ptr = (TX_TIMER *) (a); \
|
||||
(timer_ptr -> tx_timer_internal.tx_timer_internal_extension_ptr) = (VOID *)(b); \
|
||||
}
|
||||
#endif /* TX_TIMER_EXTENSION_PTR_SET */
|
||||
|
||||
#ifndef TX_TIMER_EXTENSION_PTR_GET
|
||||
#define TX_TIMER_EXTENSION_PTR_GET(a, b, c) { \
|
||||
TX_PARAMETER_NOT_USED(c); \
|
||||
if (!_tx_timer_expired_timer_ptr -> tx_timer_internal_extension_ptr) \
|
||||
return; \
|
||||
(a) = (b *)(_tx_timer_expired_timer_ptr -> tx_timer_internal_extension_ptr); \
|
||||
}
|
||||
#endif /* TX_TIMER_EXTENSION_PTR_GET */
|
||||
|
||||
#else /* not 64 bit */
|
||||
|
||||
#ifndef TX_THREAD_EXTENSION_PTR_SET
|
||||
#define TX_THREAD_EXTENSION_PTR_SET(a, b)
|
||||
#endif /* TX_THREAD_EXTENSION_PTR_SET */
|
||||
|
||||
#ifndef TX_THREAD_EXTENSION_PTR_GET
|
||||
#define TX_THREAD_EXTENSION_PTR_GET(a, b, c) { \
|
||||
(a) = (b *)(c); \
|
||||
}
|
||||
#endif /* TX_THREAD_EXTENSION_PTR_GET */
|
||||
|
||||
#ifndef TX_TIMER_EXTENSION_PTR_SET
|
||||
#define TX_TIMER_EXTENSION_PTR_SET(a, b)
|
||||
#endif /* TX_TIMER_EXTENSION_PTR_SET */
|
||||
|
||||
#ifndef TX_TIMER_EXTENSION_PTR_GET
|
||||
#define TX_TIMER_EXTENSION_PTR_GET(a, b, c) { \
|
||||
(a) = (b *)(c); \
|
||||
}
|
||||
#endif /* TX_TIMER_EXTENSION_PTR_GET */
|
||||
|
||||
#endif /* TX_64_BIT */
|
||||
|
||||
|
||||
|
||||
/* Define the common timer tick reference for use by other middleware components. The default
|
||||
value is 10ms, but may be replaced by a port specific version in tx_port.h or by the user
|
||||
as a compilation option. */
|
||||
|
||||
#ifndef TX_TIMER_TICKS_PER_SECOND
|
||||
#define TX_TIMER_TICKS_PER_SECOND ((ULONG) 100)
|
||||
#define TX_TIMER_TICKS_PER_SECOND (100UL)
|
||||
#endif
|
||||
|
||||
|
||||
@@ -555,6 +647,12 @@ typedef struct TX_THREAD_STRUCT
|
||||
cleanup routine executes. */
|
||||
ULONG tx_thread_suspension_sequence;
|
||||
|
||||
#if defined(TX_ENABLE_RANDOM_NUMBER_STACK_FILLING) && defined(TX_ENABLE_STACK_CHECKING)
|
||||
|
||||
/* Define the random stack fill number. This can be used to detect stack overflow. */
|
||||
ULONG tx_thread_stack_fill_value;
|
||||
#endif
|
||||
|
||||
/* Define the user extension field. This typically is defined
|
||||
to white space, but some ports of ThreadX may need to have
|
||||
additional fields in the thread control block. This is
|
||||
@@ -1802,6 +1900,21 @@ UINT _tx_trace_interrupt_control(UINT new_posture);
|
||||
#endif
|
||||
|
||||
|
||||
/* Add a default macro that can be re-defined in tx_port.h to add processing to the initialize random number generator.
|
||||
By default, this is simply defined as whitespace. */
|
||||
|
||||
#ifndef TX_INITIALIZE_RANDOM_GENERATOR_INITIALIZATION
|
||||
#define TX_INITIALIZE_RANDOM_GENERATOR_INITIALIZATION
|
||||
#endif
|
||||
|
||||
|
||||
/* Define the TX_RAND macro to the standard library function, if not already defined. */
|
||||
|
||||
#ifndef TX_RAND
|
||||
#define TX_RAND() rand()
|
||||
#endif
|
||||
|
||||
|
||||
/* Check for MISRA compliance requirements. */
|
||||
|
||||
#ifdef TX_MISRA_ENABLE
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/* COMPONENT DEFINITION RELEASE */
|
||||
/* */
|
||||
/* tx_thread.h PORTABLE SMP */
|
||||
/* 6.1 */
|
||||
/* 6.3.0 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -42,6 +42,8 @@
|
||||
/* DATE NAME DESCRIPTION */
|
||||
/* */
|
||||
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
/* 10-31-2023 Tiejun Zhou Fixed MISRA2012 rule 8.3, */
|
||||
/* resulting in version 6.3.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
|
||||
@@ -1349,7 +1351,7 @@ TX_THREAD *thread_remap_list[TX_THREAD_SMP_MAX_CORES];
|
||||
}
|
||||
|
||||
|
||||
static INLINE_DECLARE ULONG _tx_thread_smp_preemptable_threads_get(UINT priority, TX_THREAD *possible_preemption_list[])
|
||||
static INLINE_DECLARE ULONG _tx_thread_smp_preemptable_threads_get(UINT priority, TX_THREAD *possible_preemption_list[TX_THREAD_SMP_MAX_CORES])
|
||||
{
|
||||
|
||||
UINT i, j, k;
|
||||
@@ -1668,7 +1670,7 @@ ULONG _tx_thread_smp_available_cores_get(void);
|
||||
ULONG _tx_thread_smp_possible_cores_get(void);
|
||||
UINT _tx_thread_smp_lowest_priority_get(void);
|
||||
UINT _tx_thread_smp_remap_solution_find(TX_THREAD *schedule_thread, ULONG available_cores, ULONG thread_possible_cores, ULONG test_possible_cores);
|
||||
ULONG _tx_thread_smp_preemptable_threads_get(UINT priority, TX_THREAD *possible_preemption_list[]);
|
||||
ULONG _tx_thread_smp_preemptable_threads_get(UINT priority, TX_THREAD *possible_preemption_list[TX_THREAD_SMP_MAX_CORES]);
|
||||
VOID _tx_thread_smp_simple_priority_change(TX_THREAD *thread_ptr, UINT new_priority);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
/* PORT SPECIFIC C INFORMATION RELEASE */
|
||||
/* */
|
||||
/* tx_user.h PORTABLE C */
|
||||
/* 6.1.9 */
|
||||
/* 6.3.0 */
|
||||
/* */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
@@ -58,6 +58,14 @@
|
||||
/* user-configurable symbol */
|
||||
/* TX_TIMER_TICKS_PER_SECOND */
|
||||
/* resulting in version 6.1.9 */
|
||||
/* 04-25-2022 Wenhui Xie Modified comment(s), */
|
||||
/* optimized the definition of */
|
||||
/* TX_TIMER_TICKS_PER_SECOND, */
|
||||
/* resulting in version 6.1.11 */
|
||||
/* 10-31-2023 Xiuwen Cai Modified comment(s), */
|
||||
/* added option for random */
|
||||
/* number stack filling, */
|
||||
/* resulting in version 6.3.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
|
||||
@@ -116,7 +124,7 @@
|
||||
Note: the actual hardware timer value may need to be changed (usually in tx_initialize_low_level). */
|
||||
|
||||
/*
|
||||
#define TX_TIMER_TICKS_PER_SECOND ((ULONG) 100)
|
||||
#define TX_TIMER_TICKS_PER_SECOND (100UL)
|
||||
*/
|
||||
|
||||
/* Determine if there is a FileX pointer in the thread control block.
|
||||
@@ -166,6 +174,14 @@
|
||||
#define TX_ENABLE_STACK_CHECKING
|
||||
*/
|
||||
|
||||
/* Determine if random number is used for stack filling. By default, ThreadX uses a fixed
|
||||
pattern for stack filling. When the following is defined, ThreadX uses a random number
|
||||
for stack filling. This is effective only when TX_ENABLE_STACK_CHECKING is defined. */
|
||||
|
||||
/*
|
||||
#define TX_ENABLE_RANDOM_NUMBER_STACK_FILLING
|
||||
*/
|
||||
|
||||
/* Determine if preemption-threshold should be disabled. By default, preemption-threshold is
|
||||
enabled. If the application does not use preemption-threshold, it may be disabled to reduce
|
||||
code size and improve performance. */
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _tx_byte_pool_search PORTABLE SMP */
|
||||
/* 6.1.7 */
|
||||
/* 6.3.0 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -81,6 +81,8 @@
|
||||
/* calculation, and reduced */
|
||||
/* number of search resets, */
|
||||
/* resulting in version 6.1.7 */
|
||||
/* 10-31-2023 Tiejun Zhou Fixed MISRA2012 rule 10.4_a, */
|
||||
/* resulting in version 6.3.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
UCHAR *_tx_byte_pool_search(TX_BYTE_POOL *pool_ptr, ULONG memory_size)
|
||||
@@ -110,7 +112,7 @@ UINT blocks_searched = ((UINT) 0);
|
||||
|
||||
/* First, determine if there are enough bytes in the pool. */
|
||||
/* Theoretical bytes available = free bytes + ((fragments-2) * overhead of each block) */
|
||||
total_theoretical_available = pool_ptr -> tx_byte_pool_available + ((pool_ptr -> tx_byte_pool_fragments - 2) * ((sizeof(UCHAR *)) + (sizeof(ALIGN_TYPE))));
|
||||
total_theoretical_available = pool_ptr -> tx_byte_pool_available + ((pool_ptr -> tx_byte_pool_fragments - 2U) * ((sizeof(UCHAR *)) + (sizeof(ALIGN_TYPE))));
|
||||
if (memory_size >= total_theoretical_available)
|
||||
{
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _tx_event_flags_get PORTABLE C */
|
||||
/* 6.1 */
|
||||
/* 6.2.0 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -73,9 +73,15 @@
|
||||
/* */
|
||||
/* DATE NAME DESCRIPTION */
|
||||
/* */
|
||||
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
|
||||
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
|
||||
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
|
||||
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
|
||||
/* resulting in version 6.1 */
|
||||
/* 04-25-2022 Scott Larson Modified comment(s), */
|
||||
/* handle 0 flags case, */
|
||||
/* resulting in version 6.1.11 */
|
||||
/* 10-31-2022 Scott Larson Modified comment(s), always */
|
||||
/* return actual flags, */
|
||||
/* resulting in version 6.2.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
UINT _tx_event_flags_get(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG requested_flags,
|
||||
@@ -122,6 +128,9 @@ UINT interrupted_set_request;
|
||||
/* Pickup current flags. */
|
||||
current_flags = group_ptr -> tx_event_flags_group_current;
|
||||
|
||||
/* Return the actual event flags and apply delayed clearing. */
|
||||
*actual_flags_ptr = current_flags & ~group_ptr -> tx_event_flags_group_delayed_clear;
|
||||
|
||||
/* Apply the event flag option mask. */
|
||||
and_request = (get_option & TX_AND);
|
||||
|
||||
@@ -155,9 +164,6 @@ UINT interrupted_set_request;
|
||||
if (flags_satisfied != ((ULONG) 0))
|
||||
{
|
||||
|
||||
/* Return the actual event flags that satisfied the request. */
|
||||
*actual_flags_ptr = current_flags;
|
||||
|
||||
/* Pickup the clear bit. */
|
||||
clear_request = (get_option & TX_EVENT_FLAGS_CLEAR_MASK);
|
||||
|
||||
@@ -218,9 +224,6 @@ UINT interrupted_set_request;
|
||||
|
||||
/* Yes, this request can be handled immediately. */
|
||||
|
||||
/* Return the actual event flags that satisfied the request. */
|
||||
*actual_flags_ptr = current_flags;
|
||||
|
||||
/* Pickup the clear bit. */
|
||||
clear_request = (get_option & TX_EVENT_FLAGS_CLEAR_MASK);
|
||||
|
||||
@@ -271,16 +274,17 @@ UINT interrupted_set_request;
|
||||
#endif
|
||||
else
|
||||
{
|
||||
|
||||
/* flags_satisfied is 0. */
|
||||
/* Determine if the request specifies suspension. */
|
||||
if (wait_option != TX_NO_WAIT)
|
||||
{
|
||||
|
||||
/* Determine if the preempt disable flag is non-zero. */
|
||||
if (_tx_thread_preempt_disable != ((UINT) 0))
|
||||
/* Determine if the preempt disable flag is non-zero OR the requested events is 0. */
|
||||
if ((_tx_thread_preempt_disable != ((UINT) 0)) || (requested_flags == (UINT) 0))
|
||||
{
|
||||
|
||||
/* Suspension is not allowed if the preempt disable flag is non-zero at this point, return error completion. */
|
||||
/* Suspension is not allowed if the preempt disable flag is non-zero at this point,
|
||||
or if requested_flags is 0, return error completion. */
|
||||
status = TX_NO_EVENTS;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _tx_event_flags_set PORTABLE C */
|
||||
/* 6.1 */
|
||||
/* 6.1.11 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -72,9 +72,13 @@
|
||||
/* */
|
||||
/* DATE NAME DESCRIPTION */
|
||||
/* */
|
||||
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
|
||||
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
|
||||
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
|
||||
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
|
||||
/* resulting in version 6.1 */
|
||||
/* 04-25-2022 William E. Lamie Modified comment(s), and */
|
||||
/* added corrected preemption */
|
||||
/* check logic, resulting in */
|
||||
/* version 6.1.11 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
UINT _tx_event_flags_set(TX_EVENT_FLAGS_GROUP *group_ptr, ULONG flags_to_set, UINT set_option)
|
||||
@@ -264,9 +268,6 @@ VOID (*events_set_notify)(struct TX_EVENT_FLAGS_GROUP_STRUCT *notify_
|
||||
/* Yes, resume the thread and apply any event flag
|
||||
clearing. */
|
||||
|
||||
/* Set the preempt check flag. */
|
||||
preempt_check = TX_TRUE;
|
||||
|
||||
/* Return the actual event flags that satisfied the request. */
|
||||
suspend_info_ptr = TX_VOID_TO_ULONG_POINTER_CONVERT(thread_ptr -> tx_thread_additional_suspend_info);
|
||||
*suspend_info_ptr = current_event_flags;
|
||||
@@ -336,6 +337,11 @@ VOID (*events_set_notify)(struct TX_EVENT_FLAGS_GROUP_STRUCT *notify_
|
||||
/* Disable preemption while we process the suspended list. */
|
||||
_tx_thread_preempt_disable++;
|
||||
|
||||
/* Since we have temporarily disabled preemption globally, set the preempt
|
||||
check flag to check for any preemption condition - including from
|
||||
unrelated ISR processing. */
|
||||
preempt_check = TX_TRUE;
|
||||
|
||||
/* Loop to examine all of the suspended threads. */
|
||||
do
|
||||
{
|
||||
@@ -419,9 +425,6 @@ VOID (*events_set_notify)(struct TX_EVENT_FLAGS_GROUP_STRUCT *notify_
|
||||
|
||||
/* Yes, this request can be handled now. */
|
||||
|
||||
/* Set the preempt check flag. */
|
||||
preempt_check = TX_TRUE;
|
||||
|
||||
/* Determine if the thread is still suspended on the event flag group. If not, a wait
|
||||
abort must have been done from an ISR. */
|
||||
if (thread_ptr -> tx_thread_state == TX_EVENT_FLAG)
|
||||
|
||||
@@ -47,7 +47,7 @@ TX_SAFETY_CRITICAL_EXCEPTION_HANDLER
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _tx_initialize_kernel_enter PORTABLE SMP */
|
||||
/* 6.1 */
|
||||
/* 6.3.0 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -87,7 +87,11 @@ TX_SAFETY_CRITICAL_EXCEPTION_HANDLER
|
||||
/* */
|
||||
/* DATE NAME DESCRIPTION */
|
||||
/* */
|
||||
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
/* 10-31-2023 Xiuwen Cai Modified comment(s), */
|
||||
/* added random generator */
|
||||
/* initialization, */
|
||||
/* resulting in version 6.3.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
VOID _tx_initialize_kernel_enter(VOID)
|
||||
@@ -134,6 +138,9 @@ ULONG other_core_status, i;
|
||||
later used to represent interrupt nesting. */
|
||||
_tx_thread_system_state[0] = TX_INITIALIZE_IN_PROGRESS;
|
||||
|
||||
/* Optional random number generator initialization. */
|
||||
TX_INITIALIZE_RANDOM_GENERATOR_INITIALIZATION
|
||||
|
||||
/* Call the application provided initialization function. Pass the
|
||||
first available memory address to it. */
|
||||
tx_application_define(_tx_initialize_unused_memory);
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _tx_thread_create PORTABLE SMP */
|
||||
/* 6.1.8 */
|
||||
/* 6.3.0 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -85,6 +85,14 @@
|
||||
/* resulting in version 6.1.3 */
|
||||
/* 08-02-2021 Scott Larson Removed unneeded cast, */
|
||||
/* resulting in version 6.1.8 */
|
||||
/* 10-31-2022 Scott Larson Removed ifdef block to always */
|
||||
/* restore interrupts at end */
|
||||
/* of if block, */
|
||||
/* resulting in version 6.2.0 */
|
||||
/* 10-31-2023 Xiuwen Cai Modified comment(s), */
|
||||
/* added option for random */
|
||||
/* number stack filling, */
|
||||
/* resulting in version 6.3.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
UINT _tx_thread_create(TX_THREAD *thread_ptr, CHAR *name_ptr,
|
||||
@@ -106,6 +114,17 @@ ALIGN_TYPE updated_stack_start;
|
||||
|
||||
|
||||
#ifndef TX_DISABLE_STACK_FILLING
|
||||
#if defined(TX_ENABLE_RANDOM_NUMBER_STACK_FILLING) && defined(TX_ENABLE_STACK_CHECKING)
|
||||
|
||||
/* Initialize the stack fill value to a 8-bit random value. */
|
||||
thread_ptr -> tx_thread_stack_fill_value = ((ULONG) TX_RAND()) & 0xFFUL;
|
||||
|
||||
/* Duplicate the random value in each of the 4 bytes of the stack fill value. */
|
||||
thread_ptr -> tx_thread_stack_fill_value = thread_ptr -> tx_thread_stack_fill_value |
|
||||
(thread_ptr -> tx_thread_stack_fill_value << 8) |
|
||||
(thread_ptr -> tx_thread_stack_fill_value << 16) |
|
||||
(thread_ptr -> tx_thread_stack_fill_value << 24);
|
||||
#endif
|
||||
|
||||
/* Set the thread stack to a pattern prior to creating the initial
|
||||
stack frame. This pattern is used by the stack checking routines
|
||||
@@ -344,11 +363,8 @@ ALIGN_TYPE updated_stack_start;
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef TX_NOT_INTERRUPTABLE
|
||||
|
||||
/* Restore interrupts. */
|
||||
TX_RESTORE
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -826,7 +826,7 @@ TX_THREAD *thread_remap_list[TX_THREAD_SMP_MAX_CORES];
|
||||
}
|
||||
|
||||
|
||||
ULONG _tx_thread_smp_preemptable_threads_get(UINT priority, TX_THREAD *possible_preemption_list[])
|
||||
ULONG _tx_thread_smp_preemptable_threads_get(UINT priority, TX_THREAD *possible_preemption_list[TX_THREAD_SMP_MAX_CORES])
|
||||
{
|
||||
|
||||
UINT i, j, k;
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _tx_thread_system_suspend PORTABLE SMP */
|
||||
/* 6.1 */
|
||||
/* 6.3.0 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -87,7 +87,12 @@
|
||||
/* */
|
||||
/* DATE NAME DESCRIPTION */
|
||||
/* */
|
||||
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
/* 04-25-2022 Scott Larson Modified comments and fixed */
|
||||
/* loop to find next thread, */
|
||||
/* resulting in version 6.1.11 */
|
||||
/* 10-31-2023 Tiejun Zhou Fixed MISRA2012 rule 10.4_a, */
|
||||
/* resulting in version 6.3.0 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
VOID _tx_thread_system_suspend(TX_THREAD *thread_ptr)
|
||||
@@ -667,9 +672,18 @@ UINT processing_complete;
|
||||
/* Calculate the possible complex path. */
|
||||
complex_path_possible = possible_cores & available_cores;
|
||||
|
||||
/* Check if we need to loop to find the next highest priority thread. */
|
||||
if (next_priority == (ULONG)TX_MAX_PRIORITIES)
|
||||
{
|
||||
loop_finished = TX_TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
loop_finished = TX_FALSE;
|
||||
}
|
||||
|
||||
/* Loop to find the next highest priority ready thread that is allowed to run on this core. */
|
||||
loop_finished = TX_FALSE;
|
||||
do
|
||||
while (loop_finished == TX_FALSE)
|
||||
{
|
||||
|
||||
/* Determine if there is a thread to examine. */
|
||||
@@ -814,7 +828,7 @@ UINT processing_complete;
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (loop_finished == TX_FALSE);
|
||||
}
|
||||
|
||||
#ifdef TX_THREAD_SMP_INTER_CORE_INTERRUPT
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _tx_thread_wait_abort PORTABLE C */
|
||||
/* 6.1 */
|
||||
/* 6.2.1 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -68,9 +68,12 @@
|
||||
/* */
|
||||
/* DATE NAME DESCRIPTION */
|
||||
/* */
|
||||
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
|
||||
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
|
||||
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
|
||||
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
|
||||
/* resulting in version 6.1 */
|
||||
/* 03-08-2023 Scott Larson Check if thread is coming out */
|
||||
/* of suspension elsewhere, */
|
||||
/* resulting in version 6.2.1 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
UINT _tx_thread_wait_abort(TX_THREAD *thread_ptr)
|
||||
@@ -131,6 +134,18 @@ ULONG suspension_sequence;
|
||||
/* Restore interrupts. */
|
||||
TX_RESTORE
|
||||
#endif
|
||||
}
|
||||
else if(thread_ptr -> tx_thread_suspend_cleanup == TX_NULL)
|
||||
{
|
||||
/* Thread is coming out of suspension elsewhere. */
|
||||
|
||||
#ifndef TX_NOT_INTERRUPTABLE
|
||||
/* Increment the disable preemption flag. */
|
||||
_tx_thread_preempt_disable++;
|
||||
|
||||
/* Restore interrupts. */
|
||||
TX_RESTORE
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -167,13 +182,8 @@ ULONG suspension_sequence;
|
||||
TX_RESTORE
|
||||
#endif
|
||||
|
||||
/* Call any cleanup routines. */
|
||||
if (suspend_cleanup != TX_NULL)
|
||||
{
|
||||
|
||||
/* Yes, there is a function to call. */
|
||||
(suspend_cleanup)(thread_ptr, suspension_sequence);
|
||||
}
|
||||
/* Call cleanup routine. */
|
||||
(suspend_cleanup)(thread_ptr, suspension_sequence);
|
||||
}
|
||||
|
||||
/* If the abort of the thread wait was successful, if so resume the thread. */
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
/* FUNCTION RELEASE */
|
||||
/* */
|
||||
/* _tx_trace_object_register PORTABLE C */
|
||||
/* 6.1 */
|
||||
/* 6.1.12 */
|
||||
/* AUTHOR */
|
||||
/* */
|
||||
/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -69,9 +69,12 @@
|
||||
/* */
|
||||
/* DATE NAME DESCRIPTION */
|
||||
/* */
|
||||
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
|
||||
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
|
||||
/* 05-19-2020 William E. Lamie Initial Version 6.0 */
|
||||
/* 09-30-2020 Yuxin Zhou Modified comment(s), */
|
||||
/* resulting in version 6.1 */
|
||||
/* 07-29-2022 Scott Larson Modified comment(s), */
|
||||
/* check for null name, */
|
||||
/* resulting in version 6.1.12 */
|
||||
/* */
|
||||
/**************************************************************************/
|
||||
VOID _tx_trace_object_register(UCHAR object_type, VOID *object_ptr, CHAR *object_name, ULONG parameter_1, ULONG parameter_2)
|
||||
@@ -223,6 +226,12 @@ TX_TRACE_OBJECT_ENTRY *entry_ptr;
|
||||
work_ptr = TX_CHAR_TO_UCHAR_POINTER_CONVERT(object_name);
|
||||
work_ptr = TX_UCHAR_POINTER_ADD(work_ptr, i);
|
||||
|
||||
/* Determine if object_name (work_ptr) is null. */
|
||||
if (work_ptr == TX_NULL)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
/* Copy a character of the name. */
|
||||
entry_ptr -> tx_trace_object_entry_name[i] = (UCHAR) *work_ptr;
|
||||
|
||||
|
||||
BIN
docs/threadx-features.png
Normal file
BIN
docs/threadx-features.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 328 KiB |
@@ -322,7 +322,7 @@ void _tx_initialize_start_interrupts(void);
|
||||
|
||||
#ifdef TX_THREAD_INIT
|
||||
CHAR _tx_version_id[] =
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARCv2_EM/MetaWare Version 6.1.10 *";
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARCv2_EM/MetaWare Version 6.3.0 *";
|
||||
#else
|
||||
#ifdef TX_MISRA_ENABLE
|
||||
extern CHAR _tx_version_id[100];
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
.equ BTA, 0x412
|
||||
.equ KSTACK_TOP, 0x264
|
||||
@@ -29,7 +32,7 @@
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_context_restore ARCv2_EM/MetaWare */
|
||||
;/* 6.1.9 */
|
||||
;/* 6.2.1 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -69,6 +72,9 @@
|
||||
;/* support for disabling the */
|
||||
;/* loop control feature, */
|
||||
;/* resulting in version 6.1.9 */
|
||||
;/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
;/* #include tx_user.h, */
|
||||
;/* resulting in version 6.2.1 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_thread_context_restore(VOID)
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
.equ BTA, 0x412
|
||||
.equ KSTACK_TOP, 0x264
|
||||
@@ -29,7 +32,7 @@
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_context_save ARCv2_EM/MetaWare */
|
||||
;/* 6.1.6 */
|
||||
;/* 6.2.1 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -64,6 +67,9 @@
|
||||
;/* 04-02-2021 Andres Mlinar Modified comment(s), and */
|
||||
;/* r25/r30 are caller saved, */
|
||||
;/* resulting in version 6.1.6 */
|
||||
;/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
;/* #include tx_user.h, */
|
||||
;/* resulting in version 6.2.1 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_thread_context_save(VOID)
|
||||
|
||||
@@ -18,13 +18,16 @@
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_interrupt_control ARCv2_EM/MetaWare */
|
||||
;/* 6.1.6 */
|
||||
;/* 6.2.1 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -57,6 +60,9 @@
|
||||
;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
;/* 04-02-2021 Andres Mlinar Modified comments, */
|
||||
;/* resulting in version 6.1.6 */
|
||||
;/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
;/* #include tx_user.h, */
|
||||
;/* resulting in version 6.2.1 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;UINT _tx_thread_interrupt_control(UINT new_posture)
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
.equ BTA, 0x412
|
||||
.equ KSTACK_TOP, 0x264
|
||||
@@ -29,7 +32,7 @@
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_schedule ARCv2_EM/MetaWare */
|
||||
;/* 6.1.9 */
|
||||
;/* 6.2.1 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
.equ LONG_ALIGN_MASK, 0xFFFFFFFC
|
||||
.equ INT_ENABLE_BITS, 0x8000001E
|
||||
@@ -27,7 +30,7 @@
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_stack_build ARCv2_EM/MetaWare */
|
||||
;/* 6.1.6 */
|
||||
;/* 6.2.1 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -62,6 +65,9 @@
|
||||
;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
;/* 04-02-2021 Andres Mlinar Modified comments, */
|
||||
;/* resulting in version 6.1.6 */
|
||||
;/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
;/* #include tx_user.h, */
|
||||
;/* resulting in version 6.2.1 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_thread_stack_build(TX_THREAD *thread_ptr, VOID (*function_ptr)(VOID))
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
.equ KSTACK_TOP, 0x264
|
||||
.equ KSTACK_BASE, 0x265
|
||||
@@ -28,7 +31,7 @@
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_system_return ARCv2_EM/MetaWare */
|
||||
;/* 6.1.9 */
|
||||
;/* 6.2.1 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -66,6 +69,9 @@
|
||||
;/* 10-15-2021 Andres Mlinar Modified comments, */
|
||||
;/* use schedule reenter, */
|
||||
;/* resulting in version 6.1.9 */
|
||||
;/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
;/* #include tx_user.h, */
|
||||
;/* resulting in version 6.2.1 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_thread_system_return(VOID)
|
||||
|
||||
@@ -18,13 +18,16 @@
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_timer_interrupt ARCv2_EM/MetaWare */
|
||||
;/* 6.1.9 */
|
||||
;/* 6.2.1 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -69,6 +72,9 @@
|
||||
;/* fixed possible race */
|
||||
;/* condition on preemption */
|
||||
;/* resulting in version 6.1.9 */
|
||||
;/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
;/* #include tx_user.h, */
|
||||
;/* resulting in version 6.2.1 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_timer_interrupt(VOID)
|
||||
|
||||
@@ -336,7 +336,7 @@ VOID tx_thread_register_bank_assign(VOID *thread_ptr, UINT register_bank);
|
||||
|
||||
#ifdef TX_THREAD_INIT
|
||||
CHAR _tx_version_id[] =
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARC_HS/MetaWare Version 6.1.10 *";
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARC_HS/MetaWare Version 6.3.0 *";
|
||||
#else
|
||||
#ifdef TX_MISRA_ENABLE
|
||||
extern CHAR _tx_version_id[100];
|
||||
|
||||
@@ -19,23 +19,16 @@
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
;
|
||||
;
|
||||
;#define TX_SOURCE_CODE
|
||||
;
|
||||
;
|
||||
;/* Include necessary system files. */
|
||||
;
|
||||
;#include "tx_api.h"
|
||||
;#include "tx_initialize.h"
|
||||
;
|
||||
;
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_initialize_fast_interrupt_setup ARC_HS/MetaWare */
|
||||
;/* 6.1 */
|
||||
;/* 6.2.1 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -67,6 +60,9 @@
|
||||
;/* DATE NAME DESCRIPTION */
|
||||
;/* */
|
||||
;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
;/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
;/* #include tx_user.h, */
|
||||
;/* resulting in version 6.2.1 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_initialize_fast_interrupt_setup(VOID *stack_ptr)
|
||||
|
||||
@@ -19,25 +19,18 @@
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
;
|
||||
;
|
||||
;#define TX_SOURCE_CODE
|
||||
;
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
.equ BTA, 0x412
|
||||
;
|
||||
;/* Include necessary system files. */
|
||||
;
|
||||
;#include "tx_api.h"
|
||||
;#include "tx_thread.h"
|
||||
;#include "tx_timer.h"
|
||||
;
|
||||
;
|
||||
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_context_fast_restore ARC_HS/MetaWare */
|
||||
;/* 6.1 */
|
||||
;/* 6.2.1 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -70,6 +63,9 @@
|
||||
;/* DATE NAME DESCRIPTION */
|
||||
;/* */
|
||||
;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
;/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
;/* #include tx_user.h, */
|
||||
;/* resulting in version 6.2.1 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_thread_context_fast_restore(VOID)
|
||||
@@ -115,7 +111,7 @@ __tx_thread_nested_restore:
|
||||
__tx_thread_not_nested_restore:
|
||||
;
|
||||
; /* Determine if a thread was interrupted and no preemption is required. */
|
||||
; else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr)
|
||||
; else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr))
|
||||
; || (_tx_thread_preempt_disable))
|
||||
; {
|
||||
;
|
||||
|
||||
@@ -19,24 +19,16 @@
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
;
|
||||
;
|
||||
;#define TX_SOURCE_CODE
|
||||
;
|
||||
;
|
||||
;/* Include necessary system files. */
|
||||
;
|
||||
;#include "tx_api.h"
|
||||
;#include "tx_thread.h"
|
||||
;#include "tx_timer.h"
|
||||
;
|
||||
;
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_context_fast_save ARC_HS/MetaWare */
|
||||
;/* 6.1 */
|
||||
;/* 6.2.1 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -73,6 +65,9 @@
|
||||
;/* DATE NAME DESCRIPTION */
|
||||
;/* */
|
||||
;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
;/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
;/* #include tx_user.h, */
|
||||
;/* resulting in version 6.2.1 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_thread_context_fast_save(VOID)
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
.equ BTA, 0x412
|
||||
|
||||
@@ -26,7 +29,7 @@
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_context_restore ARC_HS/MetaWare */
|
||||
;/* 6.1.9 */
|
||||
;/* 6.2.1 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -63,6 +66,9 @@
|
||||
;/* r25/r30 are caller saved, */
|
||||
;/* use schedule_reenter, */
|
||||
;/* resulting in version 6.1.9 */
|
||||
;/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
;/* #include tx_user.h, */
|
||||
;/* resulting in version 6.2.1 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_thread_context_restore(VOID)
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
.equ BTA, 0x412
|
||||
|
||||
@@ -26,7 +29,7 @@
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_context_save ARC_HS/MetaWare */
|
||||
;/* 6.1.9 */
|
||||
;/* 6.2.1 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -61,6 +64,9 @@
|
||||
;/* 10-15-2021 Andres Mlinar Modified comment(s), and */
|
||||
;/* r25/r30 are caller saved, */
|
||||
;/* resulting in version 6.1.9 */
|
||||
;/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
;/* #include tx_user.h, */
|
||||
;/* resulting in version 6.2.1 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_thread_context_save(VOID)
|
||||
|
||||
@@ -18,13 +18,16 @@
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_interrupt_control ARC_HS/MetaWare */
|
||||
;/* 6.1.6 */
|
||||
;/* 6.2.1 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -57,6 +60,9 @@
|
||||
;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
;/* 04-02-2021 Andres Mlinar Modified comments, */
|
||||
;/* resulting in version 6.1.6 */
|
||||
;/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
;/* #include tx_user.h, */
|
||||
;/* resulting in version 6.2.1 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;UINT _tx_thread_interrupt_control(UINT new_posture)
|
||||
|
||||
@@ -19,23 +19,16 @@
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
;
|
||||
;
|
||||
;#define TX_SOURCE_CODE
|
||||
;
|
||||
;
|
||||
;/* Include necessary system files. */
|
||||
;
|
||||
;#include "tx_api.h"
|
||||
;#include "tx_thread.h"
|
||||
;
|
||||
;
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_register_bank_assign ARC_HS/MetaWare */
|
||||
;/* 6.1 */
|
||||
;/* 6.2.1 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -69,6 +62,9 @@
|
||||
;/* DATE NAME DESCRIPTION */
|
||||
;/* */
|
||||
;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
;/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
;/* #include tx_user.h, */
|
||||
;/* resulting in version 6.2.1 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_thread_register_bank_assign(VOID *thread_ptr, UINT register_bank)
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
.equ BTA, 0x412
|
||||
|
||||
@@ -26,7 +29,7 @@
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_schedule ARC_HS/MetaWare */
|
||||
;/* 6.1.9 */
|
||||
;/* 6.2.1 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -63,6 +66,9 @@
|
||||
;/* 10-15-2021 Andres Mlinar Modified comment(s), */
|
||||
;/* use schedule reenter, */
|
||||
;/* resulting in version 6.1.9 */
|
||||
;/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
;/* #include tx_user.h, */
|
||||
;/* resulting in version 6.2.1 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_thread_schedule(VOID)
|
||||
|
||||
@@ -18,6 +18,9 @@
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
.equ LONG_ALIGN_MASK, 0xFFFFFFFC
|
||||
.equ INT_ENABLE_BITS, 0x8000001E
|
||||
@@ -27,7 +30,7 @@
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_stack_build ARC_HS/MetaWare */
|
||||
;/* 6.1.6 */
|
||||
;/* 6.2.1 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -62,6 +65,9 @@
|
||||
;/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
;/* 04-02-2021 Andres Mlinar Modified comments, */
|
||||
;/* resulting in version 6.1.6 */
|
||||
;/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
;/* #include tx_user.h, */
|
||||
;/* resulting in version 6.2.1 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_thread_stack_build(TX_THREAD *thread_ptr, VOID (*function_ptr)(VOID))
|
||||
|
||||
@@ -18,13 +18,16 @@
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_thread_system_return ARC_HS/MetaWare */
|
||||
;/* 6.1.9 */
|
||||
;/* 6.2.1 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -60,6 +63,9 @@
|
||||
;/* 10-15-2021 Andres Mlinar Modified comments, */
|
||||
;/* use schedule reenter, */
|
||||
;/* resulting in version 6.1.9 */
|
||||
;/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
;/* #include tx_user.h, */
|
||||
;/* resulting in version 6.2.1 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_thread_system_return(VOID)
|
||||
|
||||
@@ -18,13 +18,16 @@
|
||||
;/** */
|
||||
;/**************************************************************************/
|
||||
;/**************************************************************************/
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
;/**************************************************************************/
|
||||
;/* */
|
||||
;/* FUNCTION RELEASE */
|
||||
;/* */
|
||||
;/* _tx_timer_interrupt ARC_HS/MetaWare */
|
||||
;/* 6.1.9 */
|
||||
;/* 6.2.1 */
|
||||
;/* AUTHOR */
|
||||
;/* */
|
||||
;/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -69,6 +72,9 @@
|
||||
;/* fixed possible race */
|
||||
;/* condition on preemption */
|
||||
;/* resulting in version 6.1.9 */
|
||||
;/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
;/* #include tx_user.h, */
|
||||
;/* resulting in version 6.2.1 */
|
||||
;/* */
|
||||
;/**************************************************************************/
|
||||
;VOID _tx_timer_interrupt(VOID)
|
||||
|
||||
@@ -320,7 +320,7 @@ unsigned int _tx_thread_interrupt_restore(UINT old_posture);
|
||||
|
||||
#ifdef TX_THREAD_INIT
|
||||
CHAR _tx_version_id[] =
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARM11/AC5 Version 6.1.9 *";
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARM11/AC5 Version 6.3.0 *";
|
||||
#else
|
||||
extern CHAR _tx_version_id[];
|
||||
#endif
|
||||
|
||||
@@ -139,7 +139,7 @@ _tx_thread_context_restore
|
||||
__tx_thread_not_nested_restore
|
||||
;
|
||||
; /* Determine if a thread was interrupted and no preemption is required. */
|
||||
; else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr)
|
||||
; else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr))
|
||||
; || (_tx_thread_preempt_disable))
|
||||
; {
|
||||
;
|
||||
|
||||
@@ -141,7 +141,7 @@ _tx_thread_fiq_context_restore
|
||||
__tx_thread_fiq_not_nested_restore
|
||||
;
|
||||
; /* Determine if a thread was interrupted and no preemption is required. */
|
||||
; else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr)
|
||||
; else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr))
|
||||
; || (_tx_thread_preempt_disable))
|
||||
; {
|
||||
;
|
||||
|
||||
@@ -309,7 +309,7 @@ unsigned int _tx_thread_interrupt_restore(UINT old_posture);
|
||||
|
||||
#ifdef TX_THREAD_INIT
|
||||
CHAR _tx_version_id[] =
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARM11/GNU Version 6.1.9 *";
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARM11/GNU Version 6.3.0 *";
|
||||
#else
|
||||
extern CHAR _tx_version_id[];
|
||||
#endif
|
||||
|
||||
@@ -19,17 +19,10 @@
|
||||
@/** */
|
||||
@/**************************************************************************/
|
||||
@/**************************************************************************/
|
||||
@
|
||||
@
|
||||
@#define TX_SOURCE_CODE
|
||||
@
|
||||
@
|
||||
@/* Include necessary system files. */
|
||||
@
|
||||
@#include "tx_api.h"
|
||||
@#include "tx_thread.h"
|
||||
@#include "tx_timer.h"
|
||||
@
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
.arm
|
||||
|
||||
#ifdef TX_ENABLE_FIQ_SUPPORT
|
||||
@@ -60,7 +53,7 @@ IRQ_MODE = 0x92 @ Disable IRQ, IRQ mode
|
||||
@/* FUNCTION RELEASE */
|
||||
@/* */
|
||||
@/* _tx_thread_context_restore ARM11/GNU */
|
||||
@/* 6.1 */
|
||||
@/* 6.2.1 */
|
||||
@/* AUTHOR */
|
||||
@/* */
|
||||
@/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -93,6 +86,9 @@ IRQ_MODE = 0x92 @ Disable IRQ, IRQ mode
|
||||
@/* DATE NAME DESCRIPTION */
|
||||
@/* */
|
||||
@/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
@/* #include tx_user.h, */
|
||||
@/* resulting in version 6.2.1 */
|
||||
@/* */
|
||||
@/**************************************************************************/
|
||||
@VOID _tx_thread_context_restore(VOID)
|
||||
@@ -138,7 +134,7 @@ _tx_thread_context_restore:
|
||||
__tx_thread_not_nested_restore:
|
||||
@
|
||||
@ /* Determine if a thread was interrupted and no preemption is required. */
|
||||
@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr)
|
||||
@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr))
|
||||
@ || (_tx_thread_preempt_disable))
|
||||
@ {
|
||||
@
|
||||
|
||||
@@ -19,17 +19,10 @@
|
||||
@/** */
|
||||
@/**************************************************************************/
|
||||
@/**************************************************************************/
|
||||
@
|
||||
@
|
||||
@#define TX_SOURCE_CODE
|
||||
@
|
||||
@
|
||||
@/* Include necessary system files. */
|
||||
@
|
||||
@#include "tx_api.h"
|
||||
@#include "tx_thread.h"
|
||||
@#include "tx_timer.h"
|
||||
@
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
#ifdef TX_ENABLE_FIQ_SUPPORT
|
||||
DISABLE_INTS = 0xC0 @ IRQ & FIQ interrupts disabled
|
||||
#else
|
||||
@@ -53,7 +46,7 @@ DISABLE_INTS = 0x80 @ IRQ interrupts disabled
|
||||
@/* FUNCTION RELEASE */
|
||||
@/* */
|
||||
@/* _tx_thread_context_save ARM11/GNU */
|
||||
@/* 6.1 */
|
||||
@/* 6.2.1 */
|
||||
@/* AUTHOR */
|
||||
@/* */
|
||||
@/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -85,6 +78,9 @@ DISABLE_INTS = 0x80 @ IRQ interrupts disabled
|
||||
@/* DATE NAME DESCRIPTION */
|
||||
@/* */
|
||||
@/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
@/* #include tx_user.h, */
|
||||
@/* resulting in version 6.2.1 */
|
||||
@/* */
|
||||
@/**************************************************************************/
|
||||
@VOID _tx_thread_context_save(VOID)
|
||||
|
||||
@@ -19,18 +19,10 @@
|
||||
@/** */
|
||||
@/**************************************************************************/
|
||||
@/**************************************************************************/
|
||||
@
|
||||
@
|
||||
@#define TX_SOURCE_CODE
|
||||
@
|
||||
@
|
||||
@/* Include necessary system files. */
|
||||
@
|
||||
@#include "tx_api.h"
|
||||
@#include "tx_thread.h"
|
||||
@#include "tx_timer.h"
|
||||
@
|
||||
@
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
SVC_MODE = 0xD3 @ SVC mode
|
||||
FIQ_MODE = 0xD1 @ FIQ mode
|
||||
DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts
|
||||
@@ -61,7 +53,7 @@ SVC_MODE_BITS = 0x13 @ SVC mode value
|
||||
@/* FUNCTION RELEASE */
|
||||
@/* */
|
||||
@/* _tx_thread_fiq_context_restore ARM11/GNU */
|
||||
@/* 6.1 */
|
||||
@/* 6.2.1 */
|
||||
@/* AUTHOR */
|
||||
@/* */
|
||||
@/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -94,6 +86,9 @@ SVC_MODE_BITS = 0x13 @ SVC mode value
|
||||
@/* DATE NAME DESCRIPTION */
|
||||
@/* */
|
||||
@/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
@/* #include tx_user.h, */
|
||||
@/* resulting in version 6.2.1 */
|
||||
@/* */
|
||||
@/**************************************************************************/
|
||||
@VOID _tx_thread_fiq_context_restore(VOID)
|
||||
@@ -140,7 +135,7 @@ _tx_thread_fiq_context_restore:
|
||||
__tx_thread_fiq_not_nested_restore:
|
||||
@
|
||||
@ /* Determine if a thread was interrupted and no preemption is required. */
|
||||
@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr)
|
||||
@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr))
|
||||
@ || (_tx_thread_preempt_disable))
|
||||
@ {
|
||||
@
|
||||
|
||||
@@ -19,17 +19,10 @@
|
||||
@/** */
|
||||
@/**************************************************************************/
|
||||
@/**************************************************************************/
|
||||
@
|
||||
@
|
||||
@#define TX_SOURCE_CODE
|
||||
@
|
||||
@
|
||||
@/* Include necessary system files. */
|
||||
@
|
||||
@#include "tx_api.h"
|
||||
@#include "tx_thread.h"
|
||||
@
|
||||
@
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
.global _tx_thread_system_state
|
||||
.global _tx_thread_current_ptr
|
||||
.global __tx_fiq_processing_return
|
||||
@@ -47,7 +40,7 @@
|
||||
@/* FUNCTION RELEASE */
|
||||
@/* */
|
||||
@/* _tx_thread_fiq_context_save ARM11/GNU */
|
||||
@/* 6.1 */
|
||||
@/* 6.2.1 */
|
||||
@/* AUTHOR */
|
||||
@/* */
|
||||
@/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -79,6 +72,9 @@
|
||||
@/* DATE NAME DESCRIPTION */
|
||||
@/* */
|
||||
@/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
@/* #include tx_user.h, */
|
||||
@/* resulting in version 6.2.1 */
|
||||
@/* */
|
||||
@/**************************************************************************/
|
||||
@ VOID _tx_thread_fiq_context_save(VOID)
|
||||
|
||||
@@ -19,17 +19,10 @@
|
||||
@/** */
|
||||
@/**************************************************************************/
|
||||
@/**************************************************************************/
|
||||
@
|
||||
@
|
||||
@#define TX_SOURCE_CODE
|
||||
@
|
||||
@
|
||||
@/* Include necessary system files. */
|
||||
@
|
||||
@#include "tx_api.h"
|
||||
@#include "tx_thread.h"
|
||||
@
|
||||
@
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
#ifdef TX_ENABLE_FIQ_SUPPORT
|
||||
DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts
|
||||
#else
|
||||
@@ -50,7 +43,7 @@ FIQ_MODE_BITS = 0x11 @ FIQ mode bits
|
||||
@/* FUNCTION RELEASE */
|
||||
@/* */
|
||||
@/* _tx_thread_fiq_nesting_end ARM11/GNU */
|
||||
@/* 6.1 */
|
||||
@/* 6.2.1 */
|
||||
@/* AUTHOR */
|
||||
@/* */
|
||||
@/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -90,6 +83,9 @@ FIQ_MODE_BITS = 0x11 @ FIQ mode bits
|
||||
@/* DATE NAME DESCRIPTION */
|
||||
@/* */
|
||||
@/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
@/* #include tx_user.h, */
|
||||
@/* resulting in version 6.2.1 */
|
||||
@/* */
|
||||
@/**************************************************************************/
|
||||
@VOID _tx_thread_fiq_nesting_end(VOID)
|
||||
|
||||
@@ -19,17 +19,10 @@
|
||||
@/** */
|
||||
@/**************************************************************************/
|
||||
@/**************************************************************************/
|
||||
@
|
||||
@
|
||||
@#define TX_SOURCE_CODE
|
||||
@
|
||||
@
|
||||
@/* Include necessary system files. */
|
||||
@
|
||||
@#include "tx_api.h"
|
||||
@#include "tx_thread.h"
|
||||
@
|
||||
@
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
FIQ_DISABLE = 0x40 @ FIQ disable bit
|
||||
MODE_MASK = 0x1F @ Mode mask
|
||||
SYS_MODE_BITS = 0x1F @ System mode bits
|
||||
@@ -46,7 +39,7 @@ SYS_MODE_BITS = 0x1F @ System mode bits
|
||||
@/* FUNCTION RELEASE */
|
||||
@/* */
|
||||
@/* _tx_thread_fiq_nesting_start ARM11/GNU */
|
||||
@/* 6.1 */
|
||||
@/* 6.2.1 */
|
||||
@/* AUTHOR */
|
||||
@/* */
|
||||
@/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -83,6 +76,9 @@ SYS_MODE_BITS = 0x1F @ System mode bits
|
||||
@/* DATE NAME DESCRIPTION */
|
||||
@/* */
|
||||
@/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
@/* #include tx_user.h, */
|
||||
@/* resulting in version 6.2.1 */
|
||||
@/* */
|
||||
@/**************************************************************************/
|
||||
@VOID _tx_thread_fiq_nesting_start(VOID)
|
||||
|
||||
@@ -19,15 +19,10 @@
|
||||
@/** */
|
||||
@/**************************************************************************/
|
||||
@/**************************************************************************/
|
||||
@
|
||||
@#define TX_SOURCE_CODE
|
||||
@
|
||||
@
|
||||
@/* Include necessary system files. */
|
||||
@
|
||||
@#include "tx_api.h"
|
||||
@#include "tx_thread.h" */
|
||||
@
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
|
||||
INT_MASK = 0x03F
|
||||
|
||||
@@ -56,7 +51,7 @@ $_tx_thread_interrupt_control:
|
||||
@/* FUNCTION RELEASE */
|
||||
@/* */
|
||||
@/* _tx_thread_interrupt_control ARM11/GNU */
|
||||
@/* 6.1 */
|
||||
@/* 6.2.1 */
|
||||
@/* AUTHOR */
|
||||
@/* */
|
||||
@/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -87,6 +82,9 @@ $_tx_thread_interrupt_control:
|
||||
@/* DATE NAME DESCRIPTION */
|
||||
@/* */
|
||||
@/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
@/* #include tx_user.h, */
|
||||
@/* resulting in version 6.2.1 */
|
||||
@/* */
|
||||
@/**************************************************************************/
|
||||
@UINT _tx_thread_interrupt_control(UINT new_posture)
|
||||
|
||||
@@ -19,16 +19,10 @@
|
||||
@/** */
|
||||
@/**************************************************************************/
|
||||
@/**************************************************************************/
|
||||
@
|
||||
@#define TX_SOURCE_CODE
|
||||
@
|
||||
@
|
||||
@/* Include necessary system files. */
|
||||
@
|
||||
@#include "tx_api.h"
|
||||
@#include "tx_thread.h"
|
||||
@
|
||||
@
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
#ifdef TX_ENABLE_FIQ_SUPPORT
|
||||
DISABLE_INTS = 0xC0 @ IRQ & FIQ interrupts disabled
|
||||
#else
|
||||
@@ -60,7 +54,7 @@ $_tx_thread_interrupt_disable:
|
||||
@/* FUNCTION RELEASE */
|
||||
@/* */
|
||||
@/* _tx_thread_interrupt_disable ARM11/GNU */
|
||||
@/* 6.1 */
|
||||
@/* 6.2.1 */
|
||||
@/* AUTHOR */
|
||||
@/* */
|
||||
@/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -90,6 +84,9 @@ $_tx_thread_interrupt_disable:
|
||||
@/* DATE NAME DESCRIPTION */
|
||||
@/* */
|
||||
@/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
@/* #include tx_user.h, */
|
||||
@/* resulting in version 6.2.1 */
|
||||
@/* */
|
||||
@/**************************************************************************/
|
||||
@UINT _tx_thread_interrupt_disable(void)
|
||||
|
||||
@@ -19,16 +19,10 @@
|
||||
@/** */
|
||||
@/**************************************************************************/
|
||||
@/**************************************************************************/
|
||||
@
|
||||
@#define TX_SOURCE_CODE
|
||||
@
|
||||
@
|
||||
@/* Include necessary system files. */
|
||||
@
|
||||
@#include "tx_api.h"
|
||||
@#include "tx_thread.h"
|
||||
@
|
||||
@
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
@/* Define the 16-bit Thumb mode veneer for _tx_thread_interrupt_restore for
|
||||
@ applications calling this function from to 16-bit Thumb mode. */
|
||||
@
|
||||
@@ -53,7 +47,7 @@ $_tx_thread_interrupt_restore:
|
||||
@/* FUNCTION RELEASE */
|
||||
@/* */
|
||||
@/* _tx_thread_interrupt_restore ARM11/GNU */
|
||||
@/* 6.1 */
|
||||
@/* 6.2.1 */
|
||||
@/* AUTHOR */
|
||||
@/* */
|
||||
@/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -84,6 +78,9 @@ $_tx_thread_interrupt_restore:
|
||||
@/* DATE NAME DESCRIPTION */
|
||||
@/* */
|
||||
@/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
@/* #include tx_user.h, */
|
||||
@/* resulting in version 6.2.1 */
|
||||
@/* */
|
||||
@/**************************************************************************/
|
||||
@UINT _tx_thread_interrupt_restore(UINT old_posture)
|
||||
|
||||
@@ -19,17 +19,10 @@
|
||||
@/** */
|
||||
@/**************************************************************************/
|
||||
@/**************************************************************************/
|
||||
@
|
||||
@
|
||||
@#define TX_SOURCE_CODE
|
||||
@
|
||||
@
|
||||
@/* Include necessary system files. */
|
||||
@
|
||||
@#include "tx_api.h"
|
||||
@#include "tx_thread.h"
|
||||
@
|
||||
@
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
#ifdef TX_ENABLE_FIQ_SUPPORT
|
||||
DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts
|
||||
#else
|
||||
@@ -50,7 +43,7 @@ IRQ_MODE_BITS = 0x12 @ IRQ mode bits
|
||||
@/* FUNCTION RELEASE */
|
||||
@/* */
|
||||
@/* _tx_thread_irq_nesting_end ARM11/GNU */
|
||||
@/* 6.1 */
|
||||
@/* 6.2.1 */
|
||||
@/* AUTHOR */
|
||||
@/* */
|
||||
@/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -90,6 +83,9 @@ IRQ_MODE_BITS = 0x12 @ IRQ mode bits
|
||||
@/* DATE NAME DESCRIPTION */
|
||||
@/* */
|
||||
@/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
@/* #include tx_user.h, */
|
||||
@/* resulting in version 6.2.1 */
|
||||
@/* */
|
||||
@/**************************************************************************/
|
||||
@VOID _tx_thread_irq_nesting_end(VOID)
|
||||
|
||||
@@ -19,17 +19,10 @@
|
||||
@/** */
|
||||
@/**************************************************************************/
|
||||
@/**************************************************************************/
|
||||
@
|
||||
@
|
||||
@#define TX_SOURCE_CODE
|
||||
@
|
||||
@
|
||||
@/* Include necessary system files. */
|
||||
@
|
||||
@#include "tx_api.h"
|
||||
@#include "tx_thread.h"
|
||||
@
|
||||
@
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
IRQ_DISABLE = 0x80 @ IRQ disable bit
|
||||
MODE_MASK = 0x1F @ Mode mask
|
||||
SYS_MODE_BITS = 0x1F @ System mode bits
|
||||
@@ -46,7 +39,7 @@ SYS_MODE_BITS = 0x1F @ System mode bits
|
||||
@/* FUNCTION RELEASE */
|
||||
@/* */
|
||||
@/* _tx_thread_irq_nesting_start ARM11/GNU */
|
||||
@/* 6.1 */
|
||||
@/* 6.2.1 */
|
||||
@/* AUTHOR */
|
||||
@/* */
|
||||
@/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -83,6 +76,9 @@ SYS_MODE_BITS = 0x1F @ System mode bits
|
||||
@/* DATE NAME DESCRIPTION */
|
||||
@/* */
|
||||
@/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
@/* #include tx_user.h, */
|
||||
@/* resulting in version 6.2.1 */
|
||||
@/* */
|
||||
@/**************************************************************************/
|
||||
@VOID _tx_thread_irq_nesting_start(VOID)
|
||||
|
||||
@@ -19,17 +19,10 @@
|
||||
@/** */
|
||||
@/**************************************************************************/
|
||||
@/**************************************************************************/
|
||||
@
|
||||
@
|
||||
@#define TX_SOURCE_CODE
|
||||
@
|
||||
@
|
||||
@/* Include necessary system files. */
|
||||
@
|
||||
@#include "tx_api.h"
|
||||
@#include "tx_thread.h"
|
||||
@#include "tx_timer.h"
|
||||
@
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
#ifdef TX_ENABLE_FIQ_SUPPORT
|
||||
ENABLE_INTS = 0xC0 @ IRQ & FIQ Interrupts enabled mask
|
||||
#else
|
||||
@@ -68,7 +61,7 @@ $_tx_thread_schedule:
|
||||
@/* FUNCTION RELEASE */
|
||||
@/* */
|
||||
@/* _tx_thread_schedule ARM11/GNU */
|
||||
@/* 6.1 */
|
||||
@/* 6.2.1 */
|
||||
@/* AUTHOR */
|
||||
@/* */
|
||||
@/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -102,6 +95,9 @@ $_tx_thread_schedule:
|
||||
@/* DATE NAME DESCRIPTION */
|
||||
@/* */
|
||||
@/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
@/* #include tx_user.h, */
|
||||
@/* resulting in version 6.2.1 */
|
||||
@/* */
|
||||
@/**************************************************************************/
|
||||
@VOID _tx_thread_schedule(VOID)
|
||||
|
||||
@@ -19,16 +19,10 @@
|
||||
@/** */
|
||||
@/**************************************************************************/
|
||||
@/**************************************************************************/
|
||||
@
|
||||
@
|
||||
@#define TX_SOURCE_CODE
|
||||
@
|
||||
@
|
||||
@/* Include necessary system files. */
|
||||
@
|
||||
@#include "tx_api.h"
|
||||
@#include "tx_thread.h"
|
||||
@
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
.arm
|
||||
|
||||
SVC_MODE = 0x13 @ SVC mode
|
||||
@@ -64,7 +58,7 @@ $_tx_thread_stack_build:
|
||||
@/* FUNCTION RELEASE */
|
||||
@/* */
|
||||
@/* _tx_thread_stack_build ARM11/GNU */
|
||||
@/* 6.1 */
|
||||
@/* 6.2.1 */
|
||||
@/* AUTHOR */
|
||||
@/* */
|
||||
@/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -97,6 +91,9 @@ $_tx_thread_stack_build:
|
||||
@/* DATE NAME DESCRIPTION */
|
||||
@/* */
|
||||
@/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
@/* #include tx_user.h, */
|
||||
@/* resulting in version 6.2.1 */
|
||||
@/* */
|
||||
@/**************************************************************************/
|
||||
@VOID _tx_thread_stack_build(TX_THREAD *thread_ptr, VOID (*function_ptr)(VOID))
|
||||
|
||||
@@ -19,16 +19,10 @@
|
||||
@/** */
|
||||
@/**************************************************************************/
|
||||
@/**************************************************************************/
|
||||
@
|
||||
@#define TX_SOURCE_CODE
|
||||
@
|
||||
@
|
||||
@/* Include necessary system files. */
|
||||
@
|
||||
@#include "tx_api.h"
|
||||
@#include "tx_thread.h"
|
||||
@#include "tx_timer.h"
|
||||
@
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
.arm
|
||||
|
||||
#ifdef TX_ENABLE_FIQ_SUPPORT
|
||||
@@ -70,7 +64,7 @@ $_tx_thread_system_return:
|
||||
@/* FUNCTION RELEASE */
|
||||
@/* */
|
||||
@/* _tx_thread_system_return ARM11/GNU */
|
||||
@/* 6.1 */
|
||||
@/* 6.2.1 */
|
||||
@/* AUTHOR */
|
||||
@/* */
|
||||
@/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -103,6 +97,9 @@ $_tx_thread_system_return:
|
||||
@/* DATE NAME DESCRIPTION */
|
||||
@/* */
|
||||
@/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
@/* #include tx_user.h, */
|
||||
@/* resulting in version 6.2.1 */
|
||||
@/* */
|
||||
@/**************************************************************************/
|
||||
@VOID _tx_thread_system_return(VOID)
|
||||
|
||||
@@ -19,17 +19,10 @@
|
||||
@/** */
|
||||
@/**************************************************************************/
|
||||
@/**************************************************************************/
|
||||
@
|
||||
@
|
||||
@#define TX_SOURCE_CODE
|
||||
@
|
||||
@
|
||||
@/* Include necessary system files. */
|
||||
@
|
||||
@#include "tx_api.h"
|
||||
@#include "tx_thread.h"
|
||||
@
|
||||
@
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
#ifdef TX_ENABLE_FIQ_SUPPORT
|
||||
DISABLE_INTS = 0xC0 @ IRQ & FIQ interrupts disabled
|
||||
#else
|
||||
@@ -54,7 +47,7 @@ DISABLE_INTS = 0x80 @ IRQ interrupts disabled
|
||||
@/* FUNCTION RELEASE */
|
||||
@/* */
|
||||
@/* _tx_thread_vectored_context_save ARM11/GNU */
|
||||
@/* 6.1 */
|
||||
@/* 6.2.1 */
|
||||
@/* AUTHOR */
|
||||
@/* */
|
||||
@/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -86,6 +79,9 @@ DISABLE_INTS = 0x80 @ IRQ interrupts disabled
|
||||
@/* DATE NAME DESCRIPTION */
|
||||
@/* */
|
||||
@/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
@/* #include tx_user.h, */
|
||||
@/* resulting in version 6.2.1 */
|
||||
@/* */
|
||||
@/**************************************************************************/
|
||||
@VOID _tx_thread_vectored_context_save(VOID)
|
||||
|
||||
@@ -19,17 +19,10 @@
|
||||
@/** */
|
||||
@/**************************************************************************/
|
||||
@/**************************************************************************/
|
||||
@
|
||||
@#define TX_SOURCE_CODE
|
||||
@
|
||||
@
|
||||
@/* Include necessary system files. */
|
||||
@
|
||||
@#include "tx_api.h"
|
||||
@#include "tx_timer.h"
|
||||
@#include "tx_thread.h"
|
||||
@
|
||||
@
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
.arm
|
||||
|
||||
@
|
||||
@@ -71,7 +64,7 @@ $_tx_timer_interrupt:
|
||||
@/* FUNCTION RELEASE */
|
||||
@/* */
|
||||
@/* _tx_timer_interrupt ARM11/GNU */
|
||||
@/* 6.1 */
|
||||
@/* 6.2.1 */
|
||||
@/* AUTHOR */
|
||||
@/* */
|
||||
@/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -106,6 +99,9 @@ $_tx_timer_interrupt:
|
||||
@/* DATE NAME DESCRIPTION */
|
||||
@/* */
|
||||
@/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
@/* #include tx_user.h, */
|
||||
@/* resulting in version 6.2.1 */
|
||||
@/* */
|
||||
@/**************************************************************************/
|
||||
@VOID _tx_timer_interrupt(VOID)
|
||||
|
||||
@@ -375,7 +375,7 @@ void _tx_thread_interrupt_restore(UINT old_posture);
|
||||
|
||||
#ifdef TX_THREAD_INIT
|
||||
CHAR _tx_version_id[] =
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARM11/IAR Version 6.1.9 *";
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARM11/IAR Version 6.3.0 *";
|
||||
#else
|
||||
#ifdef TX_MISRA_ENABLE
|
||||
extern CHAR _tx_version_id[100];
|
||||
|
||||
@@ -138,7 +138,7 @@ _tx_thread_context_restore
|
||||
__tx_thread_not_nested_restore
|
||||
;
|
||||
; /* Determine if a thread was interrupted and no preemption is required. */
|
||||
; else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr)
|
||||
; else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr))
|
||||
; || (_tx_thread_preempt_disable))
|
||||
; {
|
||||
;
|
||||
|
||||
@@ -139,7 +139,7 @@ _tx_thread_fiq_context_restore
|
||||
__tx_thread_fiq_not_nested_restore
|
||||
;
|
||||
; /* Determine if a thread was interrupted and no preemption is required. */
|
||||
; else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr)
|
||||
; else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr))
|
||||
; || (_tx_thread_preempt_disable))
|
||||
; {
|
||||
;
|
||||
|
||||
@@ -322,7 +322,7 @@ unsigned int _tx_thread_interrupt_restore(UINT old_posture);
|
||||
|
||||
#ifdef TX_THREAD_INIT
|
||||
CHAR _tx_version_id[] =
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARM9/AC5 Version 6.1.9 *";
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARM9/AC5 Version 6.3.0 *";
|
||||
#else
|
||||
extern CHAR _tx_version_id[];
|
||||
#endif
|
||||
|
||||
@@ -139,7 +139,7 @@ _tx_thread_context_restore
|
||||
__tx_thread_not_nested_restore
|
||||
;
|
||||
; /* Determine if a thread was interrupted and no preemption is required. */
|
||||
; else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr)
|
||||
; else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr))
|
||||
; || (_tx_thread_preempt_disable))
|
||||
; {
|
||||
;
|
||||
|
||||
@@ -141,7 +141,7 @@ _tx_thread_fiq_context_restore
|
||||
__tx_thread_fiq_not_nested_restore
|
||||
;
|
||||
; /* Determine if a thread was interrupted and no preemption is required. */
|
||||
; else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr)
|
||||
; else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr))
|
||||
; || (_tx_thread_preempt_disable))
|
||||
; {
|
||||
;
|
||||
|
||||
@@ -309,7 +309,7 @@ unsigned int _tx_thread_interrupt_restore(UINT old_posture);
|
||||
|
||||
#ifdef TX_THREAD_INIT
|
||||
CHAR _tx_version_id[] =
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARM9/GNU Version 6.1.9 *";
|
||||
"Copyright (c) Microsoft Corporation. All rights reserved. * ThreadX ARM9/GNU Version 6.3.0 *";
|
||||
#else
|
||||
extern CHAR _tx_version_id[];
|
||||
#endif
|
||||
|
||||
@@ -19,17 +19,10 @@
|
||||
@/** */
|
||||
@/**************************************************************************/
|
||||
@/**************************************************************************/
|
||||
@
|
||||
@
|
||||
@#define TX_SOURCE_CODE
|
||||
@
|
||||
@
|
||||
@/* Include necessary system files. */
|
||||
@
|
||||
@#include "tx_api.h"
|
||||
@#include "tx_thread.h"
|
||||
@#include "tx_timer.h"
|
||||
@
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
.arm
|
||||
|
||||
#ifdef TX_ENABLE_FIQ_SUPPORT
|
||||
@@ -60,7 +53,7 @@ IRQ_MODE = 0x92 @ Disable IRQ, IRQ mode
|
||||
@/* FUNCTION RELEASE */
|
||||
@/* */
|
||||
@/* _tx_thread_context_restore ARM9/GNU */
|
||||
@/* 6.1 */
|
||||
@/* 6.2.1 */
|
||||
@/* AUTHOR */
|
||||
@/* */
|
||||
@/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -93,6 +86,9 @@ IRQ_MODE = 0x92 @ Disable IRQ, IRQ mode
|
||||
@/* DATE NAME DESCRIPTION */
|
||||
@/* */
|
||||
@/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
@/* #include tx_user.h, */
|
||||
@/* resulting in version 6.2.1 */
|
||||
@/* */
|
||||
@/**************************************************************************/
|
||||
@VOID _tx_thread_context_restore(VOID)
|
||||
@@ -138,7 +134,7 @@ _tx_thread_context_restore:
|
||||
__tx_thread_not_nested_restore:
|
||||
@
|
||||
@ /* Determine if a thread was interrupted and no preemption is required. */
|
||||
@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr)
|
||||
@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr))
|
||||
@ || (_tx_thread_preempt_disable))
|
||||
@ {
|
||||
@
|
||||
|
||||
@@ -19,17 +19,10 @@
|
||||
@/** */
|
||||
@/**************************************************************************/
|
||||
@/**************************************************************************/
|
||||
@
|
||||
@
|
||||
@#define TX_SOURCE_CODE
|
||||
@
|
||||
@
|
||||
@/* Include necessary system files. */
|
||||
@
|
||||
@#include "tx_api.h"
|
||||
@#include "tx_thread.h"
|
||||
@#include "tx_timer.h"
|
||||
@
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
#ifdef TX_ENABLE_FIQ_SUPPORT
|
||||
DISABLE_INTS = 0xC0 @ IRQ & FIQ interrupts disabled
|
||||
#else
|
||||
@@ -53,7 +46,7 @@ DISABLE_INTS = 0x80 @ IRQ interrupts disabled
|
||||
@/* FUNCTION RELEASE */
|
||||
@/* */
|
||||
@/* _tx_thread_context_save ARM9/GNU */
|
||||
@/* 6.1 */
|
||||
@/* 6.2.1 */
|
||||
@/* AUTHOR */
|
||||
@/* */
|
||||
@/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -85,6 +78,9 @@ DISABLE_INTS = 0x80 @ IRQ interrupts disabled
|
||||
@/* DATE NAME DESCRIPTION */
|
||||
@/* */
|
||||
@/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
@/* #include tx_user.h, */
|
||||
@/* resulting in version 6.2.1 */
|
||||
@/* */
|
||||
@/**************************************************************************/
|
||||
@VOID _tx_thread_context_save(VOID)
|
||||
|
||||
@@ -19,18 +19,10 @@
|
||||
@/** */
|
||||
@/**************************************************************************/
|
||||
@/**************************************************************************/
|
||||
@
|
||||
@
|
||||
@#define TX_SOURCE_CODE
|
||||
@
|
||||
@
|
||||
@/* Include necessary system files. */
|
||||
@
|
||||
@#include "tx_api.h"
|
||||
@#include "tx_thread.h"
|
||||
@#include "tx_timer.h"
|
||||
@
|
||||
@
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
SVC_MODE = 0xD3 @ SVC mode
|
||||
FIQ_MODE = 0xD1 @ FIQ mode
|
||||
DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts
|
||||
@@ -61,7 +53,7 @@ SVC_MODE_BITS = 0x13 @ SVC mode value
|
||||
@/* FUNCTION RELEASE */
|
||||
@/* */
|
||||
@/* _tx_thread_fiq_context_restore ARM9/GNU */
|
||||
@/* 6.1 */
|
||||
@/* 6.2.1 */
|
||||
@/* AUTHOR */
|
||||
@/* */
|
||||
@/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -94,6 +86,9 @@ SVC_MODE_BITS = 0x13 @ SVC mode value
|
||||
@/* DATE NAME DESCRIPTION */
|
||||
@/* */
|
||||
@/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
@/* #include tx_user.h, */
|
||||
@/* resulting in version 6.2.1 */
|
||||
@/* */
|
||||
@/**************************************************************************/
|
||||
@VOID _tx_thread_fiq_context_restore(VOID)
|
||||
@@ -140,7 +135,7 @@ _tx_thread_fiq_context_restore:
|
||||
__tx_thread_fiq_not_nested_restore:
|
||||
@
|
||||
@ /* Determine if a thread was interrupted and no preemption is required. */
|
||||
@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr)
|
||||
@ else if (((_tx_thread_current_ptr) && (_tx_thread_current_ptr == _tx_thread_execute_ptr))
|
||||
@ || (_tx_thread_preempt_disable))
|
||||
@ {
|
||||
@
|
||||
|
||||
@@ -19,17 +19,10 @@
|
||||
@/** */
|
||||
@/**************************************************************************/
|
||||
@/**************************************************************************/
|
||||
@
|
||||
@
|
||||
@#define TX_SOURCE_CODE
|
||||
@
|
||||
@
|
||||
@/* Include necessary system files. */
|
||||
@
|
||||
@#include "tx_api.h"
|
||||
@#include "tx_thread.h"
|
||||
@
|
||||
@
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
.global _tx_thread_system_state
|
||||
.global _tx_thread_current_ptr
|
||||
.global __tx_fiq_processing_return
|
||||
@@ -47,7 +40,7 @@
|
||||
@/* FUNCTION RELEASE */
|
||||
@/* */
|
||||
@/* _tx_thread_fiq_context_save ARM9/GNU */
|
||||
@/* 6.1 */
|
||||
@/* 6.2.1 */
|
||||
@/* AUTHOR */
|
||||
@/* */
|
||||
@/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -79,6 +72,9 @@
|
||||
@/* DATE NAME DESCRIPTION */
|
||||
@/* */
|
||||
@/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
@/* #include tx_user.h, */
|
||||
@/* resulting in version 6.2.1 */
|
||||
@/* */
|
||||
@/**************************************************************************/
|
||||
@ VOID _tx_thread_fiq_context_save(VOID)
|
||||
|
||||
@@ -19,17 +19,10 @@
|
||||
@/** */
|
||||
@/**************************************************************************/
|
||||
@/**************************************************************************/
|
||||
@
|
||||
@
|
||||
@#define TX_SOURCE_CODE
|
||||
@
|
||||
@
|
||||
@/* Include necessary system files. */
|
||||
@
|
||||
@#include "tx_api.h"
|
||||
@#include "tx_thread.h"
|
||||
@
|
||||
@
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
#ifdef TX_ENABLE_FIQ_SUPPORT
|
||||
DISABLE_INTS = 0xC0 @ Disable IRQ/FIQ interrupts
|
||||
#else
|
||||
@@ -50,7 +43,7 @@ FIQ_MODE_BITS = 0x11 @ FIQ mode bits
|
||||
@/* FUNCTION RELEASE */
|
||||
@/* */
|
||||
@/* _tx_thread_fiq_nesting_end ARM9/GNU */
|
||||
@/* 6.1 */
|
||||
@/* 6.2.1 */
|
||||
@/* AUTHOR */
|
||||
@/* */
|
||||
@/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -90,6 +83,9 @@ FIQ_MODE_BITS = 0x11 @ FIQ mode bits
|
||||
@/* DATE NAME DESCRIPTION */
|
||||
@/* */
|
||||
@/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
@/* #include tx_user.h, */
|
||||
@/* resulting in version 6.2.1 */
|
||||
@/* */
|
||||
@/**************************************************************************/
|
||||
@VOID _tx_thread_fiq_nesting_end(VOID)
|
||||
|
||||
@@ -19,17 +19,10 @@
|
||||
@/** */
|
||||
@/**************************************************************************/
|
||||
@/**************************************************************************/
|
||||
@
|
||||
@
|
||||
@#define TX_SOURCE_CODE
|
||||
@
|
||||
@
|
||||
@/* Include necessary system files. */
|
||||
@
|
||||
@#include "tx_api.h"
|
||||
@#include "tx_thread.h"
|
||||
@
|
||||
@
|
||||
#ifdef TX_INCLUDE_USER_DEFINE_FILE
|
||||
#include "tx_user.h"
|
||||
#endif
|
||||
|
||||
FIQ_DISABLE = 0x40 @ FIQ disable bit
|
||||
MODE_MASK = 0x1F @ Mode mask
|
||||
SYS_MODE_BITS = 0x1F @ System mode bits
|
||||
@@ -46,7 +39,7 @@ SYS_MODE_BITS = 0x1F @ System mode bits
|
||||
@/* FUNCTION RELEASE */
|
||||
@/* */
|
||||
@/* _tx_thread_fiq_nesting_start ARM9/GNU */
|
||||
@/* 6.1 */
|
||||
@/* 6.2.1 */
|
||||
@/* AUTHOR */
|
||||
@/* */
|
||||
@/* William E. Lamie, Microsoft Corporation */
|
||||
@@ -83,6 +76,9 @@ SYS_MODE_BITS = 0x1F @ System mode bits
|
||||
@/* DATE NAME DESCRIPTION */
|
||||
@/* */
|
||||
@/* 09-30-2020 William E. Lamie Initial Version 6.1 */
|
||||
@/* 03-08-2023 Cindy Deng Modified comment(s), added */
|
||||
@/* #include tx_user.h, */
|
||||
@/* resulting in version 6.2.1 */
|
||||
@/* */
|
||||
@/**************************************************************************/
|
||||
@VOID _tx_thread_fiq_nesting_start(VOID)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user