| To: | linux-mips@linux-mips.org |
|---|---|
| Subject: | Off by two error in au1000/common/setup.c? |
| From: | Ulrich Eckhardt <eckhardt@satorlaser.com> |
| Date: | Tue, 22 Mar 2005 15:31:46 +0100 |
| Organization: | Sator Laser GmbH |
| Original-recipient: | rfc822;linux-mips@linux-mips.org |
| Sender: | linux-mips-bounce@linux-mips.org |
| User-agent: | KMail/1.7.1 |
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?
Uli
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [patch] repair failed merges of 2.6.12 in au1000_eth.c, Ulrich Eckhardt |
|---|---|
| Next by Date: | ohci-au1xxx.c breakage, Ulrich Eckhardt |
| Previous by Thread: | [patch] repair failed merges of 2.6.12 in au1000_eth.c, Ulrich Eckhardt |
| Next by Thread: | Re: Off by two error in au1000/common/setup.c?, Pete Popov |
| Indexes: | [Date] [Thread] [Top] [All Lists] |