From 53f5bf73d3a262a8aeff630cbb0f47c4f860738a Mon Sep 17 00:00:00 2001 From: Brett Gordon Date: Fri, 13 Nov 2015 09:19:39 -0500 Subject: [PATCH] bank16k's: pass byte count to swapwrite/read not block count. --- Kernel/bank16k.c | 4 ++-- Kernel/bank16k_low.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Kernel/bank16k.c b/Kernel/bank16k.c index d549b9ed..1a9a9bc4 100644 --- a/Kernel/bank16k.c +++ b/Kernel/bank16k.c @@ -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; diff --git a/Kernel/bank16k_low.c b/Kernel/bank16k_low.c index 7aa8640d..6995cb3d 100644 --- a/Kernel/bank16k_low.c +++ b/Kernel/bank16k_low.c @@ -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) */ -- 2.34.1