| Samsung Internal API reference 2.0

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

Macros | Enumerations | Functions
Integrity Report System API
Samsung Internal API

## Macros
#define | IRS_FAIL_TZ -1
#define | IRS_UNKNOWN_ID_TZ -2
#define | IRS_UNKNOWN_INT_CMD_TZ -3
#define | IRS_INCORRECT_FLAG_TYPE_TZ -4
#define | IRS_RT_FLAGS_EMPTY_TZ -5
#define | IRS_RT_FLAGS_FULL_TZ -6
#define | IRS_INCORRECT_RT_ID_TZ -7
#define | IRS_DENY_READ_FROM_SMC_TZ -8
#define | IRS_DENY_WRITE_FROM_SMC_TZ -9
#define | IRS_DENY_DELETE_FROM_SMC_TZ -10
#define | IRS_MAX_VAL_COUNTER_TZ -11
#define | IRS_MAX_VAL_COUNTER_RT_TZ -12
#define | IRS_INCORRECT_CHECKSUM_TZ -13
#define | IRS_UNKNOWN_ERROR_TZ -14
#define | IRS_SUCCESS_TZ 0

## Enumerations
enum | IRS_INTERNAL_CMD { IRS_SET_FLAG_CMD = 1, IRS_SET_FLAG_VALUE_CMD, IRS_INC_FLAG_CMD, IRS_GET_FLAG_VALUE_CMD, IRS_ADD_FLAG_CMD, IRS_DEL_FLAG_CMD }
| Internal IRS commands ids. More...
enum | IRS_PARAM { IRS_TYPE_BOOLEAN = 0x00000001, IRS_TYPE_VALUE = 0x00000002, IRS_TYPE_COUNTER = 0x00000004, IRS_NWD_RD = 0x00000008, IRS_NWD_WR = 0x00000010, IRS_NWD_CTRL = 0x00000020, IRS_SWD_RD = 0x00000040, IRS_SWD_WR = 0x00000080, IRS_SWD_CTRL = 0x00000100 }
| Bit position of params. More...

## Functions
int | TEES_SetIrsFlag (unsigned int *flag_id)
| Set flag by `flag_id` in 1. Used only for boolean flag type. More...
int | TEES_SetIrsFlagValue (unsigned int *flag_id, unsigned int value)
| Set flag by `flag_id` in value by value. More...
int | TEES_IncIrsFlag (unsigned int *flag_id)
| Increment flag by `flag_id` in 1. Used only for IRS_TYPE_VALUE flag type. More...
int | TEES_GetIrsFlagValue (unsigned int *flag_id, unsigned int *value)
| Get value by `flag_id`. More...
int | TEES_AddIrsFlag (unsigned int *flag_id, unsigned int param)
| Function for control run-time flags. More...
int | TEES_DelIrsFlag (unsigned int *flag_id)
| Delete run-time flag by `flag_id`. More...

## Detailed Description

## Macro Definition Documentation

#define IRS_DENY_DELETE_FROM_SMC_TZ -10

`#include <irs.h>`

Deny deleting access flag from SWd.

#define IRS_DENY_READ_FROM_SMC_TZ -8

`#include <irs.h>`

Deny reading access from flag from SWd.

#define IRS_DENY_WRITE_FROM_SMC_TZ -9

`#include <irs.h>`

Deny writing access to flag from SWd.

#define IRS_FAIL_TZ -1

`#include <irs.h>`

Generic error.

#define IRS_INCORRECT_CHECKSUM_TZ -13

`#include <irs.h>`

Flag was changed outside.

#define IRS_INCORRECT_FLAG_TYPE_TZ -4

`#include <irs.h>`

Incorrect flag type (can be boolean, value or counter).

#define IRS_INCORRECT_RT_ID_TZ -7

`#include <irs.h>`

Incorrect id of run-time flag.

#define IRS_MAX_VAL_COUNTER_RT_TZ -12

`#include <irs.h>`

COUNTER run-time flag got MAX value.

#define IRS_MAX_VAL_COUNTER_TZ -11

`#include <irs.h>`

COUNTER flag got MAX value.

