17ddba3d2SFrançois Revol /* 27ddba3d2SFrançois Revol * Copyright 2010, François Revol, revol@free.fr. All rights reserved. 37ddba3d2SFrançois Revol * Distributed under the terms of the MIT License. 47ddba3d2SFrançois Revol */ 57ddba3d2SFrançois Revol 67ddba3d2SFrançois Revol 77ddba3d2SFrançois Revol #include <boot/platform.h> 87ddba3d2SFrançois Revol #include <boot/stage2.h> 97ddba3d2SFrançois Revol #include <boot/stdio.h> 107ddba3d2SFrançois Revol #include <stdarg.h> 117ddba3d2SFrançois Revol 127ddba3d2SFrançois Revol #include <Errors.h> 137ddba3d2SFrançois Revol 147ddba3d2SFrançois Revol #include "rom_calls.h" 157ddba3d2SFrançois Revol 167ddba3d2SFrançois Revol 1751bac633SFrançois Revol struct GfxBase *GRAPHICS_BASE_NAME = NULL; 18f2b7a266SFrançois Revol struct Library *KEYMAP_BASE_NAME = NULL; 19*9bc9cf06SFrançois Revol struct Library *LOWLEVEL_BASE_NAME = NULL; 2051bac633SFrançois Revol 217ddba3d2SFrançois Revol 227ddba3d2SFrançois Revol /*! Maps Amiga error codes to native errors 237ddba3d2SFrançois Revol */ 247ddba3d2SFrançois Revol extern "C" status_t exec_error(int32 err)257ddba3d2SFrançois Revolexec_error(int32 err) 267ddba3d2SFrançois Revol { 277ddba3d2SFrançois Revol switch (err) { 28f2b7a266SFrançois Revol case 0: 29f2b7a266SFrançois Revol return B_OK; 307ddba3d2SFrançois Revol case IOERR_OPENFAIL: 317ddba3d2SFrançois Revol return B_DEV_BAD_DRIVE_NUM; 327ddba3d2SFrançois Revol case IOERR_ABORTED: 337ddba3d2SFrançois Revol return B_INTERRUPTED; 347ddba3d2SFrançois Revol case IOERR_NOCMD: 357ddba3d2SFrançois Revol return B_BAD_VALUE; 367ddba3d2SFrançois Revol case IOERR_BADLENGTH: 377ddba3d2SFrançois Revol return B_BAD_VALUE; 387ddba3d2SFrançois Revol case IOERR_BADADDRESS: 397ddba3d2SFrançois Revol return B_BAD_ADDRESS; 407ddba3d2SFrançois Revol case IOERR_UNITBUSY: 417ddba3d2SFrançois Revol return B_DEV_NOT_READY; 427ddba3d2SFrançois Revol case IOERR_SELFTEST: 437ddba3d2SFrançois Revol return B_NOT_INITIALIZED; 447ddba3d2SFrançois Revol default: 457ddba3d2SFrançois Revol return B_ERROR; 467ddba3d2SFrançois Revol } 477ddba3d2SFrançois Revol } 487ddba3d2SFrançois Revol 497ddba3d2SFrançois Revol 50