[LV] Back to the VAX: bitops

Kenn Humborg kenn at bluetree.ie
Sun Apr 2 05:39:28 CEST 2006


> Hi!
> 
> Finally, my move is mostly finished and I've started to look at the
> VAXen again.  I'm currently looking at <asm/bitops.h>, which should
> get a touch-up to use the newly defined generic functions in
> <asm-generic/bitops/*>.

If you're adding or modifying any primitives, could you add
test cases to archtest.c as well?

> Was there a specific reason for this:

Don't know.  That probably dates back to Andy's days.

> 
> /* Supposed to not be atomic.  */
> static __inline__ void __set_bit(int nr, volatile void *addr)
> {
>         __asm__(
>         "       bbss    %1, %0, 2f              \n"
>         "2:                                     \n"
>         : "=m" (ADDR)
>         : "ir" (nr));
> }
> 
> /* Supposed to be atomic.  */
> static __inline__ void set_bit(int nr, volatile void *addr)
> {
>         __asm__ __volatile__(
>         "       bbss    %1, %0, 1f              \n"
>         "1:                                     \n"
>         : "=m" (ADDR)
>         : "ir" (nr));
> }
> 
> 
> In both cases, bbss was chosen, but I guess bbssi would have been more
> correct for set_bit()?

Shouldn't matter for uniprocessor.  But bbssi would be right for
SMP.

BTW, are these verbatim excerpts?  If so, how does it work at
all ("addr" and "ADDR")?

I think the nr constraint could be "g".  I don't see any reason
to force GCC to load it into a register.

Later,
Kenn


_______________________________________________
Linux-Vax mailing list
Linux-Vax at pergamentum.com
http://www.pergamentum.com/mailman/listinfo/linux-vax




More information about the Vax-linux mailing list