Ignore:
Timestamp:
Jan 23, 2018, 5:02:46 PM (7 years ago)
Author:
Alan Kennedy <afakenne@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
b6838214
Parents:
6ba16fa
Message:

add context switch for ARM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/concurrency/preemption.c

    r6ba16fa rb158d8f  
    1010// Created On       : Mon Jun 5 14:20:42 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Jul 21 22:36:05 2017
    13 // Update Count     : 2
     12// Last Modified On : Tue Jan 23 13:56:32 2018
     13// Update Count     : 6
    1414//
    1515
    1616#include "preemption.h"
    1717
     18#define ftype `ftype`
    1819extern "C" {
    1920#include <errno.h>
     
    2627#include <unistd.h>
    2728}
    28 
     29#undef ftype
    2930
    3031#ifdef __USE_STREAM__
     
    6061
    6162// Machine specific register name
    62 #ifdef __x86_64__
     63#if   defined(__x86_64__)
    6364#define CFA_REG_IP REG_RIP
    64 #else
     65#elif defined(__i386__)
    6566#define CFA_REG_IP REG_EIP
     67#elif defined(__ARM_ARCH__)
     68#define CFA_REG_IP REG_R15
    6669#endif
    6770
     
    296299// Receives SIGUSR1 signal and causes the current thread to yield
    297300void sigHandler_ctxSwitch( __CFA_SIGPARMS__ ) {
    298         __cfaabi_dbg_debug_do( last_interrupt = (void *)(cxt->uc_mcontext.gregs[CFA_REG_IP]); )
     301        __cfaabi_dbg_debug_do( last_interrupt = (void *)(cxt->uc_mcontext.arm_pc); )
    299302
    300303        // Check if it is safe to preempt here
Note: See TracChangeset for help on using the changeset viewer.