Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: [netbsd-11] src/sys/arch/atari/atari



Module Name:    src
Committed By:   martin
Date:           Thu Oct  1 14:17:57 UTC 2026

Modified Files:
        src/sys/arch/atari/atari [netbsd-11]: atari_init.c

Log Message:
Pull up following revision(s) (requested by tsutsui in ticket #492):

        sys/arch/atari/atari/atari_init.c: revision 1.121
        sys/arch/atari/atari/atari_init.c: revision 1.122

atari: Fix fatal 68030 MMU TC initialization bug

ATARITT kernels from NetBSD 11.0 and -current fail to boot on my
Atari TT030.

The inline asm that loads TC specifies only `"a" (&tc)` as an input,
so the compiler may eliminate the initialization of tc as a dead store.

Then the generated code loads an uninitialized value from the stack
into TC.

Add an `"m" (tc)` input operand to the inline asm so that the compiler
knows that the asm reads tc from memory.

Tested with both NetBSD 11.0 and -current on Atari TT030 and
must be pulled up to netbsd-11.

atari: Fix 68030 SRP setup across kernel relocation
protorp[1] is currently updated after the kernel has been copied to

TT-RAM in RELOC_KERNEL case.  The following PMOVE reads the ST-RAM
copy while the MMU is disabled, so this happens to work when enabling
the MMU.  After the MMU is enabled, however, protorp refers to the
relocated copy, where protorp[1] still contains its old value.

Fortunately, this is not currently fatal because later uses of
protorp overwrite protorp[1] with the root table address before
loading the root pointer.  However, any writes to global variables
after relocation leave the reloacated kernel state inconsistent.

Set protorp[1] before copying the kernel so that the relocated copy
also contains the root table address.  This matches the ordering used
by amiga.

The PMOVE inline asm also specifies only the address of protorp as an
input, even though it reads both words of the SRP prototype from memory.

Add both words as memory input operands so that the compiler knows
about those reads.


To generate a diff of this commit:
cvs rdiff -u -r1.113 -r1.113.4.1 src/sys/arch/atari/atari/atari_init.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index