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;
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);