Define the needed Library Vector Offsets in the header and use them from the asm.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38943 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol
2010-10-10 20:41:41 +00:00
parent 396a612a64
commit 4543fd0ef6
2 changed files with 29 additions and 17 deletions
+24 -3
View File
@@ -1035,18 +1035,36 @@ struct Library;
#define EXEC_BASE_NAME SysBase
#define _LVOFindResident (-0x60)
#define _LVOAllocAbs (-0xcc)
#define _LVOOldOpenLibrary (-0x198)
#define _LVOCloseLibrary (-0x19e)
#define _LVODoIO (-0x1c8)
#define _LVOOpenLibrary (-0x228)
#ifndef __ASSEMBLER__
extern Library *EXEC_BASE_NAME;
#define AllocAbs(par1, last) \
LP2(0xcc, APTR, AllocAbs, unsigned long, par1, d0, APTR, last, a1, \
, EXEC_BASE_NAME)
#define CloseLibrary(last) \
LP1NR(0x19e, CloseLibrary, struct Library *, last, a1, \
, EXEC_BASE_NAME)
#define OpenLibrary(par1, last) \
LP2(0x228, struct Library *, OpenLibrary, uint8 *, par1, a1, unsigned long, last, d0, \
#define DoIO(last) \
LP1(0x1c8, BYTE, DoIO, struct IORequest *, last, a1, \
, EXEC_BASE_NAME)
#define OpenLibrary(par1, last) \
LP2(0x228, struct Library *, OpenLibrary, uint8 *, par1, a1, \
unsigned long, last, d0, \
, EXEC_BASE_NAME)
extern "C" status_t exec_error(int32 err);
@@ -1066,12 +1084,15 @@ extern "C" status_t exec_error(int32 err);
#define INTUITION_BASE_NAME IntuitionBase
#define _LVODisplayAlert (-0x5a)
#ifndef __ASSEMBLER__
extern Library *INTUITION_BASE_NAME;
#define DisplayAlert(par1, par2, last) \
LP3(0x5a, bool, DisplayAlert, unsigned long, par1, d0, void *, par2, a0, unsigned long, last, d1, \
LP3(0x5a, bool, DisplayAlert, unsigned long, par1, d0, void *, \
par2, a0, unsigned long, last, d1, \
, INTUITION_BASE_NAME)
#endif /* __ASSEMBLER__ */
+5 -14
View File
@@ -39,15 +39,6 @@
#include "amiga_memory_map.h"
#include "amicalls.h"
// AmigaDOS calls
// exec.library
#define _FindResident -0x60
#define _OldOpenLibrary -0x198
#define _CloseLibrary -0x19e
// intuition.library
#define _DisplayAlert -90
// 1 enabled verbose output
//#define DEBUG 1
@@ -85,21 +76,21 @@ floppy_start:
// seems like a6 is already set to ExecBase when called from the ROM ?
move.l 4.w,%a6 // exec base
//jsr _FindResident(%a6)
//jsr _LVOFindResident(%a6)
lea SysBase(%pc),%a2
move.l %a6,(%a2)
// lea dosname_boot(%pc),%a1
// move.l 4.w,%a6 // exec base
// jsr _FindResident(%a6)
// jsr _LVOFindResident(%a6)
// lea DosBase(%pc),%a2
// tst.l %d0
// beq.s _floppy_err
// move.l %d0,(%a2)
lea intname_boot(%pc),%a1
jsr _OldOpenLibrary(%a6)
jsr _LVOOldOpenLibrary(%a6)
tst.l %d0
beq.s _floppy_err
lea IntuitionBase(%pc),%a2
@@ -116,7 +107,7 @@ floppy_start:
//_continue:
// lea dosname_boot(%pc),%a1
// move.l 4.w,%a6 // exec base
// jsr _FindResident(%a6)
// jsr _LVOFindResident(%a6)
// lea _dosbase(%pc),%a2
// tst.l %d0
// beq.s _floppy_err
@@ -142,7 +133,7 @@ _display_alert:
lea alert_data(%pc),%a0
moveq #0,%d0
move.l #40,%d1
jsr _DisplayAlert(%a6)
jsr _LVODisplayAlert(%a6)
//move.l (%sp)+,%a6
rts