xref: /haiku/src/system/boot/platform/amiga_m68k/rom_calls.cpp (revision a7dde370f552f5376edbf25046ec9cf2ba8bbd1a)
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 
20 
21 /*! Maps Amiga error codes to native errors
22  */
23 extern "C" status_t
24 exec_error(int32 err)
25 {
26 	switch (err) {
27 		case 0:
28 			return B_OK;
29 		case IOERR_OPENFAIL:
30 			return B_DEV_BAD_DRIVE_NUM;
31 		case IOERR_ABORTED:
32 			return B_INTERRUPTED;
33 		case IOERR_NOCMD:
34 			return B_BAD_VALUE;
35 		case IOERR_BADLENGTH:
36 			return B_BAD_VALUE;
37 		case IOERR_BADADDRESS:
38 			return B_BAD_ADDRESS;
39 		case IOERR_UNITBUSY:
40 			return B_DEV_NOT_READY;
41 		case IOERR_SELFTEST:
42 			return B_NOT_INITIALIZED;
43 		default:
44 			return B_ERROR;
45 	}
46 }
47 
48 
49