2N/A * The contents of this file are subject to the terms of the 2N/A * Common Development and Distribution License (the "License"). 2N/A * You may not use this file except in compliance with the License. 2N/A * See the License for the specific language governing permissions 2N/A * and limitations under the License. 2N/A * When distributing Covered Code, include this CDDL HEADER in each 2N/A * If applicable, add the following below this CDDL HEADER, with the 2N/A * fields enclosed by brackets "[]" replaced with your own identifying 2N/A * information: Portions Copyright [yyyy] [name of copyright owner] 2N/A * Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved. 2N/A * The following macros for dealing with raw output from the Mostek 48T02 2N/A * were borrowed from the kernel. Openboot passes the raw Mostek data 2N/A * thru the device tree, and there are no library routines to deal with 2N/A * Tables to convert a single byte from binary-coded decimal (BCD). 2N/A 0,
1,
2,
3,
4,
5,
6,
7,
8,
9, 0, 0, 0, 0, 0, 0,
2N/A 10,
11,
12,
13,
14,
15,
16,
17,
18,
19, 0, 0, 0, 0, 0, 0,
2N/A 20,
21,
22,
23,
24,
25,
26,
27,
28,
29, 0, 0, 0, 0, 0, 0,
2N/A 30,
31,
32,
33,
34,
35,
36,
37,
38,
39, 0, 0, 0, 0, 0, 0,
2N/A 40,
41,
42,
43,
44,
45,
46,
47,
48,
49, 0, 0, 0, 0, 0, 0,
2N/A 50,
51,
52,
53,
54,
55,
56,
57,
58,
59, 0, 0, 0, 0, 0, 0,
2N/A 60,
61,
62,
63,
64,
65,
66,
67,
68,
69, 0, 0, 0, 0, 0, 0,
2N/A 70,
71,
72,
73,
74,
75,
76,
77,
78,
79, 0, 0, 0, 0, 0, 0,
2N/A 80,
81,
82,
83,
84,
85,
86,
87,
88,
89, 0, 0, 0, 0, 0, 0,
2N/A 90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
2N/A 0, 0,
31,
60,
91,
121,
152,
182,
213,
244,
274,
305,
335,
366, 0, 0,
2N/A 0, 0,
31,
59,
90,
120,
151,
181,
212,
243,
273,
304,
334,
365, 0, 0,
2N/A 0, 0,
31,
59,
90,
120,
151,
181,
212,
243,
273,
304,
334,
365, 0, 0,
2N/A 0, 0,
31,
59,
90,
120,
151,
181,
212,
243,
273,
304,
334,
365, 0, 0,
2N/A * This function takes the raw Mostek data from the device tree translates 2N/A * it into UNIXC time (secs since Jan 1, 1970) and returns a string from 2N/A utc = (
year -
70);
/* next 3 lines: utc = 365y + y/4 */ 2N/A "Most recent AC Power Failure:\n"));
2N/A /* we only call to syslog when we get the entire line. */