31 #include <linux/kernel.h>
33 #include <linux/module.h>
38 #include <asm/uaccess.h>
39 #include <asm/machvec.h>
41 #define BASE_DIR "srm_environment"
42 #define NAMED_DIR "named_variables"
43 #define NUMBERED_DIR "numbered_variables"
44 #define VERSION "0.0.6"
45 #define NAME "srm_env"
60 static char number[256][4];
80 static srm_env_t srm_numbered_entries[256];
83 static int srm_env_proc_show(
struct seq_file *
m,
void *
v)
96 if ((ret >> 61) == 0) {
110 static ssize_t srm_env_proc_write(
struct file *file,
const char __user *
buffer,
116 unsigned long ret1, ret2;
130 ret1 = callback_setenv(entry->
id, buf, count);
131 if ((ret1 >> 61) == 0) {
133 ret2 = callback_save_env();
134 while((ret2 >> 61) == 1);
145 .open = srm_env_proc_open,
149 .write = srm_env_proc_write,
153 srm_env_cleanup(
void)
156 unsigned long var_num;
163 entry = srm_named_entries;
164 while (entry->
name !=
NULL && entry->
id != 0) {
179 for (var_num = 0; var_num <= 255; var_num++) {
180 entry = &srm_numbered_entries[var_num];
202 unsigned long var_num;
207 if (!alpha_using_srm) {
209 "know about SRM (or you've booted "
210 "SRM->MILO->Linux, which gets "
211 "misdetected)...\n", __func__);
218 for (var_num = 0; var_num <= 255; var_num++)
219 sprintf(number[var_num],
"%ld", var_num);
255 entry = srm_named_entries;
256 while (entry->
name && entry->
id) {
258 &srm_env_proc_fops, entry);
267 for (var_num = 0; var_num <= 255; var_num++) {
268 entry = &srm_numbered_entries[var_num];
269 entry->
name = number[var_num];
272 &srm_env_proc_fops, entry);