bank16k's: pass byte count to swapwrite/read not block count.
authorBrett Gordon <beretta42@gmail.com>
Fri, 13 Nov 2015 14:19:39 +0000 (09:19 -0500)
committerBrett Gordon <beretta42@gmail.com>
Fri, 13 Nov 2015 14:19:39 +0000 (09:19 -0500)
Kernel/bank16k.c
Kernel/bank16k_low.c

index d549b9e..1a9a9bc 100644 (file)
@@ -192,7 +192,7 @@ int swapout(ptptr p)
        blk = map * SWAP_SIZE;
        /* Write the app (and possibly the uarea etc..) to disk */
        for (i = 0; i < 4; i++) {
-               swapwrite(SWAPDEV, blk, size, base, *pt++);
+               swapwrite(SWAPDEV, blk, size<<9, base, *pt++);
                base += 0x4000;
                base &= 0xC000; /* Snap to bank alignment */
                 blk += size;
@@ -235,7 +235,7 @@ void swapin(ptptr p, uint16_t map)
        }
 
        for (i = 0; i < 4; i ++) {
-               swapread(SWAPDEV, blk, size, base, *pt++);
+               swapread(SWAPDEV, blk, size<<9, base, *pt++);
                base += 0x4000;
                base &= 0xC000;
                blk += size;
index 7aa8640..6995cb3 100644 (file)
@@ -198,7 +198,7 @@ int swapout(ptptr p)
 
        /* Write the app (and possibly the uarea etc..) to disk */
        for (i = 0; i < 4; i ++) {
-               swapwrite(SWAPDEV, blk, size, base, *pt++);
+               swapwrite(SWAPDEV, blk, size<<9, base, *pt++);
                base += 0x4000;
                /* Last bank is determined by SWAP SIZE. We do the maths
                   in 512's (0x60 = 0xC000) */
@@ -240,12 +240,12 @@ void swapin(ptptr p, uint16_t map)
           we don't want to overwrite the live stack but buffer and fix up
           in tricks.s */
 #ifdef CONFIG_HAS_LOW_PAGE
-       swapread(SWAPDEV, blk, 1, 0x0000);
+       swapread(SWAPDEV, blk, 512, 0x0000);
        blk++;
 #endif
 
        for (i = 0; i < 4; i ++) {
-               swapread(SWAPDEV, blk, size, base, *pt++);
+               swapread(SWAPDEV, blk, size<<9, base, *pt++);
                base += 0x4000;
                /* Last bank is determined by SWAP SIZE. We do the maths
                   in 512's (0x60 = 0xC000) */