Changeset 359 for trunk


Ignore:
Timestamp:
Aug 10, 2017, 11:21:32 AM (7 years ago)
Author:
max@…
Message:

Synchronize tls_intr between context switches.

Location:
trunk/hal/x86_64/core
Files:
4 edited

Legend:

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

    r342 r359  
    6161        ctx->ctx_rsp0 = kstacktop & ~0xF;
    6262        ctx->ctx_tf = (uint64_t)&ctx->ctx_hidden_tf;
     63        ctx->ctx_intr = INTRS_ENABLED;
    6364
    6465        /*
  • trunk/hal/x86_64/core/hal_cpu.S

    r343 r359  
    196196        movq    CTX_TF(%r13),%rsp
    197197        addq    $TF_SIZE,%rsp   /* end of the structure */
     198
     199        /*
     200         * Save the TLS intr flag, and set the new one.
     201         */
     202        movq    TLSVAR(INTR),%rax
     203        movq    %rax,CTX_INTR(%r13)
     204        movq    CTX_INTR(%r12),%rax
     205        movq    %rax,TLSVAR(INTR)
    198206
    199207        /* Build the trap frame */
  • trunk/hal/x86_64/core/hal_kentry.h

    r339 r359  
    170170        uint64_t ctx_rsp0;
    171171        uint64_t ctx_tf;
     172        uint64_t ctx_intr;
    172173        hal_trapframe_t ctx_hidden_tf;
    173174} hal_cpu_context_t;
     
    202203#define CTX_RSP0  0
    203204#define CTX_TF    8
     205#define CTX_INTR  16
    204206
    205207#endif
  • trunk/hal/x86_64/core/hal_segmentation.h

    r340 r359  
    155155        uint32_t tls_lid;
    156156        uint64_t tls_rsp0; /* pointer for fast access */
     157        reg_t tls_intr;
    157158        void *tls_thr;
    158         reg_t tls_intr;
    159159} __packed;
    160160typedef struct tls tls_t;
     
    175175#define TLS_LID         12
    176176#define TLS_RSP0        16
     177#define TLS_INTR        24
    177178
    178179/* system segments and gate types */
Note: See TracChangeset for help on using the changeset viewer.