gen_idt: don't force 32-bit build
We no longer assume pointer sizes are the same between host and target, and use stdint defintions to size things. Change-Id: Ie4dc41c60d62931fdb3d1764ade01c16a64d0b54 Signed-off-by: Andrew Boie <andrew.p.boie@intel.com>
This commit is contained in:
parent
8c9be1009b
commit
9557f0306c
4 changed files with 15 additions and 18 deletions
|
@ -151,7 +151,7 @@ void irq_debug_dump_idt(void)
|
|||
|
||||
void _IntVecSet(unsigned int vector, void (*routine)(void *), unsigned int dpl)
|
||||
{
|
||||
unsigned long long *pIdtEntry;
|
||||
uint64_t *pIdtEntry;
|
||||
unsigned int key;
|
||||
|
||||
/*
|
||||
|
@ -160,7 +160,7 @@ void _IntVecSet(unsigned int vector, void (*routine)(void *), unsigned int dpl)
|
|||
* explicit validation will not be performed in this primitive.
|
||||
*/
|
||||
|
||||
pIdtEntry = (unsigned long long *)(_idt_base_address + (vector << 3));
|
||||
pIdtEntry = (uint64_t *)(_idt_base_address + (vector << 3));
|
||||
|
||||
/*
|
||||
* Lock interrupts to protect the IDT entry to which _IdtEntryCreate()
|
||||
|
@ -169,7 +169,7 @@ void _IntVecSet(unsigned int vector, void (*routine)(void *), unsigned int dpl)
|
|||
*/
|
||||
|
||||
key = irq_lock();
|
||||
_IdtEntCreate(pIdtEntry, routine, dpl);
|
||||
_IdtEntCreate(pIdtEntry, (uint32_t)routine, dpl);
|
||||
|
||||
#ifdef CONFIG_MVIC
|
||||
/* Some nonstandard interrupt controllers may be doing some IDT
|
||||
|
|
|
@ -99,14 +99,13 @@ typedef struct idt_entry {
|
|||
* host side simply passes a pointer to a local variable.
|
||||
*
|
||||
*/
|
||||
static inline void _IdtEntCreate(unsigned long long *pIdtEntry,
|
||||
void (*routine)(void *),
|
||||
static inline void _IdtEntCreate(uint64_t *pIdtEntry, uint32_t routine,
|
||||
unsigned int dpl)
|
||||
{
|
||||
unsigned long *pIdtEntry32 = (unsigned long *)pIdtEntry;
|
||||
uint32_t *pIdtEntry32 = (uint32_t *)pIdtEntry;
|
||||
|
||||
pIdtEntry32[0] = (KERNEL_CODE_SEG_SELECTOR << 16) |
|
||||
((unsigned short)(unsigned int)routine);
|
||||
((uint16_t)routine);
|
||||
|
||||
/*
|
||||
* The constant 0x8e00 results from the following:
|
||||
|
@ -126,8 +125,7 @@ static inline void _IdtEntCreate(unsigned long long *pIdtEntry,
|
|||
* Reserved = 0
|
||||
*/
|
||||
|
||||
pIdtEntry32[1] = ((unsigned int) routine & 0xffff0000) |
|
||||
(0x8e00 | (dpl << 13));
|
||||
pIdtEntry32[1] = (routine & 0xffff0000) | (0x8e00 | (dpl << 13));
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
HOSTCFLAGS_gen_idt.o += -I$(srctree)/arch/x86/include -I$(srctree)/include/arch/x86
|
||||
HOSTCFLAGS_gen_idt.o += -DKERNEL_VERSION=0 -Wall -Werror -g -m32
|
||||
HOSTCFLAGS_version.o += -DKERNEL_VERSION=0 -Wall -Werror -g -m32
|
||||
HOSTCFLAGS_gen_idt.o += -DKERNEL_VERSION=0 -Wall -Werror -g
|
||||
HOSTCFLAGS_version.o += -DKERNEL_VERSION=0 -Wall -Werror -g
|
||||
HOSTCFLAGS_gen_idt.o += -Wno-unused-result
|
||||
HOSTLDFLAGS := -m32
|
||||
|
||||
hostprogs-y += gen_idt
|
||||
gen_idt-objs := version.o gen_idt.o
|
||||
|
|
|
@ -85,13 +85,13 @@ static void generate_interrupt_vector_bitmap(void);
|
|||
static void clean_exit(int exit_code);
|
||||
|
||||
struct genidt_header_s {
|
||||
void *spurious_addr;
|
||||
void *spurious_no_error_addr;
|
||||
uint32_t spurious_addr;
|
||||
uint32_t spurious_no_error_addr;
|
||||
unsigned int num_entries;
|
||||
};
|
||||
|
||||
struct genidt_entry_s {
|
||||
void *isr;
|
||||
uint32_t isr;
|
||||
unsigned int irq;
|
||||
unsigned int priority;
|
||||
unsigned int vector_id;
|
||||
|
@ -248,7 +248,7 @@ static void open_files(void)
|
|||
|
||||
static void show_entry(struct genidt_entry_s *entry)
|
||||
{
|
||||
fprintf(stderr, "Vector %3d: ISR %10p IRQ %3d PRI %2d DPL %2x\n",
|
||||
fprintf(stderr, "Vector %3d: ISR 0x%08x IRQ %3d PRI %2d DPL %2x\n",
|
||||
entry->vector_id, entry->isr, entry->irq, entry->priority,
|
||||
entry->dpl);
|
||||
}
|
||||
|
@ -264,7 +264,7 @@ static void read_input_file(void)
|
|||
goto read_error;
|
||||
}
|
||||
|
||||
PRINTF("Spurious interrupt handlers found at %p and %p.\n",
|
||||
PRINTF("Spurious interrupt handlers found at 0x%x and 0x%x.\n",
|
||||
genidt_header.spurious_addr, genidt_header.spurious_no_error_addr);
|
||||
PRINTF("There are %d ISR(s).\n", genidt_header.num_entries);
|
||||
|
||||
|
@ -450,7 +450,7 @@ static void generate_idt(void)
|
|||
*/
|
||||
|
||||
for (i = 0; i < num_vectors; i++) {
|
||||
unsigned long long idt_entry;
|
||||
uint64_t idt_entry;
|
||||
ssize_t bytes_written;
|
||||
|
||||
_IdtEntCreate(&idt_entry, generated_entry[i].isr,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue