From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::341; helo=mail-wm1-x341.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 15789211B81A2 for ; Wed, 16 Jan 2019 13:22:31 -0800 (PST) Received: by mail-wm1-x341.google.com with SMTP id f188so3575938wmf.5 for ; Wed, 16 Jan 2019 13:22:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=G7N5j6m5QWjSCvmOT+nhf+0fvV9t4sCwCr0ar+pxWxc=; b=QS0GiAli/A5uuKlsA+y2ElNEbk68IeWFxNhQD+80syONFZ4OuQEO66pdzTR20cr2iw oR9btvuXkGl34evuF0LiI6GuDluoe7o6ztNU05QcVyj4+w2mK5V7XSRX4mjzacPW9DOm DET87iMSy4oU/v4T8gGfH/6FoPagX2Jbjvr0Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=G7N5j6m5QWjSCvmOT+nhf+0fvV9t4sCwCr0ar+pxWxc=; b=UKFkw2gPko9+zIaKehqKT77beP9k7wpDd1qTIysXoteTS/6oTr+es+Z+KshchAHXLx lJ6inbKuhmQNfhz4Fwn8PtJM5ZbPY214/mx6FFTJKvAAf7Ry0iuImWp+xBx7YkNwh9ls 3svrwwzs7UHhqCF1VsAL8rIr782qDG6+0mUYISKJ/mHFD0RmluohuvPKZODmJI41S1oY qpIZUSZdSnp2T0jzGOOs6MaifHQ1IxFeZnvO8PDxHyk7DsEtC0LDpeh2krJKzzelWnWi TzGOltb+LhWnIWF6wsaA/1YDJTAY3fhxM6jWXIxIv1Hx4KeKbsxBFMFESk0/QxIxP1GF R4lA== X-Gm-Message-State: AJcUukfmU49xSB0wqVL3MgCUE8yqkkprdAzy5FYyq7Eg05AR1Nm8ubIQ 0ZMuRHEhkEAbWxxHGzLg9pU2OgbbvhK4Fg== X-Google-Smtp-Source: ALg8bN4dkw6RcnOnhHe5ZpOxyfuJ5GfMzZ9CAbCZn2tTm9w0Jmib19pirrRAwCl3lgmzfS9VN4jXEA== X-Received: by 2002:a1c:1d81:: with SMTP id d123mr8871093wmd.112.1547673749249; Wed, 16 Jan 2019 13:22:29 -0800 (PST) Received: from dogfood.home ([2a01:cb1d:112:6f00:28df:207d:542c:1451]) by smtp.gmail.com with ESMTPSA id l14sm162789095wrp.55.2019.01.16.13.22.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jan 2019 13:22:28 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Cc: Ard Biesheuvel , Michael D Kinney , Liming Gao , Ting Ye , Gang Wei , Jian Wang , Chao Zhang , Jiewen Yao , Hao Wu , Star Zeng , Achin Gupta , Jagadeesh Ujja Date: Wed, 16 Jan 2019 22:22:19 +0100 Message-Id: <20190116212221.7460-3-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190116212221.7460-1-ard.biesheuvel@linaro.org> References: <20190116212221.7460-1-ard.biesheuvel@linaro.org> Subject: [PATCH 2/4] SecurityPkg/PlatformSecureLibNull: permit use by MM_STANDALONE modules X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Jan 2019 21:22:31 -0000 Add MM_STANDALONE to the list of module types that are permitted to link to this library. Also, since the constructor prototype is different between MM_STANDALONE and DXE_DRIVER type libraries, convert the library into BASE type. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.c | 9 +++++---- SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.inf | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.c b/SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.c index 0c6ded22f3e6..b2493a029393 100644 --- a/SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.c +++ b/SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.c @@ -15,6 +15,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ +#include + BOOLEAN mUserPhysicalPresence = FALSE; /** @@ -53,15 +55,14 @@ UserPhysicalPresent ( @retval EFI_SUCCESS PcdUserPhysicalPresence is got successfully. **/ -EFI_STATUS +RETURN_STATUS EFIAPI PlatformSecureLibNullConstructor ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable + VOID ) { mUserPhysicalPresence = PcdGetBool(PcdUserPhysicalPresence); - return EFI_SUCCESS; + return RETURN_SUCCESS; } diff --git a/SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.inf b/SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.inf index 979a33705de0..70051a27a0a9 100644 --- a/SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.inf +++ b/SecurityPkg/Library/PlatformSecureLibNull/PlatformSecureLibNull.inf @@ -21,9 +21,9 @@ [Defines] BASE_NAME = PlatformSecureLibNull MODULE_UNI_FILE = PlatformSecureLibNull.uni FILE_GUID = 7FA68D82-10A4-4e71-9524-D3D9500D3CDF - MODULE_TYPE = DXE_DRIVER + MODULE_TYPE = BASE VERSION_STRING = 1.0 - LIBRARY_CLASS = PlatformSecureLib|DXE_RUNTIME_DRIVER DXE_SMM_DRIVER DXE_DRIVER + LIBRARY_CLASS = PlatformSecureLib|DXE_RUNTIME_DRIVER DXE_SMM_DRIVER DXE_DRIVER MM_STANDALONE CONSTRUCTOR = PlatformSecureLibNullConstructor # -- 2.17.1