Ignore:
Timestamp:
Feb 9, 2018, 4:33:29 PM (6 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
bede27b
Parents:
539cdfe
Message:

harmonize conditional hardware-architecture code, fix conflicit with ftype variable on ARM

Location:
src/libcfa/concurrency
Files:
4 edited

Legend:

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

    r539cdfe r381fdee  
    1010// Created On       : Tue Jan 17 12:27:26 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jan 23 14:04:56 2018
    13 // Update Count     : 2
     12// Last Modified On : Fri Feb  9 14:41:56 2018
     13// Update Count     : 3
    1414//
    1515
     
    9393        struct coStack_t* stack = &get_coroutine( this )->stack;
    9494
    95 #if defined( __i386__ )
     95#if defined( __i386 )
    9696
    9797        struct FakeStack {
     
    114114        ((struct FakeStack *)(((struct machine_context_t *)stack->context)->SP))->fcw = 0x037F;  //Vol. 1 8-7
    115115
    116 #elif defined( __x86_64__ )
     116#elif defined( __x86_64 )
    117117
    118118        struct FakeStack {
     
    150150        fs->arg[0] = this;
    151151        fs->arg[1] = invoke;
     152
    152153#else
    153         #error Only __i386__ and __x86_64__ is supported for threads in cfa
     154        #error uknown hardware architecture
    154155#endif
    155156}
  • src/libcfa/concurrency/invoke.h

    r539cdfe r381fdee  
    1010// Created On       : Tue Jan 17 12:27:26 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Jan 23 14:55:46 2018
    13 // Update Count     : 3
     12// Last Modified On : Fri Feb  9 14:41:55 2018
     13// Update Count     : 6
    1414//
    1515
     
    202202        void CtxSwitch( void * from, void * to ) asm ("CtxSwitch");
    203203
    204         #if   defined( __x86_64__ )
     204        #if   defined( __i386 )
     205        #define CtxGet( ctx ) __asm__ ( \
     206                        "movl %%esp,%0\n"   \
     207                        "movl %%ebp,%1\n"   \
     208                : "=rm" (ctx.SP), "=rm" (ctx.FP) )
     209        #elif defined( __x86_64 )
    205210        #define CtxGet( ctx ) __asm__ ( \
    206211                        "movq %%rsp,%0\n"   \
    207212                        "movq %%rbp,%1\n"   \
    208                 : "=rm" (ctx.SP), "=rm" (ctx.FP) )
    209         #elif defined( __i386__ )
    210         #define CtxGet( ctx ) __asm__ ( \
    211                         "movl %%esp,%0\n"   \
    212                         "movl %%ebp,%1\n"   \
    213213                : "=rm" (ctx.SP), "=rm" (ctx.FP) )
    214214        #elif defined( __ARM_ARCH )
     
    217217                        "mov %1,%%r11\n"   \
    218218                : "=rm" (ctx.SP), "=rm" (ctx.FP) )
     219        #else
     220                #error unknown hardware architecture
    219221        #endif
    220222
  • src/libcfa/concurrency/kernel.c

    r539cdfe r381fdee  
    1010// Created On       : Tue Jan 17 12:27:26 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Feb  6 21:51:26 2018
    13 // Update Count     : 4
     12// Last Modified On : Thu Feb  8 23:52:19 2018
     13// Update Count     : 5
    1414//
    1515
    1616//C Includes
    1717#include <stddef.h>
    18 #define ftype `ftype`
    1918extern "C" {
    2019#include <stdio.h>
     
    2423#include <unistd.h>
    2524}
    26 #undef ftype
    2725
    2826//CFA Includes
  • src/libcfa/concurrency/preemption.c

    r539cdfe r381fdee  
    1010// Created On       : Mon Jun 5 14:20:42 2017
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Tue Feb  6 15:00:36 2018
    13 // Update Count     : 10
     12// Last Modified On : Fri Feb  9 14:42:34 2018
     13// Update Count     : 25
    1414//
    1515
    1616#include "preemption.h"
    1717
    18 #define ftype `ftype`
    1918extern "C" {
    2019#include <errno.h>
     
    2322#include <unistd.h>
    2423}
    25 #undef ftype
    2624
    2725#include "bits/signal.h"
     
    5048
    5149// Machine specific register name
    52 #if   defined(__x86_64__)
     50#if   defined( __i386 )
     51#define CFA_REG_IP gregs[REG_EIP]
     52#elif defined( __x86_64 )
    5353#define CFA_REG_IP gregs[REG_RIP]
    54 #elif defined(__i386__)
    55 #define CFA_REG_IP gregs[REG_EIP]
    56 #elif defined(__ARM_ARCH__)
     54#elif defined( __ARM_ARCH )
    5755#define CFA_REG_IP arm_pc
     56#else
     57#error unknown hardware architecture
    5858#endif
    5959
Note: See TracChangeset for help on using the changeset viewer.