Linux MIPS Architecture development
 help / color / mirror / Atom feed
From: Pete Popov <ppopov@embeddedalley.com>
To: Ulrich Eckhardt <eckhardt@satorlaser.com>
Cc: linux-mips@linux-mips.org
Subject: Re: Off by two error in au1000/common/setup.c?
Date: Tue, 22 Mar 2005 09:46:10 -0800	[thread overview]
Message-ID: <424059E2.201@embeddedalley.com> (raw)
In-Reply-To: <200503221531.46186.eckhardt@satorlaser.com>

Ulrich Eckhardt wrote:

>Hi!
>
>Could someone take a look at these lines from fixup_bigphys_addr():
>
> // in au1000.h
> #define Au1500_PCI_MEM_START      0x440000000ULL
> #define Au1500_PCI_MEM_END        0x44FFFFFFFULL
>
> // in setup.c
> start = (u32)Au1500_PCI_MEM_START;
> end = (u32)Au1500_PCI_MEM_END;
> /* check for pci memory window */
> if ((phys_addr >= start) && ((phys_addr + size) < end)) {
>  return (phys_addr - start) + Au1500_PCI_MEM_START;
> }
>
>For the (unlikely?) case that I want to use a size of 0x0 1000 0000, 
>'phys_addr+size == end+1'. IOW I need 'phys_addr+size-1' to get the last 
>address and use '<= end' to compare with the last valid address in the range.
>
>Right?
>  
>
But the a size of 0x0 1000 0001 would pass the test since phys_addr + 
1000 0001 - 1 <= end.

How about if I just make MEM_END 0x450000000 and the check " <= end" ?

Pete

  reply	other threads:[~2005-03-22 17:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-22 14:31 Off by two error in au1000/common/setup.c? Ulrich Eckhardt
2005-03-22 17:46 ` Pete Popov [this message]
2005-03-23  7:36   ` Ulrich Eckhardt
2005-03-23  7:43     ` Pete Popov

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=424059E2.201@embeddedalley.com \
    --to=ppopov@embeddedalley.com \
    --cc=eckhardt@satorlaser.com \
    --cc=linux-mips@linux-mips.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox