xref: /haiku/src/system/boot/platform/amiga_m68k/rom_calls.cpp (revision 323b65468e5836bb27a5e373b14027d902349437)
1 /*
2  * Copyright 2010, François Revol, revol@free.fr. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  */
5 
6 
7 #include <boot/platform.h>
8 #include <boot/stage2.h>
9 #include <boot/stdio.h>
10 #include <stdarg.h>
11 
12 #include <Errors.h>
13 
14 #include "rom_calls.h"
15 
16 
17 struct GfxBase *GRAPHICS_BASE_NAME = NULL;
18 struct Library *KEYMAP_BASE_NAME = NULL;
19 struct Library *LOWLEVEL_BASE_NAME = NULL;
20 
21 
22 /*! Maps Amiga error codes to native errors
23  */
24 extern "C" status_t
25 exec_error(int32 err)
26 {
27 	switch (err) {
28 		case 0:
29 			return B_OK;
30 		case IOERR_OPENFAIL:
31 			return B_DEV_BAD_DRIVE_NUM;
32 		case IOERR_ABORTED:
33 			return B_INTERRUPTED;
34 		case IOERR_NOCMD:
35 			return B_BAD_VALUE;
36 		case IOERR_BADLENGTH:
37 			return B_BAD_VALUE;
38 		case IOERR_BADADDRESS:
39 			return B_BAD_ADDRESS;
40 		case IOERR_UNITBUSY:
41 			return B_DEV_NOT_READY;
42 		case IOERR_SELFTEST:
43 			return B_NOT_INITIALIZED;
44 		default:
45 			return B_ERROR;
46 	}
47 }
48 
49 
50