-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated startIntTask in LinuxGpioDriver to take a stack size argument #2068
Updated startIntTask in LinuxGpioDriver to take a stack size argument #2068
Conversation
Os::TaskString name; | ||
name.format("GPINT_%s",this->getObjName()); // The task name can only be 16 chars including null | ||
Os::Task::TaskStatus stat = this->m_intTask.start(name, LinuxGpioDriverComponentImpl::intTaskEntry, this, priority, Os::Task::TASK_DEFAULT, cpuAffinity); | ||
Os::Task::TaskStatus stat = this->m_intTask.start(name, LinuxGpioDriverComponentImpl::intTaskEntry, this, priority, stackSize, cpuAffinity); |
Check warning
Code scanning / CodeQL
Unchecked function argument
Os::TaskString name; | ||
name.format("GPINT_%s",this->getObjName()); // The task name can only be 16 chars including null | ||
Os::Task::TaskStatus stat = this->m_intTask.start(name, LinuxGpioDriverComponentImpl::intTaskEntry, this, priority, Os::Task::TASK_DEFAULT, cpuAffinity); | ||
Os::Task::TaskStatus stat = this->m_intTask.start(name, LinuxGpioDriverComponentImpl::intTaskEntry, this, priority, stackSize, cpuAffinity); |
Check warning
Code scanning / CodeQL
Unchecked function argument
Os::TaskString name; | ||
name.format("GPINT_%s",this->getObjName()); // The task name can only be 16 chars including null | ||
Os::Task::TaskStatus stat = this->m_intTask.start(name, LinuxGpioDriverComponentImpl::intTaskEntry, this, priority, Os::Task::TASK_DEFAULT, cpuAffinity); | ||
Os::Task::TaskStatus stat = this->m_intTask.start(name, LinuxGpioDriverComponentImpl::intTaskEntry, this, priority, stackSize, cpuAffinity); |
Check warning
Code scanning / CodeQL
Unchecked function argument
@@ -397,10 +397,10 @@ | |||
} | |||
|
|||
Os::Task::TaskStatus LinuxGpioDriverComponentImpl :: | |||
startIntTask(NATIVE_UINT_TYPE priority, NATIVE_UINT_TYPE cpuAffinity) { | |||
startIntTask(NATIVE_UINT_TYPE priority, NATIVE_UINT_TYPE stackSize, NATIVE_UINT_TYPE cpuAffinity) { |
Check notice
Code scanning / CodeQL
Use of basic integral type
@@ -397,10 +397,10 @@ | |||
} | |||
|
|||
Os::Task::TaskStatus LinuxGpioDriverComponentImpl :: | |||
startIntTask(NATIVE_UINT_TYPE priority, NATIVE_UINT_TYPE cpuAffinity) { | |||
startIntTask(NATIVE_UINT_TYPE priority, NATIVE_UINT_TYPE stackSize, NATIVE_UINT_TYPE cpuAffinity) { |
Check notice
Code scanning / CodeQL
Use of basic integral type
@@ -397,10 +397,10 @@ | |||
} | |||
|
|||
Os::Task::TaskStatus LinuxGpioDriverComponentImpl :: | |||
startIntTask(NATIVE_UINT_TYPE priority, NATIVE_UINT_TYPE cpuAffinity) { | |||
startIntTask(NATIVE_UINT_TYPE priority, NATIVE_UINT_TYPE stackSize, NATIVE_UINT_TYPE cpuAffinity) { |
Check notice
Code scanning / CodeQL
Use of basic integral type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Looks like the GPIO stubs file wasn't updated. @kubiak-jpl want to fix that? If not I'll get to it Monday. |
…nasa#2068) * Updated startIntTask in LinuxGpioDriver to take an optional stack size argument * Updated LinuxGpioDriver Stubs for startIntTask update
…#2068) * Updated startIntTask in LinuxGpioDriver to take an optional stack size argument * Updated LinuxGpioDriver Stubs for startIntTask update
Change Description
Updates the startIntTask method call in LinuxGpioDriver to include a stack size argument for the new thread. This matches the behavior of the read thread call in LinuxUartDriver.
The stack size argument was inserted into the middle of the list of arguments to match LinuxUartDriver. However, existing code that uses both priority and CPU affinity arguments will be broken if directly updated. In practice I am unsure if this is too big of an issue as cpu affinity arguments will likely be invalid stack sizes.
Rationale
The application author is responsible for setting the stack size of the task, not the framework
Testing/Review Recommendations
Currently untested. Building LinuxGpioDriver still builds standalone and building this code in an internal project was successful