This pull request is intended to get feedback of the implementation of fault handler.
Core related changes:
Implemented 7 different fault handlers in the llbooter. When a fault happens the system will make a sinv call to the llbooter to handle the fault. Made an allocation of the sinv_cap of these fault handlers in the llbooter. The location of these sinv_caps in the captbl of each component have been hardcoded in cos_types.h.
Changed the sret_ret to make sure the system will use iret instead of sysexit when dealing with a fault. The registers will be restored before the fault is returned. I have added a 'fault_flag' in the invstk push and pop function to tell the sret_ret it is a normal sinv or a sinv of a fault handler.
Changed the exception.c file to save the fault regs and make a sinv call to the user-level fault handler. I have added a function called fault_handler_sinv which basically intended to reduce the redundancy of the code.
Now the user-level fault handler returns without and operation so the fault will repeat. I plan to kill the faulting thread to 'handle' the fault.
Intent for your PR
Choose one (Mandatory):
[x] This PR is for a code-review and is intended to get feedback, but not to be pulled yet.
[ ] This PR is mature, and ready to be integrated into the repo.
Reviewers (Mandatory):
@gparmer , @hungry-foolish , @phanikishoreg
Code Quality
As part of this pull request, I've considered the following:
[Style]
[x] Comments adhere to the Style Guide (SG)
[x] Spacing adhere's to the SG
[x] Naming adhere's to the SG
[x] All other aspects of the SG are adhered to, or exceptions are justified in this pull request
[ ] I have run the auto formatter on my code before submitting this PR (see doc/auto_formatter.md for instructions)
[Code Craftsmanship]:
[x] I've made an attempt to remove all redundant code
[x] I've considered ways in which my changes might impact existing code, and cleaned it up
[x] I've formatted the code in an effort to make it easier to read (proper error handling, function use, etc...)
[ ] I've commented appropriately where code is tricky
[ ] I agree that there is no "throw-away" code, and that code in this PR is of high quality
Testing
I've tested the code using the following test programs (provide list here):
I've used pingpong test to test my code. (If a fault happens in ping, the llbooter will be able to 'handle' it)
Summary of this Pull Request (PR)
This pull request is intended to get feedback of the implementation of fault handler.
Core related changes:
Implemented 7 different fault handlers in the llbooter. When a fault happens the system will make a sinv call to the llbooter to handle the fault. Made an allocation of the sinv_cap of these fault handlers in the llbooter. The location of these sinv_caps in the captbl of each component have been hardcoded in cos_types.h.
Changed the sret_ret to make sure the system will use iret instead of sysexit when dealing with a fault. The registers will be restored before the fault is returned. I have added a 'fault_flag' in the invstk push and pop function to tell the sret_ret it is a normal sinv or a sinv of a fault handler.
Changed the exception.c file to save the fault regs and make a sinv call to the user-level fault handler. I have added a function called fault_handler_sinv which basically intended to reduce the redundancy of the code.
Now the user-level fault handler returns without and operation so the fault will repeat. I plan to kill the faulting thread to 'handle' the fault.
Intent for your PR
Choose one (Mandatory):
Reviewers (Mandatory):
@gparmer , @hungry-foolish , @phanikishoreg
Code Quality
As part of this pull request, I've considered the following:
[Style]
[Code Craftsmanship]:
Testing
I've tested the code using the following test programs (provide list here):
I've used pingpong test to test my code. (If a fault happens in ping, the llbooter will be able to 'handle' it)