-
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
- Linuks od wer. 6.15 przestanie wspierać procesory 486 i będzie wymagać min. Pentium
- Propagation velocity v/c dla kabli RF
- Jakie natynkowe podwójne gniazdo z bolcem (2P+PE)
- Czujnik nacisku
- Protoków komunikacyjny do urządzenia pomiarowego
- Hiszpania bez pradu
- amperomierz w plusie
- 3G-nadal działa
- Historia pewnego miernika kalibratora
- Ustym 4k Pro i wyświetlacz
- Czemu rozwaliło celę?
- Wojna w portfelu
- Jaki trojfazowy licznik tuya lub podobny?
- Problem z dekoderem adresów
- Intel się wyprzedaje: po 10latach pchnęli pakiet kontrolny Altery za 1/4 kwoty zakupu
Najnowsze wątki
- 2025-05-15 Nowy rodzaj zagrożenie ze strony elektryków :)
- 2025-05-15 Bus inpostu, przemycający ludzi, walnął w nocy w tira zaparkowanego na autostradzie 5 ofiar
- 2025-05-15 Alert RCB w sprawie dziewczynki
- 2025-05-15 Kurierski bus przemycał ludzi i zasnął nad ranem za kierownicą.
- 2025-05-15 Dęblin => JavaScript / Node / Fullstack Developer <=
- 2025-05-14 Tsue i smsy
- 2025-05-14 Biedna kobieta jechała samochodem na targ aby sprzedać klamoty i dostała 300 zł mandatu
- 2025-05-14 hot spot traci connected device
- 2025-05-14 John Carmack twierdzi, że gdyby gry były optymalizowane, to wystarczyły by stare kompy
- 2025-05-14 John Carmack twierdzi, że gdyby gry były optymalizowane, to wystarczyły by stare kompy
- 2025-05-14 Wariant rumuński
- 2025-05-14 Rolnicy protestują w Szczecinie
- 2025-05-14 Rolnicy protestują w Szczecinie
- 2025-05-14 Rolnicy protestują w Szczecinie
- 2025-05-14 Niemcy: Przychody ze sprzedaży produktów Fairtrade w 2024r. wzrosły o rekordowe 13% do 2,9GEUR