summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2015-05-23 18:51:56 +0200
committerJustus Winter <4winter@informatik.uni-hamburg.de>2015-05-23 18:51:56 +0200
commit6af2316771841cd4d2770fae00d3d147aa11a5d9 (patch)
treeb8249bcb86a40abd559883b351019d80eb63096b
parent96ade86f9f410cee6377f60530bcc3aa89b20402 (diff)
i386: avoid breaking the strict-aliasing rules
* i386/i386/pcb.c (switch_ktss): Cleanly convert the value.
-rw-r--r--i386/i386/pcb.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/i386/i386/pcb.c b/i386/i386/pcb.c
index dabe481..3a0eba0 100644
--- a/i386/i386/pcb.c
+++ b/i386/i386/pcb.c
@@ -193,8 +193,14 @@ void switch_ktss(pcb_t pcb)
for (i=0; i < USER_GDT_SLOTS; i++) {
if (memcmp(gdt_desc_p (mycpu, USER_GDT + (i << 3)),
&pcb->ims.user_gdt[i], sizeof pcb->ims.user_gdt[i])) {
+ union {
+ struct real_descriptor real_descriptor;
+ uint64_t descriptor;
+ } user_gdt;
+ user_gdt.real_descriptor = pcb->ims.user_gdt[i];
+
if (hyp_do_update_descriptor(kv_to_ma(gdt_desc_p (mycpu, USER_GDT + (i << 3))),
- *(uint64_t *) &pcb->ims.user_gdt[i]))
+ user_gdt.descriptor))
panic("couldn't set user gdt %d\n",i);
}
}