1 // This file was extracted from the TCG Published
2 // Trusted Platform Module Library
3 // Part 3: Commands
4 // Family "2.0"
5 // Level 00 Revision 01.16
6 // October 30, 2014
7 
8 #include "InternalRoutines.h"
9 #include "NV_GlobalWriteLock_fp.h"
10 TPM_RC
TPM2_NV_GlobalWriteLock(NV_GlobalWriteLock_In * in)11 TPM2_NV_GlobalWriteLock(
12    NV_GlobalWriteLock_In       *in             // IN: input parameter list
13    )
14 {
15    TPM_RC           result;
16 
17    // Input parameter is not reference in command action
18    in = NULL; // to silence compiler warnings.
19 
20    // The command needs NV update. Check if NV is available.
21    // A TPM_RC_NV_UNAVAILABLE or TPM_RC_NV_RATE error may be returned at
22    // this point
23    result = NvIsAvailable();
24    if(result != TPM_RC_SUCCESS)
25        return result;
26 
27 // Internal Data Update
28 
29    // Implementation dependent method of setting the global lock
30    NvSetGlobalLock();
31 
32    return TPM_RC_SUCCESS;
33 }
34