Changeset 240 for trunk/hal/x86_64/core/hal_irqmask.c
- Timestamp:
- Jul 20, 2017, 9:55:05 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/hal/x86_64/core/hal_irqmask.c
r234 r240 22 22 #include <hal_types.h> 23 23 #include <hal_internal.h> 24 25 #define INTRS_ENABLED 0xFFEFAAAA 26 #define INTRS_DISABLED 0xD0CCCCC0 27 28 static uint32_t intrs_state __in_kdata = INTRS_DISABLED; 24 #include <hal_segmentation.h> 29 25 30 26 inline void hal_disable_irq(uint32_t *old) 31 27 { 32 *old = intrs_state; 33 intrs_state = INTRS_DISABLED; 28 tls_t *tls = curcpu(); 29 30 *old = tls->tls_intr; 31 tls->tls_intr = INTRS_DISABLED; 32 34 33 cli(); 35 34 } … … 37 36 inline void hal_enable_irq(uint32_t *old) 38 37 { 39 *old = intrs_state; 40 intrs_state = INTRS_ENABLED; 38 tls_t *tls = curcpu(); 39 40 *old = tls->tls_intr; 41 tls->tls_intr = INTRS_ENABLED; 42 41 43 sti(); 42 44 } … … 44 46 inline void hal_restore_irq(uint32_t old) 45 47 { 46 intrs_state = old;48 tls_t *tls = curcpu(); 47 49 48 if (intrs_state == INTRS_ENABLED) 50 tls->tls_intr = old; 51 52 if (old == INTRS_ENABLED) 49 53 sti(); 50 else if( intrs_state== INTRS_DISABLED)54 else if(old == INTRS_DISABLED) 51 55 cli(); 52 56 else
Note: See TracChangeset
for help on using the changeset viewer.