2 Copyright © 2010-2031, The AROS Development Team. All rights reserved.
5 Desc: GetCPUInfo() - Provides information about installed CPUs
11 #include <aros/debug.h>
12 #include <exec/types.h>
13 #include <aros/libcall.h>
14 #include <proto/utility.h>
15 #include <resources/processor.h>
18 #include "processor_intern_arch.h"
20 #include <proto/processor.h>
22 /* See rom/processor/getcpuinfo.c for documentation */
24 AROS_LH1(void, GetCPUInfo
,
25 AROS_LHA(struct TagItem
*, tagList
, A0
),
26 struct ProcessorBase
*, ProcessorBase
, 1, Processor
)
30 struct TagItem
* passedTag
= NULL
;
31 struct SystemProcessors
*sp
= ProcessorBase
->Private1
;
33 while ((passedTag
= LibNextTagItem(&tagList
)) != NULL
)
35 if ((passedTag
->ti_Tag
> GCIT_FeaturesBase
) &&
36 (passedTag
->ti_Tag
<= GCIT_FeaturesLast
))
38 *((BOOL
*)passedTag
->ti_Data
) = FALSE
;
43 switch(passedTag
->ti_Tag
)
45 case(GCIT_NumberOfProcessors
):
46 *((ULONG
*)passedTag
->ti_Data
) = ProcessorBase
->cpucount
;
49 *((ULONG
*)passedTag
->ti_Data
) = sp
->sp_PVR
;
51 case(GCIT_ModelString
):
52 *((CONST_STRPTR
*)passedTag
->ti_Data
) = "PowerPC";
55 *((ULONG
*)passedTag
->ti_Data
) = CPUFAMILY_UNKNOWN
;
57 case(GCIT_VectorUnit
):
58 *((ULONG
*)passedTag
->ti_Data
) = VECTORTYPE_NONE
;
60 case(GCIT_L1CacheSize
):
61 *((ULONG
*)passedTag
->ti_Data
) = 0;
63 case(GCIT_L1DataCacheSize
):
64 *((ULONG
*)passedTag
->ti_Data
) = 0;
66 case(GCIT_L1InstructionCacheSize
):
67 *((ULONG
*)passedTag
->ti_Data
) = 0;
69 case(GCIT_L2CacheSize
):
70 *((ULONG
*)passedTag
->ti_Data
) = 0;
72 case(GCIT_L3CacheSize
):
73 *((ULONG
*)passedTag
->ti_Data
) = 0;
75 case(GCIT_CacheLineSize
):
76 *((ULONG
*)passedTag
->ti_Data
) = 0;
78 case(GCIT_Architecture
):
79 *((ULONG
*)passedTag
->ti_Data
) = PROCESSORARCH_DEF
;
81 case(GCIT_Endianness
):
82 *((ULONG
*)passedTag
->ti_Data
) = ENDIANNESS_DEF
;
84 case(GCIT_ProcessorSpeed
):
85 *((UQUAD
*)passedTag
->ti_Data
) = 0;
87 case(GCIT_ProcessorLoad
):
88 *((UBYTE
*)passedTag
->ti_Data
) = 0;
90 case(GCIT_FrontsideSpeed
):
91 *((UQUAD
*)passedTag
->ti_Data
) = 0;