lkml.org 
[lkml]   [2003]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] [2.5] include/asm-generic/bitops.h {set,clear}_bit return void
Hi!

> >
> >
> >>+ mask = 1 << (nr & 0x1f);
> >>+ cli();
> >>+ *addr |= mask;
> >>+ sti();
> >
> >
> > cli() and sti() are no more. Moreover, the file you are trying to fix is

No. That file is still usefull.

> What is the preferred way to achieve atomicity in an operation now that
> cli() and sti() are gone?

spin_lock_irqsave(&bitops_lock).

> > not even used anywhere. Better submit a patch to remove it completely.
>
> The point of asm-generic is not to use the files, but to give porters a
> hint about the functionality. Quoting asm-generic/bitops.h:
>
> /* For the benefit of those who are trying to port Linux to another
> * architecture, here are some C-language equivalents. You should
> * recode these in the native assembly language, if at all possible.
> * To guarantee atomicity, these routines call cli() and sti() to
> * disable interrupts while they operate. (You have to provide inline
> * routines to cli() and sti().) */
>
> Or is this comment wrong, too?
--
Pavel
Written on sharp zaurus, because my Velo1 broke. If you have Velo you don't need...

-
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/

\
 
 \ /
  Last update: 2005-03-22 13:35    [W:0.022 / U:4.672 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site