1. Oct 20, 2020
  2. Oct 18, 2020
  3. Oct 10, 2020
  4. Oct 02, 2020
  5. Sep 25, 2020
  6. Sep 16, 2020
  7. Sep 09, 2020
  8. Sep 01, 2020
  9. Aug 21, 2020
  10. Aug 20, 2020
  11. Aug 17, 2020
  12. Aug 14, 2020
    • Anup Patel's avatar
      firmware: fw_base: Improve exception stack setup in trap handler · 4b18a2ac
      Anup Patel authored
      
      
      Currently, the low-level trap handler (i.e. _trap_handler()) uses
      branch instructions to conditionally setup exception stack based
      on which mode trap occured.
      
      This patch implements exception stack setup using xor instructions
      which is faster with same number of instructions due to lack of
      branch instructions.
      
      The new exception stack setup approach can be best described by the
      following pseudocode:
      
       Came_From_M_Mode = ((MSTATUS.MPP < PRV_M) ? 1 : 0) - 1;
       Exception_Stack = TP ^ (Came_From_M_Mode & (SP ^ TP))
      
       Came_From_M_Mode = 0    ==>    Exception_Stack = TP
       Came_From_M_Mode = -1   ==>    Exception_Stack = SP
      
      Signed-off-by: default avatarAnup Patel <anup.patel@wdc.com>
      Reviewed-by: default avatarAtish Patra <atish.patra@wdc.com>
      4b18a2ac
  13. Aug 04, 2020