# OS_GetProtectionRegion*

## C Specification

      #include <nitro/os.h>

      OS_GetProtectionRegionParam( regionNo );
      OS_GetProtectionRegionAddress( regionNo );
      OS_GetProtectionRegionSize( regionNo );
      (These functions are macros)

## Arguments

None.

regionNo | The Protection Region number. Specify a value between 0 and 7.

## Return Values

All return values are type `u32`. The values provide information about the specified Protection Region.

## Description

Gets the settings relating to the Protection Region's base address and size

The Protection Region's settings are closely related to system behavior. When making these settings, be sure you understand the design of the Protection Region and how each area is utilized.

`OS_GetProtectionRegionParam()` returns the raw values obtained from CP15, which provide information about the base address and area size of the Protection Region specified by `regionNo`.

`OS_GetProtectionRegionAddress()` returns the base address of the Protection Region specified by `regionNo`.

`OS_GetProtectionRegionSize()` returns area size information for the Protection Region specified by `regionNo`. Area size information is a value defined as HW_C6_PR_xxx, where xxx indicates the size. The following sizes can be returned:

> 4KB 8KB 16KB 32KB 64KB 128KB 256KB 512KB
> 1MB 2MB 4MB 8MB 16MB 32MB 64MB 128MB 256MB 512MB
> 1GB 2GB 4GB

These are macro functions. For `regionNo` specify a value between 0 and 7. The character string itself is used as the argument, so you cannot use the value to specify a variable. You should specify a number between 0 and 7.

## Internal Operation

The function itself is a macro, but it ultimately operates register 6 of the CP15 system control co-processor.

## See Also

`OS_EnableProtectionUnit`, `OS_DisableProtectionUnit`, `OS_SetProtectionRegion*`

## Revision History

05/28/2004 Initial Version