> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs-staging.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# URM Platform AL

**Header:** `modula/Common/Include/UrmPlatformAL.h`

## Structures

### `SysResource`

Used to store information regarding Resources / Tunables which need to be Provisioned as part of the tuneResources API.

**Members**

<ParamField path="mResCode" type="uint32_t">
  A uniqued 32-bit (unsigned) identifier for the Resource.
</ParamField>

<ParamField path="mResInfo" type="int32_t">
  Holds Logical Core and Cluster Information:
</ParamField>

<ParamField path="mOptionalInfo" type="int32_t">
  Field to hold optional information for Request Processing.
</ParamField>

<ParamField path="mNumValues" type="int32_t">
  Number of values to be configured for the Resource, both single-valued and multi-valued Resources are supported.
</ParamField>

<ParamField path="value" type="int32_t">
  Use this field for single Valued Resources.
</ParamField>

<ParamField path="values" type="int32_t *">
  Use this field for Multi Valued Resources.
</ParamField>

<ParamField path="mResValue" type="union SysResource">
  The value to be Configured for this Resource Node.
</ParamField>

### `ResPair`

**Members**

<ParamField path="name" type="const char *" />

<ParamField path="code" type="uint32_t" />

## Functions

### `getResCodeFromString`

```cpp theme={null}
uint32_t getResCodeFromString(const char *strCode, int8_t *found)
```

## Enumerations

### `RequestPriority`

Requests can have 2 levels of Priorities, HIGH or LOW.

#### Values

| Name                          | Value | Description |
| ----------------------------- | ----- | ----------- |
| `REQ_PRIORITY_HIGH`           | = 0   |             |
| `REQ_PRIORITY_LOW`            |       |             |
| `NUMBER_OF_RQUEST_PRIORITIES` |       |             |

### `Modes`

Represents the operational modes based on the device's display state.

#### Values

| Name           | Value  | Description                                       |
| -------------- | ------ | ------------------------------------------------- |
| `MODE_RESUME`  | = 0x01 | Tuning allowed when the display is on.            |
| `MODE_SUSPEND` | = 0x02 | Tuning allowed when the display is off.           |
| `MODE_DOZE`    | = 0x04 | Tuning allowed during doze (low-power idle) mode. |

### `ResCodesDef`

#### Values

| Name            | Value | Description |
| --------------- | ----- | ----------- |
| `RES_CODE_LIST` |       |             |

### *(anonymous)*

#### Values

| Name                     | Value  | Description |
| ------------------------ | ------ | ----------- |
| `URM_SIG_CAT_TEST`       | = 0x01 |             |
| `URM_SIG_CAT_GENERIC`    | = 0x02 |             |
| `URM_SIG_CAT_MULTIMEDIA` | = 0x03 |             |
| `URM_SIG_CAT_GAMING`     | = 0x04 |             |
| `URM_SIG_CAT_BROWSER`    | = 0x05 |             |
| `URM_SIG_CAT_CUSTOM`     | = 0x80 |             |

### *(anonymous)*

#### Values

| Name                                  | Value        | Description |
| ------------------------------------- | ------------ | ----------- |
| `URM_SIG_APP_OPEN`                    | = 0x00020001 |             |
| `URM_SIG_BROWSER_APP_OPEN`            | = 0x00020002 |             |
| `URM_SIG_GAME_APP_OPEN`               | = 0x00020003 |             |
| `URM_SIG_MULTIMEDIA_APP_OPEN`         | = 0x00020004 |             |
| `URM_SIG_VIDEO_DECODE`                | = 0x00030001 |             |
| `URM_SIG_CAMERA_PREVIEW`              | = 0x00030002 |             |
| `URM_SIG_CAMERA_ENCODE`               | = 0x00030003 |             |
| `URM_SIG_CAMERA_ENCODE_MULTI_STREAMS` | = 0x00030004 |             |
| `URM_SIG_ENCODE_DECODE`               | = 0x00030005 |             |

## Macros

### `OPT_WITHMAX`

```c theme={null}
#define OPT_WITHMAX 0x00000001
```

### `OPT_WITHMIN`

```c theme={null}
#define OPT_WITHMIN 0x00000002
```

### `OPT_WITHREL`

```c theme={null}
#define OPT_WITHREL 0X00000004
```

### `SET_REQUEST_PRIORITY`

```c theme={null}
#define SET_REQUEST_PRIORITY ({                                          \
    int32_t retVal;                                                                           \
    if(properties < 0 || priority < 0 || priority >= NUMBER_OF_RQUEST_PRIORITIES) {           \
        retVal = -1;                                                                          \
    } else {                                                                                  \
        retVal = (int32_t) ((properties | priority));                                         \
    }                                                                                         \
    retVal;                                                                                   \
})                                                                                            \
```

