+#if TARGET_OS_BRIDGE
+static kern_return_t LinkMacNVRAMSymbols()
+{
+ gDL_handle = dlopen("libMacEFIHostInterface.dylib", RTLD_LAZY);
+ if (gDL_handle == NULL) {
+ errx(errno, "Failed to dlopen libMacEFIHostInterface.dylib");
+ return KERN_FAILURE; /* NOTREACHED */
+ }
+
+ hostInterfaceInitialize_fptr = dlsym(gDL_handle, "hostInterfaceInitialize");
+ if (hostInterfaceInitialize_fptr == NULL) {
+ errx(errno, "failed to link hostInterfaceInitialize");
+ }
+ createNvramHostInterface_fptr = dlsym(gDL_handle, "createNvramHostInterface");
+ if (createNvramHostInterface_fptr == NULL) {
+ errx(errno, "failed to link createNvramHostInterface");
+ }
+ destroyNvramHostInterface_fptr = dlsym(gDL_handle, "destroyNvramHostInterface");
+ if (destroyNvramHostInterface_fptr == NULL) {
+ errx(errno, "failed to link destroyNvramHostInterface");
+ }
+ getNVRAMVariable_fptr = dlsym(gDL_handle, "getNVRAMVariable");
+ if (getNVRAMVariable_fptr == NULL) {
+ errx(errno, "failed to link getNVRAMVariable");
+ }
+ setNVRAMVariable_fptr = dlsym(gDL_handle, "setNVRAMVariable");
+ if (setNVRAMVariable_fptr == NULL) {
+ errx(errno, "failed to link setNVRAMVariable");
+ }
+ deleteNVRAMVariable_fptr = dlsym(gDL_handle, "deleteNVRAMVariable");
+ if (deleteNVRAMVariable_fptr == NULL) {
+ errx(errno, "failed to link deleteNVRAMVariable");
+ }
+ hostInterfaceDeinitialize_fptr = dlsym(gDL_handle, "hostInterfaceDeinitialize");
+ if (hostInterfaceDeinitialize_fptr == NULL) {
+ errx(errno, "failed to link hostInterfaceDeinitialize");
+ }
+
+ /* also do the initialization */
+ hostInterfaceInitialize_fptr();
+ gNvramInterface = createNvramHostInterface_fptr(NULL);
+
+ return KERN_SUCCESS;
+}
+#endif