sync with WEGA 3.2 kernel

This commit is contained in:
Oliver Lehmann 2008-05-27 16:10:49 +00:00
parent 0ad6e85430
commit b4236c3bac
1 changed files with 6 additions and 10 deletions

View File

@ -33,19 +33,15 @@ mkseg()
register unsigned segno; register unsigned segno;
register unsigned size; register unsigned size;
register struct proc *pp; register struct proc *pp;
struct a {
unsigned segno;
unsigned size;
}
*uap;
char i, j; char i, j;
pp = u.u_procp; pp = u.u_procp;
segno = ((struct a *)u.u_ap)->segno & 0x7f; segno = ((saddr_t *)u.u_ap)->left & 0x7f;
size = ((struct a *)u.u_ap)->size; size = lbtoc((long)((saddr_t *)u.u_ap)->right);
if (!segno){ if (!segno){
loop:
i = 4; i = 4;
loop:
for (j=0; j<u.u_nsegs; j++) for (j=0; j<u.u_nsegs; j++)
if ((u.u_segno[j]&0x7f) == i) if ((u.u_segno[j]&0x7f) == i)
if (++i > STAK){ if (++i > STAK){
@ -54,7 +50,7 @@ loop:
} }
else else
goto loop; goto loop;
segno = i; segno = (unsigned char)i;
} }
else else
for (j=0; j<u.u_nsegs; j++) for (j=0; j<u.u_nsegs; j++)
@ -63,7 +59,7 @@ loop:
return; return;
} }
j = u.u_nsegs; j = u.u_nsegs;
if (u.u_tsize+u.u_dsize+u.u_ssize+(unsigned)USIZE > umemory){ if (u.u_tsize+u.u_dsize+size+u.u_ssize+USIZE > umemory){
u.u_error = ENOMEM; u.u_error = ENOMEM;
return; return;
} }