Sorry to ask what sounds like a dumb question, but is

cli;nonatomic_cas;sti

basically "disable interrupts, do something equivalent to cas, re-enable interrupts"?

That is what I had intended to do by ifdefing out the cas instruction itself. I wasn't going to leave it out because it's obviously there for a reason. :-)

But simply for testing, it let me get beyond that point to see what else was hiding away that would cause some problems.

On Fri, Apr 24, 2020, 10:51 Rich Felker <dalias@libc.org> wrote:
On Fri, Apr 24, 2020 at 10:36:23AM +1000, Tom Storey wrote:
> Thanks Rich.
>
> Just for gits and shiggles I tried #ifdef'ing out the cas.l instruction in
> the atomic_arch.h file for 68020+ processors, and compilation then

That won't work. But for NOMMU without a separate kernel domain it
would work to do cli;nonatomic_cas;sti (not sure what the actual m68k
insns for that are). There are plenty of places where a cas that does
nothing will break code, probably even during common paths in simple
programs.

> proceeded along very smoothly for a while, but then hit another roadblock
> in src/setjmp/m68k/longjmp.s where it tries to execute a floating point
> instruction, and then subsequently fails with a "needs M68K fpu" error
> message. So maybe there was a way to work around that, but FPU adds another
> dimension to this problem.

You can add a softfloat ABI; nominally there even is one, but it's
clearly not working. The setjmp/longjmp files should be made .S
instead of .s with #if around the floating point save/restore
conditioned on being hardfloat ABI.

> Trying to make this work is probably more than I'm really willing to take
> on for this project, so I may put it on the back burner and perhaps look at

You're really probably 90% there to at least having something that'll
build and that should run if you wire up syscalls.

Rich