mirror of
git://git.9front.org/plan9front/plan9front
synced 2025-01-12 11:10:06 +00:00
vmx: clean up mksegment, memset only if segment existed (devsegment clears new ones)
This commit is contained in:
parent
d7120ecb77
commit
f5d1fce9b5
1 changed files with 7 additions and 11 deletions
|
@ -320,9 +320,6 @@ gend(void *v)
|
|||
return (u8int *) v + gavail(v);
|
||||
}
|
||||
|
||||
void *tmp, *vgamem;
|
||||
uvlong tmpoff, vgamemoff;
|
||||
|
||||
static void
|
||||
mksegment(char *sn)
|
||||
{
|
||||
|
@ -355,8 +352,9 @@ mksegment(char *sn)
|
|||
close(fd);
|
||||
gmem = segattach(0, sn, nil, sz);
|
||||
if(gmem == (void*)-1) sysfatal("segattach: %r");
|
||||
}else{
|
||||
memset(gmem, 0, sz > 1<<24 ? 1<<24 : sz);
|
||||
}
|
||||
memset(gmem, 0, sz > 1<<24 ? 1<<24 : sz);
|
||||
p = gmem;
|
||||
for(r = mmap; r != nil; r = r->next){
|
||||
if(r->segname == nil) continue;
|
||||
|
@ -365,14 +363,12 @@ mksegment(char *sn)
|
|||
p += r->end - r->start;
|
||||
r->ve = p;
|
||||
}
|
||||
vgamem = p;
|
||||
vgamemoff = p - gmem;
|
||||
regptr(0xa0000)->segoff = vgamemoff;
|
||||
regptr(0xa0000)->v = vgamem;
|
||||
/* vga */
|
||||
r = regptr(0xa0000);
|
||||
r->segoff = p - gmem;
|
||||
r->v = p;
|
||||
p += 256*1024;
|
||||
regptr(0xa0000)->ve = p;
|
||||
tmp = p;
|
||||
tmpoff = p - gmem;
|
||||
r->ve = p;
|
||||
|
||||
for(r = mmap; r != nil; r = r->next)
|
||||
modregion(r);
|
||||
|
|
Loading…
Reference in a new issue