xref: /netbsd/sys/arch/mac68k/mac68k/pram.h (revision bf9ec67e)
1 /*	$NetBSD: pram.h,v 1.4 1997/04/08 03:21:19 scottr Exp $	*/
2 
3 /*
4  * RTC toolkit version 1.08b, copyright 1995, erik vogan
5  *
6  * All rights and privledges to this code hereby donated
7  * to the ALICE group for use in NetBSD.  see the copyright
8  * below for more info...
9  */
10 /*
11  * Copyright (c) 1995 Erik Vogan
12  * All rights reserved.
13  *
14  * This code is derived from software contributed to the Alice Group
15  * by Erik Vogan.
16  *
17  * Redistribution and use in source and binary forms, with or without
18  * modification, are permitted provided that the following conditions
19  * are met:
20  * 1. Redistributions of source code must retain the above copyright
21  *    notice, this list of conditions and the following disclaimer.
22  * 2. Redistributions in binary form must reproduce the above copyright
23  *    notice, this list of conditions and the following disclaimer in the
24  *    documentation and/or other materials provided with the distribution.
25  * 3. All advertising materials mentioning features or use of this software
26  *    must display the following acknowledgement:
27  *	This product includes software developed by the Alice Group.
28  * 4. The names of the Alice Group or any of its members may not be used
29  *    to endorse or promote products derived from this software without
30  *    specific prior written permission.
31  *
32  * THIS SOFTWARE IS PROVIDED BY THE ALICE GROUP ``AS IS'' AND ANY EXPRESS OR
33  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
34  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
35  * IN NO EVENT SHALL THE ALICE GROUP BE LIABLE FOR ANY DIRECT, INDIRECT,
36  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
37  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
38  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
39  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
40  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
41  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42  */
43 
44 /*
45  * In the following functions, addr is a pointer to the data to read/write
46  * from/to PRAM (bytes) and loc is the PRAM address to read/write, and len
47  * is the number of consecutive bytes to read/write.
48  *
49  *	possible values for:		loc		len
50  *	read/writePram		     $00-$13 **	      $01-10 **
51  *	read/writeExtPram	     $00-$ff	      $00-ff
52  *
53  *	** - due to the way the PRAM is set up, $00-0f must be read with one
54  *	     command, and $10-$13 must be read with another.  Please, do not
55  *	     attempt to read across the $0f/$10 boundary!!  You have been
56  *	     warned!!
57  */
58 
59 void readPram    (char *addr, int loc, int len);
60 void writePram   (char *addr, int loc, int len);
61 void readExtPram (char *addr, int loc, int len);
62 void writeExtPram(char *addr, int loc, int len);
63 
64 /*
65  * The following routines are used to get/set the PRAM time
66  * (which is stored as seconds since 1904).
67  */
68 
69 unsigned long	getPramTime __P((void));
70 void 		setPramTime __P((unsigned long time));
71 
72 unsigned long	pram_readtime __P((void));
73 void		pram_settime __P((unsigned long));
74 
75 #ifndef MRG_ADB
76 /*
77  * These functions only when we are not using
78  * the MRG method of accessing the ADB/PRAM/RTC.
79  */
80 unsigned long	getPramTimeII __P((void));
81 void		setPramTimeII __P((unsigned long));
82 
83 #endif /* !MRG_ADB */
84 
85