Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Sep 2018 17:42:28 -0700
From:      John Baldwin <jhb@FreeBSD.org>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r338523 - head/sbin/sysctl
Message-ID:  <3748f268-f3fa-bd83-47a1-44fb41c28384@FreeBSD.org>
In-Reply-To: <20180907162608.GV3161@kib.kiev.ua>
References:  <201809071509.w87F9uEO078085@repo.freebsd.org> <8beb57f9-37dc-735c-fa85-78ecb67679ad@FreeBSD.org> <20180907162608.GV3161@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
On 9/7/18 9:26 AM, Konstantin Belousov wrote:
> On Fri, Sep 07, 2018 at 09:00:20AM -0700, John Baldwin wrote:
>> On 9/7/18 8:09 AM, Konstantin Belousov wrote:
>>> Author: kib
>>> Date: Fri Sep  7 15:09:56 2018
>>> New Revision: 338523
>>> URL: https://svnweb.freebsd.org/changeset/base/338523
>>>
>>> Log:
>>>   Teach sysctl(8) about the Persistent memory type.
>>>   
>>>   Add PersistentMemory to the list of sysctl's known memory types
>>>   when decoding an EFI memory map.
>>>   
>>>   Submitted by:	D Scott Phillips <d.scott.phillips@intel.com>
>>>   MFC after:	1 week
>>>   Approved by:	re (rgrimes)
>>>
>>> Modified:
>>>   head/sbin/sysctl/sysctl.c
>>>
>>> Modified: head/sbin/sysctl/sysctl.c
>>> ==============================================================================
>>> --- head/sbin/sysctl/sysctl.c	Fri Sep  7 14:37:44 2018	(r338522)
>>> +++ head/sbin/sysctl/sysctl.c	Fri Sep  7 15:09:56 2018	(r338523)
>>> @@ -704,7 +704,8 @@ S_efi_map(size_t l2, void *p)
>>>  		"ACPIMemoryNVS",
>>>  		"MemoryMappedIO",
>>>  		"MemoryMappedIOPortSpace",
>>> -		"PalCode"
>>> +		"PalCode",
>>> +		"PersistentMemory"
>>>  	};
>>>  
>>>  	/*
>>> @@ -733,7 +734,7 @@ S_efi_map(size_t l2, void *p)
>>>  
>>>  	for (i = 0; i < ndesc; i++,
>>>  	    map = efi_next_descriptor(map, efihdr->descriptor_size)) {
>>> -		if (map->md_type <= EFI_MD_TYPE_PALCODE)
>>> +		if (map->md_type <= EFI_MD_TYPE_PERSISTENT)
>>
>> Perhaps this should use nitems(types) instead?  (And I believe it's my
>> fault it didn't originally.)
> 
> For me, it was more an issue that the code assumes contiguous values for
> the EFI_MD_TYPEs constants.
> 
> What about the following:

Looks good to me.

-- 
John Baldwin

                                                                            



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3748f268-f3fa-bd83-47a1-44fb41c28384>