Check in the Pcd service Driver/PEIM according to the new way of generating PCD Database
[mirror_edk2.git] / EdkModulePkg / Universal / PCD / Test / PcdTest.c
1 /** @file
2 PCD TEST PEIM
3
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13
14 Module Name: PcdTest.c
15
16 **/
17 #define GUID1 \
18 {0xF9349C58, 0xB767, 0x42c8, 0xB3, 0x6B, 0x41, 0x25, 0xDE, 0x3A, 0xEF, 0xEB}
19
20 CONST GUID Guid1 = GUID1;
21
22
23 EFI_STATUS
24 EFIAPI
25 OnsetCallback1 (
26 IN UINT32 CallBackToken,
27 IN VOID *TokenData,
28 IN UINTN TokenDataSize
29 )
30 {
31 DebugPrint (0x80000000, "In CallbackOnSet %x %d\n", * ((UINT32 *)TokenData), TokenDataSize);
32 return EFI_SUCCESS;
33 }
34
35
36 VOID
37 DoTest(
38 VOID
39 )
40 {
41 UINT8 u8;
42 UINT16 u16;
43 UINT32 u32;
44 UINT64 u64;
45
46 u32 = 0xafafafaf;
47 PcdSet32(PcdTestDynamicUint32, u32);
48
49 u64 = 0xafafafaf00000000;
50 PcdSet64(PcdTestDynamicUint64, u64);
51
52 u8 = PcdGet8(PcdTestDynamicUint8);
53 u16 = PcdGet16(PcdTestDynamicUint16);
54
55
56 ASSERT (u8 == 0x01);
57 ASSERT (u16 == 0x1234);
58 ASSERT (u64 == PcdGet64(PcdTestDynamicUint64));
59 ASSERT (u32 == PcdGet32(PcdTestDynamicUint32));
60
61 return;
62 }
63
64 EFI_STATUS
65 EFIAPI
66 PcdTestPeimInit (
67 IN EFI_FFS_FILE_HEADER *FfsHeader,
68 IN EFI_PEI_SERVICES **PeiServices
69 )
70 {
71
72 DoTest();
73
74 return EFI_SUCCESS;
75 }
76