]> git.saurik.com Git - apple/xnu.git/blame - bsd/dev/arm/sysctl.c
xnu-4570.1.46.tar.gz
[apple/xnu.git] / bsd / dev / arm / sysctl.c
CommitLineData
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
10extern int trap_on_alignment_fault;
11extern uint64_t wake_abstime;
12
13static
14SYSCTL_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
18static
19SYSCTL_QUAD(_machdep, OID_AUTO, wake_abstime,
20 CTLFLAG_RD | CTLFLAG_KERN, &wake_abstime,
21 "Absolute Time at the last wakeup");
22
23static int
24sysctl_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
37SYSCTL_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
42static int
43sysctl_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
56SYSCTL_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