void cpminit(void) { IMM *io; io = m->iomem; io->sdcr = 1; io->lccr &= ~1; /* disable LCD */ io->pcint = 0; /* disable all port C interrupts */ io->pcso = 0; io->pcdir =0; io->pcpar = 0; io->pcdat = 0; io->papar = 0; io->padir = 0; io->paodr = 0; io->padat = 0; io->pbpar = 0; io->pbdir = 0; io->pbodr = 0; io->pbdat = 0; eieio(); for(io->cpcr = 0x8001; io->cpcr & 1;) /* reset all CPM channels */ eieio(); mapinit(&bdmap, bdmapv, sizeof(bdmapv)); mapfree(&bdmap, DPBASE, BDSIZE); }
int init_sessions()// { int err = mapinit(&session_map, sizeof(session_t*), 256, &hash, &cmp); if (err == -1) { printf("main: map_create failed\n"); return -1; } memset(&session_map_mutex, 0, sizeof(session_map_mutex)); return 0; }
static void confinit(void) { conf.nmach = 1; conf.mem = meminit(); conf.nuid = 1000; conf.nserve = 15; /* tunable */ conf.nfile = 30000; conf.nlgmsg = 100; conf.nsmmsg = 500; localconfinit(); conf.nwpath = conf.nfile*8; conf.nauth = conf.nfile/10; conf.gidspace = conf.nuid*3; cons.flags = 0; if (conf.devmap) mapinit(conf.devmap); }
void main(int argc, char **argv) { int id, arc; char *arv[4]; char *l, *name; chatty = 1; ARGBEGIN{ case '9': case 'u': style = ARGC(); break; case 'D': ++debug; break; }ARGEND if(argc <= 0){ ids = readunixids("/fd/0", style); if(ids) idprint(1, ids); exits(ids ? 0 : "readunixids"); } mapinit(argv[0], 0); in = Bopen("/fd/0", OREAD); while(l = Brdline(in, '\n')){ /* assign = */ l[Blinelen(in)-1] = 0; arc = strparse(l, nelem(arv), arv); if(arc <= 0) continue; switch(arv[0][0]){ case 'r': if(arc < 2) continue; mapinit(arv[1], arv[2]); break; case 'i': if(arc < 2) continue; id = strtol(arv[1], 0, 10); name = id2name(pids, id); print("%d -> %s\n", id, name); break; case 'n': if(arc < 2) continue; name = arv[1]; id = name2id(pids, name); print("%s -> %d\n", name, id); break; case 'p': print("server=%s, client=%s\n", mp->server, mp->client); break; case 'P': idprint(1, *pids); break; case 'u': pids = &mp->u.ids; print("users...\n"); break; case 'g': pids = &mp->g.ids; print("groups...\n"); break; } } exits(0); }