4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
23 * Use is subject to license terms.
26 #pragma ident "%Z%%M% %I% %E% SMI"
28 #include <sys/promif.h>
29 #include <sys/promimpl.h>
32 * This file implements promif routines for OPL-specific OBP client
33 * interfaces defined in FWARC/2005/268.
37 * prom_opl_get_tod - this function gets time-of-day and stick value from OBP.
38 * Please, see "The OPL OBP functional specification" for details.
42 prom_opl_get_tod(time_t *time
, int64_t *stickval
)
46 ci
[0] = p1275_ptr2cell("FJSV,get-tod"); /* Service name */
47 ci
[1] = (cell_t
)0; /* #argument cells */
48 ci
[2] = (cell_t
)2; /* #result cells */
49 ci
[3] = (cell_t
)0; /* The result: STICK */
50 ci
[4] = (cell_t
)0; /* The result: time */
53 (void) p1275_cif_handler(&ci
);
61 * prom_opl_set_diff - this function updates time difference
62 * w.r.t. SP/OBP reference time.
63 * Please, see "The OPL OBP functional specification" for details.
67 prom_opl_set_diff(int64_t diff
)
71 ci
[0] = p1275_ptr2cell("FJSV,set-domain-time"); /* Service name */
72 ci
[1] = (cell_t
)1; /* #argument cells */
73 ci
[2] = (cell_t
)0; /* #result cells */
74 ci
[3] = (cell_t
)diff
; /* Arg1: time diff */
77 (void) p1275_cif_handler(&ci
);
82 prom_attach_notice(int boardnum
)
87 ci
[0] = p1275_ptr2cell("FJSV,attach-notice");
90 ci
[3] = (cell_t
)boardnum
;
93 rv
= p1275_cif_handler(&ci
);
96 return ((rv
) ? -1 : p1275_cell2int(ci
[4]));
100 prom_detach_notice(int boardnum
)
105 ci
[0] = p1275_ptr2cell("FJSV,detach-notice");
108 ci
[3] = (cell_t
)boardnum
;
111 rv
= p1275_cif_handler(&ci
);
114 return ((rv
) ? -1 : p1275_cell2int(ci
[4]));
118 prom_opl_switch_console(int lsb_id
)
123 ci
[0] = p1275_ptr2cell("FJSV,switch-console"); /* name */
124 ci
[1] = (cell_t
)1; /* #argument cells */
125 ci
[2] = (cell_t
)1; /* #result cells */
126 /* target tty-port# */
127 ci
[3] = p1275_int2cell(lsb_id
);
130 rv
= p1275_cif_handler(&ci
);
136 return (p1275_cell2int(ci
[4])); /* Res1: Catch result */