From owner-svn-src-stable@freebsd.org Thu Mar 15 20:46:35 2018 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4155AF52261; Thu, 15 Mar 2018 20:46:35 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E88A077A60; Thu, 15 Mar 2018 20:46:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E38101AE8F; Thu, 15 Mar 2018 20:46:34 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2FKkY0V005360; Thu, 15 Mar 2018 20:46:34 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2FKkYwl005358; Thu, 15 Mar 2018 20:46:34 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803152046.w2FKkYwl005358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 15 Mar 2018 20:46:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r331028 - in stable/11/sys: dev/efidev sys X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/sys: dev/efidev sys X-SVN-Commit-Revision: 331028 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Mar 2018 20:46:35 -0000 Author: kevans Date: Thu Mar 15 20:46:34 2018 New Revision: 331028 URL: https://svnweb.freebsd.org/changeset/base/331028 Log: MFC r330257: Add a function to retrieve the EFI realtime clock capabilities. Modified: stable/11/sys/dev/efidev/efirt.c stable/11/sys/sys/efi.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/efidev/efirt.c ============================================================================== --- stable/11/sys/dev/efidev/efirt.c Thu Mar 15 20:43:22 2018 (r331027) +++ stable/11/sys/dev/efidev/efirt.c Thu Mar 15 20:46:34 2018 (r331028) @@ -242,7 +242,7 @@ efi_get_table(struct uuid *uuid, void **ptr) } static int -efi_get_time_locked(struct efi_tm *tm) +efi_get_time_locked(struct efi_tm *tm, struct efi_tmcap *tmcap) { efi_status status; int error; @@ -251,7 +251,7 @@ efi_get_time_locked(struct efi_tm *tm) error = efi_enter(); if (error != 0) return (error); - status = efi_runtime->rt_gettime(tm, NULL); + status = efi_runtime->rt_gettime(tm, tmcap); efi_leave(); error = efi_status_to_errno(status); return (error); @@ -265,7 +265,21 @@ efi_get_time(struct efi_tm *tm) if (efi_runtime == NULL) return (ENXIO); EFI_TIME_LOCK() - error = efi_get_time_locked(tm); + error = efi_get_time_locked(tm, NULL); + EFI_TIME_UNLOCK() + return (error); +} + +int +efi_get_time_capabilities(struct efi_tmcap *tmcap) +{ + struct efi_tm dummy; + int error; + + if (efi_runtime == NULL) + return (ENXIO); + EFI_TIME_LOCK() + error = efi_get_time_locked(&dummy, tmcap); EFI_TIME_UNLOCK() return (error); } Modified: stable/11/sys/sys/efi.h ============================================================================== --- stable/11/sys/sys/efi.h Thu Mar 15 20:43:22 2018 (r331027) +++ stable/11/sys/sys/efi.h Thu Mar 15 20:46:34 2018 (r331028) @@ -179,6 +179,7 @@ void efi_destroy_1t1_map(void); int efi_rt_ok(void); int efi_get_table(struct uuid *uuid, void **ptr); int efi_get_time(struct efi_tm *tm); +int efi_get_time_capabilities(struct efi_tmcap *tmcap); int efi_reset_system(void); int efi_set_time(struct efi_tm *tm); int efi_var_get(uint16_t *name, struct uuid *vendor, uint32_t *attrib,