ick, ick -- grossness in linux kernel

From: Jeff Foster (jfoster@EECS.Berkeley.EDU)
Date: 10/09/00


Date: Mon, 9 Oct 2000 15:45:58 -0700 (PDT)
From: Jeff Foster <jfoster@EECS.Berkeley.EDU>
Subject: ick, ick -- grossness in linux kernel
Message-ID: <Pine.LNX.4.21.0010091540460.6322-100000@lagaffe.cs.berkeley.edu>

I thought I'd share a bizarre little piece of code I ran across in the
kernel.  Check this out:

		do { __asm__ __volatile__("pushfl ; popl %0 ; cli":"=g" (
flags  ):   :"memory") ;       spin_lock( &tqueue_lock ); } while (0) ;

Currently my lock checker complains about this code, because it thinks
that the spin_lock may get executed multiple times (which would be a Bad
Thing).

Anyone know why this code gets wrapped in a useless do loop?  I assume
it's to fix some bug in some version of gcc.

Jeff



This archive was generated by hypermail 2b30 : 11/04/02 PST