From 087425100de065efb675a81833274b5ecc639335 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Thu, 1 Oct 2015 19:28:00 +0100 Subject: [PATCH] simple: support UDATA split away from process space --- Kernel/simple.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Kernel/simple.c b/Kernel/simple.c index 619f206a..07fbe344 100644 --- a/Kernel/simple.c +++ b/Kernel/simple.c @@ -71,7 +71,10 @@ int swapout(ptptr p) return ENOMEM; blk = map * SWAP_SIZE; /* Write the app (and possibly the uarea etc..) to disk */ - swapwrite(SWAPDEV, blk, SWAPTOP - SWAPBASE, +#ifdef CONFIG_SPLIT_UDATA + swapwrite(SWAPDEV, blk, UDATA_SIZE, (uint16_t)&udata, 1); +#endif + swapwrite(SWAPDEV, blk+1, SWAPTOP - SWAPBASE, SWAPBASE, 1); p->p_page = 0; p->p_page2 = map; @@ -96,7 +99,10 @@ void swapin(ptptr p, uint16_t map) return; } - swapread(SWAPDEV, blk, SWAPTOP - SWAPBASE, +#ifdef CONFIG_SPLIT_UDATA + swapread(SWAPDEV, blk, UDATA_SIZE, (uint16_t)&udata, 1); +#endif + swapread(SWAPDEV, blk+1, SWAPTOP - SWAPBASE, SWAPBASE, 1); #ifdef DEBUG kprintf("%x: swapin done %d\n", p, p->p_page); -- 2.34.1