Diff for /gforth/Attic/decstation.h between versions 1.1 and 1.3

version 1.1, 1994/02/11 16:30:46 version 1.3, 1994/05/05 17:05:32
Line 4 Line 4
   
   This is the machine-specific part for a Decstation running Ultrix    This is the machine-specific part for a Decstation running Ultrix
 */  */
   /* cache flush stuff */
   
   #ifdef DIRECT_THREADED
   
   #include <mips/cachectl.h>
   
   #define CACHE_FLUSH(addr,size) \
                                   cacheflush((char *)(addr), (int)(size), BCACHE)
   
   #endif
   
 /* Cell and UCell must be the same size as a pointer */  /* Cell and UCell must be the same size as a pointer */
 typedef long Cell;  typedef long Cell;
Line 51  typedef float SFloat; Line 60  typedef float SFloat;
                 /* CODE_ADDRESS is the address of the code jumped to through the code field */                  /* CODE_ADDRESS is the address of the code jumped to through the code field */
 #               define CODE_ADDRESS(cfa)        ((Label)(((*(unsigned *)(cfa))^JAL_PATTERN^(SEGMENT_NUM<<26))<<2))  #               define CODE_ADDRESS(cfa)        ((Label)(((*(unsigned *)(cfa))^JAL_PATTERN^(SEGMENT_NUM<<26))<<2))
 #               define MAKE_CF(cfa,ca)  ({long *_cfa = (long *)(cfa); \  #               define MAKE_CF(cfa,ca)  ({long *_cfa = (long *)(cfa); \
                                           long _ca = (long)(ca);                                            long _ca = (long)(ca); \
                                                   _cfa[0] = JAL_PATTERN|(((((long)_ca)>>2)+4)&JUMP_MASK), /* JAL ca+4 */ \                                                    _cfa[0] = JAL_PATTERN|(((((long)_ca)>>2))&JUMP_MASK); /* JAL ca+4 */ \
                                                   _cfa[1] = *(long *)_ca; /* delay slot */})                                                    _cfa[1] = 0; /* *(long *)_ca; delay slot */})
 #       endif /* undefined */  #       endif /* undefined */
   
         /* this is the point where the does code starts if label points to the          /* this is the point where the does code starts if label points to the
Line 64  typedef float SFloat; Line 73  typedef float SFloat;
 #       define DOES_CODE1(cfa)  DOES_CODE(cfa)  #       define DOES_CODE1(cfa)  DOES_CODE(cfa)
   
 #       define DOES_HANDLER_SIZE        8  #       define DOES_HANDLER_SIZE        8
   #       define MAKE_DOES_CF(cfa,does_code) \
                           ({long does_handlerp=((long)(does_code))-DOES_HANDLER_SIZE; \
                             long *_cfa = (long*)(cfa); \
                             _cfa[0] = J_PATTERN|((does_handlerp&JUMP_MASK)>>2); /* J ca */ \
                             _cfa[1] = 0; /* nop */})
   /*
 #       define MAKE_DOES_CF(cfa, does_code)     ({char *does_handlerp=((char *)does_code)-DOES_HANDLER_SIZE;    \  #       define MAKE_DOES_CF(cfa, does_code)     ({char *does_handlerp=((char *)does_code)-DOES_HANDLER_SIZE;    \
                                                   MAKE_CF(cfa,does_handlerp);   \                                                    MAKE_CF(cfa,does_handlerp);   \
                                                   MAKE_DOES_HANDLER(does_handlerp);})                                                    MAKE_DOES_HANDLER(does_handlerp) ;})
   */
         /* this stores a jump dodoes at addr */          /* this stores a jump dodoes at addr */
 #       define MAKE_DOES_HANDLER(addr)  ({long * _addr = (long *)addr; \  #       define MAKE_DOES_HANDLER(addr)  MAKE_CF(addr,symbols[DODOES])
                                           _addr[0] = J_PATTERN|((((long)DODOES)>>2)&JUMP_MASK); /* J dodoes */ \  
                                           _addr[1] = 0; /* nop */})  
 #endif  #endif
 #ifdef undefined  #ifdef undefined
 /* and here are some more efficient versions that can be tried later */  /* and here are some more efficient versions that can be tried later */
Line 80  typedef float SFloat; Line 95  typedef float SFloat;
 */  */
   
 #define MAKE_DOESJUMP(addr)     ({long * _addr = (long *)addr; \  #define MAKE_DOESJUMP(addr)     ({long * _addr = (long *)addr; \
                                   _addr[0] = J_PATTERN|(((((long)symbols[3])>>2)+4)&JUMP_MASK), /* J dodoes+4 */ \                                    _addr[0] = J_PATTERN|(((((long)symbols[DODOES])>>2)+4)&JUMP_MASK), /* J dodoes+4 */ \
                                   _addr[1] = *(long *)symbols[3]; /* delay */})                                    _addr[1] = *(long *)symbols[DODOES]; /* delay */})
   
 /* the following version uses JAL to make DOES_CODE1 faster */  /* the following version uses JAL to make DOES_CODE1 faster */
 /* !! does the declaration clear the register ? */  /* !! does the declaration clear the register ? */
 /* it's ok to use the same reg as in PFA1:  /* it's ok to use the same reg as in PFA1:
    dodoes is the only potential problem and I have taken care of it */     dodoes is the only potential problem and I have taken care of it */
   
 #define DOES_CODE1(cfa) ({register Code *_does_code asm("$31"); \  #define DOES_CODE1(cfa) ({register Code *_does_code asm("$31"); \
                                     _does_code; })                                      _does_code; })
 #define MAKE_DOESJUMP(addr)     ({long * _addr = (long *)addr; \  #define MAKE_DOESJUMP(addr)     ({long * _addr = (long *)addr; \
                                   _addr[0] = JAL_PATTERN|(((((long)symbols[3])>>2)+4)&JUMP_MASK), /* JAL dodoes+4 */ \                                    _addr[0] = JAL_PATTERN|(((((long)symbols[DODOES])>>2)+4)&JUMP_MASK), /* JAL dodoes+4 */ \
                                   _addr[1] = *(long *)symbols[3]; /* delay */})                                    _addr[1] = *(long *)symbols[DODOES]; /* delay */})
   
 #endif  #endif
   

Removed from v.1.1  
changed lines
  Added in v.1.3


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>