Subversion Repositories Kolibri OS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. /****************************************************************************
  2. *
  3. *                            Open Watcom Project
  4. *
  5. *    Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
  6. *
  7. *  ========================================================================
  8. *
  9. *    This file contains Original Code and/or Modifications of Original
  10. *    Code as defined in and that are subject to the Sybase Open Watcom
  11. *    Public License version 1.0 (the 'License'). You may not use this file
  12. *    except in compliance with the License. BY USING THIS FILE YOU AGREE TO
  13. *    ALL TERMS AND CONDITIONS OF THE LICENSE. A copy of the License is
  14. *    provided with the Original Code and Modifications, and is also
  15. *    available at www.sybase.com/developer/opensource.
  16. *
  17. *    The Original Code and all software distributed under the License are
  18. *    distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  19. *    EXPRESS OR IMPLIED, AND SYBASE AND ALL CONTRIBUTORS HEREBY DISCLAIM
  20. *    ALL SUCH WARRANTIES, INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF
  21. *    MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR
  22. *    NON-INFRINGEMENT. Please see the License for the specific language
  23. *    governing rights and limitations under the License.
  24. *
  25. *  ========================================================================
  26. *
  27. * Description:  Init/Fini routines delcarations.
  28. *
  29. ****************************************************************************/
  30.  
  31.  
  32. #ifndef _INITFINI_H_INCLUDED
  33. #define _INITFINI_H_INCLUDED
  34.  
  35. #include "variety.h"
  36. #include "rtinit.h"
  37.  
  38. #if defined(__386__)
  39.     #define __PARMREG1      eax
  40.     #define __PARMREG2      edx
  41. #elif defined(M_I86)
  42.     #define __PARMREG1      ax
  43.     #define __PARMREG2      dx
  44. #else
  45.     #define __PARMREG1
  46.     #define __PARMREG2
  47. #endif
  48.  
  49. extern void __InitRtns( unsigned );
  50. // - takes priority limit parm in __PARMREG1
  51. //      code will run init routines whose
  52. //      priority is <= __PARMREG1 (really [0-255])
  53. //      __PARMREG1==255 -> run all init routines
  54. //      __PARMREG1==15  -> run init routines whose priority is <= 15
  55. #if defined(_M_IX86)
  56.   #pragma aux __InitRtns "*" parm [__PARMREG1]
  57.   #if !defined(__386__)
  58.     extern void _WCI86FAR __FInitRtns(unsigned);
  59.     #pragma aux __FInitRtns "*" parm [__PARMREG1]
  60.   #endif
  61. #endif
  62.  
  63. extern void __FiniRtns(unsigned,unsigned);
  64. // - takes priority limit range in __PARMREG1, __PARMREG2
  65. //      code will run fini routines whose
  66. //      priority is >= __PARMREG1 (really [0-255]) and
  67. //                  <= __PARMREG2 (really [0-255])
  68. //      __PARMREG1==0 ,__PARMREG2==255 -> run all fini routines
  69. //      __PARMREG1==16,__PARMREG2==255 -> run fini routines in range 16...255
  70. //      __PARMREG1==16,__PARMREG2==40  -> run fini routines in range 16...40
  71. #if defined(_M_IX86)
  72.   #pragma aux __FiniRtns "*" parm [__PARMREG1] [__PARMREG2]
  73.   #if !defined(__386__)
  74.     extern void _WCI86FAR __FFiniRtns( unsigned, unsigned );
  75.     #pragma aux __FFiniRtns "*" parm [__PARMREG1] [__PARMREG2]
  76.   #endif
  77. #endif
  78.  
  79. #if defined(__OS2__) && defined(__386__)
  80.   #define EXIT_PRIORITY_CLIB              0x00009F00
  81. #endif
  82.  
  83. #undef __PARMREG1
  84. #undef __PARMREG2
  85.  
  86. #endif
  87.