From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tolunay Orkun Date: Wed, 26 Apr 2006 18:25:13 -0500 Subject: [U-Boot-Users] How do you test a bit set/clear from U-Boot command line/script? In-Reply-To: <20060426222044.CA140353DAD@atlas.denx.de> References: <20060426222044.CA140353DAD@atlas.denx.de> Message-ID: <44500159.8020506@orkun.us> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang Denk wrote: > In message <444FDD08.2010101@orkun.us> you wrote: > >> I know I can compare a simple value using itest command. e.g. >> >> itest *4000 -eq 1234 && echo 'Addr 4000 contains 1234' >> >> Now my problem is how can I test a bit of 32 bit quantity (say bit 4) >> stored at location 4000? This is a question about general hush/u-boot >> shell capability? It is a generic question... >> > > At the moment there is no command that implements this. As you > probaly are aware, the "itest" command just implements the following > operations: > I did hope there was some clever way to do this using existing commands. > Feel free to add new commands for AND, OR, and XOR... > I will send a patch. I am not sure how OR or XOR could be useful though... We do not support multiple operations or store computed expression results anywhere. Tolunay