2 * Copyright (c) 2003-2007 Apple Inc. All rights reserved.
5 #include <sys/kernel.h>
6 #include <sys/sysctl.h>
8 #include <machine/machine_routines.h>
10 extern int trap_on_alignment_fault
;
11 extern uint64_t wake_abstime
;
14 SYSCTL_INT(_machdep
, OID_AUTO
, alignmenttrap
,
15 CTLFLAG_RW
, &trap_on_alignment_fault
, 0,
16 "trap on alignment faults (number of alignment faults per trap)");
19 SYSCTL_QUAD(_machdep
, OID_AUTO
, wake_abstime
,
20 CTLFLAG_RD
| CTLFLAG_KERN
, &wake_abstime
,
21 "Absolute Time at the last wakeup");
24 sysctl_time_since_reset SYSCTL_HANDLER_ARGS
26 #pragma unused(arg1, arg2, oidp)
28 uint64_t return_value
= 0;
30 return_value
= ml_get_time_since_reset();
32 SYSCTL_OUT(req
, &return_value
, sizeof(return_value
));
37 SYSCTL_PROC(_machdep
, OID_AUTO
, time_since_reset
,
38 CTLFLAG_RD
| CTLTYPE_QUAD
| CTLFLAG_LOCKED
,
39 0, 0, sysctl_time_since_reset
, "I",
40 "Continuous time since last SOC boot/wake started");
43 sysctl_wake_conttime SYSCTL_HANDLER_ARGS
45 #pragma unused(arg1, arg2, oidp)
47 uint64_t return_value
= 0;
49 return_value
= ml_get_conttime_wake_time();
51 SYSCTL_OUT(req
, &return_value
, sizeof(return_value
));
56 SYSCTL_PROC(_machdep
, OID_AUTO
, wake_conttime
,
57 CTLFLAG_RD
| CTLTYPE_QUAD
| CTLFLAG_LOCKED
,
58 0, 0, sysctl_wake_conttime
, "I",
59 "Continuous Time at the last wakeup");