From 6acee54e03c9b6380b148c3005578c4a401a0da9 Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Sat, 4 Mar 2006 20:39:11 +0000 Subject: 2006-03-04 Samuel Thibault [ patch #4737 ] * i386/i386/iopb.c: Include "vm_param.h". (io_tss_init): Fix address and limit of user TSS. --- ChangeLog | 6 ++++++ i386/i386/iopb.c | 9 +++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index f464420..fa7c330 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-03-04 Samuel Thibault + + [ patch #4737 ] + * i386/i386/iopb.c: Include "vm_param.h". + (io_tss_init): Fix address and limit of user TSS. + 2006-03-04 Thomas Schwinge Remove unused and unsupported code. Consult the file diff --git a/i386/i386/iopb.c b/i386/i386/iopb.c index d2addac..97e10c9 100644 --- a/i386/i386/iopb.c +++ b/i386/i386/iopb.c @@ -43,6 +43,7 @@ #include "iopb.h" #include "seg.h" #include "gdt.h" +#include "vm_param.h" /* * A set of ports for an IO device. @@ -242,8 +243,8 @@ io_tss_init( iopb_tss_t io_tss, boolean_t access_all) /* allow access or not */ { - vm_offset_t addr = (vm_offset_t) io_tss; - vm_size_t size = (char *)&io_tss->barrier - (char *)io_tss; + vm_offset_t addr = kvtolin (io_tss); + vm_size_t limit = (char *)&io_tss->barrier - (char *)io_tss; bzero(&io_tss->tss, sizeof(struct i386_tss)); io_tss->tss.io_bit_map_offset @@ -252,11 +253,11 @@ io_tss_init( io_bitmap_init(io_tss->bitmap, access_all); io_tss->barrier = ~0; queue_init(&io_tss->io_port_list); - io_tss->iopb_desc[0] = ((size-1) & 0xffff) + io_tss->iopb_desc[0] = (limit & 0xffff) | ((addr & 0xffff) << 16); io_tss->iopb_desc[1] = ((addr & 0x00ff0000) >> 16) | ((ACC_TSS|ACC_PL_K|ACC_P) << 8) - | ((size-1) & 0x000f0000) + | (limit & 0x000f0000) | (addr & 0xff000000); } -- cgit v1.2.3