[PATCH v5] cpukit/aarch64: Add ESR register decoding

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Mar 23 17:50:23 UTC 2021


On 23/03/2021 18:42, Joel Sherrill wrote:

> > > +  mask = 1 << (num_bits - 1);
> > > +
> > > +  while ( mask != 0 ) {
> > > +    _IO_Printf( _CPU_Put_char, &sctx, "%d", (value & mask ? 1 : 0) );
> > > +    mask >>= 1;
> > > +  }

The _IO_Vprintf() is a port from the FreeBSD kvprintf(). I removed the 
support for this:

/*
  * Scaled down version of printf(3).
  *
  * Two additional formats:
  *
  * The format %b is supported to decode error registers.
  * Its usage is:
  *
  *    printf("reg=%b\n", regval, "<base><arg>*");
  *
  * where <base> is the output base expressed as a control character, e.g.
  * \10 gives octal; \20 gives hex.  Each arg is a sequence of characters,
  * the first of which gives the bit number to be inspected (origin 1), and
  * the next characters (up to a control character, i.e. a character <= 32),
  * give the name of the register.  Thus:
  *
  *    kvprintf("reg=%b\n", 3, "\10\2BITTWO\1BITONE");

We could also a a special %B specifier to produce 0b0100 stuff.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/



More information about the devel mailing list