00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "descgate.h"
00014
00015 void createDescriptor(Array *table, short descNum, long base,
00016 long limit, long control) {
00017 Descriptor *desc;
00018 desc = (Descriptor *)arrayElementAt(table, descNum);
00019
00020
00021 desc->limit_low = limit & 0xffff;
00022 desc->base_low = base & 0xffff;
00023 desc->base_med = (base >> 16) & 0xff;
00024 desc->access = (control+D_PRESENT) >> 8;
00025 desc->limit_high = limit >> 16;
00026 desc->granularity = (control & 0xff) >> 4;
00027 desc->base_high = base >> 24;
00028
00029 return;
00030 }
00031
00032 void createGate(Array *table, short descNum, long offset,
00033 short selector, long control) {
00034 Gate *gate;
00035 gate = (Gate *)arrayElementAt(table, descNum);
00036
00037
00038 gate->offset_low = offset & 0xffff;
00039 gate->selector = selector;
00040 gate->access = control + D_PRESENT;
00041 gate->offset_high = offset >> 16;
00042
00043 return;
00044 }