small cleanup
[AROS.git] / arch / arm-all / processor / processor_init.c
blob833b0780ad2eecd6d927b59679d37ec7c40feb8e
1 /*
2 Copyright © 2013-2015, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #define DEBUG 0
7 #include <aros/debug.h>
9 #include <proto/exec.h>
10 #include <proto/kernel.h>
11 #include <aros/symbolsets.h>
13 #include <resources/processor.h>
15 #include "processor_intern.h"
16 #include "processor_arch_intern.h"
18 #define DUMPINFO(a) a
20 LONG Processor_Init(struct ProcessorBase * ProcessorBase)
22 struct ARMProcessorInformation **sysprocs;
23 unsigned int i;
25 D(bug("[processor.ARM] :%s()\n", __PRETTY_FUNCTION__));
27 sysprocs = AllocVec(ProcessorBase->cpucount * sizeof(APTR), MEMF_ANY | MEMF_CLEAR);
28 if ((ProcessorBase->Private1 = sysprocs) == NULL)
29 return FALSE;
31 for (i = 0; i < ProcessorBase->cpucount; i++)
33 sysprocs[i] = AllocMem(sizeof(struct ARMProcessorInformation), MEMF_CLEAR);
34 if (!sysprocs[i])
35 return FALSE;
36 #if defined(__AROSEXEC_SMP__)
37 if (i > 0)
39 NewCreateTask(TASKTAG_AFFINITY , KrnGetCPUMask(i) },
40 TASKTAG_PRI , -127,
41 TASKTAG_PC , ReadProcessorInformation,
42 TASKTAG_ARG1 , sysprocs[i],
43 TAG_DONE);
45 else
46 #else
47 if (i == 0)
48 #endif
49 ReadProcessorInformation(sysprocs[i]);
52 DUMPINFO(
53 bug("[processor.ARM] Processor Details -:\n");
54 for (i = 0; i < ProcessorBase->cpucount; i++)
56 bug("[processor.ARM] ");
57 if (ProcessorBase->cpucount > 1)
58 bug("#%d ", i);
59 if (sysprocs[i]->FamilyString)
61 bug("%s ARM%s Processor Core\n", sysprocs[i]->Vendor, sysprocs[i]->FamilyString);
63 else
65 bug("%s ARM Processor Core (unknown family)\n", sysprocs[i]->Vendor);
68 if (sysprocs[i]->Features1 & FEATF_FPU_VFP4)
70 bug("[processor.ARM] VFPv4 Co-Processor\n");
72 else if (sysprocs[i]->Features1 & FEATF_FPU_VFP3_16)
74 bug("[processor.ARM] VFPv3 [16Double] Co-Processor\n");
76 else if (sysprocs[i]->Features1 & FEATF_FPU_VFP3)
78 bug("[processor.ARM] VFPv3 Co-Processor\n");
80 else if (sysprocs[i]->Features1 & FEATF_FPU_VFP2)
82 bug("[processor.ARM] VFPv2 Co-Processor\n");
84 else
86 bug("[processor.ARM] VFPv1 Co-Processor\n");
89 if (sysprocs[i]->Features1 & FEATF_NEON)
91 bug("[processor.ARM] NEON SIMD Extensions\n");
94 bug("[processor.ARM] Cache Info:\n");
95 bug("[processor.ARM] L1 Data : %dKb\n", sysprocs[i]->L1DataCacheSize);
96 bug("[processor.ARM] L1 Instr. : %dKb\n", sysprocs[i]->L1InstructionCacheSize);
100 return TRUE;
103 ADD2INITLIB(Processor_Init, 1);