Changeset 88cafe7


Ignore:
Timestamp:
Aug 20, 2020, 11:39:01 PM (4 years ago)
Author:
Peter A. Buhr <pabuhr@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
67ca73e
Parents:
442b624
Message:

add CtxGet? routine for ARM 64-bit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel/startup.cfa

    r442b624 r88cafe7  
    3333// Some assembly required
    3434#if defined( __i386 )
    35         #define CtxGet( ctx )        \
    36                 __asm__ volatile (     \
    37                         "movl %%esp,%0\n"\
    38                         "movl %%ebp,%1\n"\
    39                         : "=rm" (ctx.SP),\
    40                                 "=rm" (ctx.FP) \
    41                 )
     35        #define CtxGet( ctx ) __asm__ volatile ( \
     36                "movl %%esp,%0\n" \
     37                "movl %%ebp,%1\n" \
     38                : "=rm" (ctx.SP), \
     39                  "=rm" (ctx.FP) \
     40        )
    4241#elif defined( __x86_64 )
    43         #define CtxGet( ctx )        \
    44                 __asm__ volatile (     \
    45                         "movq %%rsp,%0\n"\
    46                         "movq %%rbp,%1\n"\
    47                         : "=rm" (ctx.SP),\
    48                                 "=rm" (ctx.FP) \
    49                 )
    50 #elif defined( __ARM_ARCH )
    51 #define CtxGet( ctx ) __asm__ ( \
    52                 "mov %0,%%sp\n"   \
    53                 "mov %1,%%r11\n"   \
    54         : "=rm" (ctx.SP), "=rm" (ctx.FP) )
     42        #define CtxGet( ctx ) __asm__ volatile ( \
     43                "movq %%rsp,%0\n" \
     44                "movq %%rbp,%1\n" \
     45                : "=rm" (ctx.SP), \
     46                  "=rm" (ctx.FP) \
     47        )
     48#elif defined( __aarch64__ )
     49        #define CtxGet( ctx ) __asm__ volatile ( \
     50                "mov %0, sp\n" \
     51                "mov %1, fp\n" \
     52                : "=rm" (ctx.SP), \
     53                  "=rm" (ctx.FP) \
     54        )
    5555#else
    5656        #error unknown hardware architecture
Note: See TracChangeset for help on using the changeset viewer.