Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Sep 2016 19:04:51 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r306209 - in head/sys/amd64: amd64 include
Message-ID:  <201609221904.u8MJ4pXv048672@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Thu Sep 22 19:04:51 2016
New Revision: 306209
URL: https://svnweb.freebsd.org/changeset/base/306209

Log:
  Change the efi_get_table interface to a void ** so we can return the
  pointer by dereferencing the pointer.
  
  Reviewed by: kib@
  MFC After: 2 weeks
  Sponsored by: Netflix, Inc

Modified:
  head/sys/amd64/amd64/efirt.c
  head/sys/amd64/include/efi.h

Modified: head/sys/amd64/amd64/efirt.c
==============================================================================
--- head/sys/amd64/amd64/efirt.c	Thu Sep 22 19:04:08 2016	(r306208)
+++ head/sys/amd64/amd64/efirt.c	Thu Sep 22 19:04:51 2016	(r306209)
@@ -405,7 +405,7 @@ efi_uninit(void)
 }
 
 int
-efi_get_table(struct uuid *uuid, void *ptr)
+efi_get_table(struct uuid *uuid, void **ptr)
 {
 	struct efi_cfgtbl *ct;
 	u_long count;
@@ -416,7 +416,7 @@ efi_get_table(struct uuid *uuid, void *p
 	ct = efi_cfgtbl;
 	while (count--) {
 		if (!bcmp(&ct->ct_uuid, uuid, sizeof(*uuid))) {
-			ptr = (void *)PHYS_TO_DMAP(ct->ct_data);
+			*ptr = (void *)PHYS_TO_DMAP(ct->ct_data);
 			return (0);
 		}
 		ct++;

Modified: head/sys/amd64/include/efi.h
==============================================================================
--- head/sys/amd64/include/efi.h	Thu Sep 22 19:04:08 2016	(r306208)
+++ head/sys/amd64/include/efi.h	Thu Sep 22 19:04:51 2016	(r306209)
@@ -43,7 +43,7 @@
 struct uuid;
 struct efi_tm;
 
-int efi_get_table(struct uuid *uuid, void *ptr);
+int efi_get_table(struct uuid *uuid, void **ptr);
 int efi_get_time(struct efi_tm *tm);
 int efi_get_time_locked(struct efi_tm *tm);
 int efi_reset_system(void);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201609221904.u8MJ4pXv048672>