1 #ifndef NVRAM_HELPER_H 2 #define NVRAM_HELPER_H 3 4 #include <IOKit/IOKitLib.h> 5 #include <CoreFoundation/CoreFoundation.h> 6 7 typedef enum{ 8 OP_SET = 0, 9 OP_GET, 10 OP_DEL, 11 OP_RES, 12 OP_OBL 13 } nvram_op; 14 15 #define SystemNVRAMGuidString "40A0DDD2-77F8-4392-B4A3-1E7304206516" 16 #define CommonNVRAMGuidString "7C436110-AB2A-4BBB-A880-FE41995C9F82" 17 #define RandomNVRAMGuidString "11112222-77F8-4392-B4A3-1E7304206516" 18 19 #define KernelOnlyVariablePrefix "krn." 20 21 #define DefaultSetVal "1234" 22 23 kern_return_t GetVariable(const char *name, io_registry_entry_t optionsRef); 24 kern_return_t SetVariable(const char *name, const char *value, io_registry_entry_t optionsRef); 25 kern_return_t DeleteVariable(const char *name, io_registry_entry_t optionsRef); 26 io_registry_entry_t CreateOptionsRef(void); 27 void ReleaseOptionsRef(io_registry_entry_t optionsRef); 28 void TestVarOp(nvram_op op, const char *var, const char *val, kern_return_t exp_ret, io_registry_entry_t optionsRef); 29 CFTypeID GetVarType(const char *name, io_registry_entry_t optionsRef); 30 #endif /* NVRAM_HELPER_H */ 31