Port the SB128 code to AROS.
[AROS.git] / rom / kernel / getsystemattr.c
bloba36800cb55252c374c32caf65884bdb7a2fb58f5
1 #include <aros/kernel.h>
2 #include <exec/execbase.h>
3 #include <proto/exec.h>
5 #include <kernel_base.h>
7 #ifndef IRQ_TIMER
8 #define IRQ_TIMER -1
9 #endif
11 /*****************************************************************************
13 NAME */
14 #include <proto/kernel.h>
16 AROS_LH1(intptr_t, KrnGetSystemAttr,
18 /* SYNOPSIS */
19 AROS_LHA(uint32_t, id, D0),
21 /* LOCATION */
22 struct KernelBase *, KernelBase, 29, Kernel)
24 /* FUNCTION
25 Get value of internal system attributes.
26 Currently defined attributes are:
28 KATTR_Architecture [.G] (char *) - Name of architecture the kernel built for.
29 KATTR_VBlankEnable [SG] (unsigned char) - Enable or disable exec VBlank emulation by kernel.resource.
30 This can be needed for timer.device implementations for
31 systems with only one timer available. In this case timer.device
32 should shut off kernel's VBlank emulation before taking over the
33 timer and drive exec VBlank itself.
34 KATTR_TimerIRQ [.G] (int) - Number of high precision periodic timer IRQ to be used by timer.device.
35 Needed if kernel.resource provides a timer which runs at frequency
36 which is multiple of VBlank. Generic timer.device may use this IRQ
37 for improved accuracy. Frequency of this timer is specified in
38 SysBase->ex_EClockFrequency.
40 INPUTS
41 id - ID of the attribute to get
43 RESULT
44 Value of the attribute
46 NOTES
47 These attributes (except KATTR_Architecture) are of very limited use for end user software.
48 They are valid only in certain system states. For example KATTR_TimerPeriod goes meaningless
49 if timer.device has taken over the system timer. These attributes are provided for system
50 components themselves, so it's better to stay away from them.
52 EXAMPLE
54 BUGS
56 SEE ALSO
57 KrnSetSystemAttr()
59 INTERNALS
61 ******************************************************************************/
63 AROS_LIBFUNC_INIT
65 switch (id)
67 case KATTR_Architecture:
68 return (intptr_t)AROS_ARCHITECTURE;
70 case KATTR_VBlankEnable:
71 return KernelBase->kb_VBlankEnable;
73 case KATTR_TimerIRQ:
74 return IRQ_TIMER;
76 default:
77 return -1;
80 AROS_LIBFUNC_EXIT