comp.lang.ada
 help / color / mirror / Atom feed
* Standard'Maximum_Alignment
@ 2015-05-29  9:33 jan.de.kruyf
  2015-05-29 12:22 ` Standard'Maximum_Alignment Simon Wright
  0 siblings, 1 reply; 3+ messages in thread
From: jan.de.kruyf @ 2015-05-29  9:33 UTC (permalink / raw)


Hallo,

Does anybody know about the history of this thing.


I get an error when I compile with the standard switches for making linux kernel modules.
------------------
gnat1: error: -mpreferred-stack-boundary=3 is not between 4 and 12
------------------

I think it clashes with 
-------
for Memory'Alignment use Standard'Maximum_Alignment;
--------
in s-memory.adb

according to this email Standard'Maximum_Alignment should be 16 which works out to a preferred-stack-boundary=4

https://gcc.gnu.org/ml/gcc-patches/2005-03/msg01456.html
--

gcc:
-mpreferred-stack-boundary=num
Attempt to keep the stack boundary aligned to a 2 raised to num byte boundary. If `-mpreferred-stack-boundary' is not specified, the default is 4 (16 bytes or 128 bits).
--

Am I right in  my assumption that kernel uses the value of 3 since none of the fancy cpu extensions are used in kernel code?

And gnat of course knows nothing about kernelcode. with or without the kernelcode switch it asks for memory with '__gnat_malloc'

Thanks,

j.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Standard'Maximum_Alignment
  2015-05-29  9:33 Standard'Maximum_Alignment jan.de.kruyf
@ 2015-05-29 12:22 ` Simon Wright
  2015-05-29 13:25   ` Standard'Maximum_Alignment jan.de.kruyf
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Wright @ 2015-05-29 12:22 UTC (permalink / raw)


jan.de.kruyf@gmail.com writes:

> And gnat of course knows nothing about kernelcode. with or without the
> kernelcode switch it asks for memory with '__gnat_malloc'

You'd need to supply your own version of System.Memory.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Standard'Maximum_Alignment
  2015-05-29 12:22 ` Standard'Maximum_Alignment Simon Wright
@ 2015-05-29 13:25   ` jan.de.kruyf
  0 siblings, 0 replies; 3+ messages in thread
From: jan.de.kruyf @ 2015-05-29 13:25 UTC (permalink / raw)


On Friday, May 29, 2015 at 2:22:47 PM UTC+2, Simon Wright wrote:

> 
> > And gnat of course knows nothing about kernelcode. with or without the
> > kernelcode switch it asks for memory with '__gnat_malloc'
> 
> You'd need to supply your own version of System.Memory.

I did, and that is where this error came in.
But I am not going to waste tons of memory so I can live with a courser alignment.

It was just puzzling at first.

j.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-29 13:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-29  9:33 Standard'Maximum_Alignment jan.de.kruyf
2015-05-29 12:22 ` Standard'Maximum_Alignment Simon Wright
2015-05-29 13:25   ` Standard'Maximum_Alignment jan.de.kruyf

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