simple: support UDATA split away from process space
authorAlan Cox <alan@linux.intel.com>
Thu, 1 Oct 2015 18:28:00 +0000 (19:28 +0100)
committerAlan Cox <alan@linux.intel.com>
Thu, 1 Oct 2015 18:28:00 +0000 (19:28 +0100)
Kernel/simple.c

index 619f206..07fbe34 100644 (file)
@@ -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);