| plan 9 kernel history: overview | file list | diff list |
alphapc/devarch.c (diff list | history)
| 2000/0401/sys/src/9/alphapc/devarch.c:55,62 – 2000/0726/sys/src/9/alphapc/devarch.c:55,62 (short | long) | ||
| 2000/0401 | iomap.maps[i].next = nil; iomap.free = iomap.maps; | |
| 2000/0726 | // a dummy entry at 2^17 ioalloc(0x20000, 1, 0, "dummy"); | |
| 2000/0401 | } static long cputyperead(char*, int, ulong); | |
| 2000/0726/sys/src/9/alphapc/devarch.c:27,50 – 2001/0727/sys/src/9/alphapc/devarch.c:27,96 (short | long) | ||
| 2000/0401 | } iomap; enum { | |
| 2001/0727 | Qdir = 0, Qioalloc = 1, | |
| 2000/0401 | Qiob, Qiow, Qiol, | |
| 2001/0727 | Qbase, Qmax = 16, | |
| 2000/0401 | }; | |
| 2001/0727 | typedef long Rdwrfn(Chan*, void*, long, vlong); static Rdwrfn *readfn[Qmax]; static Rdwrfn *writefn[Qmax]; static Dirtab archdir[] = { ".", { Qdir, 0, QTDIR }, 0, 0555, | |
| 2000/0401 | "ioalloc", { Qioalloc, 0 }, 0, 0444, "iob", { Qiob, 0 }, 0, 0660, "iow", { Qiow, 0 }, 0, 0660, "iol", { Qiol, 0 }, 0, 0660, | |
| 2001/0727 | Lock archwlock; /* the lock is only for changing archdir */ int narchdir = Qbase; | |
| 2000/0401 | ||
| 2001/0727 | /* * Add a file to the #P listing. Once added, you can't delete it. * You can't add a file with the same name as one already there, * and you get a pointer to the Dirtab entry so you can do things * like change the Qid version. Changing the Qid path is disallowed. */ Dirtab* addarchfile(char *name, int perm, Rdwrfn *rdfn, Rdwrfn *wrfn) { int i; Dirtab d; Dirtab *dp; memset(&d, 0, sizeof d); strcpy(d.name, name); d.perm = perm; lock(&archwlock); if(narchdir >= Qmax){ unlock(&archwlock); return nil; } for(i=0; i<narchdir; i++) if(strcmp(archdir[i].name, name) == 0){ unlock(&archwlock); return nil; } d.qid.path = narchdir; archdir[narchdir] = d; readfn[narchdir] = rdfn; writefn[narchdir] = wrfn; dp = &archdir[narchdir++]; unlock(&archwlock); return dp; } | |
| 2000/0401 | void ioinit(void) { | |
| 2000/0726/sys/src/9/alphapc/devarch.c:59,66 – 2001/0727/sys/src/9/alphapc/devarch.c:105,110 | ||
| 2000/0726 | ioalloc(0x20000, 1, 0, "dummy"); | |
| 2000/0401 | } | |
| 2000/0726/sys/src/9/alphapc/devarch.c:115,121 – 2001/0727/sys/src/9/alphapc/devarch.c:159,165 | ||
| 2000/0401 | m->tag[sizeof(m->tag)-1] = 0; *l = m; | |
| 2001/0727 | archdir[0].qid.vers++; | |
| 2000/0401 | unlock(&iomap); return m->start; | |
| 2000/0726/sys/src/9/alphapc/devarch.c:138,144 – 2001/0727/sys/src/9/alphapc/devarch.c:182,188 | ||
| 2000/0401 | if((*l)->start > port) break; } | |
| 2001/0727 | archdir[0].qid.vers++; | |
| 2000/0401 | unlock(&iomap); } | |
| 2000/0726/sys/src/9/alphapc/devarch.c:175,196 – 2001/0727/sys/src/9/alphapc/devarch.c:219,240 | ||
| 2000/0401 | return devattach('P', spec); } | |
| 2001/0727 | Walkqid* archwalk(Chan* c, Chan *nc, char** name, int nname) | |
| 2000/0401 | { | |
| 2001/0727 | return devwalk(c, nc, name, nname, archdir, narchdir, devgen); | |
| 2000/0401 | } | |
| 2001/0727 | static int archstat(Chan* c, uchar* dp, int n) | |
| 2000/0401 | { | |
| 2001/0727 | return devstat(c, dp, n, archdir, narchdir, devgen); | |
| 2000/0401 | } static Chan* archopen(Chan* c, int omode) { | |
| 2001/0727 | return devopen(c, omode, archdir, nelem(archdir), devgen); | |
| 2000/0401 | } static void | |
| 2000/0726/sys/src/9/alphapc/devarch.c:206,222 – 2001/0727/sys/src/9/alphapc/devarch.c:250,266 | ||
| 2000/0401 | static long archread(Chan *c, void *a, long n, vlong offset) { | |
| 2001/0727 | char buf[Linelen+1], *p; | |
| 2000/0401 | int port; ushort *sp; ulong *lp; | |
| 2001/0727 | IOMap *m; Rdwrfn *fn; | |
| 2000/0401 |
| |
| 2001/0727 | switch((ulong)c->qid.path){ | |
| 2000/0401 | case Qdir: | |
| 2001/0727 | return devdirread(c, a, n, archdir, nelem(archdir), devgen); | |
| 2000/0401 | case Qiob: port = offset; | |
| 2000/0726/sys/src/9/alphapc/devarch.c:248,260 – 2001/0727/sys/src/9/alphapc/devarch.c:292,300 | ||
| 2000/0401 | case Qioalloc: break; | |
| 2001/0727 | if(c->qid.path < narchdir && (fn = readfn[c->qid.path])) return fn(c, a, n, offset); | |
| 2000/0401 | error(Eperm); break; } | |
| 2000/0726/sys/src/9/alphapc/devarch.c:281,292 – 2001/0727/sys/src/9/alphapc/devarch.c:321,333 | ||
| 2000/0401 | static long archwrite(Chan *c, void *a, long n, vlong offset) { | |
| 2001/0727 | char *p; | |
| 2000/0401 | int port; ushort *sp; ulong *lp; | |
| 2001/0727 | Rdwrfn *fn; | |
| 2000/0401 |
| |
| 2001/0727 | switch((ulong)c->qid.path){ | |
| 2000/0401 | case Qiob: p = a; | |
| 2000/0726/sys/src/9/alphapc/devarch.c:316,321 – 2001/0727/sys/src/9/alphapc/devarch.c:357,364 | ||
| 2000/0401 | return n*4; default: | |
| 2001/0727 | if(c->qid.path < narchdir && (fn = writefn[c->qid.path])) return fn(c, a, n, offset); | |
| 2000/0401 | error(Eperm); break; } | |
| 2000/0726/sys/src/9/alphapc/devarch.c:329,335 – 2001/0727/sys/src/9/alphapc/devarch.c:372,377 | ||
| 2000/0401 | devreset, devinit, archattach, | |
| 2000/0726/sys/src/9/alphapc/devarch.c:366,387 – 2001/0727/sys/src/9/alphapc/devarch.c:408,413 | ||
| 2000/0401 | }; void | |
| 2000/0726/sys/src/9/alphapc/devarch.c:419,425 – 2001/0727/sys/src/9/alphapc/devarch.c:445,451 | ||
| 2000/0401 | } static long | |
| 2001/0727 | cputyperead(Chan*, void *a, long n, vlong offset) | |
| 2000/0401 | { char str[32], *cputype; ulong mhz, maj; | |
| 2000/0726/sys/src/9/alphapc/devarch.c:434,437 – 2001/0727/sys/src/9/alphapc/devarch.c:460,481 | ||
| 2000/0401 | snprint(str, sizeof(str), "%s %lud\n", cputype, mhz); return readstr(offset, a, n, str); | |
| 2001/0727 | } void archinit(void) { PCArch **p; arch = 0; for(p = knownarch; *p; p++){ if((*p)->ident && (*p)->ident() == 0){ arch = *p; break; } } if(arch == 0) arch = &archgeneric; addarchfile("cputype", 0444, cputyperead, nil); | |
| 2000/0401 | } | |
| 2001/0727/sys/src/9/alphapc/devarch.c:452,458 – 2001/0728/sys/src/9/alphapc/devarch.c:452,458 (short | long) | ||
| 2000/0401 | Hwcpu *cpu; mhz = (m->cpuhz+999999)/1000000; | |
| 2001/0728 | cpu = (Hwcpu*) ((ulong)hwrpb + hwrpb->cpuoff); /* NB CPU 0 */ | |
| 2000/0401 | cputype = "unknown"; maj = (ulong)cpu->cputype; if (maj < nelem(cpunames)) | |
| 2001/0728/sys/src/9/alphapc/devarch.c:51,56 – 2001/1023/sys/src/9/alphapc/devarch.c:51,58 (short | long) | ||
| 2000/0401 | }; | |
| 2001/0727 | Lock archwlock; /* the lock is only for changing archdir */ int narchdir = Qbase; | |
| 2001/1023 | int (*_pcmspecial)(char *, ISAConf *); void (*_pcmspecialclose)(int); | |
| 2000/0401 | ||
| 2001/0727 | /* * Add a file to the #P listing. Once added, you can't delete it. | |
| 2001/0728/sys/src/9/alphapc/devarch.c:478,481 – 2001/1023/sys/src/9/alphapc/devarch.c:480,496 | ||
| 2001/0727 | arch = &archgeneric; addarchfile("cputype", 0444, cputyperead, nil); | |
| 2001/1023 | } int pcmspecial(char *idstr, ISAConf *isa) { return (_pcmspecial != nil)? _pcmspecial(idstr, isa): -1; } void pcmspecialclose(int a) { if (_pcmspecialclose != nil) _pcmspecialclose(a); | |
| 2000/0401 | } | |
| 2001/1023/sys/src/9/alphapc/devarch.c:372,378 – 2002/0109/sys/src/9/alphapc/devarch.c:372,379 (short | long) | ||
| 2000/0401 | "arch", devreset, | |
| 2002/0109 | devinit, devshutdown, | |
| 2000/0401 | archattach, archwalk, archstat, | |
| 2002/0109/sys/src/9/alphapc/devarch.c:401,413 – 2002/1130/sys/src/9/alphapc/devarch.c:401,449 (short | long) | ||
| 2000/0401 | static char *sysnames[] = { | |
| 2002/1130 | [1] "Alpha Demo. Unit", [2] "DEC 4000; Cobra", [3] "DEC 7000; Ruby", [4] "DEC 3000/500; Flamingo family (TC)", [6] "DEC 2000/300; Jensen (EISA/ISA)", [7] "DEC 3000/300; Pelican (TC)", [8] "Avalon A12; Avalon Multicomputer", [9] "DEC 2100/A500; Sable", [10] "DEC APXVME/64; AXPvme (VME?)", [11] "DEC AXPPCI/33; NoName (PCI/ISA)", [12] "DEC 21000; TurboLaser (PCI/EISA)", [13] "DEC 2100/A50; Avanti (PCI/ISA)", [14] "DEC MUSTANG; Mustang", [15] "DEC KN20AA; kn20aa (PCI/EISA)", [17] "DEC 1000; Mikasa (PCI/ISA?)", [19] "EB66; EB66 (PCI/ISA?)", // DEC? [20] "EB64P; EB64+ (PCI/ISA?)", // DEC? [21] "Alphabook1; Alphabook", [22] "DEC 4100; Rawhide (PCI/EISA)", [23] "DEC EV45/PBP; Lego", [24] "DEC 2100A/A500; Lynx", [26] "DEC AlphaPC 164", // only supported one: "EB164 (PCI/ISA)" [27] "DEC 1000A; Noritake", [28] "DEC AlphaVME/224; Cortex", [30] "DEC 550; Miata (PCI/ISA)", [32] "DEC EV56/PBP; Takara", [33] "DEC AlphaVME/320; Yukon (VME?)", [34] "DEC 6600; MonetGoldrush", // 200 and up is Alpha Processor Inc. machines // [201] "API UP1000; Nautilus", | |
| 2000/0401 | }; static char *cpunames[] = { | |
| 2002/1130 | [1] "EV3", [2] "EV4: 21064", [3] "Simulation", [4] "LCA4: 2106[68]", [5] "EV5: 21164", [6] "EV45: 21064A", [7] "21164A", /* only supported one: EV56 */ [8] "EV6: 21264", [9] "PCA256: 21164PC", | |
| 2000/0401 | }; void | |
| 2002/0109/sys/src/9/alphapc/devarch.c:430,436 – 2002/1130/sys/src/9/alphapc/devarch.c:466,472 | ||
| 2000/0401 | s = "<unknown>"; if (hwrpb->systype < nelem(sysnames)) s = sysnames[hwrpb->systype]; | |
| 2002/1130 | print("%s (%llux, %llux, %llux)\n", s, hwrpb->systype, hwrpb->sysvar, hwrpb->sysrev); | |
| 2000/0401 | } for (i = 0; i < hwrpb->ncpu; i++) { | |