All of lore.kernel.org
 help / color / mirror / Atom feed
From: s.psomadakis@gmail.com (Stratos Psomadakis)
To: kernelnewbies@lists.kernelnewbies.org
Subject: About HPET is_hpet_capable()
Date: Tue, 09 Aug 2011 11:57:50 +0300	[thread overview]
Message-ID: <4E40F68E.1080003@gmail.com> (raw)
In-Reply-To: <SNT111-DS8F96A251D81601A4C90B3A7200@phx.gbl>

On 08/09/2011 11:28 AM, limp wrote:
> Hi all,
>
> I am having a deeper look on Linux hpet code and I was wondering how exactly
> is_hpet_capable() works.
> >From the name of it, I assume that this function checks if the system
> supports HPET or not but I can't really tell how it does that.
>
> The function is the following:
>
> static inline int is_hpet_capable(void)
> {
>          return !boot_hpet_disable && hpet_address;
> }
>
> Could anyone help me understand how this works?
>
> Regards.
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
boot_hpet_disable is a boot time param, which as the name suggests
disables the hpet timer(nohpet is the actual parameter given to the
kernel by the bootloader I think)...

hpet_address is the address where the hpet timers are mapped, which is
read by the kernel from the BIOS ACPI table for hpet I think...

If you look at the code that does the actual initialization for hpet,
it's a bit more complicated than that, but generally, this function
checks whether HPET is disabled at boot time, and if a suitable entry /
address for HPET timers is found in the BIOS ACPI tables (if it's not
found, the hpet_address will be NULL). So if hpet is enabled, and an
address is found, this function returns 1/true. Else 0/false.

-- 
Stratos Psomadakis
<s.psomadakis@gmail.com>

      reply	other threads:[~2011-08-09  8:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-09  8:28 About HPET is_hpet_capable() limp
2011-08-09  8:57 ` Stratos Psomadakis [this message]

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=4E40F68E.1080003@gmail.com \
    --to=s.psomadakis@gmail.com \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.