2 Copyright © 2010-2011, The AROS Development Team. All rights reserved.
5 Desc: GetCPUInfo() - Provides information about installed CPUs (ARM version)
10 #include <aros/libcall.h>
11 #include <resources/processor.h>
12 #include <proto/utility.h>
14 #include "processor_intern.h"
15 #include "arch_intern.h"
17 AROS_LH1(void, GetCPUInfo
,
18 AROS_LHA(struct TagItem
*, tagList
, A0
),
19 struct ProcessorBase
*, ProcessorBase
, 1, Processor
)
23 struct TagItem
*passedTag
= NULL
;
24 struct LinuxArmProcessor
*data
= ProcessorBase
->Private1
;
26 /* Go over each passed tag and fill apprioprate data */
27 while ((passedTag
= NextTagItem(&tagList
)) != NULL
)
31 switch (passedTag
->ti_Tag
)
33 case GCIT_NumberOfProcessors
:
34 *((ULONG
*)passedTag
->ti_Data
) = 1;
38 *((ULONG
*)passedTag
->ti_Data
) = data
->Arch
;
42 *((ULONG
*)passedTag
->ti_Data
) = data
->Part
; /* ARM Model is vendor-specific part number */
45 case GCIT_ModelString
:
46 *((CONST_STRPTR
*)passedTag
->ti_Data
) = data
->Model
; /* String composed by Linux kernel */
50 *((ULONG
*)passedTag
->ti_Data
) = data
->Version
;
54 /* These values are mutually exclusive, report the best from feature flags */
55 if (data
->Features
& FF_NEON
)
56 val
= VECTORTYPE_NEON
;
57 else if (data
->Features
& FF_VFPv3
)
58 val
= VECTORTYPE_VFPv3
;
59 else if (data
->Features
& FF_VFP
)
64 *((ULONG
*)passedTag
->ti_Data
) = val
;
67 case GCIT_Architecture
:
68 *((ULONG
*)passedTag
->ti_Data
) = PROCESSORARCH_ARM
;
72 *((ULONG
*)passedTag
->ti_Data
) = ENDIANNESS_LE
; /* We are little-endian only */
76 *((ULONG
*)passedTag
->ti_Data
) = data
->Implementer
;
80 if ((passedTag
->ti_Tag
>= GCIT_SupportsVFP
) && (passedTag
->ti_Tag
<= GCIT_SupportsThumbEE
))
82 /* Each feature tag has own bit in Features field */
83 ULONG val
= data
->Features
>> (passedTag
->ti_Tag
- GCIT_SupportsVFP
);
85 *((BOOL
*)passedTag
->ti_Data
) = val
& 0x01;