]>
Commit | Line | Data |
---|---|---|
5ba3f43e A |
1 | /* |
2 | * Copyright (c) 2003-2007 Apple Inc. All rights reserved. | |
3 | */ | |
4 | #include <sys/param.h> | |
5 | #include <sys/kernel.h> | |
6 | #include <sys/sysctl.h> | |
7 | ||
8 | #include <machine/machine_routines.h> | |
9 | ||
10 | extern int trap_on_alignment_fault; | |
11 | extern uint64_t wake_abstime; | |
12 | ||
13 | static | |
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)"); | |
17 | ||
18 | static | |
19 | SYSCTL_QUAD(_machdep, OID_AUTO, wake_abstime, | |
20 | CTLFLAG_RD | CTLFLAG_KERN, &wake_abstime, | |
21 | "Absolute Time at the last wakeup"); | |
22 | ||
23 | static int | |
24 | sysctl_time_since_reset SYSCTL_HANDLER_ARGS | |
25 | { | |
26 | #pragma unused(arg1, arg2, oidp) | |
27 | int error = 0; | |
28 | uint64_t return_value = 0; | |
29 | ||
30 | return_value = ml_get_time_since_reset(); | |
31 | ||
32 | SYSCTL_OUT(req, &return_value, sizeof(return_value)); | |
33 | ||
34 | return error; | |
35 | } | |
36 | ||
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"); | |
41 | ||
42 | static int | |
43 | sysctl_wake_conttime SYSCTL_HANDLER_ARGS | |
44 | { | |
45 | #pragma unused(arg1, arg2, oidp) | |
46 | int error = 0; | |
47 | uint64_t return_value = 0; | |
48 | ||
49 | return_value = ml_get_conttime_wake_time(); | |
50 | ||
51 | SYSCTL_OUT(req, &return_value, sizeof(return_value)); | |
52 | ||
53 | return error; | |
54 | } | |
55 | ||
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"); | |
60 |