Amiga.org

Operating System Specific Discussions => Amiga OS => Amiga OS -- Development => Topic started by: Karlos on October 28, 2005, 11:09:32 PM

Title: How to detect 68060
Post by: Karlos on October 28, 2005, 11:09:32 PM
Hi,

What's the best (ie safest and most standard) way of detecting if you have a 68060 CPU from within your code?

SysBase->AttnFlags doesn't really seem to cater for it, do I have to check to see if a 68060.library is resident or do I have to go into supervisor mode and do a spot of peeking about?
Title: Re: How to detect 68060
Post by: SamuraiCrow on October 28, 2005, 11:42:37 PM
I don't suppose the CPU command under AmigaDOS would help.
Title: Re: How to detect 68060
Post by: Piru on October 28, 2005, 11:58:20 PM
@Karlos
Code: [Select]

if (SysBase->AttnFlags & 0x80)
{
  /* 68060 */
}

This bit was defined by Phase5, so you can't find it from NDK 3.1 includes. It's included in exec/execbase.h of NDK 3.5 and 3.9 though:
Code: [Select]

#define AFB_68060 7
#define AFF_68060 (1L<<7)

With 68060, AFF_FPU40, AFF_68881 and AFF_68882 have the same meaning as for 68040 (so AFF_FPU040 acts as AFF_FPU060 really).
Title: Re: How to detect 68060
Post by: Karlos on October 29, 2005, 01:33:02 AM
@Piru

Cheers.

That's weird, I can't find them in my execbase.h - I think something may have installed over my ndk :-?
Title: Re: How to detect 68060
Post by: Karlos on October 29, 2005, 01:41:18 AM
Nope, the NDK is from 3.5 (as found on DevCD 2.1), the release 44.1 includes/execbase.h doesn't define this bit. I guess it was added in an update or just the 3.9 one?

-edit-

not that it actually matters, I dare say I should update the OS 3.x NDK to the 3.9 one anyway ;-)