diff --git a/src/system/boot/platform/atari_m68k/bios.h b/src/system/boot/platform/atari_m68k/bios.h deleted file mode 100644 index cfdbcdb549..0000000000 --- a/src/system/boot/platform/atari_m68k/bios.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright 2007, Haiku, Inc. All Rights Reserved. - * Distributed under the terms of the MIT license. - * - * Author: - * François Revol, revol@free.fr. - */ -#ifndef _BIOS_H -#define _BIOS_H - -/* - * Atari BIOS calls - */ - -#define BIOS_TRAP XXX - -// BIOSxxx...: x: param type {W|L} - -#define BIOS(nr) \ -({ uint32 ret; \ -asm volatile ( \ -" move #%0,-(sp)\n" \ -" trap #" #BIOS_TRAP "\n" \ -" add.l #2,sp" \ -:: "=r"(ret)); \ -ret; }) - -#define BIOSW(nr, w0) \ -({ uint32 ret; \ -asm volatile ( \ -" move.w %1,-(sp)\n" \ -" move #" #nr ",-(sp)\n" \ -" trap #" #BIOS_TRAP "\n" \ -" add.l #2,sp" \ -:: "=r"(ret)); \ -ret; }) - -#define Bconin(p0) (uint32)BIOSW(2, p0) -//XXX nparams ? -#define Kbshift(p0) (uint32)BIOSW(11, p0) - -#endif /* _BIOS_H */ diff --git a/src/system/boot/platform/atari_m68k/gemdos.h b/src/system/boot/platform/atari_m68k/gemdos.h deleted file mode 100644 index ba29b4ea9e..0000000000 --- a/src/system/boot/platform/atari_m68k/gemdos.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2007, Haiku, Inc. All Rights Reserved. - * Distributed under the terms of the MIT license. - * - * Author: - * François Revol, revol@free.fr. - */ -#ifndef _GEMDOS_H -#define _GEMDOS_H - -/* - * Atari GEMDOS calls - */ - -#define GEMDOS_TRAP 1 - -// official names -#define Cconin() GEMDOS(1) - -// check for names -#define supexec() GEMDOS(0x20) -#define terminate() GEMDOS(0) - -#endif /* _GEMDOS_H */ diff --git a/src/system/boot/platform/atari_m68k/toscalls.S b/src/system/boot/platform/atari_m68k/toscalls.S new file mode 100644 index 0000000000..246f180735 --- /dev/null +++ b/src/system/boot/platform/atari_m68k/toscalls.S @@ -0,0 +1,46 @@ +/* + * Copyright 2007, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT license. + * + * Author: + * François Revol, revol@free.fr. + */ + +#define FUNCTION(x) .global x; .type x,@function; x + +/* non reentrant but that's enough + * idea taken from + * http://www.fortunecity.com/skyscraper/apple/308/html/chap4.htm + */ + +_trap_ret_addr: + .long 0 + +/* uint32 bios(uint16 nr, ...); */ +FUNCTION(bios): + move.l (%a7)+,_trap_ret_addr + trap # + move.l _trap_ret_addr,-(%a7) + rts + +/* uint32 xbios(uint16 nr, ...); */ +FUNCTION(xbios): + move.l (%a7)+,_trap_ret_addr + trap #14 + move.l _trap_ret_addr,-(%a7) + rts + +/* uint32 gemdos(uint16 nr, ...); */ +FUNCTION(gemdos): + move.l (%a7)+,_trap_ret_addr + trap #1 + move.l _trap_ret_addr,-(%a7) + rts + +/* uint32 vdi(uint16 nr, ...); */ +FUNCTION(vdi): + move.l (%a7)+,_trap_ret_addr + trap #14 + move.l _trap_ret_addr,-(%a7) + rts + diff --git a/src/system/boot/platform/atari_m68k/toscalls.h b/src/system/boot/platform/atari_m68k/toscalls.h new file mode 100644 index 0000000000..4faf78e070 --- /dev/null +++ b/src/system/boot/platform/atari_m68k/toscalls.h @@ -0,0 +1,50 @@ +/* + * Copyright 2007, Haiku, Inc. All Rights Reserved. + * Distributed under the terms of the MIT license. + * + * Author: + * François Revol, revol@free.fr. + */ + +#ifndef _TOSCALLS_H +#define _TOSCALLS_H + +#ifdef __cplusplus +extern "C" { +#endif + +/* + * Atari BIOS calls + */ + +extern uint32 bios(uint16 nr, ...); + +#define Bconin(p0) bios(2, p0) +//XXX nparams ? +#define Kbshift(p0) bios(11, p0) + +/* + * Atari XBIOS calls + */ + +extern uint32 bios(uint16 nr, ...); + + +/* + * Atari GEMDOS calls + */ + +extern uint32 gemdos(uint16 nr, ...); + +// official names +#define Cconin() gemdos(1) +#define Super(a) gemdos(0x20, (uint32)a) + +// check for names +#define terminate() GEMDOS(0) + +#ifdef __cplusplus +} +#endif + +#endif /* _TOSCALLS_H */ diff --git a/src/system/boot/platform/atari_m68k/xbios.h b/src/system/boot/platform/atari_m68k/xbios.h deleted file mode 100644 index 97245b5208..0000000000 --- a/src/system/boot/platform/atari_m68k/xbios.h +++ /dev/null @@ -1,18 +0,0 @@ -/* - * Copyright 2007, Haiku, Inc. All Rights Reserved. - * Distributed under the terms of the MIT license. - * - * Author: - * François Revol, revol@free.fr. - */ -#ifndef _XBIOS_H -#define _XBIOS_H - -/* - * Atari XBIOS calls - */ - -#define BIOS_TRAP 14 -//#define GEMDOS_TRAP 1 - -#endif /* _XBIOS_H */