changeset 18:6cf2a3e7cca2

fix void * and volatile
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 07 Jul 2022 15:54:45 +0900
parents 735c804f890e
children 376be169227d
files src/bio.c src/defs.h src/fs.c
diffstat 3 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/bio.c	Thu Jul 07 15:38:55 2022 +0900
+++ b/src/bio.c	Thu Jul 07 15:54:45 2022 +0900
@@ -74,7 +74,7 @@
                 return b;
             }
 
-            sleep(b, &bcache.lock);
+            sleep((void*)b, &bcache.lock);
             goto loop;
         }
     }
@@ -136,7 +136,7 @@
     bcache.head.next = b;
 
     b->flags &= ~B_BUSY;
-    wakeup(b);
+    wakeup((void*)b);
 
     release(&bcache.lock);
 }
--- a/src/defs.h	Thu Jul 07 15:38:55 2022 +0900
+++ b/src/defs.h	Thu Jul 07 15:54:45 2022 +0900
@@ -131,10 +131,10 @@
 void            procdump(void);
 void            scheduler(void) __attribute__((noreturn));
 void            sched(void);
-void            sleep(struct buf *, struct spinlock*);
+void            sleep(void *, struct spinlock*);
 void            userinit(void);
 int             wait(void);
-void            wakeup(struct buf *);
+void            wakeup(vid *);
 void            yield(void);
 
 // swtch.S
--- a/src/fs.c	Thu Jul 07 15:38:55 2022 +0900
+++ b/src/fs.c	Thu Jul 07 15:54:45 2022 +0900
@@ -284,7 +284,7 @@
 
     acquire(&icache.lock);
     while (ip->flags & I_BUSY) {
-        sleep(ip, &icache.lock);
+        sleep((void*)ip, &icache.lock);
     }
 
     ip->flags |= I_BUSY;
@@ -319,7 +319,7 @@
 
     acquire(&icache.lock);
     ip->flags &= ~I_BUSY;
-    wakeup(ip);
+    wakeup((void*)ip);
     release(&icache.lock);
 }
 
@@ -346,7 +346,7 @@
 
         acquire(&icache.lock);
         ip->flags = 0;
-        wakeup(ip);
+        wakeup((void*)ip);
     }
 
     ip->ref--;