home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / DC-POS24.LZX / pOS / Guide.lzx / Guide / pExec / Memory.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-03-11  |  5.0 KB  |  146 lines

  1. @DATABASE "pExec/Memory.h"
  2. @MASTER   "Work2:AD/IInc/pExec/Memory.h"
  3. @REMARK   This file was created by ADtoHT 2.0 on 11-Mär-97  13:34:27
  4. @REMARK   Do not edit
  5. @REMARK   ADtoHT is © 1993-1995 Christian Stieber
  6.  
  7. @NODE MAIN "pExec/Memory.h"
  8. @TOC "__pOS_Dev.guide/MAIN"
  9.  
  10. @{"pExec/Memory.h" LINK File}
  11.  
  12.  
  13. @{b}Structures@{ub}
  14.  
  15. @{"pOS_MemChunk" LINK "pExec/Memory.h/File" 18}  @{"pOS_MemEntry" LINK "pExec/Memory.h/File" 44}  @{"pOS_MemHeader" LINK "pExec/Memory.h/File" 28}  @{"pOS_MemList" LINK "pExec/Memory.h/File" 62}  @{"pOS_MemPool" LINK "pExec/Memory.h/File" 74}
  16.  
  17. @ENDNODE
  18. @NODE File "pExec/Memory.h"
  19. #ifndef __INC_POS_PEXEC_MEMORY_H
  20. #define __INC_POS_PEXEC_MEMORY_H
  21. /*******************************************************************
  22.  Includes Release 24
  23.  (C) Copyright 1995-1997 proDAD
  24.      All Rights Reserved
  25.  
  26.  $AUT Holger Burkarth
  27.  $DAT >>Memory.h<<   09 Jan 1997    09:25:25 - (C) ProDAD
  28. *******************************************************************/
  29. #ifndef __INC_POS_PEXEC_LIST_H
  30. #include <@{"pExec/List.h" LINK "pExec/List.h/File"}>
  31. #endif
  32.  
  33.  
  34. /*----------------------------------
  35. -----------------------------------*/
  36. struct pOS_MemChunk
  37. {
  38.   struct pOS_MemChunk *mc_Next;  /* pointer to next chunk */
  39.   @{"size_t" LINK "pExec/Types.h/File" 113}               mc_Bytes;  /* chunk byte size */
  40. };
  41.  
  42.  
  43.  
  44. /*----------------------------------
  45. -----------------------------------*/
  46. struct pOS_MemHeader
  47. {
  48.   @{"struct pOS_ExNode" LINK "pExec/List.h/File" 37}    mh_Node;
  49.   @{"UWORD" LINK "pExec/Types.h/File" 93}                mh_Attributes;      /* characteristics of this region */
  50.   @{"struct pOS_MemChunk" LINK File 18} *mh_First;          /* first free region            */
  51.   @{"APTR" LINK "pExec/Types.h/File" 87}                 mh_Lower;           /* lower memory bound           */
  52.   @{"APTR" LINK "pExec/Types.h/File" 87}                 mh_Upper;           /* upper memory bound+1 */
  53.   @{"size_t" LINK "pExec/Types.h/File" 113}               mh_Free;            /* total number of free bytes   */
  54.  
  55.   @{"UBYTE" LINK "pExec/Types.h/File" 95} mh_Reserved[16];
  56. };
  57.  
  58.  
  59.  
  60. /*----------------------------------
  61. -----------------------------------*/
  62. struct pOS_MemEntry
  63. {
  64.   union
  65.     @{"ULONG" LINK "pExec/Types.h/File" 91}   meu_Reqs;   /* the AllocMem requirements */
  66.     @{"APTR" LINK "pExec/Types.h/File" 87}    meu_Addr;   /* the address of this memory region */
  67.   } me_Un;
  68.   @{"size_t" LINK "pExec/Types.h/File" 113}   me_Length;   /* the length of this memory region */
  69.  
  70. #define me_Addr  me_Un.meu_Addr
  71. #define me_Reqs  me_Un.meu_Reqs
  72. };
  73.  
  74.  
  75.  
  76.  
  77. /* Note: sizeof(struct MemList) includes the size of the first MemEntry! */
  78. /*----------------------------------
  79. -----------------------------------*/
  80. struct pOS_MemList
  81. {
  82.   @{"struct pOS_ExNode" LINK "pExec/List.h/File" 37}   ml_Node;
  83.   @{"UWORD" LINK "pExec/Types.h/File" 93}               ml_NumEntries;  /* number of entries in this struct */
  84.   @{"struct pOS_MemEntry" LINK "pExec/Memory.h/File" 44} ml_ME[1];       /* the first entry      */
  85. };
  86.  
  87.  
  88.  
  89.  
  90. /*----------------------------------
  91. -----------------------------------*/
  92. struct pOS_MemPool
  93. {
  94.   @{"struct pOS_ExList" LINK "pExec/List.h/File" 50} mpl_List;      /* Liste der pOS_MemHeaders */
  95.   @{"size_t" LINK "pExec/Types.h/File" 113}            mpl_SegmSize;  /* standard-size eines Segmentes */
  96.   @{"ULONG" LINK "pExec/Types.h/File" 91}             mpl_SegmFlags; /* Alloc-Flags (enum pOS_MemoryFlag) */
  97.  
  98.   @{"__ARID__" LINK "pExec/Types.h/File" 155} @{"struct pOS_MemHeader" LINK File 28}* (*mpl_Alloc)(@{"_R_LB" LINK "pExec/Types.h/File" 35} struct pOS_ExecBase*,_R_A0 struct pOS_MemPool*,_R_D0 size_t);
  99.   @{"VOID" LINK "pExec/Types.h/File" 83}                           (*mpl_Free)(@{"_R_LB" LINK "pExec/Types.h/File" 35} struct pOS_ExecBase*,_R_A0 struct pOS_MemPool*,_R_A1 __ARID__ struct pOS_MemHeader*);
  100.  
  101.   @{"UBYTE" LINK "pExec/Types.h/File" 95}      mpl_Reserved[16];
  102. };
  103.  
  104.  
  105.  
  106.  
  107.  
  108. enum pOS_MemoryFlag
  109. {
  110.   MEMF_ANY     =0x00,       /* Any type of memory will do */
  111.   MEMF_PUBLIC  =0x01,
  112.  
  113.   MEMF_LOCAL   =0x0100,     /* Memory that does not go away at RESET */
  114.   MEMF_VMEM    =0x0200,     /* Virtual-Memory-Manager may be swap memoryblock */
  115.  
  116.   MEMF_CLEAR   =0x010000,   /* @{"pOS_AllocMem" LINK "pExecD/pOS_AllocMem"}: @{"NULL" LINK "pExec/Types.h/File" 117} out area before return */
  117.   MEMF_LARGEST =0x020000,   /* @{"pOS_AvailMem" LINK "pExecD/pOS_AvailMem"}: return the largest chunk size */
  118.   MEMF_REVERSE =0x040000,   /* @{"pOS_AllocMem" LINK "pExecD/pOS_AllocMem"}: allocate from the top down */
  119.   MEMF_TOTAL   =0x080000,   /* @{"pOS_AvailMem" LINK "pExecD/pOS_AvailMem"}: return total size of memory */
  120.  
  121.   MEMF_NO_EXPUNGE =0x80000000, /* @{"pOS_AllocMem" LINK "pExecD/pOS_AllocMem"}: Do not cause expunge on failure */
  122.  
  123. /*----- Current alignment rules for memory blocks (may increase) -----*/
  124.   MEM_BLOCKSIZE  = 8,
  125.   MEM_BLOCKMASK  = (MEM_BLOCKSIZE-1),
  126.  
  127.  
  128.   MEMF_CHIP=   0x02,
  129.   MEMF_FAST=   0x04,
  130. };
  131.  
  132.  
  133. /** pOS_TypeOfMem(,,enum pOS_TypeOfMemoryMode) **/
  134. enum pOS_TypeOfMemoryMode
  135. {
  136.   TOMEMMD_Physics =0, /* Result: MEMF_FAST or MEMF_CHIP, @{"NULL" LINK "pExec/Types.h/File" 117} => error (wrong address) */
  137. };
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144. #endif
  145. @ENDNODE
  146.