]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/entry_points.cpp
32 and 64 bit Linux PPC support
[factor.git] / vm / entry_points.cpp
index 9f4c827ddf1b1eb9f2dd962897e628b64087c3fb..da4ed9d9ce88c26501ac80278b30d41fc19c7734 100755 (executable)
@@ -13,9 +13,10 @@ void factor_vm::c_to_factor(cell quot)
        {
                tagged<word> c_to_factor_word(special_objects[C_TO_FACTOR_WORD]);
                code_block *c_to_factor_block = callbacks->add(c_to_factor_word.value(),0);
-               c_to_factor_func = (c_to_factor_func_type)c_to_factor_block->entry_point();
+               void* func = c_to_factor_block->entry_point();
+               CODE_TO_FUNCTION_POINTER_CALLBACK(this, func);
+               c_to_factor_func = (c_to_factor_func_type)func;
        }
-
        c_to_factor_func(quot);
 }
 
@@ -31,17 +32,26 @@ template<typename Func> Func factor_vm::get_entry_point(cell n)
 
 void factor_vm::unwind_native_frames(cell quot, stack_frame *to)
 {
-       get_entry_point<unwind_native_frames_func_type>(UNWIND_NATIVE_FRAMES_WORD)(quot,to);
+       tagged<word> entry_point_word(special_objects[UNWIND_NATIVE_FRAMES_WORD]);
+       void *func = entry_point_word->code->entry_point();
+       CODE_TO_FUNCTION_POINTER(func);
+       ((unwind_native_frames_func_type)func)(quot,to);
 }
 
 cell factor_vm::get_fpu_state()
 {
-       return get_entry_point<get_fpu_state_func_type>(GET_FPU_STATE_WORD)();
+       tagged<word> entry_point_word(special_objects[GET_FPU_STATE_WORD]);
+       void *func = entry_point_word->code->entry_point();
+       CODE_TO_FUNCTION_POINTER(func);
+       return ((get_fpu_state_func_type)func)();
 }
 
 void factor_vm::set_fpu_state(cell state)
 {
-       get_entry_point<set_fpu_state_func_type>(GET_FPU_STATE_WORD)(state);
+       tagged<word> entry_point_word(special_objects[SET_FPU_STATE_WORD]);
+       void *func = entry_point_word->code->entry_point();
+       CODE_TO_FUNCTION_POINTER(func);
+       ((set_fpu_state_func_type)func)(state);
 }
 
 }