Skip to content

Commit

Permalink
x86: desc_empty
Browse files Browse the repository at this point in the history
This replaces the desc_empty macro with an inline.  It now handles
easily any of the four different types used between 32/64 code to
refer to these 8 bytes.  It's identical in both asm-x86/processor_64.h
and asm-x86/processor_32.h, so if these files ever get merged this
function can be in the common code.

This also removes the desc_equal macro because nothing uses it.

Signed-off-by: Roland McGrath <roland@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
  • Loading branch information
Roland McGrath authored and Ingo Molnar committed Jan 30, 2008
1 parent df5d438 commit 12c3cbb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
9 changes: 5 additions & 4 deletions include/asm-x86/processor_32.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,12 @@ struct desc_struct {
unsigned long a,b;
};

#define desc_empty(desc) \
(!((desc)->a | (desc)->b))
static inline int desc_empty(const void *ptr)
{
const u32 *desc = ptr;
return !(desc[0] | desc[1]);
}

#define desc_equal(desc1, desc2) \
(((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b))
/*
* Default implementation of macro that returns current
* instruction pointer ("program counter").
Expand Down
10 changes: 5 additions & 5 deletions include/asm-x86/processor_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
#define VIP_MASK 0x00100000 /* virtual interrupt pending */
#define ID_MASK 0x00200000

#define desc_empty(desc) \
(!((desc)->a | (desc)->b))

#define desc_equal(desc1, desc2) \
(((desc1)->a == (desc2)->a) && ((desc1)->b == (desc2)->b))
static inline int desc_empty(const void *ptr)
{
const u32 *desc = ptr;
return !(desc[0] | desc[1]);
}

/*
* Default implementation of macro that returns current
Expand Down

0 comments on commit 12c3cbb

Please sign in to comment.