@ GNU AS assembler header file for Podule
@ Written by DefMod (Dec  9 2012) on Sun Dec  9 15:45:18 2012
@ Jonathan Coxhead, jonathan@doves.demon.co.uk, 21 Aug 1995

@ OSLib---efficient, type-safe, transparent, extensible,
@ register-safe API coverage of RISC OS
@ 
@ Copyright (c) 1994-2012 Jonathan Coxhead and OSLib maintainers
@ 
@ Licence:
@ 
@    OSLib is free software; you can redistribute it and/or modify
@ it under the terms of the GNU General Public License as published by
@ the Free Software Foundation; either version 1, or (at your option)
@ any later version - and this with the following clarification and
@ special exception:
@ 
@    Linking this library statically or dynamically with other modules
@ is making a combined work based on this library. Thus, the terms
@ and conditions of the GNU General Public License cover the whole
@ combination.
@ 
@    As a special exception, the copyright holders of this library
@ give you permission to link this library with independent modules
@ to produce an executable, regardless of the license terms of these
@ independent modules, and to copy and distribute the resulting
@ executable under terms of your choice, provided that you also meet,
@ for each linked independent module, the terms and conditions of the
@ license of that module. An independent module is a module which is
@ not derived from or based on this library. If you modify this
@ library, you may extend this exception to your version of the library,
@ but you are not obliged to do so. If you do not wish to do so, delete
@ this exception statement from your version.
@ 
@    OSLib is distributed in the hope that it will be useful,
@ but WITHOUT ANY WARRANTY; without even the implied warranty of
@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@ GNU General Public License for more details.
@ 
@    You should have received a copy of the GNU General Public License
@ along with this programme; if not, write to the Free Software
@ Foundation, Inc, 675 Mass Ave, Cambridge, MA 02139, USA.

#ifndef Podule_Hdr
#  define Podule_Hdr

#  ifndef Get_Types
#    define Get_Types
#    include "oslib/Types.Hdr"
#  endif

#  ifndef Get_OS
#    define Get_OS
#    include "oslib/OS.Hdr"
#  endif

@Symbols for constants
#  define Podule_SectionSystemROM 0xffffffff
#  define Podule_SectionExpansionCard0 0x0
#  define Podule_SectionExpansionCard1 0x1
#  define Podule_SectionExpansionCard2 0x2
#  define Podule_SectionExpansionCard3 0x3
#  define Podule_SectionExtensionROM1 0xfffffffe
#  define Error_PoduleBadPod 0x500
#  define Error_PoduleBadSpeed 0x501
#  define Error_PoduleNoPod 0x502
#  define Error_PoduleNotExt 0x503
#  define Error_PoduleNotAcrn 0x504
#  define Error_PoduleNoLdr 0x505
#  define Error_PoduleInLdr 0x506
#  define Error_PoduleBadChnk 0x507
#  define Error_PoduleBadDeviceNumber 0x508
#  define Error_PoduleBadDeviceType 0x509
#  define Error_PoduleRAMConfigSyntax 0x50a
#  define Error_PoduleWrongPoduleType 0x50b
#  define Error_PoduleROMBoardSyntax 0x50c
#  define Error_PoduleBadRead 0x50d
#  define Error_PoduleBdSpeed 0x50e
#  define Error_PoduleNotEASI 0x50f
#  define Error_PoduleSpeedNo 0x510
#  define Error_PoduleECNoSpd 0x511
#  define Error_PoduleECNoNet 0x512
#  define Error_PoduleNDallas 0x513
#  define Error_PoduleNotWritable 0x580
#  define Error_PoduleAddressRange 0x581
#  define Error_PoduleDeviceNotWritable 0x582
#  define Error_PodulePoduleReadOnly 0x583
#  define Error_PoduleAddressTooBig 0x584

@Symbols for structure offsets and sizes
        .struct 0
        .skip   Int
Podule_Section                 : 

        .struct 0
Podule_Header_b                : .skip   16*Byte
Podule_Header                  : 


@Symbols for SWI's and SWI reason codes
.set XPodule_ReadID,0x60280
.set Podule_ReadID,0x40280
   @Entry
   @  R3 = section (Podule_Section)
   @Exit
   @  R0 = ec_id (Int)

.set XPodule_ReadHeader,0x60281
.set Podule_ReadHeader,0x40281
   @Entry
   @  R2 = header (pointer to Podule_Header)
   @  R3 = section (Podule_Section)

.set XPodule_EnumerateChunks,0x60282
.set Podule_EnumerateChunks,0x40282
   @Entry
   @  R0 = context (Int)
   @  R3 = section (Podule_Section)
   @Exit
   @  R0 = context_out (Int)
   @  R1 = size (Int)
   @  R2 = os_id (Byte)
   @  R4 -> module_name (String)

.set XPodule_ReadChunk,0x60283
.set Podule_ReadChunk,0x40283
   @Entry
   @  R0 = chunk_no (Int)
   @  R2 = buffer (pointer to data)
   @  R3 = section (Podule_Section)

