* We have a hackish fix for init that would be nice
* resolve.
*
- * FIXME: we need to move udata.u_top into p-> in order to
- * support banked swapping.
+ * Use p-> not udata. The udata is not yet swapped in!
*/
int pagemap_alloc(ptptr p)
{
uint8_t *ptr = (uint8_t *) & p->p_page;
- int needed = maps_needed(udata.u_top);
+ int needed = maps_needed(p->p_top);
int i;
#ifdef SWAPDEV
* Swap out the memory of a process to make room
* for something else. For bank16k do this as four operations
* ready for when we pass page values not processes to the drivers
+ *
+ * FIXME: bank16k should only read/write out the banks that are in use
*/
int swapout(ptptr p)
/*
* Swap ourself in: must be on the swap stack when we do this
+ *
+ * FIXME: bank16k should only read/write out the banks that are in use
*/
void swapin(ptptr p, uint16_t map)
{
int pagemap_alloc(ptptr p)
{
uint8_t *ptr = (uint8_t *) & p->p_page;
- int needed = maps_needed(udata.u_top);
+ int needed = maps_needed(p->p_top);
int i;
#ifdef SWAPDEV
int pagemap_alloc(ptptr p)
{
uint8_t *ptr = (uint8_t *) & p->p_page;
- int needed = maps_needed(udata.u_top);
+ int needed = maps_needed(p->p_top);
#ifdef SWAPDEV
/* Throw our toys out of our pram until we have enough room */
/*
* Swap out the memory of a process to make room
* for something else
+ *
+ * FIXME: we can write out base - p_top, then the udata providing
+ * we also modify our read logic here as well
*/
int swapout(ptptr p)
{
/**HP**/
uint16_t p_pgrp; /* Process group */
uint8_t p_nice;
+ usize_t p_top; /* Copy of u_top */
#ifdef CONFIG_PROFIL
uint8_t p_profscale;
void * p_profbuf;
init_process = ptab_alloc();
udata.u_ptab = init_process;
udata.u_top = PROGLOAD + 4096; /* Plenty for the boot */
+ init_process->p_top = udata.u_top;
map_init();
newproc(init_process);
/* From this point on we are commmited to the exec() completing */
udata.u_top = top;
+ udata.u_ptab->p_top = top;
/* setuid, setgid if executable requires it */
if (ino->c_node.i_mode & SET_UID)
/**HP**/
uint16_t p_pgrp; /* Process group */
uint8_t p_nice;
+ uint16_t p_top; /* Copy of u_top : FIXME: usize_t */
#ifdef CONFIG_PROFIL
uint8_t p_profscale;
void * p_profbuf;