Ignore:
Timestamp:
Jul 20, 2017, 9:55:05 AM (7 years ago)
Author:
max@…
Message:

Make the secondary CPUs jump into kernel_init().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/core/hal_irqmask.c

    r234 r240  
    2222#include <hal_types.h>
    2323#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>
    2925
    3026inline void hal_disable_irq(uint32_t *old)
    3127{
    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
    3433        cli();
    3534}
     
    3736inline void hal_enable_irq(uint32_t *old)
    3837{
    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
    4143        sti();
    4244}
     
    4446inline void hal_restore_irq(uint32_t old)
    4547{
    46         intrs_state = old;
     48        tls_t *tls = curcpu();
    4749
    48         if (intrs_state == INTRS_ENABLED)
     50        tls->tls_intr = old;
     51
     52        if (old == INTRS_ENABLED)
    4953                sti();
    50         else if(intrs_state == INTRS_DISABLED)
     54        else if(old == INTRS_DISABLED)
    5155                cli();
    5256        else
Note: See TracChangeset for help on using the changeset viewer.