home *** CD-ROM | disk | FTP | other *** search
/ Aminet 18 / aminetcdnumber181997.iso / Aminet / misc / emu / AROSdev.lha / AROS / config / i386 / machine.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-01-09  |  3.5 KB  |  99 lines

  1. #ifndef AROS_MACHINE_H
  2. #define AROS_MACHINE_H
  3. /*
  4.     (C) 1995-96 AROS - The Amiga Replacement OS
  5.     $Id: machine.h,v 1.11 1996/11/29 11:14:04 aros Exp $
  6.  
  7.     NOTE: This file must compile *without* any other header !
  8.  
  9.     Desc: machine.h include file for Linux/i386 and FreeBSD/i386
  10.     Lang: english
  11. */
  12.  
  13. /* Information generated by machine.c */
  14. #define AROS_STACK_GROWS_DOWNWARDS 1 /* Stack direction */
  15. #define AROS_BIG_ENDIAN        0 /* Big or little endian */
  16. #define AROS_SIZEOFULONG       4 /* Size of an ULONG */
  17. #define AROS_WORDALIGN           2 /* Alignment for WORD */
  18. #define AROS_LONGALIGN           4 /* Alignment for LONG */
  19. #define AROS_PTRALIGN           4 /* Alignment for PTR */
  20. #define AROS_IPTRALIGN           4 /* Alignment for IPTR */
  21. #define AROS_DOUBLEALIGN       4 /* Alignment for double */
  22. #define AROS_WORSTALIGN        4 /* Worst case alignment */
  23.  
  24. /* ??? */
  25. #define SP_OFFSET 0
  26.  
  27. /*
  28.     One entry in a libraries' jumptable. For assembler compatibility, the
  29.     field jmp should contain the code for an absolute jmp to a 32bit
  30.     address. There are also a couple of macros which you should use to
  31.     access the vector table from C.
  32. */
  33. struct JumpVec
  34. {
  35.     unsigned char jmp;
  36.     unsigned char vec[4];
  37. };
  38. /* Internal macros */
  39. #define __AROS_ASMJMP            0xE9
  40. #define __AROS_SET_VEC(v,a)             (*(ULONG*)(v)->vec=(ULONG)(a)-(ULONG)(v)-5)
  41. #define __AROS_GET_VEC(v)               ((APTR)(*(ULONG*)(v)->vec+(ULONG)(v)+5))
  42.  
  43. /* Use these to acces a vector table */
  44. #define LIB_VECTSIZE            (sizeof (struct JumpVec))
  45. #define __AROS_GETJUMPVEC(lib,n)        ((struct JumpVec *)(((UBYTE *)lib)-(n*LIB_VECTSIZE)))
  46. #define __AROS_GETVECADDR(lib,n)        (__AROS_GET_VEC(__AROS_GETJUMPVEC(lib,n)))
  47. #define __AROS_SETVECADDR(lib,n,addr)   (__AROS_SET_VEC(__AROS_GETJUMPVEC(lib,n),(APTR)(addr)))
  48. #define __AROS_INITVEC(lib,n)           __AROS_GETJUMPVEC(lib,n)->jmp = __AROS_ASMJMP, \
  49.                     __AROS_SETVECADDR(lib,n,_aros_not_implemented)
  50.  
  51. /* ??? */
  52. #define RDFCALL(hook,data,dptr) ((void(*)(UBYTE,APTR))(hook))(data,dptr);
  53.  
  54. /*
  55.     Find the next valid alignment for a structure if the next x bytes must
  56.     be skipped.
  57. */
  58. #define AROS_ALIGN(x)        (((x)+AROS_WORSTALIGN-1)&-AROS_WORSTALIGN)
  59.  
  60. /* Prototypes */
  61. extern void _aros_not_implemented (void);
  62.  
  63. /* How much stack do we need ? Lots :-) */
  64. #define AROS_STACKSIZE    100000
  65.  
  66. /* How to map function arguments to CPU registers */
  67. /*
  68.     The i386 processor doesn't have enough registers to map the m68k
  69.     register set onto them - so simply use the compiler's calling
  70.     convention. The library base is mapped to the last argument so that
  71.     it can be ignored by the function.
  72. */
  73.  
  74. /* What to do with the library base in header, prototype and call */
  75. #define __AROS_LH_BASE(basetype,basename)   basetype basename
  76. #define __AROS_LP_BASE(basetype,basename)   void *
  77. #define __AROS_LC_BASE(basetype,basename)   basename
  78.  
  79. /* How to transform an argument in header, prototype and call */
  80. #define __AROS_LHA(type,name,reg)     type name
  81. #define __AROS_LPA(type,name,reg)     type
  82. #define __AROS_LCA(type,name,reg)     name
  83. #define __AROS_UFHA(type,name,reg)    type name
  84. #define __AROS_UFPA(type,name,reg)    type
  85. #define __AROS_UFCA(type,name,reg)    name
  86.  
  87. /* Prefix for library function in header, prototype and call */
  88. #define __AROS_LH_PREFIX    /* eps */
  89. #define __AROS_LP_PREFIX    /* eps */
  90. #define __AROS_LC_PREFIX    /* eps */
  91. #define __AROS_UFH_PREFIX   /* eps */
  92. #define __AROS_UFP_PREFIX   /* eps */
  93. #define __AROS_UFC_PREFIX   /* eps */
  94.  
  95. /* if this is defined, all AROS_LP*-macros will expand to nothing. */
  96. #define __AROS_USE_MACROS_FOR_LIBCALL
  97.  
  98. #endif /* AROS_MACHINE_H */
  99.