qdosmsq:vectors:rchp

MM_RECHP/MEM_RCHP - Vector $C2

This vector deallocates memory on the common heap. It should only be called in supervisor mode. The vector is atomic. The memory being deallocated should have been allocated using MM_ALCHP/MEM_ACHP.

Call ParametersReturn Parameters
D1.LUnused. D1.LCorrupted.
D2.LUnused. D2.LCorrupted.
D3.LUnused. D3.LCorrupted.
A0.LAddress of area to deallocate. A0.LCorrupted.
A1.LUnused. A1.LCorrupted.
A2.LUnused. A2.LCorrupted.
A3.LUnused. A3.LCorrupted.
A6.LSystem variables address A6.LPreserved.

No errors are returned by this vector call.

  • All registers not shown above are not used on entry and are preserved on exit.
  • Must be called in supervisor mode only.
  • Mainly used in device driver 'close' routines to deallocate space used for channel definition blocks and so on.
  • This vector call is atomic.

The example below shows the use of this vector to deallocate a previously allocated chunk of memory. For the sake of the example, the start address of the area is assumed to be on the top of the stack.

Kill_hp move.w  MM_RECHP,A2     ; MM_RECHP vector address.
        movea.l (a7)+,a0        ; Unstack the start of the allocated area.
                                ; Assume A6 is correct already.
        jsr      (a2)           ; Make the call.
        ...                     ; Carry on here.
  • qdosmsq/vectors/rchp.txt
  • Last modified: 2008/06/27 20:29
  • by norman