Read about our upcoming Code of Conduct on this issue

Commit 51780784 authored by alex@thinkpad's avatar alex@thinkpad
Browse files

qemu-util: fix compilation in bootloader context;

sample boot messages in reboot.c, e.g. printing firmware signature or RESTARTSTART address
(only present in the output binary when compiling with CONFIG_QEMU=y)

--HG--
branch : qemu
parent c33141cd12a9
......@@ -38,6 +38,12 @@ static inline int qprint(const char * msg)
return 0;
}
/* from dryos.h
* required to compile qprintf in bootloader context,
* although you won't be able to use it (vsnprintf is in main firmware)
* ... unless you can supply another vsnprintf, e.g. from dietlibc */
extern int vsnprintf( char* str, size_t n, const char* fmt, va_list ap );
/* print messages to the QEMU console */
static int qprintf(const char * fmt, ...)
{
......
......@@ -29,6 +29,7 @@
#include "fw-signature.h"
#include "disp_direct.h"
#include <string.h>
#include <qemu-util.h>
/* this magic is a BX R3 */
#define FOOTER_MAGIC 0xE12FFF13
......@@ -216,6 +217,8 @@ cstart( void )
int _signature = (int)CURRENT_CAMERA_SIGNATURE;
if (s != _signature)
{
qprint("[boot] firmware signature: "); qprintn(s); qprint("\n");
qprint(" expected: "); qprintn(_signature); qprint("\n");
fail();
}
#endif
......@@ -258,6 +261,7 @@ cstart( void )
sooner or later. So, we have copied it to RESTARTSTART, and will tell Canon code not to touch it
(usually by resizing some memory allocation pool and choosing RESTARTSTART in the newly created space).
*/
qprint("[boot] copy_and_restart "); qprintn(RESTARTSTART); qprint("\n");
void __attribute__((long_call)) (*copy_and_restart)() = (void*) RESTARTSTART;
copy_and_restart();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment