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.

IntelU~ING HARDWARE PROTECTION FEATURESPL/M-<strong>286</strong> COMPILER 960-505 date PAGE 2151617181920212223242526272829303132333412222222222212222222/*******************************************************//* Create a descriptor at a given slot to a given '*//* segment, and return selector that points *//* to that slot. */POINT AT: PROCEDURE (SLOT, RIGHTS, PHYS_ADDR_PTR, LIMIT)- PUBLIC REENTRANT;DECLARE SLOT SELECTOR,SLOTW WORD AT (@SLOT), /* Alternate type */RIGHTS BYTE,PHYS ADDR PTR POINTER,PHYS-ADDR- BASED PHYS ADDR PTR STRUCTURE(LO-WORD WORD, --DECLARE SLOTIDTA_SELDTHI-WORD WORD) ,LIMITWORD;WORD, /* Slot index */SELECTOR, /* To be set to eitherGOT alias or LOT alias. */BASED DTA SEL (DT SIZE)STRUCTURE- (DESC_STR);DTA'SEL = FIND DT ALIAS(SLOT);SLOTI = SHR(SLOTW;3); /* Expose index value. */DT(SLOTI) .LO BASE PHYS ADDR.LO WORD;DT(SLOTI) .HI-BASE LOW(PHYS ADDR.HI WORD);DT(SLOTI).LIMIT LIMIT; - -DT(SLOTI) .SW RESRVD 0;DT(SLOTI) .RIGHTS RIGHTS;RETURN;/*******************************************************//* Invalidate descriptor indexed by SLOT. */NULLIFY: PROCEDURE (SLOT) PUBLIC REENTRANT;DECLARE SLOTSLOTWDECLARE SLOTIDTA SELDTSELECTOR,WORD AT (@SLOT); /* Alternate type */WORD, /* Slot index */SELECTOR, /* To be set to eitherGDT alias or LDT alias. */BASED DTA SEL (DT SIZE)STRUCTURE-(DESC_STR);DTA SEL = FIND DT ALIAS(SLOT);SLOTI = SHR(SLOTW;3); /* Get index part of selector. */DT(SLOTI) .RIGHTS = 80H;/* This invalid value preventsuse of the descriptor. */RETURN;END NULLIFY;/*******************************************************/Figure 2-16. Descriptor Manipulation Example (Cont'd.)2-24 121960-001

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

Saved successfully!

Ooh no, something went wrong!