]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/pc/devi82365.c
kernel: cleanup the software mouse cursor mess
[plan9front.git] / sys / src / 9 / pc / devi82365.c
index 0e05a610294a8beaed353f1113507b95009f91e8..20cace973729bad62fd1dfd3e45cda1c7c8f8058 100644 (file)
@@ -268,7 +268,6 @@ pcmmap(int slotno, ulong offset, int len, int attr)
                if((we & bit))
                if(m->attr == attr)
                if(offset >= m->ca && e <= m->cea){
-
                        m->ref++;
                        unlock(&pp->mlock);
                        return m;
@@ -285,12 +284,13 @@ pcmmap(int slotno, ulong offset, int len, int attr)
 
        /* if isa space isn't big enough, free it and get more */
        if(m->len < len){
-               if(m->isa){
+               if(m->len){
                        umbfree(m->isa, m->len);
                        m->len = 0;
                }
-               m->isa = PADDR(umbmalloc(0, len, Mgran));
-               if(m->isa == 0){
+               m->isa = umballoc(-1, len, Mgran);
+               if(m->isa == -1){
+                       m->isa = 0;
                        print("pcmmap: out of isa space\n");
                        unlock(&pp->mlock);
                        return 0;
@@ -864,7 +864,7 @@ i82365write(Chan *c, void *a, long n, vlong off)
 
                /* set vpp on card */
                if(strncmp(buf, "vpp", 3) == 0)
-                       wrreg(pp, Rpc, vcode(atoi(buf+3))|Fautopower|Foutena|Fcardena);
+                       wrreg(pp, Rpc, vcode(strtol(buf+3, 0, 0))|Fautopower|Foutena|Fcardena);
                return n;
        case Qmem:
        case Qattr: