From: Alan Cox Date: Thu, 1 Oct 2015 18:28:00 +0000 (+0100) Subject: simple: support UDATA split away from process space X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=087425100de065efb675a81833274b5ecc639335;p=FUZIX.git simple: support UDATA split away from process space --- 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);