M carrera/segment.h => carrera/segment.h +1 -0
@@ 6,6 6,7 @@ Physseg physseg[] =
{
{ SG_SHARED, "shared", 0, SEGMAXSIZE, 0, 0 },
{ SG_BSS, "memory", 0, SEGMAXSIZE, 0, 0 },
+ { SG_MAP, "map", 0, SEGMAXSIZE, 0, 0 },
{ SG_PHYSICAL, "eisaio", Eisaphys, 64*1024, 0, 0 },
{ SG_PHYSICAL, "eisavga", Eisavgaphys, 128*1024, 0, 0 },
{ SG_PHYSICAL, "bootrom", 0x1fc00000, 256*1024, 0, 0 },
M port/devproc.c => port/devproc.c +1 -1
@@ 47,7 47,7 @@ Dirtab procdir[] =
};
/* Segment type from portdat.h */
-char *sname[]={ "Text", "Data", "Bss", "Stack", "Shared", "Phys", "Shdata" };
+char *sname[]={ "Text", "Data", "Bss", "Stack", "Shared", "Phys", "Shdata", "Map" };
/*
* Qids are, in path:
M port/fault.c => port/fault.c +9 -2
@@ 52,10 52,12 @@ fixfault(Segment *s, ulong addr, int read, int doputmmu)
{
int type;
Pte **p, *etp;
- ulong mmuphys=0, soff;
+ char buf[ERRLEN];
+ ulong va, mmuphys=0, soff;
Page **pg, *lkp, *new;
Page *(*fn)(Segment*, ulong);
+ va = addr;
addr &= ~(BY2PG-1);
soff = addr-s->base;
p = &s->map[soff/PTEMAPMEM];
@@ 97,8 99,13 @@ fixfault(Segment *s, ulong addr, int read, int doputmmu)
case SG_BSS:
case SG_SHARED: /* Zero fill on demand */
- case SG_STACK:
+ case SG_STACK:
+ case SG_MAP:
if(*pg == 0) {
+ if(type == SG_MAP) {
+ sprint(buf, "map 0x%lux %c", va, read ? 'r' : 'w');
+ postnote(up, 1, buf, NDebug);
+ }
new = newpage(1, &s, addr);
if(s == 0)
return -1;
M port/portdat.h => port/portdat.h +1 -0
@@ 341,6 341,7 @@ enum
SG_SHARED = 04,
SG_PHYSICAL = 05,
SG_SHDATA = 06,
+ SG_MAP = 07,
SG_RONLY = 0040, /* Segment is read only */
SG_CEXEC = 0100, /* Detach at exec */
M port/segment.c => port/segment.c +1 -0
@@ 144,6 144,7 @@ dupseg(Segment **seg, int segno, int share)
break;
case SG_BSS: /* Just copy on write */
+ case SG_MAP:
qlock(&s->lk);
if(share && s->ref == 1) {
s->type = (s->type&~SG_TYPE)|SG_SHARED;
M port/swap.c => port/swap.c +1 -0
@@ 134,6 134,7 @@ loop:
case SG_BSS:
case SG_STACK:
case SG_SHARED:
+ case SG_MAP:
up->psstate = "Pageout";
pageout(p, s);
if(ioptr != 0) {