Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 8 Aug 2002 19:02:14 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 8 Aug 2002 19:02:14 -0400 Received: from smtpzilla2.xs4all.nl ([194.109.127.138]:25875 "EHLO smtpzilla2.xs4all.nl") by vger.kernel.org with ESMTP id ; Thu, 8 Aug 2002 19:02:13 -0400 Date: Fri, 9 Aug 2002 01:04:40 +0200 (CEST) From: Roman Zippel X-X-Sender: roman@serv To: Luca Barbieri cc: Linux-Kernel ML , Alan Cox Subject: Re: [PATCH] [2.5] asm-generic/atomic.h and changes to arm, parisc, mips, m68k, sh, cris to use it In-Reply-To: <1028846417.1669.95.camel@ldb> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 677 Lines: 33 Hi, On 9 Aug 2002, Luca Barbieri wrote: > > The compiler can cache the value in a register > It shouldn't since it is volatile and the machine has instructions with > memory operands. volatile is no guarantee for that: volatile int x; void f(int y) { x += y; } becomes: move.l x,%d0 add.l 8(%a6),%d0 move.l %d0,x I agree that volatile should avoid caching, but it does not guarantee an atomic modify. bye, Roman - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/