From: Wolfgang Denk Date: Tue, 22 Mar 2011 14:28:37 +0100 Subject: [U-Boot] [PATCH 01/21] Define new system_restart() and emergency_restart() In-Reply-To: <4D88909A.80508@gmail.com> References: <1299519462-25320-1-git-send-email-Kyle.D.Moffett@boeing.com> <1299519462-25320-2-git-send-email-Kyle.D.Moffett@boeing.com> <20110313192458.1C19DE0CE97@gemini.denx.de> <20110314185944.56ECC1518DB7@gemini.denx.de> <613C8F89-3CE5-4C28-A48E-D5C3E8143A4C@boeing.com> <20110314203808.C022B1518DB6@gemini.denx.de> <44A75130-ED4F-46D6-B0E4-12433CC15142@boeing.com> <20110314220108.683E51518DB6@gemini.denx.de> <4D8739F6.5040805@gmail.com> <20110321120054.71E63DD9C74@gemini.denx.de> <4D88909A.80508@gmail.com> Message-ID: <20110322132837.ABE701537B0@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Graeme Russ, In message <4D88909A.80508@gmail.com> you wrote: > > > That would be a layer higher than do_reset() (for example, in > > panic()). > > Hmmm, but panic() is defined in lib/vsprintf.c with no possibility for it > to be overridden in any arch or board specific way I guess that could be helped. > > panic() is a higher software layer. It probably results in calling > > reset() in the end. > > Unless CONFIG_PANIC_HANG is defined... > reset(): > - does not exist (as far as I can tell) reset() is used as symbol in many arm, mips and sparc start.S files > I still like the idea of passing a 'reason' to reset() / panic() - Could we > change panic() to: ... > Anywhere in the code that needed to hang has a choice - hang(reason) or > panic(reason | PANIC_FLAG_HANG) I don't think you resonably decide which to use in common code. Most calls to panic() appear to come from proprietary flash drivers anyway - most of which should be dropped as they could use the CFI driver instead. [And if you look at the actual code, the tests for these panic()s can easily be computed at compile time, so these are stupid aniway.] Others Now, assume for things like this: panic("No working SDRAM available\n"); or like handling undefined instructions or that - what would be more useful - to hang() to to reset()? ;-) Can you please show me a specific case where you would use such different arguments to panic() in the existing code? > Default implementations of hang() and reset() would just ignore reason. > Board specific code can use reason to do one last boot_progress(), set LED > states etc. That should be done at a higher software layer. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de CAUTION: The Mass of This Product Contains the Energy Equivalent of 85 Million Tons of TNT per Net Ounce of Weight.