Jump to content
    

__interrupt_handler

Приветствую! Пишу программу для MicroBlaze. Прога обрабатывает прерывания от нескольких внешних устройств, а в остальное время бездействует. Оказалось критичным время реакции, но увеличивать частоту нехочется. Все дело в следующем

 

void __interrupt_handler () __attribute__ ((interrupt_handler));

 

extern MB_InterruptVectorTableEntry MB_InterruptVectorTable;

 

void __interrupt_handler(void)

{

/* The compiler saves all volatiles and the MSR */

MB_InterruptVectorTable.Handler(MB_InterruptVectorTable.CallBackRef);

/* The compiler restores all volatiles and MSR, and returns from interrupt */

}

 

Тупо убрать атрибут не получается, при перекомпиляции файл microblaze_interrupt_handler.c генерится заново.

Подскажите, как обойти?

Share this post


Link to post
Share on other sites

Сам пользую РРС (механизм обработки прерываний немного разный), но думаю что никак. Упаковка в стек осуществляется самим ядром процессора (а не процедурой обработки прерывания). Если хотите повысить время реакции, то есть 2 пути:

1) Увеличивать такт. частоту

2) Пытаться реализовывать функции обработки на логике

Share this post


Link to post
Share on other sites

Но в мануале на МВ отдельно написано, что для функций обработки прерывания в прототипе нужно добавлять атрибут __attribute__ ((interrupt_handler)) или __attribute__((save_volatiles)) и тогда компилятор добавляет инструкции записи в стек. Я так понял что этого можно и не делать. Но здесь функция обработки прерывания вызывается опосредованно через __interrupt_handler ().

Share this post


Link to post
Share on other sites

Отбой! Похоже действительно нельзя. Если извернуться и убрать все атрибуты, при компиляции проекта всеравно выскакивает ошибка: нехватает атрибута interrupt_hendler.

Edited by expflash

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...