diff --git a/H/Yap.h b/H/Yap.h index 99009f946..d4a8b36ad 100755 --- a/H/Yap.h +++ b/H/Yap.h @@ -556,7 +556,7 @@ typedef struct opcode_tab_entry { OPCODE opc; op_numbers opnum; -} opentry; +} op_entry; #endif diff --git a/H/dhstruct.h b/H/dhstruct.h index 90ee4b667..8039fa41d 100644 --- a/H/dhstruct.h +++ b/H/dhstruct.h @@ -277,6 +277,9 @@ #define ParserErrorStyle Yap_heap_regs->parser_error_style #define Yap_LibDir Yap_heap_regs->yap_lib_dir +#define Yap_ForeignDir Yap_heap_regs->yap_foreign_dir +#define Yap_CommonsDir Yap_heap_regs->yap_commons_dir +#define Yap_BinDir Yap_heap_regs->yap_bin_dir #define LastWtimePtr Yap_heap_regs->last_wtime diff --git a/H/hstruct.h b/H/hstruct.h index 0872294f8..adfcc17ff 100755 --- a/H/hstruct.h +++ b/H/hstruct.h @@ -61,7 +61,7 @@ #if USE_THREADED_CODE - opentry *op_rtable; + op_entry *op_rtable; #endif OPCODE execute_cpred_op_code; @@ -276,7 +276,10 @@ int parser_error_style; - char *yap_lib_dir; + const char *yap_lib_dir; + const char *yap_foreign_dir; + const char *yap_commons_dir; + const char *yap_bin_dir; void *last_wtime; diff --git a/H/ihstruct.h b/H/ihstruct.h index 96b1cb637..0ade80f05 100644 --- a/H/ihstruct.h +++ b/H/ihstruct.h @@ -277,6 +277,9 @@ ParserErrorStyle = EXCEPTION_ON_PARSER_ERROR; Yap_LibDir = NULL; + Yap_ForeignDir = NULL; + Yap_CommonsDir = NULL; + Yap_BinDir = NULL; LastWtimePtr = NULL; diff --git a/H/rhstruct.h b/H/rhstruct.h index aea230d60..f0fd7bc90 100644 --- a/H/rhstruct.h +++ b/H/rhstruct.h @@ -276,7 +276,10 @@ - Yap_LibDir = CodeCharPAdjust(Yap_LibDir); + Yap_LibDir = CodeConstCharPAdjust(Yap_LibDir); + Yap_ForeignDir = CodeConstCharPAdjust(Yap_ForeignDir); + Yap_CommonsDir = CodeConstCharPAdjust(Yap_CommonsDir); + Yap_BinDir = CodeConstCharPAdjust(Yap_BinDir); LastWtimePtr = CodeVoidPAdjust(LastWtimePtr); diff --git a/H/sshift.h b/H/sshift.h index 561993921..efe1712ea 100644 --- a/H/sshift.h +++ b/H/sshift.h @@ -107,6 +107,7 @@ #define TrailAdjust(P) TrailAdjust__(P PASS_REGS) #define HoldEntryAdjust(P) HoldEntryAdjust__(P PASS_REGS) #define CodeCharPAdjust(P) CodeCharPAdjust__(P PASS_REGS) +#define CodeConstCharPAdjust(P) CodeConstCharPAdjust__(P PASS_REGS) #define CodeVoidPAdjust(P) CodeVoidPAdjust__(P PASS_REGS) #define HaltHookAdjust(P) HaltHookAdjust__(P PASS_REGS) #define TokEntryAdjust(P) TokEntryAdjust__(P PASS_REGS) @@ -720,6 +721,16 @@ CodeCharPAdjust__ (char * addr USES_REGS) return addr + LOCAL_HDiff; } +INLINE_ONLY inline EXTERN const char * CodeConstCharPAdjust__ (const char * CACHE_TYPE); + +INLINE_ONLY inline EXTERN const char * +CodeConstCharPAdjust__ (const char * addr USES_REGS) +{ + if (!addr) + return NULL; + return addr + LOCAL_HDiff; +} + INLINE_ONLY inline EXTERN void * CodeVoidPAdjust__ (void * CACHE_TYPE); INLINE_ONLY inline EXTERN void * @@ -829,12 +840,12 @@ TermToGlobalOrAtomAdjust__ (Term t USES_REGS) return t; } -INLINE_ONLY inline EXTERN opentry *OpRTableAdjust__ (opentry * CACHE_TYPE); +INLINE_ONLY inline EXTERN op_entry *OpRTableAdjust__ (op_entry * CACHE_TYPE); -INLINE_ONLY inline EXTERN opentry * -OpRTableAdjust__ (opentry * ptr USES_REGS) +INLINE_ONLY inline EXTERN op_entry * +OpRTableAdjust__ (op_entry * ptr USES_REGS) { - return (opentry *) (((opentry *) (CharP (ptr) + LOCAL_HDiff))); + return (op_entry *) (((op_entry *) (CharP (ptr) + LOCAL_HDiff))); } INLINE_ONLY inline EXTERN OpEntry *OpEntryAdjust__ (OpEntry * CACHE_TYPE); diff --git a/misc/HEAPFIELDS b/misc/HEAPFIELDS index ace67c342..a8a94d8ae 100644 --- a/misc/HEAPFIELDS +++ b/misc/HEAPFIELDS @@ -59,7 +59,7 @@ UInt MaxTrail_ MaxTrail =0 void /* execution info */ /* OPCODE TABLE, needed to recover op tables */ #if USE_THREADED_CODE -opentry *op_rtable OP_RTABLE void OpRTableAdjust +op_entry *op_rtable OP_RTABLE void OpRTableAdjust #endif /* popular opcodes */ @@ -309,10 +309,10 @@ char *char_conversion_table2 CharConversionTable2 =NULL CodeCharPAdjust int parser_error_style ParserErrorStyle =EXCEPTION_ON_PARSER_ERROR void /* library location. */ -const char *yap_lib_dir Yap_LibDir =NULL CodeCharPAdjust -const char *yap_foreign_dir Yap_ForeignDir =NULL CodeCharPAdjust -const char *yap_commons_dir Yap_CommonsDir =NULL CodeCharPAdjust -const char *yap_bin_dir Yap_BinDir =NULL CodeCharPAdjust +const char *yap_lib_dir Yap_LibDir =NULL CodeConstCharPAdjust +const char *yap_foreign_dir Yap_ForeignDir =NULL CodeConstCharPAdjust +const char *yap_commons_dir Yap_CommonsDir =NULL CodeConstCharPAdjust +const char *yap_bin_dir Yap_BinDir =NULL CodeConstCharPAdjust /* time */ void *last_wtime LastWtimePtr =NULL CodeVoidPAdjust