1 { 2 This file is part of the Free Pascal run time library. 3 4 A file in Amiga system run time library. 5 Copyright (c) 1998-2003 by Nils Sjoholm 6 member of the Amiga RTL development team. 7 8 See the file COPYING.FPC, included in this distribution, 9 for details about the copyright. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 15 **********************************************************************} 16 { 17 History: 18 19 Added the defines use_amiga_smartlink and 20 use_auto_openlib. Implemented autoopening of 21 the library. 22 14 Jan 2003. 23 24 Update for AmigaOS 3.9. 25 Changed start code for unit. 26 01 Feb 2003. 27 28 Changed cardinal > longword. 29 09 Feb 2003. 30 31 nils.sjoholm@mailbox.swipnet.se Nils Sjoholm 32 } 33 34 UNIT expansion; 35 36 INTERFACE 37 USES exec, configvars, amigados; 38 39 Const 40 EXPANSIONNAME : PChar = 'expansion.library'; 41 42 { flags for the AddDosNode() call } 43 ADNB_STARTPROC = 0; 44 45 ADNF_STARTPROC = 1; 46 47 VAR ExpansionBase : pLibrary = nil; 48 49 AddBootNodenull50FUNCTION AddBootNode(bootPri : LONGINT location 'd0'; flags : ULONG location 'd1'; deviceNode : pDeviceNode location 'a0'; configDev : pConfigDev location 'a1') : wordbool; syscall ExpansionBase 036; 51 PROCEDURE AddConfigDev(configDev : pConfigDev location 'a0'); syscall ExpansionBase 030; AddDosNodenull52FUNCTION AddDosNode(bootPri : LONGINT location 'd0'; flags : ULONG location 'd1'; deviceNode : pDeviceNode location 'a0') : wordbool; syscall ExpansionBase 150; 53 PROCEDURE AllocBoardMem(slotSpec : ULONG location 'd0'); syscall ExpansionBase 042; AllocConfigDevnull54FUNCTION AllocConfigDev : pConfigDev; syscall ExpansionBase 048; AllocExpansionMemnull55FUNCTION AllocExpansionMem(numSlots : ULONG location 'd0'; slotAlign : ULONG location 'd1') : POINTER; syscall ExpansionBase 054; 56 PROCEDURE ConfigBoard(board : POINTER location 'a0'; configDev : pConfigDev location 'a1'); syscall ExpansionBase 060; 57 PROCEDURE ConfigChain(baseAddr : POINTER location 'a0'); syscall ExpansionBase 066; FindConfigDevnull58FUNCTION FindConfigDev(const oldConfigDev : pConfigDev location 'a0'; manufacturer : LONGINT location 'd0'; product : LONGINT location 'd1') : pConfigDev; syscall ExpansionBase 072; 59 PROCEDURE FreeBoardMem(startSlot : ULONG location 'd0'; slotSpec : ULONG location 'd1'); syscall ExpansionBase 078; 60 PROCEDURE FreeConfigDev(configDev : pConfigDev location 'a0'); syscall ExpansionBase 084; 61 PROCEDURE FreeExpansionMem(startSlot : ULONG location 'd0'; numSlots : ULONG location 'd1'); syscall ExpansionBase 090; GetCurrentBindingnull62FUNCTION GetCurrentBinding(const currentBinding : pCurrentBinding location 'a0'; bindingSize : ULONG location 'd0') : ULONG; syscall ExpansionBase 138; MakeDosNodenull63FUNCTION MakeDosNode(const parmPacket : POINTER location 'a0') : pDeviceNode; syscall ExpansionBase 144; 64 PROCEDURE ObtainConfigBinding; syscall ExpansionBase 120; ReadExpansionBytenull65FUNCTION ReadExpansionByte(const board : POINTER location 'a0'; offset : ULONG location 'd0') : BYTE; syscall ExpansionBase 096; 66 PROCEDURE ReadExpansionRom(const board : POINTER location 'a0'; configDev : pConfigDev location 'a1'); syscall ExpansionBase 102; 67 PROCEDURE ReleaseConfigBinding; syscall ExpansionBase 126; 68 PROCEDURE RemConfigDev(configDev : pConfigDev location 'a0'); syscall ExpansionBase 108; 69 PROCEDURE SetCurrentBinding(currentBinding : pCurrentBinding location 'a0'; bindingSize : ULONG location 'd0'); syscall ExpansionBase 132; 70 PROCEDURE WriteExpansionByte(board : POINTER location 'a0'; offset : ULONG location 'd0'; byte : ULONG location 'd1'); syscall ExpansionBase 114; 71 72 IMPLEMENTATION 73 74 const 75 { Change VERSION and LIBVERSION to proper values } 76 VERSION : string[2] = '0'; 77 LIBVERSION : longword = 0; 78 79 initialization 80 ExpansionBase := OpenLibrary(EXPANSIONNAME,LIBVERSION); 81 finalization 82 if Assigned(ExpansionBase) then 83 CloseLibrary(ExpansionBase); 84 END. (* UNIT EXPANSION *) 85 86 87 88