Changeset 69a5600 in mainline


Ignore:
Timestamp:
2006-04-29T11:32:44Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2382d09
Parents:
429ff2ea
Message:

I/O Permission bitmap fixes. The trailing all-one sequence must be 8 bits long.
Update TSS limit in a proper way.

Location:
arch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/src/proc/scheduler.c

    r429ff2ea r69a5600  
    4848        ptr_16_64_t cpugdtr;
    4949        descriptor_t *gdt_p;
     50        tss_descriptor_t *tss_desc;
    5051
    5152        /*
     
    6263                bitmap_copy(&iomap, &TASK->arch.iomap, TASK->arch.iomap.bits);
    6364                /*
    64                  * It is safe to set the trailing four bits because of the extra
     65                 * It is safe to set the trailing eight bits because of the extra
    6566                 * convenience byte in TSS_IOMAP_SIZE.
    6667                 */
    67                 bitmap_set_range(&iomap, TASK->arch.iomap.bits, 4);
     68                bitmap_set_range(&iomap, TASK->arch.iomap.bits, 8);
    6869        }
    6970        spinlock_unlock(&TASK->lock);
     
    7475        gdt_tss_setlimit(&gdt_p[TSS_DES], TSS_BASIC_SIZE + BITS2BYTES(bits) - 1);
    7576        gdtr_load(&cpugdtr);
     77       
     78        /*
     79         * Before we load new TSS limit, the current TSS descriptor
     80         * type must be changed to describe inactive TSS.
     81         */
     82        tss_desc = (tss_descriptor_t *) &gdt_p[TSS_DES];
     83        tss_desc->type = AR_TSS;
     84        tr_load(gdtselector(TSS_DES));
    7685}
    7786
  • arch/ia32/src/proc/scheduler.c

    r429ff2ea r69a5600  
    6262                bitmap_copy(&iomap, &TASK->arch.iomap, TASK->arch.iomap.bits);
    6363                /*
    64                  * It is safe to set the trailing four bits because of the extra
     64                 * It is safe to set the trailing eight bits because of the extra
    6565                 * convenience byte in TSS_IOMAP_SIZE.
    6666                 */
    67                 bitmap_set_range(&iomap, TASK->arch.iomap.bits, 4);
     67                bitmap_set_range(&iomap, TASK->arch.iomap.bits, 8);
    6868        }
    6969        spinlock_unlock(&TASK->lock);
     
    7474        gdt_setlimit(&gdt_p[TSS_DES], TSS_BASIC_SIZE + BITS2BYTES(bits) - 1);
    7575        gdtr_load(&cpugdtr);
     76
     77        /*
     78         * Before we load new TSS limit, the current TSS descriptor
     79         * type must be changed to describe inactive TSS.
     80         */
     81        gdt_p[TSS_DES].access = AR_PRESENT | AR_TSS | DPL_KERNEL;
     82        tr_load(selector(TSS_DES));
    7683}
    7784
Note: See TracChangeset for help on using the changeset viewer.