Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DM_FATFileSystem EthernetInterface HTTPClient mbed-rtos mbed-src
Fork of DMSupport by
Diff: Bios/BiosLoader.cpp
- Revision:
- 26:a65fbb4bde5c
- Parent:
- 24:9a677afc86f1
- Child:
- 27:0499c29688cc
diff -r ca399b043d30 -r a65fbb4bde5c Bios/BiosLoader.cpp
--- a/Bios/BiosLoader.cpp Tue Jan 20 09:11:28 2015 +0100
+++ b/Bios/BiosLoader.cpp Thu Jan 22 16:04:54 2015 +0100
@@ -25,7 +25,7 @@
#ifdef __cplusplus
extern "C" {
#endif
- void bios_debug_aid(bios_header_t* header, const char** pMsg);
+ void bios_debug_aid(bios_header_t* header, const char** pMsg, uint32_t* paramSize);
#ifdef __cplusplus
}
#endif
@@ -48,7 +48,14 @@
#define MAX(__a, __b) (((__a)>(__b))?(__a):(__b))
#endif
-
+/*
+ * The BIOS is API compatible as long as the Major component of the
+ * version is the same.
+ */
+#define SUPPORTED_BIOS_VER 0x000000
+#define SUPPORTED_BIOS_MASK 0xff0000 // only look at the Major component
+#define SUPPORTED_VERSION(__ver) (((__ver)&SUPPORTED_BIOS_MASK) == SUPPORTED_BIOS_VER)
+
/******************************************************************************
* Local variables
*****************************************************************************/
@@ -112,7 +119,7 @@
break;
}
- if (fh.version != BIOS_VER) {
+ if (!SUPPORTED_VERSION(fh.version)) {
err = DMBoard::BiosVersionError;
break;
}
@@ -214,7 +221,16 @@
#if defined(DM_BOARD_BIOS_DEVELOPMENT)
// This requires that the project contains the source code for the BIOS
const char* msg;
- bios_debug_aid(&_bios, &msg);
+ uint32_t tmp = 0;
+ bios_debug_aid(&_bios, &msg, &tmp);
+ if (tmp > file_header->paramSize) {
+ free(_biosData);
+ _biosData = malloc(tmp);
+ if (_biosData == NULL) {
+ err = DMBoard::MemoryError;
+ break;
+ }
+ }
DMBoard::instance().logger()->printf("BIOS info: %s\n", msg);
#endif
