From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32165 invoked by alias); 27 Feb 2014 16:40:01 -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 32152 invoked by uid 89); 27 Feb 2014 16:40:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2 X-HELO: p02c12o144.mxlogic.net Received: from p02c12o144.mxlogic.net (HELO p02c12o144.mxlogic.net) (208.65.145.77) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Thu, 27 Feb 2014 16:39:58 +0000 Received: from unknown [12.218.215.72] (EHLO smtpauth1.linear.com) by p02c12o144.mxlogic.net(mxl_mta-7.2.4-1) with ESMTP id b5a6f035.0.13618.00-273.36491.p02c12o144.mxlogic.net (envelope-from ); Thu, 27 Feb 2014 09:39:58 -0700 (MST) X-MXL-Hash: 530f6a5e74700d66-5e45d5471b9dae2a42e93d532217782116c1e643 Received: from topp.engineering.linear.com (unknown [10.186.3.71]) by smtpauth1.linear.com (Postfix) with ESMTPSA id 1B13E740B1; Thu, 27 Feb 2014 08:39:50 -0800 (PST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 6.6 \(1510\)) From: Michael Jones In-Reply-To: Date: Thu, 27 Feb 2014 16:40:00 -0000 Cc: ecos discuss Content-Transfer-Encoding: quoted-printable Message-Id: References: To: =?iso-8859-1?Q?Lambrecht_J=FCrgen?= X-AnalysisOut: [v=2.0 cv=O5OOSmBW c=1 sm=1 a=glloKNylpeYNumXQcclYyA==:17 a] X-AnalysisOut: [=CFl6StMSI_gA:10 a=D2_GN2MmYMYA:10 a=BLceEmwcHowA:10 a=8nJ] X-AnalysisOut: [EP1OIZ-IA:10 a=MqDINYqSAAAA:8 a=lYns4bTXbHIA:10 a=prgfXTrU] X-AnalysisOut: [AAAA:8 a=CCpqsmhAAAAA:8 a=8mV0FltqwUFE6oZuz6kA:9 a=wPNLvfG] X-AnalysisOut: [TeEIA:10 a=ntesgRjRzHUA:10 a=xLpt9-x9cSEA:10 a=4t78-hnhQh4] X-AnalysisOut: [A:10] X-Spam: [F=0.5000000000; CM=0.500; MH=0.500(2014022710); S=0.200(2010122901)] X-MAIL-FROM: X-IsSubscribed: yes Subject: Re: [ECOS] Scheduler startup question X-SW-Source: 2014-02/txt/msg00006.txt.bz2 By tracing through a Cortex M application that works, I found that when the= first thread is run, there is a loop at the bottom of the thread entry cal= l that calls unlock until sched_lock is 0. Every thread entry does this. This seems a bit dangerous to me, as the unlocking occurs anytime a new thr= ead is created. I have to assume that the thread could not be entered when = in a critical section between scheduler locks. I'll look into that behavior and see if it is related to my BSD assertion. On Feb 26, 2014, at 11:40 PM, Lambrecht J=FCrgen = wrote: > As far as I know the scheduler is started after cyg_user_start(), used by= your application to initialize everything. Do you use cyg_user_start? >=20 >=20 > Verzonden vanaf Samsung Mobile >=20 >=20 >=20 > -------- Oorspronkelijk bericht -------- > Van: Michael Jones > Datum: > Aan: ecos discuss > Onderwerp: [ECOS] Scheduler startup question >=20 >=20 > I have a question about proper scheduler locking startup behavior. >=20 > The context is I am cleaning up my iMX6 HAL and attempting to make things= work without a couple of kernel hacks I added to make it work. >=20 > The question has to do with sched_lock. By default this has a value of 1,= so during startup the scheduler is locked. >=20 > When there is an interrupt, sched_lock is incremented in Vectors.S, and d= ecremented in interrupt_end. >=20 > However, I am getting an assert in sync.h which is part of the BSD stack.= The assert is because it expects the lock to be zero. >=20 > The question is, during the startup process, how does the lock get set to= zero after initialization? Is it supposed to stay 1 while hardware is init= ialized and through all the constructors, etc? Is it cleared by the schedul= er somehow? Is the HAL supposed to zero it at some point during startup? >=20 > My HAL is part of the ARM hal, so if this is device specific, it is the A= RM HAL I am working with. >=20 > Mike > -- > Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos > and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss >=20 >=20 > -- > Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos > and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss >=20 -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss