# MI_CancelWram*

## Syntax

  `#include <twl/mi.h>`
  `void MI_CancelWram( MIWramPos wram, MIWramProc proc )`
  `void MI_CancelWramSlot( MIWramPos wram, int slot, MIWramSize size, MIWramProc proc )`
  `(#define)
  #define MI_CancelWram_A( proc )
  #define MI_CancelWram_B( proc )
  #define MI_CancelWram_C( proc )
  #define MI_CancelWramSlot_A( slot, size, proc )
  #define MI_CancelWramSlot_B( slot, size, proc )
  #define MI_CancelWramSlot_C( slot, size, proc )`

## Arguments

wram | WRAM to cancel the reservation for.
slot | Starting WRAM number of the region to cancel the reservation for.
size | Size of the region to cancel the reservation for.
proc | Processor to cancel the reservation for.

## Return Values

The number of WRAM slots for which reservations were cancelled. A value of 0 indicates that no reservations were cancelled. A value of -1 indicates a failure.

## Description

Cancels the reservation of the specified WRAM for a given processor.

It cancels a reservation for a region of WRAM that has been reserved with a `MI_ReserveWram*` function. It cancels all reservations in the specified WRAM for the specified processor. It cancels reservations even if that region is in use. Even if a reservation is cancelled, the master processor for the given region does not change, and its content is not lost.

The wram argument indicates the target WRAM. This is of type `MIWramPos` and is `MI_WRAM_A`, `MI_WRAM_B`, or `MI_WRAM_C`.

The slot argument is the starting slot number for the region reservations are being cancelled for.

The size argument is the size of the region to cancel the reservation for.

The proc argument indicates which processor's reservations should be cancelled. This is of type `MIWramProc` and is `MI_WRAM_ARM9`, `MI_WRAM_ARM7`, or `MI_WRAM_DSP`.

`MI_CancelWram_A` is the #define directive of `MI_CancelWram( MI_WRAM_A, ... )`.
`MI_CancelWram_B` is the #define directive of `MI_CancelWram( MI_WRAM_B, ... )`.
`MI_CancelWram_C` is the #define directive of `MI_CancelWram( MI_WRAM_C, ... )`.
`MI_CancelWramSlot_A` is the #define directive of `MI_CancelWramSlot( MI_WRAM_A, ... )`.
`MI_CancelWramSlot_B` is the #define directive of `MI_CancelWramSlot( MI_WRAM_B, ... )`.
`MI_CancelWramSlot_C` is the #define directive of `MI_CancelWramSlot( MI_WRAM_C, ... )`.

The `MI_CancelWram` function frees all regions reserved for the specified processor in the specified WRAM.

The `MI_CancelWramSlot` function specifies a region within the specified WRAM by its slot and size, and frees all regions contained therein that are reserved for the specified processor.

Example: Here, we cancel all reservations for the DSP in WRAM-C.
`MI_CancelWram( MI_WRAM_C, MI_WRAM_DSP );`
OR
`MI_CancelWram_C( MI_WRAM_DSP );`

Example: Here, we cancel all reservations for the DSP in the 96 KB area of WRAM-C that starts with slot 2.
`MI_CancelWramSlot( MI_WRAM_C, 2, MI_WRAM_SIZE_96KB, MI_WRAM_DSP );`
OR
`MI_CancelWramSlot_C( 2, MI_WRAM_SIZE_96KB, MI_WRAM_DSP );`

## See Also

Overview: Work RAM
MI-Related Constants

## Revision History

2007/08/20 Initial version.

CONFIDENTIAL