From fnaumann@mail.cs.uni-magdeburg.de Sun Jul 11 18:56:37 2004 Subject: Re: [MiNT] MiNT on Coldfire From: Petr Stehlik To: mint@lists.fishpool.fi In-Reply-To: <001901c4675d$a0c2b1b0$550f63d9@blaszak> References: <40F1519D.40604@inf.tu-dresden.de> <001901c4675d$a0c2b1b0$550f63d9@blaszak> Content-Type: text/plain; charset=iso-8859-2 Message-Id: <1089564523.2583.7.camel@joy.home> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Sun, 11 Jul 2004 18:48:43 +0200 X-MIME-Autoconverted: from 8bit to quoted-printable by ns1.avonet.cz id SAA10147 X-Virus-Scanned: by amavisd-new-20030616-p7 (Debian) at fishpool.fi Delivered-To: mint@lists.fishpool.fi X-ecartis-version: Ecartis v1.0.0 Sender: mint-bounce@lists.fishpool.fi Errors-to: mint-bounce@lists.fishpool.fi X-original-sender: joy@sophics.cz Precedence: bulk List-help: List-unsubscribe: List-ID: X-List-ID: X-Milter: ClamAV 0.70/0.70kjel X-Milter: milter-regex 1.5jel X-Milter: ClamAV 0.70/0.70kjel X-Milter: milter-regex 1.5jel Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by prinz.cs.uni-magdeburg.de id i6BGu1Ys016518 V Ne, 11. 07. 2004 v 17:41, Konrad Kokoszkiewicz píše: > writes should not set these bits"). If there's some better way to > differentiate 68030 and 68040, I am all ears. >From linux-m68k Atari bootstrap (written by Arjan Knor, Robert de Vries, Roman Hodek and Andreas Schwab, GPL): static int test_cpu_type (void) { int rv; static char testarray[4] = { 0, 0, 1, 1 }; __asm__ __volatile__ ( "movel 0x2c,a0\n\t" /* save line F vector */ "movel sp,a1\n\t" /* save stack pointer */ "movew sr,d2\n\t" /* save sr */ "orw #0x700,sr\n\t" /* disable interrupts */ "moveq #0,%0\n\t" /* assume 68000 (or 010) */ "moveq #1,d1\n\t" "tstb %1@(d1:l:2)\n\t" /* pre-020 CPU ignores scale and reads * 0, otherwise 1 */ "beq 1f\n\t" /* if 0 is 68000, end */ "moveq #20,%0\n\t" /* now assume 68020 */ "movel #2f,0x2c\n\t" /* continue if trap */ "movel %1,a2\n\t" "nop \n\t" ".long 0xf0120a00\n\t" /* pmove tt0,a2@, tt0 only on '030 */ "nop \n\t" "moveq #30,%0\n\t" /* surely is 68030 */ "bra 1f\n" "2:\t" /* now could be '020 or '040+ */ "movel #1f,0x2c\n\t" /* end if trap */ "movel %1,a2\n\t" "nop \n\t" ".long 0xf622a000\n\t" /* move16 a2@+,a2@+ only on '040+ */ "nop \n\t" "moveq #40,%0\n\t" /* assume 68040 */ "nop \n\t" ".word 0xf5ca\n\t" /* plpar a2@, only on '060 */ "nop \n\t" "moveq #60,%0\n" /* surely is 68060 */ "1:\t" "movel a1,sp\n\t" /* restore stack */ "movel a0,0x2c\n\t" /* restore line F vector */ "movew d2,sr" /* reenable ints */ : "=&d" (rv) : "a" (testarray) : "d1", "d2", "a0", "a1", "a2", "memory" ); return( rv ); }