summaryrefslogtreecommitdiffstats
path: root/DynamicTablesPkg/Library/Common/DynamicPlatRepoLib/TokenGenerator.c
blob: 7033b5f1b5dd83968b1f532d91cf0603c3d04d1b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/** @file
  Token Generator

  Copyright (c) 2021, Arm Limited. All rights reserved.<BR>

  SPDX-License-Identifier: BSD-2-Clause-Patent

  @par Glossary:
    - Cm or CM   - Configuration Manager
    - Obj or OBJ - Object
**/

#include <Protocol/ConfigurationManagerProtocol.h>

/** Generate a token.

  @return A token.
**/
CM_OBJECT_TOKEN
EFIAPI
GenerateToken (
  VOID
  )
{
  // Start Tokens at 1 to avoid collisions with CM_NULL_TOKEN.
  STATIC UINTN  CurrentToken = 1;

  return (CM_OBJECT_TOKEN)(CurrentToken++);
}