public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Sergei Gavrikov <sergei.gavrikov@gmail.com>
To: Oleg Uzenkov <o.uzenkov@unicore.co.ua>
Cc: eCos Discussion <ecos-discuss@sourceware.org>
Subject: Re: [ECOS] place thread stack into CCM memory on STM32
Date: Fri, 17 Oct 2014 14:25:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.00.1410171706110.1880@sg-laptop> (raw)
In-Reply-To: <54410554.5040001@unicore.co.ua>

On Fri, 17 Oct 2014, Oleg Uzenkov wrote:

> Ok,  it appears that it is possible to specify
> __attribute__((section("<name>"))) for class's member methods.

Really?

  https://gcc.gnu.org/onlinedocs/gcc/Variable-Attributes.html says

  You may use the section attribute with initialized or uninitialized
  global variables.

IMO, your C++ style (rejected) is not very good. Look, please, on the
eCos kernel's tests in C++ (those *.cxx tests are examples to follow).
In a fact that C++ coding style is something likes EC++. I would say it
is Embedded C++ style from eCos gurus.

Find kernel/current/tests/testaux.hxx and tests/*.cxx code.

On 64K aside. I would try to "move" eCos heap (__heap1) in .ccm segment.
Then all dynamic stuff will be live in .ccm segment. Benefits: 1) you
will get more space for eCos program (code+data) ~120K; 2) you will get
64K room for all dynamically allocated objects (just allocate the
buffers for thread's stacks); 3) no mess with 'section' attribute.
Drawback(s): 1) if you won't use 'new' or 'malloc' (will you?) then .ccm
will be waste. I seems for me (not tested, I have no STM target) you have
only to re-define the heap's size in mlt*h (set it 64K) and move __heap1
label in mlt*ldi (put __heap1 after .ccm section). Well, this is just an
idea, perhaps, I miss something and it will not work, but you can try
it.

Sergei

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

  reply	other threads:[~2014-10-17 14:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-16 14:01 Oleg Uzenkov
2014-10-17 12:02 ` Oleg Uzenkov
2014-10-17 14:25   ` Sergei Gavrikov [this message]
2014-10-17 15:45     ` Sergei Gavrikov

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=alpine.DEB.2.00.1410171706110.1880@sg-laptop \
    --to=sergei.gavrikov@gmail.com \
    --cc=ecos-discuss@sourceware.org \
    --cc=o.uzenkov@unicore.co.ua \
    /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).