]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/teg2/main.c
devarch: restrict i/o port access to 64K, disallow msr 32-bit wrap arround (thanks...
[plan9front.git] / sys / src / 9 / teg2 / main.c
index 6847f3a9165ae561077339c85938d31758a73c49..892224132ab62b9fca3a5aecdb1419190664975a 100644 (file)
@@ -208,13 +208,10 @@ getenv(char* name, char* buf, int n)
 void
 machon(uint cpu)
 {
-       ulong cpubit;
-
-       cpubit = 1 << cpu;
        lock(&active);
-       if ((active.machs & cpubit) == 0) {     /* currently off? */
+       if (active.machs[cpu] == 0) {   /* currently off? */
+               active.machs[cpu] = 1;
                conf.nmach++;
-               active.machs |= cpubit;
        }
        unlock(&active);
 }
@@ -223,13 +220,10 @@ machon(uint cpu)
 void
 machoff(uint cpu)
 {
-       ulong cpubit;
-
-       cpubit = 1 << cpu;
        lock(&active);
-       if (active.machs & cpubit) {            /* currently on? */
+       if (active.machs[cpu]) {                /* currently on? */
+               active.machs[cpu] = 0;
                conf.nmach--;
-               active.machs &= ~cpubit;
        }
        unlock(&active);
 }
@@ -461,7 +455,6 @@ main(void)
 //     i8250console();                 /* too early; see init0 */
 
        pageinit();                     /* prints "1020M memory: ⋯ */
-       swapinit();
        userinit();
 
        /*
@@ -501,7 +494,7 @@ exit(int)
 int
 isaconfig(char *class, int ctlrno, ISAConf *isa)
 {
-       char cc[32], *p;
+       char cc[32], *p, *x;
        int i;
 
        snprint(cc, sizeof cc, "%s%d", class, ctlrno);
@@ -509,6 +502,10 @@ isaconfig(char *class, int ctlrno, ISAConf *isa)
        if(p == nil)
                return 0;
 
+       x = nil;
+       kstrdup(&x, p);
+       p = x;
+
        isa->type = "";
        isa->nopt = tokenize(p, isa->opt, NISAOPT);
        for(i = 0; i < isa->nopt; i++){
@@ -913,3 +910,10 @@ wakewfi(void)
                intrcpu(cpu);
 #endif
 }
+
+void
+setupwatchpts(Proc *, Watchpt *, int n)
+{
+       if(n > 0)
+               error("no watchpoints");
+}