[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Minios-devel] [UNIKRAFT PATCH 2/3] lib/ukboot: Modify ctor iteration to end at uk_ctortab_end


  • To: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>, "minios-devel@xxxxxxxxxxxxx" <minios-devel@xxxxxxxxxxxxx>
  • From: Vlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
  • Date: Wed, 28 Aug 2019 21:03:44 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=stud.acs.upb.ro; dmarc=pass action=none header.from=stud.acs.upb.ro; dkim=pass header.d=stud.acs.upb.ro; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=drJkDLMXLPAUPq8jdHgv5KhAgObWHRhBqaN4EqWogA4=; b=TrjohIdzMu5YQ0KfJE7NkyJg8Ja1j1WqFlfnYOmeMNRu0QB2vuxcycDJKiNgcBIVGWCOA/Ax6kEsKen/wLLs3k1zzRm7GRXiPTflEzrLP5gyODXXhYnZ4eZOwXnbt+hh6oXs9dKPGLyTLIbsMnqH4AdE1tEk8CAoBX2fxVuxOFULJoG8UFWRhVjnczC85Fxqj7pFvAQCf050J+sX823ilPXK9hP7rovaDY8UjGgptOzdSjwDVlk2mAUelLs5gaowtVWUbGU1vhnCIPU9ST0CXqZp8bvIGhxk4YhwBy8Rxt7WEm2uSQGJflLrc0hxWFSLf3/Ke4OpEtzBkvxaLzjsyQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RMgX4yt85ATvyq78QpO6mCwpA6CdHfT1lnDrQSN6TrmEhgMqA/RDmweYLBb5/PftWKTp4wxHS0oH54BBL3+hHIIOWjJgUK+F2FmUyy+nVGyTRaLdviZGbrFBjIsImy7YkX7mU2cSd0Qpk9sHHB4HuGjmGKA3ftPp2a7jtTEqBWVK4GQr83C3dYIc2THNUsd5A004XEWv39L3mD1J8moboVZuLxuGaqJnLfLYlF0rRvsfHvoupeQnjYWnAhop5/b1kWK/u5fN3jOU5JnIYIHPBOhvy99Ms50fuOmtXj0mRro/2cCX7nFheTyK/Hq7CHp0MMsXID8ik01T991r12PyUw==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=vlad_andrei.badoiu@xxxxxxxxxxxxxxx;
  • Cc: "sharan.santhanam@xxxxxxxxx" <sharan.santhanam@xxxxxxxxx>
  • Delivery-date: Wed, 28 Aug 2019 21:03:52 +0000
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>
  • Thread-index: AQHVXPzMbiWMB8qSxUKvj0WzulKy56cQu0wAgABS4IA=
  • Thread-topic: [Minios-devel] [UNIKRAFT PATCH 2/3] lib/ukboot: Modify ctor iteration to end at uk_ctortab_end

Hey Simon,

On 28.08.2019 19:07, Simon Kuenzer wrote:
> On 27.08.19 19:28, Vlad-Andrei BĂDOIU (78692) wrote:
>> The iteration thourgh the ctortab array of constructors now ends at
>> uk_ctortab_end.
>>
>> Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@xxxxxxxxxxxxxxx>
>> ---
>>   include/uk/ctors.h | 1 +
>>   lib/ukboot/boot.c  | 2 +-
>>   2 files changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/include/uk/ctors.h b/include/uk/ctors.h
>> index a3432e2b..4223b338 100644
>> --- a/include/uk/ctors.h
>> +++ b/include/uk/ctors.h
>> @@ -45,6 +45,7 @@ extern "C" {
>>     typedef void (*uk_ctor_func_t)(void);
>>   extern const uk_ctor_func_t uk_ctortab[];
>> +extern const uk_ctor_func_t uk_ctortab_end[];
>
> I would declare this as
>     extern const uk_ctor_func_t uk_ctortab_end;
>
> Then you can re-use the already existing foreach macro which is 
> currently within <uk/plat/ctors.h>
>>     /*
>>    * Register a constructor function that is
>> diff --git a/lib/ukboot/boot.c b/lib/ukboot/boot.c
>> index 9738a912..935123c7 100644
>> --- a/lib/ukboot/boot.c
>> +++ b/lib/ukboot/boot.c
>> @@ -182,7 +182,7 @@ void ukplat_entry(int argc, char *argv[])
>>   #endif
>>         uk_pr_info("Unikraft constructors table at %p\n", uk_ctortab);
>> -    for (cfn = uk_ctortab; *cfn != NULL; ++cfn) {
>> +    for (cfn = uk_ctortab; cfn != &uk_ctortab_end; ++cfn) {
>
> Logically, the '&' is de-referencing the end address of the list. It 
> is too much in this line. However, I would prefer using the existing 
> foreach macro instead.
I agree. I initially thought about using the foreach macro but passed 
over the idea in order to keep the amount of changes to the minimum. 
I'll add the proposed changes in the v2 of this patch.
>
>>           uk_pr_debug("Call constructor %p\n", *cfn);
>>           (*cfn)();
>>       }
>>
_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.