summaryrefslogtreecommitdiffstats
path: root/firmware/include
diff options
context:
space:
mode:
authorMarcin Bukat <marcin.bukat@gmail.com>2012-03-04 15:34:29 +0100
committerMarcin Bukat <marcin.bukat@gmail.com>2013-06-27 13:50:11 +0200
commit0b29691324e5700f15ea653592bf29f8552d47d7 (patch)
tree00e4f77f28c813a493cd8af22170f486f6e82903 /firmware/include
parent46ea8bfe7c690c8db230fff3a582a69779f8e432 (diff)
downloadrockbox-0b29691324e5700f15ea653592bf29f8552d47d7.tar.gz
rockbox-0b29691324e5700f15ea653592bf29f8552d47d7.tar.bz2
rockbox-0b29691324e5700f15ea653592bf29f8552d47d7.zip
Move load_firmware() to separate file
The idea is to share loading code between bootloaders and rolo(). Change-Id: I1656ed91946d7a05cb7c9fa7a16793c3c862a5cd Reviewed-on: http://gerrit.rockbox.org/190 Reviewed-by: Marcin Bukat <marcin.bukat@gmail.com>
Diffstat (limited to 'firmware/include')
-rw-r--r--firmware/include/loader_strerror.h38
-rw-r--r--firmware/include/rb-loader.h22
2 files changed, 60 insertions, 0 deletions
diff --git a/firmware/include/loader_strerror.h b/firmware/include/loader_strerror.h
new file mode 100644
index 0000000000..e36036a8c0
--- /dev/null
+++ b/firmware/include/loader_strerror.h
@@ -0,0 +1,38 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ *
+ * Copyright (C) 2013 Marcin Bukat
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+enum error_t {
+ EFILE_EMPTY = 0,
+ EFILE_NOT_FOUND = -1,
+ EREAD_CHKSUM_FAILED = -2,
+ EREAD_MODEL_FAILED = -3,
+ EREAD_IMAGE_FAILED = -4,
+ EBAD_CHKSUM = -5,
+ EFILE_TOO_BIG = -6,
+ EINVALID_FORMAT = -7,
+ EKEY_NOT_FOUND = -8,
+ EDECRYPT_FAILED = -9,
+ EREAD_HEADER_FAILED = -10,
+ EBAD_HEADER_CHKSUM = -11,
+ EINVALID_LOAD_ADDR = -12,
+ EBAD_MODEL = -13
+};
+
+char *loader_strerror(enum error_t error);
diff --git a/firmware/include/rb-loader.h b/firmware/include/rb-loader.h
new file mode 100644
index 0000000000..e1e756dba9
--- /dev/null
+++ b/firmware/include/rb-loader.h
@@ -0,0 +1,22 @@
+/***************************************************************************
+ * __________ __ ___.
+ * Open \______ \ ____ ____ | | _\_ |__ _______ ___
+ * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
+ * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
+ * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
+ * \/ \/ \/ \/ \/
+ *
+ * Copyright (C) 2005 by Linus Nielsen Feltzing
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 1
+ * of the License, or (at your option) any later version.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ****************************************************************************/
+
+const char *rb_strerror(int8_t errno);
+int load_firmware(unsigned char* buf, const char* firmware, int buffer_size);