comp.lang.ada
 help / color / mirror / Atom feed
From: Robert Eachus <rieachus@comcast.net>
Subject: Re: Compiler doesn't respect 'Size for atomic object
Date: Wed, 20 Dec 2017 21:55:57 -0800 (PST)
Date: 2017-12-20T21:55:57-08:00	[thread overview]
Message-ID: <609cb46c-3565-483b-a2b0-2b5d2cfda80a@googlegroups.com> (raw)
In-Reply-To: <lypo79f65n.fsf@pushface.org>

On Wednesday, December 20, 2017 at 4:20:22 PM UTC-5, Simon Wright wrote:

> I meant, naturally an integral type. The RM description of the NVIC's
> STIR indicates that the IRQ fits in 8 bits; the top 24 bits are reserved
> (write as 0).

A language lawyer reading:  If the hardware specifies that those bit must be zero?  Then it is definitely a bug.  But if all the hardware says is that the positions are reserved, I would expect the compiler to pass whatever junk happened to be in the register.  (In other words, move the IRQ as eight-bits to a register, then pass the register to the hardware.)

Should the address of Register in your example be set to 16#E000EF00#? Also should your type Interrupt_ID be given a size?  If so I would expect the new behavior with Interrupt_ID'Size set to 8, and the old behavior when it is set to 32.

I am certainly not an expert on the Cortex-M CPUs, but as I read the documentation, the STIR is write-only, and the upper 24-bits of the value written there are ignored.  If so, no bug, but probably worth a comment IF the behavior of the compiler has changed, not just the bits you are passing..

  reply	other threads:[~2017-12-21  5:55 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-20 12:35 Compiler doesn't respect 'Size for atomic object Simon Wright
2017-12-20 19:23 ` Simon Clubley
2017-12-20 20:19   ` Simon Wright
2017-12-20 20:45     ` Simon Clubley
2017-12-21  7:10       ` Randy Brukardt
2017-12-21 14:08         ` Simon Wright
2017-12-20 21:20     ` Simon Wright
2017-12-21  5:55       ` Robert Eachus [this message]
2017-12-21 14:02         ` Simon Wright
2017-12-21 22:02         ` Simon Wright
2017-12-22  4:51           ` Robert Eachus
2017-12-22 10:21             ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox