Re: [PATCH] ARM: Remove kernel booting call for thumb2 mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2015-12-03 at 01:24 +0000, Trent Piepho wrote:
> The asm code to do the actual call into the kernel (or another
> barebox) when compiled in thumb2 mode isn't necessary.  gcc generates
> a perfectly good calling sequence from a normal function pointer call.
> If it didn't, the code in bootstrap_boot() that uses a function
> pointer to jump to the 2nd stage barebox from an xloader wouldn't
> work.

The same commit that originally added this code also added
thumb2_execute(), which is used by the go command in a thumb2 build.

This doesn't seem necessary for the same reason as the code in
start_linux.  THUMB2 selects AEABI, which in turn turns on the aapcs
abi, which requires interworking safe indirect calls.  And again, the
bootstrap code doesn't use a special call sequence so if it didn't work
that would be broken too.

The code for thumb2_execute() is also odd in that it subtracts one from
argc, drops the 1st argv entry, and supplies zero for the first function
argument.  I.e., "go" in arm mode (and all non-arm arches) does this:
	func(argc - 1, &argv[1]);
and in thumb2 mode does this:
	func(0, argc - 2, &argv[2]);

I don't see why one would want this difference.

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux