File:  [gforth] / gforth / engine / forth.h
Revision 1.112: download - view: text, annotated - select for diffs
Mon May 17 09:01:11 2010 UTC (13 years, 11 months ago) by pazsan
Branches: MAIN
CVS tags: HEAD
Added some proposed memory access words (with OF syntax for be/le)

    1: /* common header file
    2: 
    3:   Copyright (C) 1995,1996,1997,1998,2000,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc.
    4: 
    5:   This file is part of Gforth.
    6: 
    7:   Gforth is free software; you can redistribute it and/or
    8:   modify it under the terms of the GNU General Public License
    9:   as published by the Free Software Foundation, either version 3
   10:   of the License, or (at your option) any later version.
   11: 
   12:   This program is distributed in the hope that it will be useful,
   13:   but WITHOUT ANY WARRANTY; without even the implied warranty of
   14:   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15:   GNU General Public License for more details.
   16: 
   17:   You should have received a copy of the GNU General Public License
   18:   along with this program; if not, see http://www.gnu.org/licenses/.
   19: */
   20: 
   21: #include "config.h"
   22: #include "128bit.h"
   23: #include <stdio.h>
   24: #include <sys/time.h>
   25: #include <unistd.h>
   26: #ifndef STANDALONE
   27: #if defined(HAVE_LIBLTDL)
   28: #include <ltdl.h>
   29: #endif
   30: #endif
   31: 
   32: #if !defined(FORCE_LL) && !defined(BUGGY_LONG_LONG)
   33: #define BUGGY_LONG_LONG
   34: #endif
   35: 
   36: #if defined(DOUBLY_INDIRECT)||defined(INDIRECT_THREADED)||defined(VM_PROFILING)
   37: #define NO_DYNAMIC
   38: #endif
   39: 
   40: #if defined(DOUBLY_INDIRECT)
   41: #  undef DIRECT_THREADED
   42: #  undef INDIRECT_THREADED
   43: #  define INDIRECT_THREADED
   44: #endif
   45: 
   46: #if defined(GFORTH_DEBUGGING) || defined(INDIRECT_THREADED) || defined(DOUBLY_INDIRECT) || defined(VM_PROFILING)
   47: #  undef USE_TOS
   48: #  undef USE_FTOS
   49: #  undef USE_NO_TOS
   50: #  undef USE_NO_FTOS
   51: #  define USE_NO_TOS
   52: #  define USE_NO_FTOS
   53: 
   54: #define PRIM_I "prim.i"
   55: #define PRIM_LAB_I "prim_lab.i"
   56: #define PRIM_NAMES_I "prim_names.i"
   57: #define PRIM_SUPEREND_I "prim_superend.i"
   58: #define PRIM_NUM_I "prim_num.i"
   59: #define PRIM_GRP_I "prim_grp.i"
   60: #define COSTS_I "costs.i"
   61: #define SUPER2_I "super2.i"
   62: /* #define PROFILE_I "profile.i" */
   63: 
   64: #else
   65: /* gforth-fast or gforth-native */
   66: #  undef USE_TOS
   67: #  undef USE_FTOS
   68: #  undef USE_NO_TOS
   69: #  undef USE_NO_FTOS
   70: #  define USE_TOS
   71: 
   72: #define PRIM_I "prim-fast.i"
   73: #define PRIM_LAB_I "prim_lab-fast.i"
   74: #define PRIM_NAMES_I "prim_names-fast.i"
   75: #define PRIM_SUPEREND_I "prim_superend-fast.i"
   76: #define PRIM_NUM_I "prim_num-fast.i"
   77: #define PRIM_GRP_I "prim_grp-fast.i"
   78: #define COSTS_I "costs-fast.i"
   79: #define SUPER2_I "super2-fast.i"
   80: /* profile.c uses profile.i but does not define VM_PROFILING */
   81: /* #define PROFILE_I "profile-fast.i" */
   82: 
   83: #endif
   84: 
   85: 
   86: 
   87: #include <limits.h>
   88: 
   89: #if defined(NeXT)
   90: #  include <libc.h>
   91: #endif /* NeXT */
   92: 
   93: /* symbol indexed constants */
   94: 
   95: #define DOCOL	0
   96: #define DOCON	1
   97: #define DOVAR	2
   98: #define DOUSER	3
   99: #define DODEFER	4
  100: #define DOFIELD	5
  101: #define DOVAL	6
  102: #define DODOES	7
  103: #define DOABICODE	8
  104: #define DOSEMIABICODE   9
  105: #define DOER_MAX        9
  106: 
  107: #include "machine.h"
  108: 
  109: /* C interface data types */
  110: 
  111: typedef WYDE_TYPE Wyde;
  112: typedef TETRABYTE_TYPE Tetrabyte;
  113: typedef OCTABYTE_TYPE Octabyte;
  114: typedef unsigned WYDE_TYPE UWyde;
  115: typedef unsigned TETRABYTE_TYPE UTetrabyte;
  116: typedef unsigned OCTABYTE_TYPE UOctabyte;
  117: 
  118: /* Forth data types */
  119: /* Cell and UCell must be the same size as a pointer */
  120: #define CELL_BITS	(sizeof(Cell) * CHAR_BIT)
  121: #define CELL_MIN (((Cell)1)<<(sizeof(Cell)*CHAR_BIT-1))
  122: 
  123: #define HALFCELL_BITS	(CELL_BITS/2)
  124: #define HALFCELL_MASK   ((~(UCell)0)>>HALFCELL_BITS)
  125: #define UH(x)		(((UCell)(x))>>HALFCELL_BITS)
  126: #define LH(x)		((x)&HALFCELL_MASK)
  127: #define L2U(x)		(((UCell)(x))<<HALFCELL_BITS)
  128: #define HIGHBIT(x)	(((UCell)(x))>>(CELL_BITS-1))
  129: 
  130: #define FLAG(b) (-(b))
  131: #define FILEIO(error)	(FLAG(error) & -37)
  132: #define FILEEXIST(error)	(FLAG(error) & -38)
  133: 
  134: #define F_TRUE (FLAG(0==0))
  135: #define F_FALSE (FLAG(0!=0))
  136: 
  137: /* define this false if you want native division */
  138: #ifdef FORCE_CDIV
  139: #define FLOORED_DIV 0
  140: #else
  141: #define FLOORED_DIV ((1%-3)>0)
  142: #endif
  143: 
  144: #if defined(BUGGY_LONG_LONG)
  145: 
  146: #define BUGGY_LL_CMP    /* compares not possible */
  147: #define BUGGY_LL_MUL    /* multiplication not possible */
  148: #define BUGGY_LL_DIV    /* division not possible */
  149: #define BUGGY_LL_ADD    /* addition not possible */
  150: #define BUGGY_LL_SHIFT  /* shift not possible */
  151: #define BUGGY_LL_D2F    /* to float not possible */
  152: #define BUGGY_LL_F2D    /* from float not possible */
  153: #define BUGGY_LL_SIZE   /* long long "too short", so we use something else */
  154: 
  155: typedef struct {
  156:   Cell hi;
  157:   UCell lo;
  158: } DCell;
  159: 
  160: typedef struct {
  161:   UCell hi;
  162:   UCell lo;
  163: } UDCell;
  164: 
  165: #define DHI(x) (x).hi
  166: #define DLO(x) (x).lo
  167: #define DHI_IS(x,y) (x).hi=(y)
  168: #define DLO_IS(x,y) (x).lo=(y)
  169: 
  170: #define UD2D(ud)	({UDCell _ud=(ud); (DCell){_ud.hi,_ud.lo};})
  171: #define D2UD(d)		({DCell _d1=(d); (UDCell){_d1.hi,_d1.lo};})
  172: 
  173: /* shifts by less than CELL_BITS */
  174: #define DLSHIFT(d,u) ({DCell _d=(d); UCell _u=(u); \
  175:                        ((_u==0) ? \
  176:                         _d : \
  177:                         (DCell){(_d.hi<<_u)|(_d.lo>>(CELL_BITS-_u)), \
  178:                                  _d.lo<<_u});})
  179: 
  180: #define UDLSHIFT(ud,u) D2UD(DLSHIFT(UD2D(ud),u))
  181: 
  182: #if SMALL_OFF_T
  183: #define OFF2UD(o) ({UDCell _ud; _ud.hi=0; _ud.lo=(Cell)(o); _ud;})
  184: #define UD2OFF(ud) ((ud).lo)
  185: #else /* !SMALL_OFF_T */
  186: #define OFF2UD(o) ({UDCell _ud; off_t _o=(o); _ud.hi=_o>>CELL_BITS; _ud.lo=(Cell)_o; _ud;})
  187: #define UD2OFF(ud) ({UDCell _ud=(ud); (((off_t)_ud.hi)<<CELL_BITS)+_ud.lo;})
  188: #endif /* !SMALL_OFF_T */
  189: #define DZERO		((DCell){0,0})
  190: 
  191: #else /* !defined(BUGGY_LONG_LONG) */
  192: 
  193: /* DCell and UDCell must be twice as large as Cell */
  194: typedef DOUBLE_CELL_TYPE DCell;
  195: typedef DOUBLE_UCELL_TYPE UDCell;
  196: 
  197: #define DHI(x) ({ Double_Store _d; _d.d=(x); _d.cells.high; })
  198: #define DLO(x) ({ Double_Store _d; _d.d=(x); _d.cells.low;  })
  199: 
  200: /* beware with the assignment: x is referenced twice! */
  201: #define DHI_IS(x,y) ({ Double_Store _d; _d.d=(x); _d.cells.high=(y); (x)=_d.d; })
  202: #define DLO_IS(x,y) ({ Double_Store _d; _d.d=(x); _d.cells.low =(y); (x)=_d.d; })
  203: 
  204: #define UD2D(ud)	((DCell)(ud))
  205: #define D2UD(d)		((UDCell)(d))
  206: #define OFF2UD(o)	((UDCell)(o))
  207: #define UD2OFF(ud)	((off_t)(ud))
  208: #define DZERO		((DCell)0)
  209: /* shifts by less than CELL_BITS */
  210: #define DLSHIFT(d,u)  ((d)<<(u))
  211: #define UDLSHIFT(d,u)  ((d)<<(u))
  212: 
  213: #endif /* !defined(BUGGY_LONG_LONG) */
  214: 
  215: typedef union {
  216:   struct {
  217: #if defined(WORDS_BIGENDIAN)||defined(BUGGY_LONG_LONG)
  218:     Cell high;
  219:     UCell low;
  220: #else
  221:     UCell low;
  222:     Cell high;
  223: #endif
  224:   } cells;
  225:   DCell d;
  226:   UDCell ud;
  227: } Double_Store;
  228: 
  229: #define FETCH_DCELL_T(d_,lo,hi,t_)	({ \
  230: 				     Double_Store _d; \
  231: 				     _d.cells.low = (lo); \
  232: 				     _d.cells.high = (hi); \
  233: 				     (d_) = _d.t_; \
  234: 				 })
  235: 
  236: #define STORE_DCELL_T(d_,lo,hi,t_)	({ \
  237: 				     Double_Store _d; \
  238: 				     _d.t_ = (d_); \
  239: 				     (lo) = _d.cells.low; \
  240: 				     (hi) = _d.cells.high; \
  241: 				 })
  242: 
  243: #define vm_twoCell2d(lo,hi,d_)  FETCH_DCELL_T(d_,lo,hi,d);
  244: #define vm_twoCell2ud(lo,hi,d_) FETCH_DCELL_T(d_,lo,hi,ud);
  245: 
  246: #define vm_d2twoCell(d_,lo,hi)  STORE_DCELL_T(d_,lo,hi,d);
  247: #define vm_ud2twoCell(d_,lo,hi) STORE_DCELL_T(d_,lo,hi,ud);
  248: 
  249: typedef Label *Xt;
  250: 
  251: /* PFA gives the parameter field address corresponding to a cfa */
  252: #define PFA(cfa)	(((Cell *)cfa)+2)
  253: /* PFA1 is a special version for use just after a NEXT1 */
  254: #define PFA1(cfa)	PFA(cfa)
  255: /* CODE_ADDRESS is the address of the code jumped to through the code field */
  256: #define CODE_ADDRESS(cfa)	(*(Xt)(cfa))
  257: 
  258: /* DOES_CODE is the Forth code does jumps to */
  259: #if !defined(DOUBLY_INDIRECT)
  260: #  define DOES_CA (symbols[DODOES])
  261: #else /* defined(DOUBLY_INDIRECT) */
  262: #  define DOES_CA ((Label)&xts[DODOES])
  263: #endif /* defined(DOUBLY_INDIRECT) */
  264: 
  265: 
  266: 
  267: #define DOES_CODE1(cfa)	((Xt *)(cfa[1]))
  268: /* MAKE_CF creates an appropriate code field at the cfa;
  269:    ca is the code address */
  270: #define MAKE_CF(cfa,ca) ((*(Label *)(cfa)) = ((Label)ca))
  271: /* make a code field for a defining-word-defined word */
  272: 
  273: #define CF(const)	(-const-2)
  274: 
  275: #define CF_NIL	-1
  276: 
  277: #ifndef FLUSH_ICACHE
  278: #warning flush-icache probably will not work (see manual)
  279: #	define FLUSH_ICACHE(addr,size)
  280: #warning no FLUSH_ICACHE, turning off dynamic native code by default
  281: #undef NO_DYNAMIC_DEFAULT
  282: #define NO_DYNAMIC_DEFAULT 1
  283: #endif
  284: 
  285: #if defined(GFORTH_DEBUGGING) || defined(INDIRECT_THREADED) || defined(DOUBLY_INDIRECT) || defined(VM_PROFILING)
  286: #define STACK_CACHE_DEFAULT 0
  287: #else
  288: #define STACK_CACHE_DEFAULT STACK_CACHE_DEFAULT_FAST
  289: #endif
  290: 
  291: #ifdef USE_FTOS
  292: #define IF_fpTOS(x) x
  293: #else
  294: #define IF_fpTOS(x)
  295: #define fpTOS (fp[0])
  296: #endif
  297: 
  298: #define IF_rpTOS(x)
  299: #define rpTOS (rp[0])
  300: 
  301: typedef struct {
  302:   Address base;		/* base address of image (0 if relocatable) */
  303:   UCell checksum;	/* checksum of ca's to protect against some
  304: 			   incompatible	binary/executable combinations
  305: 			   (0 if relocatable) */
  306:   UCell image_size;	/* all sizes in bytes */
  307:   UCell dict_size;
  308:   UCell data_stack_size;
  309:   UCell fp_stack_size;
  310:   UCell return_stack_size;
  311:   UCell locals_stack_size;
  312:   Xt *boot_entry;	/* initial ip for booting (in BOOT) */
  313:   Xt *throw_entry;	/* ip after signal (in THROW) */
  314:   Cell unused1;		/* possibly tib stack size */
  315:   Label *xt_base;         /* base of DOUBLE_INDIRECT xts[], for comp-i.fs */
  316:   Address data_stack_base; /* this and the following fields are initialized by the loader */
  317:   Address fp_stack_base;
  318:   Address return_stack_base;
  319:   Address locals_stack_base;
  320: } ImageHeader;
  321: /* the image-header is created in main.fs */
  322: 
  323: #ifdef HAS_F83HEADERSTRING
  324: struct F83Name {
  325:   struct F83Name *next;  /* the link field for old hands */
  326:   char		countetc;
  327:   char		name[0];
  328: };
  329: 
  330: #define F83NAME_COUNT(np)	((np)->countetc & 0x1f)
  331: #endif
  332: struct Longname {
  333:   struct Longname *next;  /* the link field for old hands */
  334:   Cell		countetc;
  335:   char		name[0];
  336: };
  337: 
  338: #define LONGNAME_COUNT(np)	((np)->countetc & (((~((UCell)0))<<4)>>4))
  339: 
  340: struct Cellpair {
  341:   Cell n1;
  342:   Cell n2;
  343: };
  344: 
  345: struct Cellquad {
  346:   Cell n1;
  347:   Cell n2;
  348:   Cell n3;
  349:   Cell n4;
  350: };
  351: 
  352: #define IOR(flag)	((flag)? -512-errno : 0)
  353: 
  354: #ifdef GFORTH_DEBUGGING
  355: #if defined(GLOBALS_NONRELOC)
  356: /* if globals cause non-relocatable primitives, keep saved_ip and rp
  357:    in a structure and access it through locals */
  358: typedef struct saved_regs {
  359:   Xt *sr_saved_ip;
  360:   Cell *sr_rp;
  361: } saved_regs;
  362: extern saved_regs saved_regs_v, *saved_regs_p;
  363: #define saved_ip (saved_regs_p->sr_saved_ip)
  364: #define rp       (saved_regs_p->sr_rp)
  365: /* for use in gforth_engine header */
  366: #error sr_proto not passed in fflib.fs callbacks (solution: disable GLOBALS_NONRELOC)
  367: #define sr_proto , struct saved_regs *saved_regs_p0
  368: #define sr_call  , saved_regs_p
  369: #else /* !defined(GLOBALS_NONRELOC) */
  370: extern Xt *saved_ip;
  371: extern Cell *rp;
  372: #define sr_proto
  373: #define sr_call
  374: #endif /* !defined(GLOBALS_NONRELOC) */
  375: #else /* !defined(GFORTH_DEBUGGING) */
  376: #define sr_proto
  377: #define sr_call
  378: #endif /* !defined(GFORTH_DEBUGGING) */
  379: 
  380: Label *gforth_engine(Xt *ip, Cell *sp, Cell *rp0, Float *fp, Address lp sr_proto);
  381: Label *gforth_engine2(Xt *ip, Cell *sp, Cell *rp0, Float *fp, Address lp sr_proto);
  382: Label *gforth_engine3(Xt *ip, Cell *sp, Cell *rp0, Float *fp, Address lp sr_proto);
  383: 
  384: /* for ABI-CODE and ;ABI-CODE */
  385: typedef Cell *abifunc(Cell *sp, Float **fpp);
  386: typedef Cell *semiabifunc(Cell *sp, Float **fpp, Address body);
  387: 
  388: /* engine/prim support routines */
  389: Address gforth_alloc(Cell size);
  390: char *cstr(Char *from, UCell size, int clear);
  391: char *tilde_cstr(Char *from, UCell size, int clear);
  392: Cell opencreate_file(char *s, Cell wfam, int flags, Cell *wiorp);
  393: DCell timeval2us(struct timeval *tvp);
  394: void cmove(Char *c_from, Char *c_to, UCell u);
  395: void cmove_up(Char *c_from, Char *c_to, UCell u);
  396: Cell compare(Char *c_addr1, UCell u1, Char *c_addr2, UCell u2);
  397: struct Longname *listlfind(Char *c_addr, UCell u, struct Longname *longname1);
  398: struct Longname *hashlfind(Char *c_addr, UCell u, Cell *a_addr);
  399: struct Longname *tablelfind(Char *c_addr, UCell u, Cell *a_addr);
  400: UCell hashkey1(Char *c_addr, UCell u, UCell ubits);
  401: struct Cellpair parse_white(Char *c_addr1, UCell u1);
  402: Cell rename_file(Char *c_addr1, UCell u1, Char *c_addr2, UCell u2);
  403: struct Cellquad read_line(Char *c_addr, UCell u1, FILE *wfileid);
  404: struct Cellpair file_status(Char *c_addr, UCell u);
  405: Cell to_float(Char *c_addr, UCell u, Float *r_p);
  406: Float v_star(Float *f_addr1, Cell nstride1, Float *f_addr2, Cell nstride2, UCell ucount);
  407: void faxpy(Float ra, Float *f_x, Cell nstridex, Float *f_y, Cell nstridey, UCell ucount);
  408: UCell lshift(UCell u1, UCell n);
  409: UCell rshift(UCell u1, UCell n);
  410: int gforth_system(Char *c_addr, UCell u);
  411: void gforth_ms(UCell u);
  412: UCell gforth_dlopen(Char *c_addr, UCell u);
  413: Cell capscompare(Char *c_addr1, UCell u1, Char *c_addr2, UCell u2);
  414: int gf_ungetc(int c, FILE *stream);
  415: void gf_regetc(FILE *stream);
  416: int gf_ungottenc(FILE *stream);
  417: 
  418: /* signal handler stuff */
  419: void install_signal_handlers(void);
  420: void throw(int code);
  421: /* throw codes */
  422: #define BALL_DIVZERO     -10
  423: #define BALL_RESULTRANGE -11
  424: 
  425: typedef void Sigfunc(int);
  426: Sigfunc *bsd_signal(int signo, Sigfunc *func);
  427: 
  428: /* dblsub routines */
  429: DCell dnegate(DCell d1);
  430: UDCell ummul (UCell a, UCell b);
  431: DCell mmul (Cell a, Cell b);
  432: UDCell umdiv (UDCell u, UCell v);
  433: DCell smdiv (DCell num, Cell denom);
  434: DCell fmdiv (DCell num, Cell denom);
  435: 
  436: Cell memcasecmp(const Char *s1, const Char *s2, Cell n);
  437: 
  438: void vm_print_profile(FILE *file);
  439: void vm_count_block(Xt *ip);
  440: 
  441: /* dynamic superinstruction stuff */
  442: void compile_prim1(Cell *start);
  443: void finish_code(void);
  444: int forget_dyncode(Address code);
  445: Label decompile_code(Label prim);
  446: 
  447: extern int offset_image;
  448: extern int die_on_signal;
  449: extern int ignore_async_signals;
  450: extern UCell pagesize;
  451: extern ImageHeader *gforth_header;
  452: extern Label *vm_prims;
  453: extern Label *xts;
  454: extern Cell npriminfos;
  455: 
  456: #ifdef HAS_DEBUG
  457: extern int debug;
  458: #else
  459: # define debug 0
  460: #endif
  461: 
  462: extern Cell *gforth_SP;
  463: extern Cell *gforth_RP;
  464: extern Address gforth_LP;
  465: extern Float *gforth_FP;
  466: extern Address gforth_UP;
  467: #ifndef HAS_LINKBACK
  468: extern void * gforth_pointers[];
  469: #endif
  470: 
  471: #ifdef HAS_FFCALL
  472: extern Cell *gforth_RP;
  473: extern Address gforth_LP;
  474: extern void gforth_callback(Xt* fcall, void * alist);
  475: #endif
  476: 
  477: #ifdef NO_IP
  478: extern Label next_code;
  479: #endif
  480: 
  481: #ifdef HAS_FILE
  482: extern char* fileattr[6];
  483: extern char* pfileattr[6];
  484: extern int ufileattr[6];
  485: #endif
  486: 
  487: #ifdef PRINT_SUPER_LENGTHS
  488: Cell prim_length(Cell prim);
  489: void print_super_lengths();
  490: #endif
  491: 
  492: /* declare all the functions that are missing */
  493: #ifndef HAVE_ATANH
  494: extern double atanh(double r1);
  495: extern double asinh(double r1);
  496: extern double acosh(double r1);
  497: #endif
  498: #ifndef HAVE_ECVT
  499: /* extern char* ecvt(double x, int len, int* exp, int* sign);*/
  500: #endif
  501: #ifndef HAVE_MEMMOVE
  502: /* extern char *memmove(char *dest, const char *src, long n); */
  503: #endif
  504: #ifndef HAVE_POW10
  505: extern double pow10(double x);
  506: #endif
  507: #ifndef HAVE_STRERROR
  508: extern char *strerror(int err);
  509: #endif
  510: #ifndef HAVE_STRSIGNAL
  511: extern char *strsignal(int sig);
  512: #endif
  513: #ifndef HAVE_STRTOUL
  514: extern unsigned long int strtoul(const char *nptr, char **endptr, int base);
  515: #endif
  516: 
  517: #define GROUP(x, n)
  518: #define GROUPADD(n)
  519: 
  520: #ifdef HAVE_ENDIAN_H
  521: #include <endian.h>
  522: #else
  523: #define BSWAP16(x) ((((x) >> 8) & 0xff | (((x) & 0xff) << 8)))
  524: #define BSWAP32(x) ((BSWAP16((x) >> 16) | (BSWAP16(x) << 16)))
  525: #define BSWAP64(x) ((BSWAP32((x) >> 32) | (BSWAP32(x) << 32)))
  526: #ifdef WORDS_BIGENDIAN
  527: #define htobe16(x) (x)
  528: #define htobe32(x) (x)
  529: #define htobe64(x) (x)
  530: #define be16toh(x) (x)
  531: #define be32toh(x) (x)
  532: #define be64toh(x) (x)
  533: #define htole16(x) BSWAP16(x)
  534: #define htole32(x) BSWAP32(x)
  535: #define htole64(x) BSWAP64(x)
  536: #define le16toh(x) BSWAP16(x)
  537: #define le32toh(x) BSWAP32(x)
  538: #define le64toh(x) BSWAP64(x)
  539: #else
  540: #define htobe16(x) BSWAP16(x)
  541: #define htobe32(x) BSWAP32(x)
  542: #define htobe64(x) BSWAP64(x)
  543: #define be16toh(x) BSWAP16(x)
  544: #define be32toh(x) BSWAP32(x)
  545: #define be64toh(x) BSWAP64(x)
  546: #define htole16(x) (x)
  547: #define htole32(x) (x)
  548: #define htole64(x) (x)
  549: #define le16toh(x) (x)
  550: #define le32toh(x) (x)
  551: #define le64toh(x) (x)
  552: #endif
  553: #endif

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