revert between 56095 -> 55830 in arch
[AROS.git] / arch / all-pc / kernel / getsystemattr.c
blobeec15982b0025860e71601d01a6ce5d37552420b
1 /*
2 Copyright © 1995-2017, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 */
8 #include <aros/kernel.h>
9 #include <exec/execbase.h>
10 #include <proto/exec.h>
12 #include <kernel_base.h>
13 #include "kernel_intern.h"
16 /*****************************************************************************
18 NAME */
19 #include <proto/kernel.h>
21 AROS_LH1(intptr_t, KrnGetSystemAttr,
23 /* SYNOPSIS */
24 AROS_LHA(uint32_t, id, D0),
26 /* LOCATION */
27 struct KernelBase *, KernelBase, 29, Kernel)
29 /* FUNCTION
30 Get value of internal system attributes.
31 Currently defined attributes are:
33 KATTR_Architecture [.G] (char *) - Name of architecture the kernel built for.
35 KATTR_PeripheralBase [.G] IPTR - IO Base address for ARM peripherals
37 INPUTS
38 id - ID of the attribute to get
40 RESULT
41 Value of the attribute
43 NOTES
45 EXAMPLE
47 BUGS
49 SEE ALSO
51 INTERNALS
53 ******************************************************************************/
55 AROS_LIBFUNC_INIT
57 struct PlatformData *pdata = KernelBase->kb_PlatformData;
58 struct APICData *apicData = pdata->kb_APIC;
60 intptr_t retval = -1;
62 if ((apicData) && (id >= KATTR_CPULoad && id < KATTR_CPULoad_END))
64 id -= KATTR_CPULoad;
65 if (id < apicData->apic_count)
66 retval = apicData->cores[id].cpu_Load;
68 else if (id == KATTR_Architecture)
70 retval = (intptr_t)AROS_ARCHITECTURE;
73 return retval;
75 AROS_LIBFUNC_EXIT