Changeset ea199e5 in mainline


Ignore:
Timestamp:
2006-05-01T11:55:10Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cf26ba9
Parents:
4fd61ba
Message:

When seting TSS limit, take the mandatory extra ending byte with all bits set into account.
Align this group of eight bits on byte boundary.

Location:
arch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • arch/amd64/src/ddi/ddi.c

    r4fd61ba rea199e5  
    3838#include <arch/cpu.h>
    3939#include <arch.h>
     40#include <align.h>
    4041
    4142/** Enable I/O space range for task.
     
    142143                 * convenience byte in TSS_IOMAP_SIZE.
    143144                 */
    144                 bitmap_set_range(&iomap, TASK->arch.iomap.bits, 8);
     145                bitmap_set_range(&iomap, ALIGN_UP(TASK->arch.iomap.bits, 8), 8);
    145146        }
    146147        spinlock_unlock(&TASK->lock);
    147148
    148         /* Second, adjust TSS segment limit. */
     149        /*
     150         * Second, adjust TSS segment limit.
     151         * Take the extra ending byte will all bits set into account.
     152         */
    149153        gdtr_store(&cpugdtr);
    150154        gdt_p = (descriptor_t *) cpugdtr.base;
    151         gdt_tss_setlimit(&gdt_p[TSS_DES], TSS_BASIC_SIZE + BITS2BYTES(bits) - 1);
     155        gdt_tss_setlimit(&gdt_p[TSS_DES], TSS_BASIC_SIZE + BITS2BYTES(bits));
    152156        gdtr_load(&cpugdtr);
    153157       
  • arch/ia32/src/ddi/ddi.c

    r4fd61ba rea199e5  
    3939#include <cpu.h>
    4040#include <arch.h>
     41#include <align.h>
    4142
    4243/** Enable I/O space range for task.
     
    142143                 * convenience byte in TSS_IOMAP_SIZE.
    143144                 */
    144                 bitmap_set_range(&iomap, TASK->arch.iomap.bits, 8);
     145                bitmap_set_range(&iomap, ALIGN_UP(TASK->arch.iomap.bits, 8), 8);
    145146        }
    146147        spinlock_unlock(&TASK->lock);
    147148
    148         /* Second, adjust TSS segment limit. */
     149        /*
     150         * Second, adjust TSS segment limit.
     151         * Take the extra ending byte with all bits set into account.
     152         */
    149153        gdtr_store(&cpugdtr);
    150154        gdt_p = (descriptor_t *) cpugdtr.base;
    151         gdt_setlimit(&gdt_p[TSS_DES], TSS_BASIC_SIZE + BITS2BYTES(bits) - 1);
     155        gdt_setlimit(&gdt_p[TSS_DES], TSS_BASIC_SIZE + BITS2BYTES(bits));
    152156        gdtr_load(&cpugdtr);
    153157
Note: See TracChangeset for help on using the changeset viewer.