* The ff flag causes its core to be freed--
* it may be off when called to create an image for a
* child process in newproc.
* Os is the old size of the data area of the process,
* and is supplied during core expansion swaps.
* panic: out of swap space
* panic: swap error -- IO error
a
= malloc(swapmap
, (rp
->p_size
+7)/8);
panic("out of swap space");
if(swap(a
, rp
->p_addr
, os
, 0))
mfree(coremap
, os
, rp
->p_addr
);
rp
->p_flag
=& ~(SLOAD
|SLOCK
);
* relinquish use of the shared text segment
if((xp
=u
.u_procp
->p_textp
) != NULL
) {
u
.u_procp
->p_textp
= NULL
;
if((ip
->i_mode
&ISVTX
) == 0) {
mfree(swapmap
, (xp
->x_size
+7)/8, xp
->x_daddr
);
* Attach to a shared text segment.
* If there is no shared text, just return.
* If there is, hook up to it:
* if it is not currently being used, it has to be read
* in from the inode (ip) and established in the swap space.
* If it is being used, but is not currently in core,
* a swap has to be done to get it back.
* The full coroutine glory has to be invoked--
* see slp.c-- because if the calling process
* is misplaced in core the text image might not fit.
* Quite possibly the code after "out:" could check to
* see if the text does fit and simply swap it in.
* panic: out of swap space
register struct text
*xp
;
for(xp
= &text
[0]; xp
< &text
[NTEXT
]; xp
++)
ts
= ((u
.u_arg
[1]+63)>>6) & 01777;
if((xp
->x_daddr
= malloc(swapmap
, (ts
+7)/8)) == NULL
)
panic("out of swap space");
swap(xp
->x_daddr
, rp
->p_addr
+USIZE
, ts
, 0);
u
.u_procp
->p_flag
=| SSWAP
;
* Decrement the in-core usage count of a shared text segment.
* When it drops to zero, free the core space.
if((rp
=xp
)!=NULL
&& rp
->x_ccount
!=0)
mfree(coremap
, rp
->x_size
, rp
->x_caddr
);