1 /* $NetBSD: memswitch.h,v 1.1.1.1 1999/06/21 15:56:03 minoura Exp $ */
4 * Copyright (c) 1999 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
37 #define _PATH_DEVSRAM "/dev/sram"
40 #define PROP_MAGIC1 (0)
41 #define PROP_MAGIC2 (1)
42 #define MAGIC1 (0x82773638)
43 #define MAGIC2 (0x30303057)
44 #define MAXVALUELEN 100
48 typedef int (*parse_t
) __P((struct property
*, const char*));
49 typedef int (*print_t
) __P((struct property
*, char*));
50 typedef int (*fill_t
) __P((struct property
*));
51 typedef int (*flush_t
) __P((struct property
*));
60 unsigned char byte
[4];
61 unsigned short word
[2];
62 unsigned long longword
;
66 union value modified_value
;
67 union value default_value
;
76 extern int number_of_props
;
77 extern struct property properties
[];
78 extern char *progname
;
79 extern u_int8_t
*current_values
;
80 extern u_int8_t
*modified_values
;
82 void usage
__P((void)) __attribute__((noreturn
));
83 void show_single
__P((const char*));
84 void show_all
__P((void));
85 void modify_single
__P((const char*));
86 void help_single
__P((const char*));
87 void alloc_current_values
__P((void));
88 void alloc_modified_values
__P((void));
89 void flush
__P((void));
90 int save
__P((const char*));
91 int restore
__P((const char*));