### `ADD_ALLOWED_MODE`

```c theme={null}
#define ADD_ALLOWED_MODE ({                                                  \
    int32_t retVal;                                                                           \
    if(properties < 0 || mode < MODE_RESUME || mode > MODE_DOZE) {                            \
        retVal = -1;                                                                          \
    } else {                                                                                  \
        retVal = (int32_t) (properties | (((properties >> 8) | mode) << 8));                  \
    }                                                                                         \
    retVal;                                                                                   \
})                                                                                            \
```

### `EXTRACT_REQUEST_PRIORITY`

```c theme={null}
#define EXTRACT_REQUEST_PRIORITY ({                                                \
    (int8_t) ((properties) & ((1 << 8) - 1));                                                 \
})
```

### `EXTRACT_ALLOWED_MODES`

```c theme={null}
#define EXTRACT_ALLOWED_MODES ({                                                   \
    (int8_t) ((properties >> 8) & ((1 << 8) - 1));                                            \
})                                                                                            \
```

### `EXTRACT_RESOURCE_CORE_VALUE`

```c theme={null}
#define EXTRACT_RESOURCE_CORE_VALUE ({                                                \
    (int8_t) ((resInfo) & ((1 << 8) - 1));                                                    \
})                                                                                            \
```

### `EXTRACT_RESOURCE_CLUSTER_VALUE`

```c theme={null}
#define EXTRACT_RESOURCE_CLUSTER_VALUE ({                                             \
    (int8_t) ((resInfo >> 8) & ((1 << 8) - 1));                                               \
})                                                                                            \
```

### `EXTRACT_RESOURCE_MPAM_VALUE`

```c theme={null}
#define EXTRACT_RESOURCE_MPAM_VALUE ({                                                \
    (int8_t) ((resInfo >> 16) & ((1 << 8) - 1));                                              \
})                                                                                            \
```

### `SET_RESOURCE_CORE_VALUE`

```c theme={null}
#define SET_RESOURCE_CORE_VALUE ({                                          \
    (int32_t) ((resInfo ^ EXTRACT_RESOURCE_CORE_VALUE(resInfo)) | newValue);                  \
})                                                                                            \
```

### `SET_RESOURCE_CLUSTER_VALUE`

```c theme={null}
#define SET_RESOURCE_CLUSTER_VALUE ({                                       \
    (int32_t) ((resInfo ^ (EXTRACT_RESOURCE_CLUSTER_VALUE(resInfo) << 8)) | (newValue << 8)); \
})                                                                                            \
```

### `SET_RESOURCE_MPAM_VALUE`

```c theme={null}
#define SET_RESOURCE_MPAM_VALUE ({                                          \
    (int32_t) ((resInfo ^ (EXTRACT_RESOURCE_MPAM_VALUE(resInfo) << 16)) | (newValue << 16));  \
})                                                                                            \
```

### `GET_SIGNAL_ID`

```c theme={null}
#define GET_SIGNAL_ID ({                                                              \
    (uint32_t) ((uint64_t)sigCode >> 32);                                                     \
})                                                                                            \
```

### `GET_SIGNAL_TYPE`

```c theme={null}
#define GET_SIGNAL_TYPE ({                                                            \
    (uint32_t) (((uint64_t)sigCode) & 0xffffffff);                                            \
})                                                                                            \
```

### `CONSTRUCT_RES_CODE`

```c theme={null}
#define CONSTRUCT_RES_CODE ({                                               \
    uint32_t resourceBitmap = 0;                                                              \
    resourceBitmap |= ((uint32_t)resCode);                                                    \
    resourceBitmap |= ((uint32_t)resType << 16);                                              \
    resourceBitmap;                                                                           \
})                                                                                            \
```

### `CONSTRUCT_SIG_CODE`

```c theme={null}
#define CONSTRUCT_SIG_CODE ({                                                  \
    uint32_t signalBitmap = 0;                                                                \
    signalBitmap |= ((uint32_t)sigID);                                                        \
    signalBitmap |= ((uint32_t)sigCat << 16);                                                 \
    signalBitmap;                                                                             \
})                                                                                            \
```

### `CUSTOM`

```c theme={null}
#define CUSTOM ({                                                                     \
    uint32_t opBitmap = opCode;                                                               \
    opBitmap |= (1 << 31);                                                                    \
    opBitmap;                                                                                 \
})                                                                                            \
```

### `RES_CODE_LIST`

```c theme={null}
#define RES_CODE_LIST 
```

### `X`

```c theme={null}
#define X name = value,
```

### `X`

```c theme={null}
#define X {#name, (uint32_t)value,},
```

## Variables

### `resCodeMapping`

```cpp theme={null}
ResPair resCodeMapping
```
