All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandall <eric@sandall.us>
To: Ben Collins <bcollins@debian.org>
Cc: Nico Schottelius <nico-mutt@schottelius.org>,
	linux-kernel@vger.kernel.org
Subject: Re: transmeta cpu code question
Date: Wed, 19 Nov 2003 22:57:56 -0800	[thread overview]
Message-ID: <1069311476.3fbc65f46135c@horde.sandall.us> (raw)
In-Reply-To: <20031120025315.GR11983@phunnypharm.org>

Quoting Ben Collins <bcollins@debian.org>:

> On Thu, Nov 20, 2003 at 03:02:18AM +0100, Nico Schottelius wrote:
> > Hello!
> > 
> > What does this do:
> > 
> >                 printk(KERN_INFO "CPU: Processor revision %u.%u.%u.%u,
> > %u MHz\n",
> >                        (cpu_rev >> 24) & 0xff,
> >                        (cpu_rev >> 16) & 0xff,
> >                        (cpu_rev >> 8) & 0xff,
> >                        cpu_rev & 0xff,
> >                        cpu_freq);
> > 
> > (from arch/i386/kernel/cpu/transmeta.c)
> > 
> > Does not & 0xff make no sense? 0 & 1 makes 0, 1 & 1 makes 1, 
> > no changes.
> >
> > And I don't understand why we do this for 8bit and shifting the
> > cpu_rev...
> 
> You are a bit confused. The cpu_rev is a 4 byte value, each byte is a
> decimal of the revision.
> 
> And (0 & 1) makes 1, not 0. That's an AND, not an OR.

Last I checked, 0 AND anything is 0. Think of it this way:

A   B   A & B
------------
T   F     F
T   T     T
F   T     F
F   F     F

So, anything ANDed with F is false.

-sandalle

-- 
PGP Key Fingerprint:  FCFF 26A1 BE21 08F4 BB91  FAED 1D7B 7D74 A8EF DD61
http://search.keyserver.net:11371/pks/lookup?op=get&search=0xA8EFDD61

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/E/IT$ d-- s++:+>: a-- C++(+++) BL++++VIS>$ P+(++) L+++ E-(---) W++ N+@ o?
K? w++++>-- O M-@ V-- PS+(+++) PE(-) Y++(+) PGP++(+) t+() 5++ X(+) R+(++)
tv(--)b++(+++) DI+@ D++(+++) G>+++ e>+++ h---(++) r++ y+
------END GEEK CODE BLOCK------

Eric Sandall                     |  Source Mage GNU/Linux Developer
eric@sandall.us                  |  http://www.sourcemage.org/
http://eric.sandall.us/          |  SysAdmin @ Inst. Shock Physics @ WSU
http://counter.li.org/  #196285  |  http://www.shock.wsu.edu/

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

      parent reply	other threads:[~2003-11-20  6:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-11-20  2:02 transmeta cpu code question Nico Schottelius
2003-11-20  2:10 ` Ben Hoskings
2003-11-20  8:38   ` Nico Schottelius
2003-11-20 17:33     ` H. Peter Anvin
2003-11-20 23:25       ` Jamie Lokier
2003-11-21  8:34         ` John Bradford
2003-11-21  8:48           ` Jamie Lokier
2003-11-24  6:54             ` H. Peter Anvin
2003-11-24 13:19               ` Jamie Lokier
2003-11-20  2:53 ` Ben Collins
2003-11-20  3:06   ` Kevin P. Fleming
2003-11-20 13:25     ` Ben Collins
2003-11-20  3:18   ` Ben Hoskings
2003-11-20  6:57   ` Eric Sandall [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=1069311476.3fbc65f46135c@horde.sandall.us \
    --to=eric@sandall.us \
    --cc=bcollins@debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nico-mutt@schottelius.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.