From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20649 invoked by alias); 17 Oct 2014 14:25:36 -0000 Mailing-List: contact ecos-discuss-help@ecos.sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: ecos-discuss-owner@ecos.sourceware.org Received: (qmail 20636 invoked by uid 89); 17 Oct 2014 14:25:36 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-lb0-f169.google.com Received: from mail-lb0-f169.google.com (HELO mail-lb0-f169.google.com) (209.85.217.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 17 Oct 2014 14:25:34 +0000 Received: by mail-lb0-f169.google.com with SMTP id 10so778398lbg.0 for ; Fri, 17 Oct 2014 07:25:31 -0700 (PDT) X-Received: by 10.152.36.230 with SMTP id t6mr3553990laj.88.1413555930945; Fri, 17 Oct 2014 07:25:30 -0700 (PDT) Received: from sg-laptop ([178.121.91.119]) by mx.google.com with ESMTPSA id l13sm487313lbh.32.2014.10.17.07.25.29 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Fri, 17 Oct 2014 07:25:30 -0700 (PDT) Date: Fri, 17 Oct 2014 14:25:00 -0000 From: Sergei Gavrikov To: Oleg Uzenkov cc: eCos Discussion In-Reply-To: <54410554.5040001@unicore.co.ua> Message-ID: References: <543FCF93.4090209@unicore.co.ua> <54410554.5040001@unicore.co.ua> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IsSubscribed: yes Subject: Re: [ECOS] place thread stack into CCM memory on STM32 X-SW-Source: 2014-10/txt/msg00028.txt.bz2 On Fri, 17 Oct 2014, Oleg Uzenkov wrote: > Ok, it appears that it is possible to specify > __attribute__((section(""))) 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