#define IRS_RT_FLAGS_EMPTY_TZ -5

`#include <irs.h>`

Run-time flags are empty.

#define IRS_RT_FLAGS_FULL_TZ -6

`#include <irs.h>`

Run-time flags are full.

#define IRS_SUCCESS_TZ 0

`#include <irs.h>`

Success result.

#define IRS_UNKNOWN_ERROR_TZ -14

`#include <irs.h>`

Unknown error.

#define IRS_UNKNOWN_ID_TZ -2

`#include <irs.h>`

Unknown flag id.

#define IRS_UNKNOWN_INT_CMD_TZ -3

`#include <irs.h>`

Unknown internal command.

## Enumeration Type Documentation

enum IRS_INTERNAL_CMD

`#include <irs.h>`

Internal IRS commands ids.

Enumerator
IRS_SET_FLAG_CMD | Internal command setFlag.
IRS_SET_FLAG_VALUE_CMD | Internal command setFlagValue.
IRS_INC_FLAG_CMD | Internal command incFlag.
IRS_GET_FLAG_VALUE_CMD | Internal command getFlagValue.
IRS_ADD_FLAG_CMD | Internal command addFlag.
IRS_DEL_FLAG_CMD | Internal command delFlag.

enum IRS_PARAM

`#include <irs.h>`

Bit position of params.

Enumerator
IRS_TYPE_BOOLEAN | Boolean type.
IRS_TYPE_VALUE | Value type.
IRS_TYPE_COUNTER | Counter type.
IRS_NWD_RD | Read from NWd.
IRS_NWD_WR | Write to NWd.
IRS_NWD_CTRL | Control NWd.
IRS_SWD_RD | Read from SWd.
IRS_SWD_WR | WRite to SWd.
IRS_SWD_CTRL | Control SWd.

## Function Documentation

int TEES_AddIrsFlag | ( | unsigned int * | flag_id,
|  | unsigned int | param
| ) |  |

`#include <irs.h>`

Function for control run-time flags.

Add new run-time flag to rt_irs_flags and fill params by incoming param. Increment of rt_flags_num(current numbers of run-time flags).

Parameters

  [out] | flag_id | return a pointer to new run-time flag identifier.
  [in] | param | 32 bits with data (using enum IRS_PARAM).

Return values

  0 | no error.
  IRS_error | code on failure.

int TEES_DelIrsFlag | ( | unsigned int * | flag_id | ) |

`#include <irs.h>`

Delete run-time flag by `flag_id`.

Parameters

  [in] | flag_id | Pointer to flag identifier.

Return values

  0 | no error.
  IRS_error | code on failure.

int TEES_GetIrsFlagValue | ( | unsigned int * | flag_id,
|  | unsigned int * | value
| ) |  |

`#include <irs.h>`

Get value by `flag_id`.

Get value of flag by `flag_id`. Used only for IRS_TYPE_COUNTER flag type.

Parameters

  [in] | flag_id | Pointer to flag identifier.
  [out] | value | Pointer to output value.

Return values

  0 | no error.
  IRS_error | code on failure.

int TEES_IncIrsFlag | ( | unsigned int * | flag_id | ) |

`#include <irs.h>`

Increment flag by `flag_id` in 1. Used only for IRS_TYPE_VALUE flag type.

Parameters

  [in] | flag_id | Pointer to flag identifier.

Return values

  0 | no error.
  IRS_error | code on failure.

int TEES_SetIrsFlag | ( | unsigned int * | flag_id | ) |

`#include <irs.h>`

Set flag by `flag_id` in 1. Used only for boolean flag type.

Parameters

  [in] | flag_id | Pointer to flag identifier.

Return values

  0 | no error.
  IRS_error | code on failure.

int TEES_SetIrsFlagValue | ( | unsigned int * | flag_id,
|  | unsigned int | value
| ) |  |

`#include <irs.h>`

Set flag by `flag_id` in value by value.

Parameters

  [in] | flag_id | Pointer to flag identifier. Used only for IRS_TYPE_BOOLEAN flag type.
  [in] | value | inputed value.

Return values

  0 | no error.
  IRS_error | code on failure.