home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD v1.2 / amidev_cd_12.iso / inc&ad2.0 / includes / exec / memory.i < prev    next >
Text File  |  1992-09-01  |  3KB  |  98 lines

  1.     IFND    EXEC_MEMORY_I
  2. EXEC_MEMORY_I    SET    1
  3. **
  4. **    $Filename: exec/memory.i $
  5. **    $Release: 2.04 Includes, V37.4 $
  6. **    $Revision: 36.11 $
  7. **    $Date: 91/03/15 $
  8. **
  9. **    Definitions and structures used by the memory allocation system
  10. **
  11. **    (C) Copyright 1985-1991 Commodore-Amiga, Inc.
  12. **        All Rights Reserved
  13. **
  14.  
  15.     IFND EXEC_NODES_I
  16.     INCLUDE "exec/nodes.i"
  17.     ENDC    ; EXEC_NODES_I
  18.  
  19.  
  20. *---------------------------------------------------------------------
  21. *
  22. *   Memory List Structures
  23. *
  24. *---------------------------------------------------------------------
  25. *
  26. *   A memory list appears in two forms:  One is a requirements list
  27. *   the other is a list of already allocated memory.  The format is
  28. *   the same, with the reqirements/address field occupying the same
  29. *   position.
  30. *
  31. *   The format is a linked list of ML structures each of which has
  32. *   an array of ME entries.
  33. *
  34. *---------------------------------------------------------------------
  35.  
  36.  STRUCTURE ML,LN_SIZE
  37.     UWORD   ML_NUMENTRIES        ; The number of ME structures that follow
  38.     LABEL   ML_ME            ; where the ME structures begin
  39.     LABEL   ML_SIZE    ;Note: does NOT include any "ME" structures.
  40.  
  41.  
  42.  STRUCTURE ME,0
  43.     LABEL   ME_REQS            ; the AllocMem requirements
  44.     APTR    ME_ADDR            ; the address of this block (an alias
  45.                     ;    for the same location as ME_REQS)
  46.     ULONG   ME_LENGTH            ; the length of this region
  47.     LABEL   ME_SIZE
  48.  
  49.  
  50. *------ memory options:
  51. *------ see the AllocMem() documentation for details------*
  52.  
  53. MEMF_ANY    EQU 0        ;Any type of memory will do
  54.     BITDEF  MEM,PUBLIC,0
  55.     BITDEF  MEM,CHIP,1
  56.     BITDEF  MEM,FAST,2
  57.     BITDEF  MEM,LOCAL,8        ;Memory that does not go away at RESET
  58.     BITDEF  MEM,24BITDMA,9    ;DMAable memory within 24 bits of address
  59.  
  60.     BITDEF  MEM,CLEAR,16    ;AllocMem: NULL out area before return
  61.     BITDEF  MEM,LARGEST,17    ;AvailMem: return the largest chunk size
  62.     BITDEF  MEM,REVERSE,18    ;AllocMem: allocate from the top down
  63.     BITDEF  MEM,TOTAL,19    ;AvailMem: return total size of memory
  64.  
  65.  
  66. *----- Current alignment rules for memory blocks (may increase) -----
  67. MEM_BLOCKSIZE    EQU 8
  68. MEM_BLOCKMASK    EQU (MEM_BLOCKSIZE-1)
  69.  
  70.  
  71. *---------------------------------------------------------------------
  72. *
  73. *   Memory Region Header
  74. *
  75. *---------------------------------------------------------------------
  76.  
  77.  STRUCTURE  MH,LN_SIZE            ; (LN_TYPE will be set to NT_MEMORY)
  78.     UWORD   MH_ATTRIBUTES        ; characteristics of this region
  79.     APTR    MH_FIRST            ; first free region
  80.     APTR    MH_LOWER            ; lower memory bound
  81.     APTR    MH_UPPER            ; upper memory bound+1
  82.     ULONG   MH_FREE            ; number of free bytes
  83.     LABEL   MH_SIZE
  84.  
  85.  
  86. *---------------------------------------------------------------------
  87. *
  88. *   Memory Chunk
  89. *
  90. *---------------------------------------------------------------------
  91.  
  92.  STRUCTURE  MC,0
  93.     APTR    MC_NEXT            ; ptr to next chunk
  94.     ULONG   MC_BYTES            ; chunk byte size
  95.     APTR    MC_SIZE
  96.  
  97.     ENDC    ; EXEC_MEMORY_I
  98.