summaryrefslogtreecommitdiff
path: root/debian/patches/40_user-tss.patch
blob: b55f361e98cb29c9f37d6ba2a8fcc0e3a81890ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#DPATCHLEVEL=0

2005-12-26  Samuel Thibault <samuel.thibault@ens-lyon.org>

	* i386/i386/iopb.c: Include "vm_param.h" for kvtolin().
	(io_tss_init): Fix address and limit of user TSS.


--- i386/i386/iopb.c	2005-05-01 18:04:47.000000000 +0200
+++ i386/i386/iopb.c	2005-12-26 19:50:22.000000000 +0100
@@ -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);
 }