Changeset 380 for trunk/hal/generic
- Timestamp:
- Aug 14, 2017, 6:31:25 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/generic/hal_exception.h
r17 r380 32 32 // ALMOS-MKH defines three classes of exceptions: 33 33 // 34 // - NON_FATAL : exceptions such as "page fault" or "FPU unusable" are non fatal. 35 // The calling thread resumes execution when the exception has been handled. 34 // - NON_FATAL : exceptions such as "page unmapped" or "FPU unusable" can be non fatal. 35 // => The hal_do_exception() function call the generic vmm_handle_page_fault(), 36 // or the fpu_handle_exception() function, and the calling thread resumes execution 37 // when the exception has been handled. 36 38 // 37 // - USER_ERROR : these exceptions such a "illegal vaddr" or "illegal write access"38 // are fatal. The calling thread process is killed, after an "error" message on the39 // kernel terminal.39 // - USER_ERROR : exceptions such a "illegal vaddr" or "illegal write access" are fatal. 40 // => The hal_do_exception() function send a kill signal to the calling thread process, 41 // and displays an error message on TXT0. 40 42 // 41 // - KERNEL_PANIC : events such as "no memory" or "kernel mistakes" are considered42 // abnormal events. The calling core goes to sleep, after a "panic" message43 // on the kernel terminal.43 // - KERNEL_PANIC : "kernel mistakes" are abnormal events. 44 // => The hal_do_exception() function calls the generic panic() function, to display 45 // a message on TXT0, disable IRQs and call the hal_core_sleep() function. 44 46 // 45 // For all exceptions, the faulty core context has been saved in a registers 46 // array stored in the user thread descriptor (core in user mode), and in the47 // kernel stack ( core in kernel mode).47 // For all exceptions, the faulty core context has been saved in a registers array 48 // stored in the user thread descriptor (for a core in user mode), and in the 49 // kernel stack (for a core in kernel mode). 48 50 // 49 51 // Any architecture specific implementation must implement this API. … … 55 57 56 58 /***************************************************************************************** 57 * This function implements the ALMOS-MKH exception handler. 58 * It is called by the hal_kentry function when an exception is detected 59 * by the hardware for an user thread running on a given core. 59 * This function is called by the hal_kentry() function when an exception is detected by 60 * the hardware for a given thread running on a given core. 60 61 ***************************************************************************************** 61 62 * @ this : pointer on the faulty thread descriptor. 62 * @ regs_tbl : array containing the core registers values saved by hal_kentry .63 * @ regs_tbl : array containing the core registers values saved by hal_kentry(). 63 64 ****************************************************************************************/ 64 65 void hal_do_exception( struct thread_s * this, 65 66 reg_t * regs_tbl ); 66 67 67 /*****************************************************************************************68 * This function prints on the kernel terminal the saved context (core registers)69 * and the thread state of a faulty thread.70 *****************************************************************************************71 * @ this : pointer on the faulty thread descriptor.72 * @ regs_tbl : pointer on the array containing the core registers values.73 ****************************************************************************************/74 void hal_exception_dump( struct thread_s * this,75 reg_t * regs_tbl );76 77 68 #endif // _HAL_EXCEPTION_H_
Note: See TracChangeset
for help on using the changeset viewer.