linux-stable-rt/include/asm-powerpc
Robert Jennings 434f98c48f [POWERPC] atomic_dec_if_positive sign extension fix
On 64-bit machines, if an atomic counter is explicitly set to a
negative value, the atomic_dec_if_positive function will decrement and
store the next smallest value in the atomic counter, contrary to its
intended operation.

The comparison to determine if the decrement will make the result
negative was done by the "addic." instruction, which operates on a
64-bit value, namely the zero-extended word loaded from the atomic
variable.  This patch uses an explicit word compare (cmpwi) and
changes the addic. to an addi (also changing "=&r" to "=&b" so that r0
isn't used, and addi doesn't become li).

This also fixes a bug for both 32-bit and 64-bit in that previously
0x80000000 was considered positive, since the result after
decrementing is positive.  Now it is considered negative.

Also, I clarify the return value in the comments just to make it clear
that the value returned is always the decremented value, even if that
value is not stored back to the atomic counter.

Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
2007-01-22 21:27:36 +11:00
..
iseries
8253pit.h
Kbuild [POWERPC] cell: Fix spu_info.h header export 2006-12-08 15:55:55 +11:00
a.out.h
abs_addr.h
agp.h
asm-compat.h
atomic.h [POWERPC] atomic_dec_if_positive sign extension fix 2007-01-22 21:27:36 +11:00
auxvec.h
backlight.h
bitops.h [PATCH] LOG2: Make powerpc's __ilog2_u64() take a 64-bit argument 2006-12-11 12:29:27 -08:00
bootx.h
btext.h
bug.h [POWERPC] Fix manual assembly WARN_ON() in enter_rtas(). 2007-01-09 17:03:02 +11:00
bugs.h
byteorder.h
cache.h
cacheflush.h [PATCH] Optimize D-cache alias handling on fork 2006-12-13 09:27:08 -08:00
cell-pmu.h [POWERPC] cell: Add oprofile support 2006-12-04 20:40:14 +11:00
checksum.h
compat.h
cputable.h Merge branch 'for_paulus' of master.kernel.org:/pub/scm/linux/kernel/git/galak/powerpc 2006-12-11 16:31:42 +11:00
cputime.h
current.h
dbdma.h [POWERPC] Xserve cpu-meter driver 2006-12-04 20:39:30 +11:00
dcr-mmio.h
dcr-native.h [POWERPC] Only export __mtdcr/__mfdcr if CONFIG_PPC_DCR is set 2006-12-10 23:15:47 -06:00
dcr.h [POWERPC] Only export __mtdcr/__mfdcr if CONFIG_PPC_DCR is set 2006-12-10 23:15:47 -06:00
delay.h
device.h
div64.h
dma-mapping.h [PATCH] Pass struct dev pointer to dma_cache_sync() 2006-12-07 08:39:41 -08:00
dma.h
eeh.h [POWERPC] Merge 32 and 64 bits asm-powerpc/io.h 2006-12-04 20:39:05 +11:00
eeh_event.h
elf.h [PATCH] elf: Always define elf_addr_t in linux/elf.h 2006-12-07 08:39:38 -08:00
emergency-restart.h
errno.h
fcntl.h
firmware.h [POWERPC] ps3: multiplatform build fixes 2006-12-04 20:41:16 +11:00
floppy.h
fs_pd.h
futex.h [PATCH] mm: pagefault_{disable,enable}() 2006-12-07 08:39:21 -08:00
grackle.h
hardirq.h
heathrow.h
hvcall.h [POWERPC] Fix bugs in the hypervisor call stats code 2007-01-09 17:03:03 +11:00
hvconsole.h
hvcserver.h
hw_irq.h [POWERPC] Delete unused irq functions on powerpc 2006-12-08 17:10:18 +11:00
i8259.h
ibmebus.h
ide.h [POWERPC] Merge 32 and 64 bits asm-powerpc/io.h 2006-12-04 20:39:05 +11:00
immap_86xx.h
immap_qe.h
io-defs.h [POWERPC] Merge 32 and 64 bits asm-powerpc/io.h 2006-12-04 20:39:05 +11:00
io.h [POWERPC] include/asm-powerpc/: "extern inline" -> "static inline" 2006-12-04 20:41:26 +11:00
ioctl.h
ioctls.h
iommu.h [POWERPC] Cell iommu support 2006-12-04 20:39:02 +11:00
ipc.h
ipcbuf.h
ipic.h
irq.h [POWERPC] add virq_to_hw accessor routine 2006-12-04 20:40:37 +11:00
irq_regs.h
irqflags.h
kdebug.h
kdump.h
kexec.h
keylargo.h
kmap_types.h
kprobes.h
linkage.h
lmb.h
local.h
lppaca.h
lv1call.h [POWERPC] ps3: add lv1 hvcalls 2006-12-04 20:40:44 +11:00
machdep.h [POWERPC] Merge 32 and 64 bits asm-powerpc/io.h 2006-12-04 20:39:05 +11:00
macio.h
mc146818rtc.h
mediabay.h
mman.h
mmu.h
mmu_context.h
mmzone.h
module.h [POWERPC] Generic BUG for powerpc 2006-12-11 16:35:07 +11:00
mpc52xx.h [POWERPC] 52xx: Don't use device_initcall to probe of_platform_bus 2007-01-09 17:03:02 +11:00
mpc85xx.h
mpc86xx.h
mpic.h
msgbuf.h
mutex.h
namei.h
nvram.h
of_device.h
of_platform.h
ohare.h
oprofile_impl.h [POWERPC] cell: Add oprofile support 2006-12-04 20:40:14 +11:00
pSeries_reconfig.h
paca.h
page.h
page_32.h [PATCH] LOG2: Provide ilog2() fallbacks for powerpc 2006-12-08 08:28:51 -08:00
page_64.h
param.h
parport.h
pci-bridge.h [POWERPC] Fix mmap of PCI resource with hack for X 2006-12-08 17:21:06 +11:00
pci.h [POWERPC] Define pci_unmap_addr() et al. when CONFIG_NOT_COHERENT_CACHE=y 2006-12-08 17:10:18 +11:00
percpu.h
pgalloc.h [PATCH] slab: remove kmem_cache_t 2006-12-07 08:39:25 -08:00
pgtable-4k.h
pgtable-64k.h
pgtable.h
pmac_feature.h
pmac_low_i2c.h
pmac_pfunc.h
pmc.h
poll.h
posix_types.h [PATCH] FD_ZERO build fix 2007-01-11 18:18:22 -08:00
ppc-pci.h
ppc_asm.h
processor.h
prom.h
ps3.h [POWERPC] ps3: add ps3 platform system bus support 2006-12-04 20:40:57 +11:00
ptrace.h
qe.h
qe_ic.h
reg.h [POWERPC] Add SPURR SPR to sysfs 2006-12-09 11:39:06 +11:00
reg_8xx.h
resource.h
rtas.h [POWERPC] Add rtas_service_present() helper 2006-12-08 17:10:22 +11:00
rtc.h
rwsem.h
scatterlist.h
seccomp.h
sections.h
semaphore.h
sembuf.h
serial.h
setup.h [PATCH] cleanup asm/setup.h userspace visibility 2006-12-07 08:39:46 -08:00
shmbuf.h
shmparam.h
sigcontext.h
siginfo.h
signal.h
smp.h
smu.h
socket.h
sockios.h
sparsemem.h [POWERPC] ps3: add lpar addressing 2006-12-04 20:40:52 +11:00
spinlock.h
spinlock_types.h
spu.h [POWERPC] cell: add forward struct declarations to spu.h 2006-12-19 15:35:36 +01:00
spu_csa.h
spu_info.h [POWERPC] spufs: Add /lslr, /dma_info and /proxydma files 2006-12-04 20:39:45 +11:00
spu_priv1.h [POWERPC] cell: abstract spu management routines 2006-12-04 20:40:39 +11:00
sstep.h
stat.h
statfs.h
string.h
synch.h
syscalls.h
systbl.h
system.h
tce.h
termbits.h [PATCH] tty: switch to ktermios 2006-12-08 08:28:57 -08:00
termios.h
thread_info.h [PATCH] PM: Fix SMP races in the freezer 2006-12-13 09:05:49 -08:00
time.h
timex.h
tlb.h
tlbflush.h
topology.h [PATCH] sched: add option to serialize load balancing 2006-12-10 09:55:43 -08:00
tsi108.h [POWERPC] include/asm-powerpc/: "extern inline" -> "static inline" 2006-12-04 20:41:26 +11:00
tsi108_irq.h
types.h [PATCH] Centralise definitions of sector_t and blkcnt_t 2006-12-04 19:41:15 -08:00
uaccess.h [POWERPC] include/asm-powerpc/: "extern inline" -> "static inline" 2006-12-04 20:41:26 +11:00
ucc.h
ucc_fast.h
ucc_slow.h
ucontext.h
udbg.h
unaligned.h
uninorth.h
unistd.h [PATCH] remove kernel syscalls 2006-12-07 08:39:37 -08:00
user.h
vdso.h
vdso_datapage.h
vga.h
vio.h
xmon.h
xor.h