Fix FS#11539. Undo r23967 and use another way to achieve results for negative exponen...
[maemo-rb.git] / bootloader / common.h
blob7d5425c9c8d0747ef3e2180c79451670b2b0c4d6
1 /***************************************************************************
2 * __________ __ ___.
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
7 * \/ \/ \/ \/ \/
8 * $Id$
10 * Copyright (C) 2005 by Linus Nielsen Feltzing
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #include <stdbool.h>
24 /* Error codes */
25 #define EOK 0
26 #define EFILE_NOT_FOUND -1
27 #define EREAD_CHKSUM_FAILED -2
28 #define EREAD_MODEL_FAILED -3
29 #define EREAD_IMAGE_FAILED -4
30 #define EBAD_CHKSUM -5
31 #define EFILE_TOO_BIG -6
32 #define EINVALID_FORMAT -7
34 /* Set this to true to enable lcd_update() in the printf function */
35 extern bool verbose;
37 /* Error types */
38 #define EATA -1
39 #define EDISK -2
40 #define EBOOTFILE -3
42 /* Functions common to all bootloaders */
43 void reset_screen(void);
44 int printf(const char *format, ...);
45 char *strerror(int error);
46 void error(int errortype, int error, bool shutdown);
47 int load_firmware(unsigned char* buf, char* firmware, int buffer_size);
48 int load_raw_firmware(unsigned char* buf, char* firmware, int buffer_size);
49 #ifdef ROCKBOX_HAS_LOGF
50 void display_logf(void);
51 #endif