]> git.proxmox.com Git - mirror_edk2.git/blob - Nt32Pkg/MiscSubClassPlatformDxe/MiscSystemManufacturerFunction.c
Remove ".intel_syntax", convert MASM to GAS.
[mirror_edk2.git] / Nt32Pkg / MiscSubClassPlatformDxe / MiscSystemManufacturerFunction.c
1 /**@file
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12 Module Name:
13
14 MiscSystemManufacturerFunction.c
15
16 Abstract:
17
18 This driver parses the mMiscSubclassDataTable structure and reports
19 any generated data to the DataHub.
20
21 **/
22
23 #include "MiscSubclassDriver.h"
24
25 BOOLEAN mDone = FALSE;
26
27 //
28 //
29 //
30 MISC_SUBCLASS_TABLE_FUNCTION (
31 MiscSystemManufacturer
32 )
33 /*++
34 Description:
35
36 This function makes boot time changes to the contents of the
37 MiscSystemManufacturer (Type 13).
38
39 Parameters:
40
41 RecordType
42 Type of record to be processed from the Data Table.
43 mMiscSubclassDataTable[].RecordType
44
45 RecordLen
46 Size of static RecordData from the Data Table.
47 mMiscSubclassDataTable[].RecordLen
48
49 RecordData
50 Pointer to copy of RecordData from the Data Table. Changes made
51 to this copy will be written to the Data Hub but will not alter
52 the contents of the static Data Table.
53
54 LogRecordData
55 Set *LogRecordData to TRUE to log RecordData to Data Hub.
56 Set *LogRecordData to FALSE when there is no more data to log.
57
58 Returns:
59
60 EFI_SUCCESS
61 All parameters were valid and *RecordData and *LogRecordData have
62 been set.
63
64 EFI_UNSUPPORTED
65 Unexpected RecordType value.
66
67 EFI_INVALID_PARAMETER
68 One of the following parameter conditions was true:
69 RecordLen was zero.
70 RecordData was NULL.
71 LogRecordData was NULL.
72 --*/
73 {
74 //
75 // First check for invalid parameters.
76 //
77 if (*RecordLen == 0 || RecordData == NULL || LogRecordData == NULL) {
78 return EFI_INVALID_PARAMETER;
79 }
80 //
81 // Then check for unsupported RecordType.
82 //
83 if (RecordType != EFI_MISC_SYSTEM_MANUFACTURER_RECORD_NUMBER) {
84 return EFI_UNSUPPORTED;
85 }
86 //
87 // Is this the first time through this function?
88 //
89 if (!mDone) {
90 //
91 // Yes, this is the first time. Inspect/Change the contents of the
92 // RecordData structure.
93 //
94 //
95 // Set system GUID.
96 //
97 // ((EFI_MISC_SYSTEM_MANUFACTURER_DATA *)RecordData)->SystemUuid = %%TBD
98 //
99 // Set power-on type.
100 //
101 // ((EFI_MISC_SYSTEM_MANUFACTURER_DATA *)RecordData)->SystemWakeupType = %%TBD
102 //
103 // Set mDone flag to TRUE for next pass through this function.
104 // Set *LogRecordData to TRUE so data will get logged to Data Hub.
105 //
106 mDone = TRUE;
107 *LogRecordData = TRUE;
108 } else {
109 //
110 // No, this is the second time. Reset the state of the mDone flag
111 // to FALSE and tell the data logger that there is no more data
112 // to be logged for this record type. If any memory allocations
113 // were made by earlier passes, they must be released now.
114 //
115 mDone = FALSE;
116 *LogRecordData = FALSE;
117 }
118
119 return EFI_SUCCESS;
120 }
121
122 /* eof - MiscSystemManufacturerFunction.c */