Wanderer/Info: fix compilation
[AROS.git] / arch / ppc-native / processor / getcpuinfo.c
blobaa96f3f0f5b6dcf1c2036133d7ffd9b241517566
1 /*
2 Copyright © 2010-2031, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: GetCPUInfo() - Provides information about installed CPUs
6 Lang: english
7 */
9 #define DEBUG 0
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>
17 #include "defaults.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)
28 AROS_LIBFUNC_INIT
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;
39 continue;
41 else
43 switch(passedTag->ti_Tag)
45 case(GCIT_NumberOfProcessors):
46 *((ULONG *)passedTag->ti_Data) = ProcessorBase->cpucount;
47 break;
48 case(GCIT_Model):
49 *((ULONG *)passedTag->ti_Data) = sp->sp_PVR;
50 break;
51 case(GCIT_ModelString):
52 *((CONST_STRPTR *)passedTag->ti_Data) = "PowerPC";
53 break;
54 case(GCIT_Family):
55 *((ULONG *)passedTag->ti_Data) = CPUFAMILY_UNKNOWN;
56 break;
57 case(GCIT_VectorUnit):
58 *((ULONG *)passedTag->ti_Data) = VECTORTYPE_NONE;
59 break;
60 case(GCIT_L1CacheSize):
61 *((ULONG *)passedTag->ti_Data) = 0;
62 break;
63 case(GCIT_L1DataCacheSize):
64 *((ULONG *)passedTag->ti_Data) = 0;
65 break;
66 case(GCIT_L1InstructionCacheSize):
67 *((ULONG *)passedTag->ti_Data) = 0;
68 break;
69 case(GCIT_L2CacheSize):
70 *((ULONG *)passedTag->ti_Data) = 0;
71 break;
72 case(GCIT_L3CacheSize):
73 *((ULONG *)passedTag->ti_Data) = 0;
74 break;
75 case(GCIT_CacheLineSize):
76 *((ULONG *)passedTag->ti_Data) = 0;
77 break;
78 case(GCIT_Architecture):
79 *((ULONG *)passedTag->ti_Data) = PROCESSORARCH_DEF;
80 break;
81 case(GCIT_Endianness):
82 *((ULONG *)passedTag->ti_Data) = ENDIANNESS_DEF;
83 break;
84 case(GCIT_ProcessorSpeed):
85 *((UQUAD *)passedTag->ti_Data) = 0;
86 break;
87 case(GCIT_ProcessorLoad):
88 *((UBYTE *)passedTag->ti_Data) = 0;
89 break;
90 case(GCIT_FrontsideSpeed):
91 *((UQUAD *)passedTag->ti_Data) = 0;
92 break;
97 AROS_LIBFUNC_EXIT
98 } /* GetCPUInfo() */