[lkml]   [2003]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [ACPI] ACPI global lock macros
Yu, Luming wrote:
> Above code have a bug! Considering below code:
> u8 acquired = FALSE;
> ACPI_ACQUIRE_GLOBAL_LOC(acpi_gbl_common_fACS.global_lock, acquired);
> if(acquired) {
> ....
> }
> Gcc will complain " ERROR: '%cl' not allowed with sbbl ". And I think any other compiler will
> complain that too !

Oops - the version I posted differed in one character from the version
that I'd compiled - I'd just used "sbb" in the working version and let
the compiler figure out which version to use.

> How about below changes to your proposal code.
> < "sbbl %0,%0" \
> < :"=r"(Acq):"r"(GLptr),"i"(~1L):"dx","ax"); \
> ---
>> "sbbl %%eax,%%eax" \
>> :"=a"(Acq):"r"(GLptr),"i"(~1L):"dx"); \

Yes, that would work too, but I don't like forcing the asm to use
particular registers when there's no good reason to do so.

> PS. I'm very curious about how could you find this bug.

It was mainly down to the differences between the i386 and x86_64
versions, and trying to understand the reasons for those differences,
and indeed how the entire set of macros worked at all.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

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