[PATCH 12/12] x86: Use struct fields instead of bitmasks

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Joe Damato
Date: Friday, October 24, 2008 - 8:15 pm

Use fields in structs instead of bitmasks for getting/setting descriptor data.

Signed-off-by: Joe Damato <ice799@gmail.com>
---
 drivers/lguest/interrupts_and_traps.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/lguest/interrupts_and_traps.c b/drivers/lguest/interrupts_and_traps.c
index bfb24d9..0d9c065 100644
--- a/drivers/lguest/interrupts_and_traps.c
+++ b/drivers/lguest/interrupts_and_traps.c
@@ -178,7 +178,7 @@ void maybe_do_interrupt(struct lg_cpu *cpu)
 	 * over them. */
 	idt = &cpu->arch.idt[FIRST_EXTERNAL_VECTOR+irq];
 	/* If they don't have a handler (yet?), we just ignore it */
-	if (idt_present(idt->a, idt->b)) {
+	if (idt->p) {
 		/* OK, mark it no longer pending and deliver it. */
 		clear_bit(irq, cpu->irqs_pending);
 		/* set_guest_interrupt() takes the interrupt descriptor and a
@@ -254,7 +254,7 @@ int deliver_trap(struct lg_cpu *cpu, unsigned int num)
 
 	/* Early on the Guest hasn't set the IDT entries (or maybe it put a
 	 * bogus one in): if we fail here, the Guest will be killed. */
-	if (!idt_present(cpu->arch.idt[num].a, cpu->arch.idt[num].b))
+	if (!cpu->arch.idt[num].p)
 		return 0;
 	set_guest_interrupt(cpu, desc_lo(cpu->arch.idt[num]),
 			    desc_hi(cpu->arch.idt[num]), has_err(num));
@@ -461,7 +461,7 @@ void copy_traps(const struct lg_cpu *cpu, gate_desc *idt,
 		 * If it can't go direct, we still need to copy the priv. level:
 		 * they might want to give userspace access to a software
 		 * interrupt. */
-		if (idt_type(gidt->a, gidt->b) == 0xF)
+		if (gidt->type == 0xF)
 			idt[i] = *gidt;
 		else
 			default_idt_entry(&idt[i], i, def[i], gidt);
-- 
1.5.4.3

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 00/12] x86: Cleanup idt, gdt/ldt/tss structs , Joe Damato, (Fri Oct 24, 8:15 pm)
[PATCH 02/12] x86: Use new gate_struct for gate_desc, Joe Damato, (Fri Oct 24, 8:15 pm)
[PATCH 04/12] x86: Add macros for gate_desc, Joe Damato, (Fri Oct 24, 8:15 pm)
[PATCH 05/12] x86: Refactor pack_gate for gate_desc, Joe Damato, (Fri Oct 24, 8:15 pm)
[PATCH 06/12] x86: Refactor pack_descriptor, Joe Damato, (Fri Oct 24, 8:15 pm)
[PATCH 07/12] x86: Add a static initializer for IDTs, Joe Damato, (Fri Oct 24, 8:15 pm)
[PATCH 12/12] x86: Use struct fields instead of bitmasks, Joe Damato, (Fri Oct 24, 8:15 pm)
Re: [PATCH 00/12] x86: Cleanup idt, gdt/ldt/tss structs, Willy Tarreau, (Fri Oct 24, 10:40 pm)
Re: [PATCH 00/12] x86: Cleanup idt, gdt/ldt/tss structs, walter harms, (Sat Oct 25, 2:39 am)
Re: [PATCH 00/12] x86: Cleanup idt, gdt/ldt/tss structs, H. Peter Anvin, (Mon Oct 27, 7:34 am)
Re: [PATCH 00/12] x86: Cleanup idt, gdt/ldt/tss structs, Jeremy Fitzhardinge, (Mon Oct 27, 4:02 pm)
Re: [PATCH 03/12] x86: Cleanup usage of struct desc_struct, Jeremy Fitzhardinge, (Wed Oct 29, 5:52 am)
Re: [PATCH 02/12] x86: Use new gate_struct for gate_desc, Jeremy Fitzhardinge, (Wed Oct 29, 5:53 am)
Re: [PATCH 04/12] x86: Add macros for gate_desc, Jeremy Fitzhardinge, (Wed Oct 29, 5:54 am)
Re: [PATCH 12/12] x86: Use struct fields instead of bitmasks, Jeremy Fitzhardinge, (Wed Oct 29, 5:56 am)
Re: [PATCH 09/12] x86: Add static initiazlier for descriptors, Jeremy Fitzhardinge, (Wed Oct 29, 5:58 am)