Annotation of coherent/d/PS2_KERNEL/tools/devload.c, revision 1.1.1.1

1.1       root        1: /*
                      2:  * devload.c - call the load routine for a device driver
                      3:  *
                      4:  * Useful mainly during installation.  Sometime after booting, patch
                      5:  * the "con" address for a driver into drvl+..., then use this
                      6:  * command with the device major number to start up the driver.
                      7:  *
                      8:  * Usage - devload major_number
                      9:  */
                     10: #include <stdio.h>
                     11: #include <sys/param.h>
                     12: 
                     13: main(argc, argv)
                     14: int argc;
                     15: char ** argv;
                     16: {
                     17:        int res;
                     18:        unsigned int a2;
                     19: 
                     20:        if (argc == 2) {
                     21:                if (sscanf(argv[1], "%d", &a2) == 1) {
                     22:                        if (a2 < NDRV) {
                     23:                                res = cohcall(COH_DEVLOAD, a2);
                     24:                                if (res == -1) {
                     25:                                        perror("devload");
                     26:                                        exit(1);
                     27:                                } else
                     28:                                        exit(0);
                     29:                        } else {
                     30:                                fprintf(stderr,
                     31: "Major number is %d - must be between 0 and %d\n", a2, NDRV-1);
                     32:                                exit(1);
                     33:                        }
                     34:                } else {
                     35:                        fprintf(stderr, "Usage:  %s major_number\n", argv[0]);
                     36:                        exit(1);
                     37:                }
                     38:        } else {
                     39:                fprintf(stderr, "Usage:  %s major_number\n", argv[0]);
                     40:                exit(1);
                     41:        }
                     42: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.