original_kernel/include/asm-blackfin
Andrea Righi 27ac792ca0 PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures
On 32-bit architectures PAGE_ALIGN() truncates 64-bit values to the 32-bit
boundary. For example:

	u64 val = PAGE_ALIGN(size);

always returns a value < 4GB even if size is greater than 4GB.

The problem resides in PAGE_MASK definition (from include/asm-x86/page.h for
example):

#define PAGE_SHIFT      12
#define PAGE_SIZE       (_AC(1,UL) << PAGE_SHIFT)
#define PAGE_MASK       (~(PAGE_SIZE-1))
...
#define PAGE_ALIGN(addr)       (((addr)+PAGE_SIZE-1)&PAGE_MASK)

The "~" is performed on a 32-bit value, so everything in "and" with
PAGE_MASK greater than 4GB will be truncated to the 32-bit boundary.
Using the ALIGN() macro seems to be the right way, because it uses
typeof(addr) for the mask.

Also move the PAGE_ALIGN() definitions out of include/asm-*/page.h in
include/linux/mm.h.

See also lkml discussion: http://lkml.org/lkml/2008/6/11/237

[akpm@linux-foundation.org: fix drivers/media/video/uvc/uvc_queue.c]
[akpm@linux-foundation.org: fix v850]
[akpm@linux-foundation.org: fix powerpc]
[akpm@linux-foundation.org: fix arm]
[akpm@linux-foundation.org: fix mips]
[akpm@linux-foundation.org: fix drivers/media/video/pvrusb2/pvrusb2-dvb.c]
[akpm@linux-foundation.org: fix drivers/mtd/maps/uclinux.c]
[akpm@linux-foundation.org: fix powerpc]
Signed-off-by: Andrea Righi <righi.andrea@gmail.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-07-24 10:47:21 -07:00
..
mach-bf527 Blackfin Serial Driver: Use timer to poll CTS PIN instead of workqueue. 2008-06-19 17:46:39 +08:00
mach-bf533 Blackfin Serial Driver: Use timer to poll CTS PIN instead of workqueue. 2008-06-19 17:46:39 +08:00
mach-bf537 Blackfin Serial Driver: Use timer to poll CTS PIN instead of workqueue. 2008-06-19 17:46:39 +08:00
mach-bf548 Blackfin Serial Driver: Use timer to poll CTS PIN instead of workqueue. 2008-06-19 17:46:39 +08:00
mach-bf561 Blackfin Serial Driver: Use timer to poll CTS PIN instead of workqueue. 2008-06-19 17:46:39 +08:00
mach-common [Blackfin] arch: fix gdb testing regression 2008-05-07 11:41:26 +08:00
.gitignore
Kbuild
a.out.h
atomic.h
auxvec.h
bfin-global.h Blackfin arch: Remove bad and usless code 2008-05-31 15:35:40 +08:00
bfin5xx_spi.h
bfin_simple_timer.h
bfin_sport.h
bitops.h
blackfin.h
bug.h
bugs.h
byteorder.h
cache.h
cacheflush.h
checksum.h [Blackfin] arch: Blackfin checksum annotations 2008-05-12 11:55:10 +08:00
cplb-mpu.h
cplb.h
cplbinit.h
cpumask.h
cputime.h
current.h
delay.h
device.h
div64.h
dma-mapping.h
dma.h
dpmc.h [Blackfin] arch: Functional power management support: Add CPU and platform voltage scaling support 2008-05-07 11:41:26 +08:00
early_printk.h
elf.h
emergency-restart.h
entry.h [Blackfin] arch: fix gdb testing regression 2008-05-07 11:41:26 +08:00
errno.h
fb.h
fcntl.h
fixed_code.h
flat.h
futex.h
gpio.h Blackfin arch: Add workaround to read edge triggered GPIOs 2008-05-17 16:01:51 +08:00
gptimers.h
hardirq.h
hw_irq.h
ide.h
io.h Blackfin arch: IO Port functions to read/write unalligned memory 2008-05-17 16:38:52 +08:00
ioctl.h
ioctls.h
ipcbuf.h
irq.h
irq_handler.h
irq_regs.h
kdebug.h
kgdb.h
kmap_types.h
kvm.h
l1layout.h
linkage.h
local.h
mem_map.h
mman.h
mmu.h
mmu_context.h
module.h
msgbuf.h
mutex.h
namei.h
nand.h
page.h PAGE_ALIGN(): correctly handle 64-bit values on 32-bit architectures 2008-07-24 10:47:21 -07:00
page_offset.h
param.h
pci.h
percpu.h
pgalloc.h
pgtable.h
poll.h
portmux.h
posix_types.h
processor.h
ptrace.h
reboot.h
resource.h
scatterlist.h
sections.h
segment.h
semaphore.h
sembuf.h
serial.h Blackfin serial driver: add extra IRQ flag for 8250 serial driver 2008-05-17 18:21:57 +08:00
setup.h
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h
socket.h
sockios.h
spinlock.h
stat.h
statfs.h
string.h
system.h
termbits.h
termios.h
thread_info.h
time.h [Blackfin] arch: Support for CPU_FREQ and NOHZ 2008-05-07 11:41:26 +08:00
timex.h
tlb.h
tlbflush.h
topology.h
trace.h
traps.h
types.h
uaccess.h
ucontext.h
unaligned.h
unistd.h
user.h