[ipxe-devel] EFI TPL for efi_currticks()

Petr Borsodi petr.borsodi at gmail.com
Tue Dec 8 16:22:30 UTC 2020


Hi,

why efi_currticks function restores the TPL to an "external" TPL (especially TPL_APPLICATION) and raises it back to TPL_CALLBACK?

This would not be necessary if the timer used TPL_NOTIFY for its event.

The current solution also has the disadvantage that it can surprisingly run different code on the TPL_CALLBACK during TPL restoring.

Proposed change:

diff --git a/src/interface/efi/efi_timer.c b/src/interface/efi/efi_timer.c
--- a/src/interface/efi/efi_timer.c
+++ b/src/interface/efi/efi_timer.c
@@ -135,9 +100,6 @@ static unsigned long efi_currticks ( void ) {
      */
     if ( efi_shutdown_in_progress ) {
         efi_jiffies++;
-    } else {
-        bs->RestoreTPL ( efi_external_tpl );
-        bs->RaiseTPL ( TPL_CALLBACK );
     }
 
     return ( efi_jiffies * ( TICKS_PER_SEC / EFI_JIFFIES_PER_SEC ) );
@@ -167,7 +129,7 @@ static void efi_tick_startup ( void ) {
 
     /* Create timer tick event */
     if ( ( efirc = bs->CreateEvent ( ( EVT_TIMER | EVT_NOTIFY_SIGNAL ),
-                     TPL_CALLBACK, efi_tick, NULL,
+                     TPL_NOTIFY, efi_tick, NULL,
                      &efi_tick_event ) ) != 0 ) {
         rc = -EEFI ( efirc );
         DBGC ( colour, "EFI could not create timer tick: %s\n",



Petr Borsodi



More information about the ipxe-devel mailing list