public inbox for ecos-devel@sourceware.org
 help / color / mirror / Atom feed
From: "Christophe Coutand" <ccoutand@stmi.com>
To: "Nick Garnett" <nickg@ecoscentric.com>,
		"Nagaraj K" <nagaraj.kmurthy@gmail.com>
Cc: <ecos-devel@ecos.sourceware.org>
Subject: RE: Cortex-M3 HAL interrupt-priority code bug
Date: Thu, 25 Nov 2010 11:26:00 -0000	[thread overview]
Message-ID: <D6050C555CC56940A7AF3265228302760373DF4C@mail2.STMIRV01.COM> (raw)
In-Reply-To: <m3vd3lvefs.fsf@xl5.calivar.com>

My understanding is:

CYGNUM_HAL_CORTEXM_PRIORITY_MAX is defined equal to
1<<(8-CYGNUM_HAL_CORTEXM_PRIORITY_LEVEL_BITS)

What the eCos implementation really does is to reserved level 0 for
DEBUG and SVC traps. If you call hal_interrupt_set_level with level 0
what you will really get is a priority of 1. Nothing wrong with that?

Christophe

-----Original Message-----
From: ecos-devel-owner@ecos.sourceware.org
[mailto:ecos-devel-owner@ecos.sourceware.org] On Behalf Of Nick Garnett
Sent: 25. november 2010 12:19
To: Nagaraj K
Cc: ecos-devel@ecos.sourceware.org
Subject: Re: Cortex-M3 HAL interrupt-priority code bug

Nagaraj K <nagaraj.kmurthy@gmail.com> writes:

> I see that this function wrongly implements the priority level in
> Cortex-M3 processor. According to the Cortex-M3 data sheet, we need to
> write the priority level to the top N bits of the register where N is
> the number of priority level bits implemented in this particular
> version of the cortex variant.

The intention in the design of the hardware is that software can use a
256 level prioirity scheme on all implementations. By defining the
actual priority in terms of the top N bits of the registers, the
hardware essentially groups the 256 virtual priorities into a set of
real priorities by ignoring the less significant bits.

eCos simply follows the lead given by the hardware and implements 256
priorities. It is a good scheme and allows us to write code that will
work in all implementations.

-- 
Nick Garnett                                      eCos Kernel Architect
eCosCentric Limited    http://www.eCosCentric.com      The eCos experts
Barnwell House, Barnwell Drive, Cambridge, UK.     Tel: +44 1223 245571
Registered in England and Wales:                        Reg No: 4422071

  reply	other threads:[~2010-11-25 11:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-25 10:34 Nagaraj K
2010-11-25 11:19 ` Nick Garnett
2010-11-25 11:26   ` Christophe Coutand [this message]
2010-11-25 12:03     ` Nick Garnett
2010-11-25 12:10       ` Nick Garnett
2010-11-25 14:29         ` Nagaraj K

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=D6050C555CC56940A7AF3265228302760373DF4C@mail2.STMIRV01.COM \
    --to=ccoutand@stmi.com \
    --cc=ecos-devel@ecos.sourceware.org \
    --cc=nagaraj.kmurthy@gmail.com \
    --cc=nickg@ecoscentric.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).