On Thu, Oct 17, 2013 at 03:28:15PM +0200, Andrew Jones wrote: > On Thu, Oct 17, 2013 at 12:16:18PM +0200, Andrew Jones wrote: > > On Wed, Oct 16, 2013 at 06:06:35PM -0700, Christoffer Dall wrote: > > > > diff --git a/arm/boot.c b/arm/boot.c > > > > new file mode 100644 > > > > index 0000000000000..375e8708a7c54 > > > > > > this file's indentation is also funny, you should really check your > > > editor configuration :) > > > > Actually the editor prefers kernel style, I had to keep trying to > > force the other style on it, and now see below that I wasn't always > > successful. '++expected' should have had just a tab, not a > > tab+4spaces... > > > > > > --- /dev/null > > > > +++ b/arm/boot.c > > > > @@ -0,0 +1,27 @@ > > > > +#include "libcflat.h" > > > > +#include "arm/bootinfo.h" > > > > + > > > > +static bool info_check(u32 var, char *expected) > > > > +{ > > > > + char var_str[9]; > > > > + snprintf(var_str, 9, "%x", var); > > > > + while (*expected == '0' || *expected == 'x') > > > > + ++expected; > > > > + return !strcmp(var_str, expected); > > > > +} > > > > + > > > > +int main(int argc, char **argv) > > > > +{ > > > > + int ret = 0; > > > > + > > > > + if (argc < 3) { > > > > + printf("Not enough arguments. Can't test\n"); > > > > + return 1; > > > > + } > > > > + > > > > + if (!strcmp(argv[0], "info")) > > > > + ret = !info_check(mem32.size, argv[1]) > > > > + || !info_check(core.pagesize, argv[2]); > > > > + > > > > + return ret; > > > > +} > > > > > > I'm actually a little confused, when does this main get invoked and by > > > whom and what are we testing for here? > > > > See cstart.S:start 'bl main' below for the who invokes. And > > arm/unittests.cfg, also below, for the (poorly documented) test case > > definition. You'll see we config the test to have 256G memory, and then > > here we confirm that we read the bootinfo correctly, i.e. it says 256G. Thanks. > > The above 'G's are of course 'M's. Who remapped my keyboard? > That would be one swanky ARM board. -Chrsitoffer -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html