Changeset 380 for trunk/hal/generic


Ignore:
Timestamp:
Aug 14, 2017, 6:31:25 PM (7 years ago)
Author:
alain
Message:

Remove the generic kernel/kern/do_exception files to handle exceptions in HAL.
The HAL call only the vmm_handle_page_fault() function if required.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/generic/hal_exception.h

    r17 r380  
    3232// ALMOS-MKH defines three classes of exceptions:
    3333//
    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.
    3638//
    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 the
    39 //   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.
    4042//
    41 // - KERNEL_PANIC : events such as "no memory" or "kernel mistakes" are considered
    42 //   abnormal events. The calling core goes to sleep, after a "panic" message
    43 //   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.
    4446//
    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 the
    47 // 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).
    4850//
    4951// Any architecture specific implementation must implement this API.
     
    5557
    5658/*****************************************************************************************
    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.
    6061 *****************************************************************************************
    6162 * @ 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().
    6364 ****************************************************************************************/
    6465void hal_do_exception( struct thread_s * this,
    6566                       reg_t           * regs_tbl );
    6667
    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 
    7768#endif  // _HAL_EXCEPTION_H_
Note: See TracChangeset for help on using the changeset viewer.