lkml.org 
[lkml]   [2001]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] advansys.c: include missing restore_flags, etc
Date
Arnaldo Carvalho de Melo writes:
> Please consider applying, comments in the patch.

Can't the following be fixed properly?

> -STATIC int
> +STATIC unsigned long
> DvcEnterCritical(void)
> {
> - int flags;
> + unsigned long flags;
>
> save_flags(flags);
> cli();

Guess what happens here?

return flags;

> @@ -9965,7 +9972,7 @@
> }
>
> STATIC void
> -DvcLeaveCritical(int flags)
> +DvcLeaveCritical(unsigned long flags)
> {
> restore_flags(flags);
> }

The above doesn't work on some architectures. Its better to use a macro
if you want to separate this out. ie, something like (davem will have to
okay it tho):

#define DvcEnterCritical() \
({ unsigned long __flags; save_flags(__flags); cli(); __flags; })

#define DvcLeaveCritical(flags) \
do { restore_flags(flags); } while (0)

This should then ensure that you don't end up with problems associated
with register windows on the sparc or whatever. Even better would be
to use a spinlock instead of Dvc?????Critical.
_____
|_____| ------------------------------------------------- ---+---+-
| | Russell King rmk@arm.linux.org.uk --- ---
| | | | http://www.arm.linux.org.uk/personal/aboutme.html / / |
| +-+-+ --- -+-
/ | THE developer of ARM Linux |+| /|\
/ | | | --- |
+-+-+ ------------------------------------------------- /\\\ |
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

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