public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Andrew Fish <afish@apple.com>
To: TVKR <tresko1@gmail.com>
Cc: edk2-devel@lists.01.org
Subject: Re: DXE core - Connecting a controller to driver
Date: Tue, 27 Jun 2017 07:07:04 -0700	[thread overview]
Message-ID: <A1E20F18-8784-49CB-A14E-B6E3B1893730@apple.com> (raw)
In-Reply-To: <CAD+hitf1Rs7_nB6vg2cUsSCTWqgQkFQvgXVVkW55ZTCndCcMFQ@mail.gmail.com>


> On Jun 26, 2017, at 9:30 AM, TVKR <tresko1@gmail.com> wrote:
> 
> Hi experts,
> 
> I have  a question related to the ConnectController implementation in the
> edk2 codebase (MdeModulePkg\Core\Dxe\Hand\DriverSupport.c). Under the
> CoreConnectSingleController function, what if DriverBinding->Supported
> returns an error? I see that there is a do/while loop waiting for
> DriverFound to be set to TRUE, but it looks like this wont happen if
> DriverBinding->Supported returns an error (looping for ever). Am I reading
> this wrong?
> 

How do you think a do while loop works in C?

DriverFound = FALSE;
do {
 ;
} while (DriverFound);

Is not an infinite loop? It just runs one time. 

The code is looping as long as Start() is called as calling Start() could cause other drivers Supported() to start returning TRUE, so you have to recheck the set after calling Start(). 

Thanks,

Andrew Fish

> Thanks
> _______________________________________________
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel



  parent reply	other threads:[~2017-06-27 14:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26 16:30 DXE core - Connecting a controller to driver TVKR
2017-06-27 13:52 ` TVKR
2017-06-27 14:07 ` Andrew Fish [this message]
2017-06-27 22:44   ` TVKR

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-list 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=A1E20F18-8784-49CB-A14E-B6E3B1893730@apple.com \
    --to=devel@edk2.groups.io \
    /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