diff mbox

[U-Boot,14/20] x86: Provide access to the IDT

Message ID 1430174911-27538-15-git-send-email-sjg@chromium.org
State Superseded
Delegated to: Simon Glass
Headers show

Commit Message

Simon Glass April 27, 2015, 10:48 p.m. UTC
Add a function to return the address of the Interrupt Descriptor Table.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 arch/x86/cpu/interrupts.c        | 5 +++++
 arch/x86/include/asm/interrupt.h | 2 ++
 2 files changed, 7 insertions(+)

Comments

Bin Meng April 28, 2015, 8:16 a.m. UTC | #1
Hi Simon,

On Tue, Apr 28, 2015 at 6:48 AM, Simon Glass <sjg@chromium.org> wrote:
> Add a function to return the address of the Interrupt Descriptor Table.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  arch/x86/cpu/interrupts.c        | 5 +++++
>  arch/x86/include/asm/interrupt.h | 2 ++
>  2 files changed, 7 insertions(+)
>
> diff --git a/arch/x86/cpu/interrupts.c b/arch/x86/cpu/interrupts.c
> index a21d2a6..c777d36 100644
> --- a/arch/x86/cpu/interrupts.c
> +++ b/arch/x86/cpu/interrupts.c
> @@ -147,6 +147,11 @@ int cpu_init_interrupts(void)
>         return 0;
>  }
>
> +void *x86_get_idt(void)
> +{
> +       return &idt_ptr;
> +}
> +

idt_ptr is not declared as static, so this is unneeded? Or should we
change it to static?

>  void __do_irq(int irq)
>  {
>         printf("Unhandled IRQ : %d\n", irq);
> diff --git a/arch/x86/include/asm/interrupt.h b/arch/x86/include/asm/interrupt.h
> index 25abde7..0a75f89 100644
> --- a/arch/x86/include/asm/interrupt.h
> +++ b/arch/x86/include/asm/interrupt.h
> @@ -38,4 +38,6 @@ extern char exception_stack[];
>   */
>  void configure_irq_trigger(int int_num, bool is_level_triggered);
>
> +void *x86_get_idt(void);
> +
>  #endif
> --

Regards,
Bin
Simon Glass April 29, 2015, 2:08 a.m. UTC | #2
Hi Bin,

On 28 April 2015 at 02:16, Bin Meng <bmeng.cn@gmail.com> wrote:
> Hi Simon,
>
> On Tue, Apr 28, 2015 at 6:48 AM, Simon Glass <sjg@chromium.org> wrote:
>> Add a function to return the address of the Interrupt Descriptor Table.
>>
>> Signed-off-by: Simon Glass <sjg@chromium.org>
>> ---
>>
>>  arch/x86/cpu/interrupts.c        | 5 +++++
>>  arch/x86/include/asm/interrupt.h | 2 ++
>>  2 files changed, 7 insertions(+)
>>
>> diff --git a/arch/x86/cpu/interrupts.c b/arch/x86/cpu/interrupts.c
>> index a21d2a6..c777d36 100644
>> --- a/arch/x86/cpu/interrupts.c
>> +++ b/arch/x86/cpu/interrupts.c
>> @@ -147,6 +147,11 @@ int cpu_init_interrupts(void)
>>         return 0;
>>  }
>>
>> +void *x86_get_idt(void)
>> +{
>> +       return &idt_ptr;
>> +}
>> +
>
> idt_ptr is not declared as static, so this is unneeded? Or should we
> change it to static?

I think it is better to access it via a function. It is used from
assembler so I would rather not make it static. Any thoughts?

>
>>  void __do_irq(int irq)
>>  {
>>         printf("Unhandled IRQ : %d\n", irq);
>> diff --git a/arch/x86/include/asm/interrupt.h b/arch/x86/include/asm/interrupt.h
>> index 25abde7..0a75f89 100644
>> --- a/arch/x86/include/asm/interrupt.h
>> +++ b/arch/x86/include/asm/interrupt.h
>> @@ -38,4 +38,6 @@ extern char exception_stack[];
>>   */
>>  void configure_irq_trigger(int int_num, bool is_level_triggered);
>>
>> +void *x86_get_idt(void);
>> +
>>  #endif
>> --

Regards,
Simon
Bin Meng April 29, 2015, 5:23 a.m. UTC | #3
Hi Simon,

On Wed, Apr 29, 2015 at 10:08 AM, Simon Glass <sjg@chromium.org> wrote:
> Hi Bin,
>
> On 28 April 2015 at 02:16, Bin Meng <bmeng.cn@gmail.com> wrote:
>> Hi Simon,
>>
>> On Tue, Apr 28, 2015 at 6:48 AM, Simon Glass <sjg@chromium.org> wrote:
>>> Add a function to return the address of the Interrupt Descriptor Table.
>>>
>>> Signed-off-by: Simon Glass <sjg@chromium.org>
>>> ---
>>>
>>>  arch/x86/cpu/interrupts.c        | 5 +++++
>>>  arch/x86/include/asm/interrupt.h | 2 ++
>>>  2 files changed, 7 insertions(+)
>>>
>>> diff --git a/arch/x86/cpu/interrupts.c b/arch/x86/cpu/interrupts.c
>>> index a21d2a6..c777d36 100644
>>> --- a/arch/x86/cpu/interrupts.c
>>> +++ b/arch/x86/cpu/interrupts.c
>>> @@ -147,6 +147,11 @@ int cpu_init_interrupts(void)
>>>         return 0;
>>>  }
>>>
>>> +void *x86_get_idt(void)
>>> +{
>>> +       return &idt_ptr;
>>> +}
>>> +
>>
>> idt_ptr is not declared as static, so this is unneeded? Or should we
>> change it to static?
>
> I think it is better to access it via a function. It is used from
> assembler so I would rather not make it static. Any thoughts?
>

OK, fair enough.

[snip]

Regards,
Bin
diff mbox

Patch

diff --git a/arch/x86/cpu/interrupts.c b/arch/x86/cpu/interrupts.c
index a21d2a6..c777d36 100644
--- a/arch/x86/cpu/interrupts.c
+++ b/arch/x86/cpu/interrupts.c
@@ -147,6 +147,11 @@  int cpu_init_interrupts(void)
 	return 0;
 }
 
+void *x86_get_idt(void)
+{
+	return &idt_ptr;
+}
+
 void __do_irq(int irq)
 {
 	printf("Unhandled IRQ : %d\n", irq);
diff --git a/arch/x86/include/asm/interrupt.h b/arch/x86/include/asm/interrupt.h
index 25abde7..0a75f89 100644
--- a/arch/x86/include/asm/interrupt.h
+++ b/arch/x86/include/asm/interrupt.h
@@ -38,4 +38,6 @@  extern char exception_stack[];
  */
 void configure_irq_trigger(int int_num, bool is_level_triggered);
 
+void *x86_get_idt(void);
+
 #endif