-
Path: news-archive.icm.edu.pl!news.gazeta.pl!newsfeed.pionier.net.pl!plix.pl!newsfeed
1.plix.pl!news.nask.pl!news.nask.org.pl!news.onet.pl!not-for-mail
From: "Pszemol" <P...@P...com>
Newsgroups: pl.misc.elektronika
Subject: Re: printf i wielozadaniowosc (MicroC/OS-II)
Date: Mon, 19 Oct 2009 17:31:45 -0500
Organization: http://onet.pl
Lines: 128
Message-ID: <h...@p...onet.pl>
References: <h...@p...onet.pl> <h9tc37$135h$1@news.mm.pl>
<h...@p...onet.pl> <h9vmcj$4pm$1@atlantis.news.neostrada.pl>
<h...@p...onet.pl> <ha0f1t$cf0$1@news.onet.pl>
<h...@p...onet.pl> <ha0ka1$pnp$1@news.onet.pl>
Reply-To: "Pszemol" <P...@B...com>
NNTP-Posting-Host: gw.petrovend.com
Mime-Version: 1.0
Content-Type: text/plain; format=flowed; charset="iso-8859-2"; reply-type=response
Content-Transfer-Encoding: 8bit
X-Trace: news.onet.pl 1255991502 4658 204.248.56.195 (19 Oct 2009 22:31:42 GMT)
X-Complaints-To: n...@o...pl
NNTP-Posting-Date: Mon, 19 Oct 2009 22:31:42 +0000 (UTC)
X-Posting-Agent: Hamster/1.3.13.0
In-Reply-To: <ha0ka1$pnp$1@news.onet.pl>
X-Priority: 3
X-MSMail-Priority: Normal
Importance: Normal
X-Newsreader: Microsoft Windows Live Mail 14.0.8064.206
X-MimeOLE: Produced By Microsoft MimeOLE V14.0.8064.206
Xref: news-archive.icm.edu.pl pl.misc.elektronika:573846
[ ukryj nagłówki ]"Jerry1111" <j...@w...pl.pl.wp> wrote in message
news:ha0ka1$pnp$1@news.onet.pl...
>>> Zaciekawilo mnie (bo ja wiem ze Nios czasem przerywa sobie printfy - mi
>>> to nie przeszkadza) czemu tak sie dzieje. Popatrzylem na zrodla drivera
>>> uart w Nios 9.0 i tam nie ma OSIntExit pod koniec
>>> altera_avalon_uart_rxirq().
>>
>> rxirq() wołane jest z ogólnego handlera przerwania od portu
>> szeregowego gdzie jest sprawdzany status register i wywoływane
>> są poszczególne procedury skoku do txirq lub rxirq().
>
> Tak, ale nigdzie OS nie jest informowany ze aktualnie obslugujemy
> przerwanie... Na poczatku (AFAIR) ma byc OSIntEnter(), a na koncu ma byc
> OSIntExit(). Powinno to byc odpowiednio na poczatku/koncu ogolnego
> przerwania gdzie sprawdza status register - a nic tam nie ma. Jedyne
> odwolania do OSa w tx to flaga ze w txbuf jest miejsce.
Przy okazji innego problemu z innym projektem pod Niosem
wszedłem sobie debuggerem do kodu i co widzę? Ano INT_EXIT():
/*
* alt_irq_handler() is called by the interrupt exception handler in order
to
* process any outstanding interrupts.
*
* It is defined here since (in the case of nios2) it is linked in using
weak
* linkage. This means that if there is never a call to alt_irq_register()
* (above) then this function will not get linked in to the executable. This
is
* acceptable since if no handler is ever registered, then an interrupt can
never
* occur.
*
* If Nios II interrupt vector custom instruction exists, use it to
accelerate
* the dispatch of interrupt handlers. The Nios II interrupt vector custom
* instruction is present if the macro ALT_CI_INTERRUPT_VECTOR defined.
*/
void alt_irq_handler (void) __attribute__ ((section (".exceptions")));
void alt_irq_handler (void)
{
#ifdef ALT_CI_INTERRUPT_VECTOR
alt_32 offset;
char* alt_irq_base = (char*)alt_irq;
#else
alt_u32 active;
alt_u32 mask;
alt_u32 i;
#endif /* ALT_CI_INTERRUPT_VECTOR */
/*
* Notify the operating system that we are at interrupt level.
*/
ALT_OS_INT_ENTER();
#ifdef ALT_CI_INTERRUPT_VECTOR
/*
* Call the interrupt vector custom instruction using the
* ALT_CI_INTERRUPT_VECTOR macro.
* It returns the offset into the vector table of the lowest-valued
pending
* interrupt (corresponds to highest priority) or a negative value if
none.
* The custom instruction assumes that each table entry is eight bytes.
*/
while ((offset = ALT_CI_INTERRUPT_VECTOR) >= 0) {
struct ALT_IRQ_HANDLER* handler_entry =
(struct ALT_IRQ_HANDLER*)(alt_irq_base + offset);
handler_entry->handler(handler_entry->context, offset >> 3);
}
#else
/*
* Obtain from the interrupt controller a bit list of pending interrupts,
* and then process the highest priority interrupt. This process loops,
* loading the active interrupt list on each pass until alt_irq_pending()
* return zero.
*
* The maximum interrupt latency for the highest priority interrupt is
* reduced by finding out which interrupts are pending as late as
possible.
* Consider the case where the high priority interupt is asserted during
* the interrupt entry sequence for a lower priority interrupt to see why
* this is the case.
*/
active = alt_irq_pending ();
do
{
i = 0;
mask = 1;
/*
* Test each bit in turn looking for an active interrupt. Once one is
* found, the interrupt handler asigned by a call to alt_irq_register()
is
* called to clear the interrupt condition.
*/
do
{
if (active & mask)
{
alt_irq[i].handler(alt_irq[i].context, i);
break;
}
mask <<= 1;
i++;
} while (1);
active = alt_irq_pending ();
} while (active);
#endif /* ALT_CI_INTERRUPT_VECTOR */
/*
* Notify the operating system that interrupt processing is complete.
*/
ALT_OS_INT_EXIT();
}
Następne wpisy z tego wątku
- 21.10.09 20:18 Jerry1111
Najnowsze wątki z tej grupy
- Jaka ładowarka sieciowa do Iphona?
- Taśma izolacyjna do prac elektrycznych
- Recenzja 3.1A ;) w 6 gniazdach...
- Re: Recenzja 3.1A ;) w 6 gniazdach...
- Re: Recenzja 3.1A ;) w 6 gniazdach...
- Re: Recenzja 3.1A ;) w 6 gniazdach...
- Wkrętarki, wiertarki...
- Zasilacz impulsowy 12V 10A, coś godnego uwagi jako zamiennik akumulatora wkrętarki
- Mouser - koszt wysyłki
- [OT] Jak wycinac ksztalt w piance lub styropianie?
- FV--> ciepła woda w kranie
- Szok
- Dziwny schemat wzmacniacza m.cz.
- We Wrocławiu ruszyła Odra 5, pierwszy w Polsce komputer kwantowy z nadprzewodzącymi kubitami
- CGNAT i ewentualne problemy
Najnowsze wątki
- 2025-07-03 Trybik
- 2025-07-04 Renault Symbioz
- 2025-07-04 Architektura IIIRP: Wyjątkowa, a prymitywniejsza niż stodoła pod zaborami
- 2025-07-04 Warszawa => International Freight Forwarder <=
- 2025-07-04 Wrocław => SAP ABAP Developer <=
- 2025-07-04 Warszawa => Mid/Senior IT Recruiter <=
- 2025-07-04 Białystok => Kotlin Developer <=
- 2025-07-04 Bieruń => Spedytor Międzynarodowy (handel ładunkami/prowadzenie flo
- 2025-07-04 Warszawa => Specjalista wsparcia IT - analiza techniczna sprzętu IT <
- 2025-07-04 Zakrzewo => Konsultant SAP HCM <=
- 2025-07-04 Łódź => Programista Mainframe (z/OS, Assembler) <=
- 2025-07-04 Szczecin => Key Account Manager IT <=
- 2025-07-04 Warszawa => Technik IT - Konfiguracja i Wsparcie Sprzętowe <=
- 2025-07-04 Warszawa => Technique IT - Hardware Configuration and Support <=
- 2025-07-04 Warszawa => Specjalista ds. Sprzętu IT i Wsparcia Technicznego <=