Ignore:
Timestamp:
Aug 7, 2017, 3:11:45 PM (7 years ago)
Author:
max@…
Message:

Add support for context switch - not tested yet, due to some other bugs in
the mapper. This cswitch is similar to that of TSAR.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/hal/x86_64/core/hal_kentry.h

    r335 r339  
    4545#define T_USER  0x100
    4646
    47 #define CPUVAR(off)     %gs:CPU_INFO_ ## off
     47#define TLSVAR(off)     %gs:TLS_ ## off
    4848
    4949/*
     
    128128
    129129/*
    130  * The x86_64 CPU trap frame.
     130 * The x86_64 CPU trap frame. !!WARNING!! The size of this structure must be
     131 * exactly TF_SIZE.
    131132 */
    132133typedef struct hal_trapframe_s {
     
    168169typedef struct hal_cpu_context_s {
    169170        uint64_t ctx_rsp0;
    170         uint64_t ctx_rsp;
    171         uint64_t ctx_rbp;
     171        uint64_t ctx_tf;
     172        hal_trapframe_t ctx_hidden_tf;
    172173} hal_cpu_context_t;
    173174
    174175#else
    175176
    176 /* offsets in the trapframe structure */
     177/* Offsets in the trapframe structure */
    177178#define TF_RAX  0
    178179#define TF_RBX  8
     
    195196#define TF_DS   144
    196197
     198/* Size of the trapframe structure */
     199#define TF_SIZE 208
     200
     201/* Offsets in the context structure */
     202#define CTX_RSP0  0
     203#define CTX_TF    8
     204
    197205#endif
    198206
Note: See TracChangeset for help on using the changeset viewer.