13.07.2015 Views

iAPX 286 Operating System Writers Guide 1983

iAPX 286 Operating System Writers Guide 1983

iAPX 286 Operating System Writers Guide 1983

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

REAL MEMORY MANAGEMENTPL/M-<strong>286</strong> COMPILER 960-501 date PAGE 6131 2132 2133 3134 3135 3136 3137 3138 4139 41411 4141 3142 2143 2144 3145 3146 3147 4148 4149 4150 4151 3152 3153 3154 4155 4156 4157 4158 3159 2160 2161 2162 2163 2164 2166 2ELSE IF (NCASE AND HI USED) HI USED/* if high neighbor-free */THEN DO; /* Dispose with high neighbor's links. *//* Make selector for high neighbor. */NEIBR ADDR = FREE BASE + FREE SIZE + TAGS SIZE;CALL POINT AT (SLOT B,DWRIGHTS~@NEIBR ADDR~LINK LIMIT);IF NCASE =-0 /* both neighbors free */ -THEN /* remove one from available list. */CALL DELINK (SLOT B);ELSE /* Must be case 2. */DO /* Transfer links to new current. */;CURR LINK. PRIOR = NEIBR LINK. PRIOR;CURR=LINK.NEXT = NEIBR=LINK.NEXT;END;END; /* disposing with high neighbor's links. */IF (NCASE AND LO USED) = LO USED/* if low neighbor used. */THEN DO; /* Fix up links in prior and next segments. */IF CURR LINK. PRIOR = NULL PHYS ADDRTHEN /* there is no prior */ -FIRST AVLBL = CURR AVLBL; .ELSE DO; /* fix up prior */NEIBR ADDR = CURR LINK. PRIOR;CALL POINT AT (SLOT B, DWRIGHTS, @NEIBR_ADDR,- LINK-LIMIT);NEIBR_LINK.NEXT = CURR_AVLBL;END;IF CURR LINK. NEXT = NULL PHYS ADDRTHEN /* there is no next */ -LAST AVLBL = CURR AVLBL;ELSE DO; /* fix up-next */NEIBR ADDR = CURR LINK.NEXT;CALL POINT AT (SLOT B, DWRIGHTS, @NEIBR_ADDR,. - LINK-LIMIT);NEIBR LINK. PRIOR = CURR AVLBL;END; - -END; /* Fixing up links. *//* Set tag words */CURR LINK.LO TAG = FREE;/* set START-field in new current segment. */NEIBR ADDR = CURR AVLBL + CURR LINK. SIZE + TAGS SIZE;CALL POINT AT(SLOT B,DWRIGHTS,@NEIBR ADDR,LINK LIMIT);NEIBR LINK~START =-CURR AVLBL; - -NEIBR-LINK.HI TAG = FREE;CALL NULLIFY (SLOT_A); CALL NULLIFY (SLOT_B);END RETURN SPACE;$EJECT -Figure 3-9 . . Code for Memory-Manag~ment Example (Cont'd.)3-20 121960-001

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!