- desc->d[1] = ((base >> 16) & 0xff) | (type << 8) | SEG_PRESENT | (dpl << 13);
- desc->d[1] |= (base & 0xff000000) | (limit & 0xf0000) | SEG_AVL | SEG_GRAN;
-
- switch(type) {
- case SEG_CODE:
- desc->d[1] |= (3 << 11) | SEG_DEF | SEG_RD;
- break;
-
- case SEG_DATA:
- desc->d[1] |= (2 << 11) | SEG_WR;
- break;
- }
+ desc->d[1] = ((base >> 16) & 0xff) | (type << 8) | SEG_PRESENT | (dpl << 13) | segtype[type];
+ desc->d[1] |= (base & 0xff000000) | (limit & 0xf0000) | SEG_GRAN | SEG_DEF | SEG_RD;