linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
To: Alexey Kardashevskiy <aik@ozlabs.ru>,
	linuxppc-dev@ozlabs.org, thuth@redhat.com,
	segher@kernel.crashing.org
Cc: dvaleev@suse.com
Subject: Re: [PATCH SLOF v4 1/4] disk-label: simplify gpt-prep-partition? routine
Date: Sat, 04 Jul 2015 17:27:01 +0530	[thread overview]
Message-ID: <87vbe09lv6.fsf@linux.vnet.ibm.com> (raw)
In-Reply-To: <55973A15.1040609@ozlabs.ru>

Alexey Kardashevskiy <aik@ozlabs.ru> writes:

> On 07/02/2015 09:35 PM, Nikunj A Dadhania wrote:
>> Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
>> Reviewed-by: Thomas Huth <thuth@redhat.com>
>
> If it does not change SLOF behaviour in any way (and it does not,
> right?),

It does not.

> it would be nice to see in the commit log.
>
>
>> ---
>>   slof/fs/packages/disk-label.fs | 41 +++++++++++++++--------------------------
>>   1 file changed, 15 insertions(+), 26 deletions(-)
>>
>> diff --git a/slof/fs/packages/disk-label.fs b/slof/fs/packages/disk-label.fs
>> index fe1c25e..f1f083a 100644
>> --- a/slof/fs/packages/disk-label.fs
>> +++ b/slof/fs/packages/disk-label.fs
>> @@ -352,42 +352,31 @@ CONSTANT /gpt-part-entry
>>      drop 0
>>   ;
>>
>> -\ Check for GPT PReP partition GUID
>> -9E1A2D38     CONSTANT GPT-PREP-PARTITION-1
>> -C612         CONSTANT GPT-PREP-PARTITION-2
>> -4316         CONSTANT GPT-PREP-PARTITION-3
>> -AA26         CONSTANT GPT-PREP-PARTITION-4
>> -8B49521E5A8B CONSTANT GPT-PREP-PARTITION-5
>> +\ Check for GPT PReP partition GUID. Only first 3 blocks are
>> +\ byte-swapped treating last two blocks as contigous for simplifying
>> +\ comparison
>> +9E1A2D38            CONSTANT GPT-PREP-PARTITION-1
>> +C612                CONSTANT GPT-PREP-PARTITION-2
>> +4316                CONSTANT GPT-PREP-PARTITION-3
>> +AA268B49521E5A8B    CONSTANT GPT-PREP-PARTITION-4
>>
>>   : gpt-prep-partition? ( -- true|false )
>> -   block gpt-part-entry>part-type-guid l@-le GPT-PREP-PARTITION-1 = IF
>> -      block gpt-part-entry>part-type-guid 4 + w@-le
>> -      GPT-PREP-PARTITION-2 = IF
>> -         block gpt-part-entry>part-type-guid 6 + w@-le
>> -         GPT-PREP-PARTITION-3 = IF
>> -            block gpt-part-entry>part-type-guid 8 + w@
>> -            GPT-PREP-PARTITION-4 = IF
>> -               block gpt-part-entry>part-type-guid a + w@
>> -               block gpt-part-entry>part-type-guid c + l@ swap lxjoin
>> -               GPT-PREP-PARTITION-5 = IF
>> -                   TRUE EXIT
>> -               THEN
>> -            THEN
>> -         THEN
>> -      THEN
>> -   THEN
>> -   FALSE
>> +   block gpt-part-entry>part-type-guid
>> +   dup l@-le     GPT-PREP-PARTITION-1 <> IF drop false EXIT THEN
>> +   dup 4 + w@-le GPT-PREP-PARTITION-2 <> IF drop false EXIT THEN
>> +   dup 6 + w@-le GPT-PREP-PARTITION-3 <> IF drop false EXIT THEN
>> +       8 + x@    GPT-PREP-PARTITION-4 =
>>   ;
>>
>>   : load-from-gpt-prep-partition ( addr -- size )
>> -   no-gpt? IF drop FALSE EXIT THEN
>> +   no-gpt? IF drop false EXIT THEN
>>      debug-disk-label? IF
>>         cr ." GPT partition found " cr
>>      THEN
>>      1 read-sector block gpt>part-entry-lba l@-le
>>      block-size * to seek-pos
>>      block gpt>part-entry-size l@-le to gpt-part-size
>> -   block gpt>num-part-entry l@-le dup 0= IF FALSE EXIT THEN
>> +   block gpt>num-part-entry l@-le dup 0= IF false EXIT THEN
>>      1+ 1 ?DO
>>         seek-pos 0 seek drop
>>         block gpt-part-size read drop gpt-prep-partition? IF
>> @@ -405,7 +394,7 @@ AA26         CONSTANT GPT-PREP-PARTITION-4
>>         THEN
>>         seek-pos gpt-part-size i * + to seek-pos
>>      LOOP
>> -   FALSE
>> +   false
>>   ;
>>
>>   \ Extract the boot loader path from a bootinfo.txt file
>>
>
>
> -- 
> Alexey

  reply	other threads:[~2015-07-04 11:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-02 11:35 [PATCH SLOF v4 0/4] GPT fixes and LVM support with FAT Nikunj A Dadhania
2015-07-02 11:35 ` [PATCH SLOF v4 1/4] disk-label: simplify gpt-prep-partition? routine Nikunj A Dadhania
2015-07-04  1:42   ` Alexey Kardashevskiy
2015-07-04 11:57     ` Nikunj A Dadhania [this message]
2015-07-02 11:35 ` [PATCH SLOF v4 2/4] introduce 8-byte LE helpers Nikunj A Dadhania
2015-07-02 11:35 ` [PATCH SLOF v4 3/4] disk-label: introduce helper to check fat filesystem Nikunj A Dadhania
2015-07-02 11:35 ` [PATCH SLOF v4 4/4] disk-label: add support for booting from GPT FAT partition Nikunj A Dadhania
2015-07-04  1:55 ` [PATCH SLOF v4 0/4] GPT fixes and LVM support with FAT Alexey Kardashevskiy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vbe09lv6.fsf@linux.vnet.ibm.com \
    --to=nikunj@linux.vnet.ibm.com \
    --cc=aik@ozlabs.ru \
    --cc=dvaleev@suse.com \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=segher@kernel.crashing.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).