home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / CTASK22.ZIP / TSKCONF.H < prev    next >
Text File  |  1990-10-12  |  17KB  |  451 lines

  1. ;/* --- Version 2.2 90-10-12 16:16 ---
  2. COMMENT ^
  3.  
  4.    TSKCONF.H - CTask - Configuration definitions 
  5.  
  6.    Public Domain Software written by
  7.       Thomas Wagner
  8.       Ferrari electronic Gmbh
  9.       Beusselstrasse 27
  10.       D-1000 Berlin 21
  11.       Germany
  12.  
  13.    This file has been changed in version 2.1 to allow inclusion in 
  14.    both the C and the Assembler parts. This avoids confusion and hard
  15.    to find errors due to mismatched configurations. It's still possible
  16.    to make errors, but since everything is close together, it's easier 
  17.    to spot the problem. Please be extra careful to ensure that the
  18.    C and Assembler definitions agree.
  19. */
  20.  
  21. #define  FALSE             0
  22. #define  TRUE              1       /*^
  23.          FALSE          =  0
  24.          TRUE           =  0ffffh  ; Note: Assembler definition is different
  25.  
  26. COMMENT ^
  27.  
  28.    CODE_SHARING   If TRUE, the generated kernel supports code sharing.
  29.                   This requires the entry points to load ds on entry,
  30.                   and compilation with Large model (MSC) or Huge model (TC).
  31.                   The default is FALSE.
  32.                   
  33.    NEAR_CODE      If TRUE, all CTask routines are 'near'.
  34.                   Use only with small model.
  35.                   You will have to change the make-files so the
  36.                   compiler model is no longer Large, and the code segment
  37.                   is not named, when turning on this flag.
  38.                   The default is FALSE.
  39.  
  40.    LOCALS_FAR     If TRUE, internal CTask routines ar 'far'.
  41.                   This might be necessary if your compiler/linker does
  42.                   not allow placing all CTask kernel code in a common
  43.                   segment.
  44.                   Do not set this flag if NEAR_CODE is set.
  45.                   The default is FALSE.
  46.  
  47.    CALL_PASCAL    Use Pascal calling sequence for CTask routines.
  48.                   This may save some code, but may cause naming
  49.                   conflicts if your compiler limits external Pascal
  50.                   names to 8 characters.
  51.                   The default is FALSE.
  52.  
  53.    TC_HUGE        (Assembler only)
  54.                   Define TC_HUGE for use with the Turbo C Huge
  55.                   model, and if it is desired to separate CTask's data
  56.                   from the normal data segment.
  57.                   This flag causes the CTASK_DATA segment to be defined,
  58.                   (class is DATA) and DS to be loaded with this segment
  59.                   on function entry. 
  60.                   The C functions in the CTask kernel must be compiled
  61.                   to use the same data segment.
  62.                   The default is not defined.
  63.  
  64.    LOAD_DS        (Assembler only)
  65.                   Define LOAD_DS to reload the data segment on entry
  66.                   to global functions.
  67.                   This flag must be defined for TC_HUGE. It can also be
  68.                   defined if the data segment can not safely be assumed to be
  69.                   loaded in DS on function entry, for example if the code
  70.                   sharing feature of version 2.1 is used. The C routines
  71.                   must be compiled with the necessary compiler switches
  72.                   or the _loadds keyword in this case.
  73.                   The default is not defined.
  74.  
  75.    ROM_CODE       (Assembler only)
  76.                   Define ROM_CODE TRUE for embedded systems using ROM-
  77.                   based code. This option disables storing variables in
  78.                   the code segment.
  79.                   The default is FALSE.
  80.  
  81.    FAR_STACK      (Assembler only)
  82.                   If FAR_STACK is defined TRUE, the local stacks used
  83.                   by CTask interrupt handlers are allocated outside the
  84.                   default data segment. This may require changes in the
  85.                   standard start-up module to make sure the segment 
  86.                   ordering is correct. The Turbo C linker may be confused
  87.                   and place the CTask-stack segment in the middle of the
  88.                   DGROUP if no mention is made of the segment in C0.ASM.
  89.                   The default is FALSE.
  90.  
  91.       CAUTION:    Changing requires recompile of all sources.
  92. */
  93.  
  94. #define  CODE_SHARING      FALSE
  95. #define  NEAR_CODE         FALSE
  96. #define  LOCALS_FAR        FALSE
  97. #define  CALL_PASCAL       FALSE    /*^
  98.                         
  99.          CODE_SHARING   =  FALSE
  100.          NEAR_CODE      =  FALSE
  101.          LOCALS_FAR     =  FALSE
  102.          CALL_PASCAL    =  FALSE
  103.  
  104.          ROM_CODE       =  FALSE    ; ASM only
  105.          FAR_STACKS     =  FALSE    ; ASM only
  106.  
  107. ; The following two defines may be defined on the command line (any value)
  108. ; or uncommented here. To disable, don't set to FALSE, comment them out.
  109. ; Setting TC_HUGE is sufficient to enable both options.
  110.  
  111. ;        TC_HUGE        =  1     ; ASM only
  112. ;        LOAD_DS        =  1     ; ASM only
  113.          IFDEF    TC_HUGE
  114. LOAD_DS  =  1
  115.          ENDIF
  116.  
  117. COMMENT ^
  118.  
  119.    TSK_DYNAMIC    if TRUE, creating dynamic control blocks is allowed.
  120.                   This option should normally be disabled in embedded
  121.                   systems. Disabling the option will also save some
  122.                   code, and eliminate the (model dependent) references
  123.                   to the C memory allocation routines. This could be
  124.                   useful for TSR or spawning kernels, and if you don't
  125.                   use the dynamic allocation feature anyway.
  126.                   The tsksio module requires TSK_DYNAMIC to be set
  127.                   if on-line definition of new ports is desired.
  128.                   The default is TRUE.
  129.  
  130.       CAUTION:    Changing requires recompile of all sources.
  131.  
  132.    TSK_DYNLOAD    if FALSE, this instance of the kernel does not include
  133.                   dynamic allocation routines.
  134.                   Setting this flag to FALSE when TSK_DYNAMIC is TRUE
  135.                   only makes sense with multiple linked kernels. A resident
  136.                   kernel might not employ dynamic allocation, whereas a
  137.                   secondary kernel needs it. In this situation, TSK_DYNAMIC
  138.                   must be set in the primary so that the task kill code
  139.                   is included and the kernel configurations match, but 
  140.                   TSK_DYNLOAD may be false to prevent inclusion of the 
  141.                   malloc/free run-time routines.
  142.                   This option has no effect if TSK_DYNAMIC is FALSE.
  143.                   The default is TRUE.
  144.  
  145.       CAUTION:    Changing requires recompile of tskinst.c and tskgrp.c.
  146. */
  147.  
  148. #define  TSK_DYNAMIC       TRUE
  149. #define  TSK_DYNLOAD       TRUE    /*^
  150.  
  151.          TSK_DYNAMIC    =  TRUE
  152.          TSK_DYNLOAD    =  TRUE
  153.  
  154. COMMENT ^
  155.  
  156.    IBM            if TRUE, routines specific to the IBM family of PCs
  157.                   (and clones) are installed.
  158.                   The default is TRUE.
  159.  
  160.    DOS            if TRUE, routines specific to PC/MS-DOS are installed.
  161.                   The default is TRUE.
  162.  
  163.    NOTE:          If you disable IBM, you have to provide timer and keyboard
  164.                   hardware support yourself. Check the areas in "tskmain.c" 
  165.                   that are affected by this define.
  166.                   If you disable DOS, the resulting version can not be
  167.                   used under DOS without significant restrictions.
  168.                   The program can be tested, but DOS is not protected
  169.                   from multiple entrance, so that concurrent DOS calls
  170.                   will crash the system. You can use this configuration
  171.                   (IBM true, DOS false) to debug embedded applications
  172.                   which do not use DOS calls under DOS.
  173.  
  174.       CAUTION:    Changing requires recompile of all sources.
  175. */
  176.  
  177. #define  IBM               TRUE
  178. #define  DOS               TRUE     /*^
  179.  
  180.          IBM            =  TRUE 
  181.          DOS            =  TRUE 
  182.  
  183. COMMENT ^
  184.  
  185.    TSK_NAMEPAR    if TRUE, the create_xxx routines accept a name parameter.
  186.                   The default is TRUE.
  187.  
  188.    TSK_NAMED      if TRUE, control block names are processed.
  189.                   The default is TRUE.
  190.  
  191.                   TSK_NAMED may only be enabled (TRUE) if TSK_NAMEPAR is also 
  192.                   enabled. The TSK_NAMEPAR option is provided to allow
  193.                   compatible calling sequences. If TSK_NAMED is FALSE, and
  194.                   TSK_NAMEPAR is TRUE, the name parameter will be ignored.
  195.                   Using TSK_NAMED is highly reommended for DOS applications.
  196.  
  197.    GROUPS         if TRUE, multiple task groups are supported.
  198.                   For this option to work, TSK_NAMEPAR and TSK_NAMED must
  199.                   be enabled. Allowing task groups is strongly recommended
  200.                   for DOS applications (the standard version requires it), 
  201.                   embedded systems will usually not use task groups.
  202.                   The default is TRUE.
  203.  
  204.       CAUTION:    Changing requires recompile of all sources.
  205.  
  206.    If DOS is TRUE, TSK_NAMEPAR, TSK_NAMED, and GROUPS must also be TRUE.
  207. */
  208.  
  209. #define  TSK_NAMED         TRUE
  210. #define  TSK_NAMEPAR       TRUE
  211. #define  GROUPS            TRUE       /*^
  212.  
  213.          TSK_NAMED      =  TRUE
  214.          TSK_NAMEPAR    =  TRUE
  215.          GROUPS         =  TRUE 
  216.  
  217. COMMENT ^
  218.  
  219.  
  220.    CLOCK_MSEC     if TRUE, all timeouts are specified in milliseconds.
  221.                   The default is FALSE.
  222.  
  223.       CAUTION:    Changing requires recompile of all sources.
  224. */
  225.  
  226. #define  CLOCK_MSEC        FALSE    /*^
  227.  
  228.          CLOCK_MSEC     =  FALSE
  229.  
  230. COMMENT ^
  231.  
  232.    PRI_TIMER      Priority of the timer task. Normally higher than any
  233.                   other task in the system.
  234.                   The default is 0xf000.
  235.  
  236.    PRI_STD        standard priority of user tasks (arbitrary), for use
  237.                   in user programs.
  238.                   The default is 100.
  239.  
  240.    PRI_INT8       priority of the int8 task. Normally lower than or equal to
  241.                   user defined tasks, but may be adjusted to tune responses
  242.                   of TSR's. If there are busy waiting tasks in the system,
  243.                   the priority should be equal to or higher than that of the
  244.                   task that does the busy waiting.
  245.                   The default is PRI_STD.
  246.  
  247.       CAUTION:    Changing requires recompile of tskinst.c
  248. */
  249.  
  250. #define  PRI_TIMER         0xf000
  251. #define  PRI_STD           100
  252. #define  PRI_INT8          (PRI_STD)      /*^
  253.  
  254.          PRI_TIMER      =  0f000h
  255.          PRI_STD        =  100
  256.          PRI_INT8       =  PRI_STD
  257.  
  258. COMMENT ^
  259.  
  260.    AT_BIOS        if TRUE, the AT BIOS wait/post handler is installed.
  261.                   This can normally be left on even for XT type machines.
  262.                   However, some exotic clone BIOS versions have been
  263.                   reported to have problems with INT 15h compatibility, so 
  264.                   for complete portability, this option could be set FALSE.
  265.                   The same effect (although with slightly increased code)
  266.                   can be had by setting the IFL_INT15 flag on installation.
  267.                   The default is TRUE.
  268.  
  269.       CAUTION:    Changing requires recompile of tskinst.c
  270.  
  271.    INT8_EARLY     if TRUE, the timer interrupt always uses early INT8
  272.                   processing, regardless of the IFL_INT8_EARLY
  273.                   installation flag.
  274.                   Setting this flag saves some code and data,
  275.                   but eliminates some flexibility. Under DOS, timer
  276.                   ticks can be missed under certain circumstances when
  277.                   set, so DOS based configurations always should use FALSE.
  278.                   The installation flag has a slightly different effect,
  279.                   and may be used under DOS with no adverse effects.
  280.                   Embedded systems likely will always use TRUE.
  281.                   The default is FALSE (use installation flag).
  282.  
  283.    INT8_LATE      if TRUE, the timer interrupt always uses late INT8
  284.                   processing, regardless of the IFL_INT8_EARLY
  285.                   installation flag.
  286.                   Setting this flag saves some code, but eliminates 
  287.                   some flexibility.
  288.                   Embedded systems likely will always use FALSE.
  289.                   The default is FALSE (use installation flag).
  290.  
  291.       CAUTION:    Changing requires recompile of 
  292.                   tskmain.c, tskttsk.c, and tsktim.asm.
  293. */
  294.  
  295. #define  AT_BIOS           TRUE 
  296. #define  INT8_EARLY        FALSE
  297. #define  INT8_LATE         FALSE    /*^
  298.  
  299.          AT_BIOS        =  TRUE
  300.          INT8_EARLY     =  FALSE
  301.          INT8_LATE      =  FALSE
  302.  
  303. COMMENT ^
  304.  
  305.    SINGLE_DATA    if TRUE, only a single global data block is used.
  306.                   This speeds up processing, but prohibits linkage
  307.                   of multiple groups. Useful for dedicated systems,
  308.                   and also if your program is known to never interact
  309.                   with another copy of CTask. Should be left FALSE if you're
  310.                   not so sure, must be FALSE if GROUPS is enabled.
  311.                   The default is FALSE.
  312.  
  313.       CAUTION:    Changing requires recompile of all sources.
  314. */
  315.  
  316. #define  SINGLE_DATA       FALSE    /*^
  317.  
  318.          SINGLE_DATA    =  FALSE
  319.  
  320. COMMENT ^
  321.  
  322.    EMS            If TRUE, EMS support is included. For DOS applications
  323.                   using spawn or going TSR, this should always be TRUE,
  324.                   unless it is known that the program will never be
  325.                   executed in an EMS environment. It must also be TRUE
  326.                   for programs using EMS.
  327.                   The default is TRUE.
  328.  
  329.    EMS_SAVE_SIZE  Size of the EMS page info save area.
  330.                   For LIM 4.0 drivers, only four pages are saved, 
  331.                   so 16 bytes should be sufficient. If the partial
  332.                   page map function is not available in the driver,
  333.                   more space may be required for holding the full
  334.                   page map.
  335.                   The default is 16.
  336.  
  337.       CAUTION:    Changing requires recompile of all sources.
  338. */
  339.  
  340. #define  EMS               TRUE
  341. #define  EMS_SAVE_SIZE     16     /*^
  342.  
  343.          EMS            =  TRUE 
  344.          EMS_SAVE_SIZE  =  16
  345.  
  346. COMMENT ^
  347.  
  348.  
  349.    NDP            If TRUE, 80x87 support is included.
  350.                   The default is FALSE.
  351.  
  352.       CAUTION:    Changing requires recompile of all sources.
  353.  
  354. */
  355.  
  356. #define  NDP               FALSE    /*^
  357.  
  358.          NDP            =  FALSE
  359.  
  360. COMMENT ^
  361.  
  362.  
  363.    HOTKEYS        If TRUE, keyboard Hotkey support is included.
  364.                   The default is TRUE.
  365.  
  366.       CAUTION:    Changing requires recompile of all sources.
  367. */
  368.  
  369. #define  HOTKEYS           TRUE     /*^
  370.  
  371.          HOTKEYS        =  TRUE 
  372.  
  373. COMMENT ^
  374.  
  375.  
  376.    CHECKING       Enables pointer and stack checks when TRUE.
  377.                   The default is FALSE.
  378.  
  379.       CAUTION:    Changing requires recompile of all sources.
  380. */
  381.  
  382. #define  CHECKING          FALSE    /*^
  383.  
  384.          CHECKING       =  FALSE
  385.  
  386. COMMENT ^
  387. */
  388.  
  389. /* ----------------------------------------------------------------------- */
  390.  
  391. #if (CODE_SHARING && NEAR_CODE)
  392. #error Bad conf: Cant have near code with code sharing
  393. #endif
  394. #if (NEAR_CODE && LOCALS_FAR)
  395. #error Bad conf: Cant have near code and locals far
  396. #endif
  397. #if (TSK_NAMED && !TSK_NAMEPAR)
  398. #error Bad conf: Cant have names without name parameters
  399. #endif
  400. #if (GROUPS && !TSK_NAMEPAR)
  401. #error Bad conf: Cant have goups without names
  402. #endif
  403. #if (DOS && !GROUPS)
  404. #error Bad conf: DOS requires names and groups
  405. #endif
  406. #if (INT8_EARLY && INT8_LATE)
  407. #error Bad conf: INT8 cant be both early and late
  408. #endif
  409. #if (GROUPS && SINGLE_DATA)
  410. #error Bad conf: Groups require multiple data
  411. #endif
  412.  
  413. /*^
  414.         IF CODE_SHARING
  415.           IFNDEF LOAD_DS
  416.         %out Bad conf: Must have Load_ds with code sharing
  417.         .err
  418.           ENDIF
  419.         ENDIF
  420.         IF (CODE_SHARING AND NEAR_CODE)
  421.         %out Bad conf: Cant have near code with code sharing
  422.         .err
  423.         ENDIF
  424.         IF (NEAR_CODE AND LOCALS_FAR)
  425.         %out Bad conf: Cant have near code and locals far
  426.         .err
  427.         ENDIF
  428.         IF (TSK_NAMED AND NOT TSK_NAMEPAR)
  429.         %out Bad conf: Cant have names without name parameters
  430.         .err
  431.         ENDIF
  432.         IF (GROUPS AND NOT TSK_NAMEPAR)
  433.         %out Bad conf: Cant have goups without names
  434.         .err
  435.         ENDIF
  436.         IF (DOS AND NOT GROUPS)
  437.         %out Bad conf: DOS requires names and groups
  438.         .err
  439.         ENDIF
  440.         IF (INT8_EARLY AND INT8_LATE)
  441.         %out Bad conf: INT8 cant be both early and late
  442.         .err
  443.         ENDIF
  444.         IF (GROUPS AND SINGLE_DATA)
  445.         %out Bad conf: Groups require multiple data
  446.         .err
  447.         ENDIF
  448.  
  449. ; */
  450.  
  451.