.set XPodule_ReadBytes,0x60284
.set Podule_ReadBytes,0x40284
   @Entry
   @  R0 = start_offset (Int)
   @  R1 = size (Int)
   @  R2 = buffer (pointer to data)
   @  R3 = slot_no (Int)

.set XPodule_WriteBytes,0x60285
.set Podule_WriteBytes,0x40285
   @Entry
   @  R0 = start_offset (Int)
   @  R1 = size (Int)
   @  R2 -> buffer (data)
   @  R3 = slot_no (Int)

.set XPodule_CallLoader,0x60286
.set Podule_CallLoader,0x40286
   @Entry
   @  R0 = arg0 (Int)
   @  R1 = arg1 (Int)
   @  R2 = arg2 (Int)
   @  R3 = slot_no (Int)
   @Exit
   @  R0 = arg0_out (Int)
   @  R1 = arg1_out (Int)
   @  R2 = arg2_out (Int)

.set XPodule_RawRead,0x60287
.set Podule_RawRead,0x40287
   @Entry
   @  R0 = start_offset (Int)
   @  R1 = size (Int)
   @  R2 = buffer (pointer to data)
   @  R3 = slot_no (Int)

.set XPodule_RawWrite,0x60288
.set Podule_RawWrite,0x40288
   @Entry
   @  R0 = start_offset (Int)
   @  R1 = size (Int)
   @  R2 -> buffer (data)
   @  R3 = slot_no (Int)

.set XPodule_HardwareAddress,0x60289
.set Podule_HardwareAddress,0x40289
   @Entry
   @  R3 = section (Podule_Section)
   @Exit
   @  R3 = combined_addr (pointer to Int)

.set XPodule_EnumerateChunksWithInfo,0x6028a
.set Podule_EnumerateChunksWithInfo,0x4028a
   @Entry
   @  R0 = context (Int)
   @  R3 = section (Podule_Section)
   @  R6 = &1
   @Exit
   @  R0 = context_out (Int)
   @  R1 = size (Int)
   @  R2 = os_id (Byte)
   @  R4 -> module_name (String)
   @  R5 -> help_text (String)
   @  R6 = module_base (pointer to Int)

.set XPodule_HardwareAddresses,0x6028b
.set Podule_HardwareAddresses,0x4028b
   @Entry
   @  R3 = section (Podule_Section)
   @Exit
   @  R0 = base_addr (pointer to Int)
   @  R1 = combined_addr (pointer to Int)

.set XPodule_ReturnNumber,0x6028c
.set Podule_ReturnNumber,0x4028c
   @Exit
   @  R0 = expansion_card_count (Int)
   @  R1 = extension_rom_count (Int)

.set XPodule_ReadInfo,0x6028d
.set Podule_ReadInfo,0x4028d
   @Entry
   @  R0 = mask (Bits)
   @  R1 = buffer (pointer to data)
   @  R2 = size (Int)
   @  R3 = section (Podule_Section)
   @Exit
   @  R2 = used (Int)

.set XPodule_SetSpeed,0x6028e
.set Podule_SetSpeed,0x4028e
   @Entry
   @  R0 = speed (Int)
   @  R3 = section (Podule_Section)
   @Exit
   @  R0 = old_speed (Int)

#  define Service_PreReset 0x45
   @Entry
   @  R1 = &45

#  define Service_ADFSPodule 0x10800
   @Entry
   @  R1 = &10800
   @  R2 = controller (pointer to data)
   @  R3 = status_location (pointer to Int)
   @  R4 = status_bits (Bits)
   @  R5 = irq_location (pointer to Int)
   @  R6 = irq_bits (Bits)
   @Exit
   @  R1 = unclaimed (Bool)
   @  R2 = controller_out (pointer to data)
   @  R3 = status_location_out (pointer to Int)
   @  R4 = status_bits_out (Bits)
   @  R5 = irq_location_out (pointer to Int)
   @  R6 = irq_bits_out (Bits)

#  define Service_ADFSPoduleIDE 0x10801
   @Entry
   @  R1 = &10801
   @  R2 = controller (pointer to data)
   @  R3 = status_location (pointer to Int)
   @  R4 = status_bits (Bits)
   @  R5 = irq_location (pointer to Int)
   @  R6 = irq_bits (Bits)
   @  R7 = read_code (pointer to code)
   @  R8 = write_code (pointer to code)
   @Exit
   @  R1 = unclaimed (Bool)
   @  R2 = controller_out (pointer to data)
   @  R3 = status_location_out (pointer to Int)
   @  R4 = status_bits_out (Bits)
   @  R5 = irq_location_out (pointer to Int)
   @  R6 = irq_bits_out (Bits)
   @  R7 = read_code_out (pointer to code)
   @  R8 = write_code_out (pointer to code)

#  define Service_ADFSPoduleIDEDying 0x10802
   @Entry
   @  R1 = &10802

#endif
