-
Notifications
You must be signed in to change notification settings - Fork 59
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
Fix #158, Implement exception storage in PSP #159
Fix #158, Implement exception storage in PSP #159
Conversation
fa75255
to
21b017b
Compare
Implment exceptions for VxWorks and PC-Linux PSP Exceptions are buffered in an extra block inside the PSP reserved area. On pc-linux, the interrupt (CTRL+C) handling is also treated as an exception, which shuts down the CFE normally. This also means processor resets on the pc-linux can be tested.
21b017b
to
fe5e019
Compare
All components of this are now rebased. Ready for merge. |
Need to resolve CI failures |
start_addr = (cpuaddr) sysMemTop(); | ||
end_addr = start_addr; | ||
|
||
memset(&CFE_PSP_ReservedMemoryMap, 0, sizeof(CFE_PSP_ReservedMemoryMap)); | ||
|
||
CFE_PSP_ReservedMemoryMap.BootPtr = (CFE_PSP_ReservedMemoryBootRecord_t *)end_addr; | ||
end_addr += sizeof(CFE_PSP_ReservedMemoryBootRecord_t); | ||
end_addr = (end_addr + CFE_PSP_MEMALIGN_MASK) & ~CFE_PSP_MEMALIGN_MASK; |
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.
Did you look into the routines Doyle suggested?
CCB 20200506 - Had special topic on April 30 2020. @acudmore will review later this week. |
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.
Nice improvement, and having the linux exception handling helps as well.
When I finally merge RTEMS 5.x changes in, I would like to implement the exception code for RTEMS and also explore concepts of saving the exception storage on boot, but that can be a separate effort.
Describe the contribution
Implements exception capture and storage within the PSP.
Provides a new API so that CFE can poll for exceptions at a later time and also record the information in the ER log.
Testing performed
Add a divide by zero "bug" to sample_app
Confirm that the PSP captures the exception context correctly and it is later logged by CFE
Confirm SIGINT, SIGQUIT, and SIGTERM are appropriately handled on POSIX
Expected behavior changes
Exception handling is now implemented on POSIX. The initial config will capture arithmetic errors (SIGFPE) as well as SIGINT and SIGTERM. The latter is notable in that there is no longer a separate handler for SIGINT - it is now treated as an exception and goes through the normal process which ends up "restarting" CFE, which on pc-linux causes the process to exit normally.
Importantly, as CTRL+C is frequently used during testing, this means that there is now a mechanism through which the exception code will get used during normal test cycles. Otherwise the code is very infrequently used and could suffer from bit-rot.
System(s) tested on
Ubuntu 20.04 LTS
VxWorks 6.9 on MCP750
i686-rtems4.11 (pc-rtems) on QEMU (no exception handling here, just tested to ensure nothing broke)
Additional context
Goes along with nasa/cFE#411, nasa/cFE#76
Contributor Info - All information REQUIRED for consideration of pull request
Joseph Hickey, Vantage Systems, Inc.