Subject: Re: bit set/clr macro's; atomic instructions.
To: Gordon W. Ross <gwr@mc.com>
From: Leo Weppelman <leo@wau.mis.ah.nl>
List: port-m68k
Date: 09/11/1996 08:05:01
Gordon W. Ross wrote:

> There is another way to avoid spl* calls in these situations:
> All you need to do is store your binary flags each in a char
> variable.  Take your "ssir" variable for example.  Instead of
> using three bits in one char, you could use three chars, i.e.
> 
> 	union {
> 		int ssir_int;
> 		char ssir_c[4];
> 	} ssir;
> 
> Then you can "set a bit" by just slamming 1 into one of the
> char slots.  In this case, you can even check four values at
> one time in the service routine (though that will need an spl).
As Peter already pointed out, this too is machine specific. Another
reason that this is no replacement for the suggested macro's is that
this method provides no solution for manipulating hardware registers - like
interrupt masks.

Leo.