unless you really know what this hack does.
CONFIG_SRM_ENV
- If you enable this option, a subdirectory called srm_environment
- will give you access to the most important SRM environment
- variables. If you've got an Alpha style system supporting
- SRC, then it is a good idea to say Yes or Module to this driver.
+ If you enable this option, a subdirectory inside /proc called
+ /proc/srm_environment will give you access to the all important
+ SRM environment variables (those which have a name) and also
+ to all others (by their internal number).
+
+ SRM is something like a BIOS for Alpha machines. There are some
+ other such BIOSes, like AlphaBIOS, which this driver cannot
+ support (hey, that's not SRM!).
+
+ Despite the fact that this driver doesn't work on all Alphas (but
+ only on those which have SRM as their firmware), it's save to
+ build it even if your particular machine doesn't know about SRM
+ (or if you intend to compile a generic kernel). It will simply
+ not create those subdirectory in /proc (and give you some warning,
+ of course).
This driver is also available as a module and will be called
- srm_env.o if you build it as a module.
+ srm_env.o then.
CONFIG_DEBUG_KERNEL
Say Y here if you are developing drivers or trying to debug and
* Changelog
* ~~~~~~~~~
*
+ * Thu, 22 Aug 2002 15:10:43 +0200
+ * - Update Config.help entry. I got a number of emails asking
+ * me to tell their senders if they could make use of this
+ * piece of code... So: "SRM is something like BIOS for your
+ * Alpha"
+ * - Update code formatting a bit to better conform CodingStyle
+ * rules.
+ * - So this is v0.0.5, with no changes (except formatting)
+ *
* Wed, 22 May 2002 00:11:21 +0200
* - Fix typo on comment (SRC -> SRM)
* - Call this "Version 0.0.4"
#define BASE_DIR "srm_environment" /* Subdir in /proc/ */
#define NAMED_DIR "named_variables" /* Subdir for known variables */
#define NUMBERED_DIR "numbered_variables" /* Subdir for all variables */
-#define VERSION "0.0.4" /* Module version */
+#define VERSION "0.0.5" /* Module version */
#define NAME "srm_env" /* Module name */
MODULE_AUTHOR("Jan-Benedict Glaw <jbglaw@lug-owl.de>");
};
static srm_env_t srm_numbered_entries[256];
+
+
static int
srm_env_read(char *page, char **start, off_t off, int count, int *eof,
- void *data) {
+ void *data)
+{
int nbytes;
unsigned long ret;
srm_env_t *entry;
return -EFAULT;
}
- entry = (srm_env_t *)data;
+ entry = (srm_env_t *) data;
ret = callback_getenv(entry->id, page, count);
if((ret >> 61) == 0)
- nbytes = (int)ret;
+ nbytes = (int) ret;
else
nbytes = -EFAULT;
return nbytes;
}
+
static int
srm_env_write(struct file *file, const char *buffer, unsigned long count,
- void *data) {
+ void *data)
+{
#define BUFLEN 512
int nbytes;
srm_env_t *entry;
do
ret2 = callback_save_env();
while((ret2 >> 61) == 1);
- nbytes = (int)ret1;
+ nbytes = (int) ret1;
} else
nbytes = -EFAULT;
return nbytes;
}
+
static void
-srm_env_cleanup(void) {
+srm_env_cleanup(void)
+{
srm_env_t *entry;
unsigned long var_num;
return;
}
+
static int __init
-srm_env_init(void) {
+srm_env_init(void)
+{
srm_env_t *entry;
unsigned long var_num;
*/
if(!alpha_using_srm) {
printk(KERN_INFO "%s: This Alpha system doesn't "
- "know about SRM...\n", __FUNCTION__);
+ "know about SRM (or you've booted "
+ "SRM->MILO->Linux, which gets "
+ "misdetected)...\n", __FUNCTION__);
return -ENODEV;
}
if(entry->proc_entry == NULL)
goto cleanup;
- entry->proc_entry->data = (void *)entry;
+ entry->proc_entry->data = (void *) entry;
entry->proc_entry->owner = THIS_MODULE;
entry->proc_entry->read_proc = srm_env_read;
entry->proc_entry->write_proc = srm_env_write;
goto cleanup;
entry->id = var_num;
- entry->proc_entry->data = (void *)entry;
+ entry->proc_entry->data = (void *) entry;
entry->proc_entry->owner = THIS_MODULE;
entry->proc_entry->read_proc = srm_env_read;
entry->proc_entry->write_proc = srm_env_write;
printk(KERN_INFO "%s: version %s loaded successfully\n", NAME,
VERSION);
+
return 0;
cleanup:
srm_env_cleanup();
+
return -ENOMEM;
}
+
static void __exit
-srm_env_exit(void) {
+srm_env_exit(void)
+{
srm_env_cleanup();
printk(KERN_INFO "%s: unloaded successfully\n", NAME);
+
return;
}
+
module_init(srm_env_init);
module_exit(srm_env_exit);