@ GNU AS assembler header file for OSArgs
@ Written by DefMod (Dec  9 2012) on Sun Dec  9 15:47:15 2012
@ Jonathan Coxhead, jonathan@doves.demon.co.uk, 29 June 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 OSArgs_Hdr
#  define OSArgs_Hdr

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

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

#  ifndef Get_FileSwitch
#    define Get_FileSwitch
#    include "oslib/FileSwitch.Hdr"
#  endif

@Symbols for constants
#  define OSArgs_StreamInteractive 0x8
#  define OSArgs_StreamSupportsGBPB 0x10
#  define OSArgs_StreamDir 0x20
#  define OSArgs_StreamReadable 0x40
#  define OSArgs_StreamWritable 0x80
#  define OSArgs_StreamWritten 0x100
#  define OSArgs_StreamEOFErrorOnNextRead 0x200
#  define OSArgs_StreamUnbuffered 0x400
#  define OSArgs_StreamUnallocated 0x800
#  define OSArgs_StreamCritical 0x1000
#  define OSArgs_StreamDataLost 0x2000
#  define OSArgs_StreamImageFileBusy 0x4000
#  define OSArgs_IOCtlReason 0xffff
#  define OSArgs_IOCtlReasonShift 0x0
#  define OSArgs_IOCtlGroup 0xff0000
#  define OSArgs_IOCtlGroupShift 0x10
#  define OSArgs_IOCtlReadValue 0x40000000
#  define OSArgs_IOCtlWriteValue 0x80000000
#  define OSArgs_IOCtlBaudRate 0x1
#  define OSArgs_IOCtlDataFormat 0x2
#  define OSArgs_IOCtlHandshaking 0x3
#  define OSArgs_IOCtlBufferSize 0x4
#  define OSArgs_IOCtlBufferThresholds 0x5
#  define OSArgs_IOCtlControlLines 0x6
#  define OSArgs_IOCtlFIFOTriggerLevel 0x7
#  define OSArgs_IOCtlSupportedBaudRateCount 0x8
#  define OSArgs_IOCtlSupportedBaudRate 0x9

@Symbols for structure offsets and sizes
        .struct 0
        .skip   Bits
OSArgs_StreamStatus            : 

        .struct 0
        .skip   Bits
OSArgs_IOCtlOperation          : 

        .struct 0
OSArgs_IOCtlParameters_operation: .skip   OSArgs_IOCtlOperation
OSArgs_IOCtlParameters_value   : .skip   Int
OSArgs_IOCtlParameters         : 


@Symbols for SWI's and SWI reason codes
.set XOS_Args,0x20009
.set OS_Args,0x9

#  define OSArgs_ReadPtr 0x0
   @Entry
   @  R0 = &0
   @  R1 = file (OS_F)
   @Exit
   @  R2 = ptr (Int)

#  define OSArgs_ReadPtrW 0x0
   @Entry
   @  R0 = &0
   @  R1 = file (OS_FW)
   @Exit
   @  R2 = ptr (Int)

#  define OSArgs_ReadTemporaryFS 0x0
   @Entry
   @  R0 = &0
   @  R1 = &0
   @Exit
   @  R0 = temp_fs_no (FileSwitch_FSNo)

#  define OSArgs_SetPtr 0x1
   @Entry
   @  R0 = &1
   @  R1 = file (OS_F)
   @  R2 = ptr (Int)

#  define OSArgs_SetPtrW 0x1
   @Entry
   @  R0 = &1
   @  R1 = file (OS_FW)
   @  R2 = ptr (Int)

#  define OSArgs_ReadExt 0x2
   @Entry
   @  R0 = &2
   @  R1 = file (OS_F)
   @Exit
   @  R2 = ext (Int)

#  define OSArgs_ReadExtW 0x2
   @Entry
   @  R0 = &2
   @  R1 = file (OS_FW)
   @Exit
   @  R2 = ext (Int)

#  define OSArgs_SetExt 0x3
   @Entry
   @  R0 = &3
   @  R1 = file (OS_F)
   @  R2 = ext (Int)

#  define OSArgs_SetExtW 0x3
   @Entry
   @  R0 = &3
   @  R1 = file (OS_FW)
   @  R2 = ext (Int)

#  define OSArgs_ReadAllocation 0x4
   @Entry
   @  R0 = &4
   @  R1 = file (OS_F)
   @Exit
   @  R2 = allocation (Int)

#  define OSArgs_ReadAllocationW 0x4
   @Entry
   @  R0 = &4
   @  R1 = file (OS_FW)
   @Exit
   @  R2 = allocation (Int)

#  define OSArgs_ReadEOFStatus 0x5
   @Entry
   @  R0 = &5
   @  R1 = file (OS_F)
   @Exit
   @  R2 = eof_status (Bool)

#  define OSArgs_ReadEOFStatusW 0x5
   @Entry
   @  R0 = &5
   @  R1 = file (OS_FW)
   @Exit
   @  R2 = eof_status (Bool)

#  define OSArgs_SetAllocation 0x6
   @Entry
   @  R0 = &6
   @  R1 = file (OS_F)
   @  R2 = allocation (Int)
   @Exit
   @  R2 = allocation_out (Int)

#  define OSArgs_SetAllocationW 0x6
   @Entry
   @  R0 = &6
   @  R1 = file (OS_FW)
   @  R2 = allocation (Int)
   @Exit
   @  R2 = allocation_out (Int)

#  define OSArgs_ReadPath 0x7
   @Entry
   @  R0 = &7
   @  R1 = file (OS_F)
   @  R2 = buffer (pointer to String)
   @  R5 = size (Int)
   @Exit
   @  R5 = spare (Int)

#  define OSArgs_ReadPathW 0x7
   @Entry
   @  R0 = &7
   @  R1 = file (OS_FW)
   @  R2 = buffer (pointer to String)
   @  R5 = size (Int)
   @Exit
   @  R5 = spare (Int)

#  define OSArgs_ImageStamped 0x8
   @Entry
   @  R0 = &8
   @  R1 = file (OS_F)
   @  R2 = image_stamp (Int)

#  define OSArgs_ImageStampedW 0x8
   @Entry
   @  R0 = &8
   @  R1 = file (OS_FW)
   @  R2 = image_stamp (Int)

#  define OSArgs_IOCtl 0x0
   @Entry
   @  R0 = &0
   @  R1 = file (OS_F)
   @  R2 = parameters (pointer to OSArgs_IOCtlParameters)

#  define OSArgs_ReadInfo 0xfe
   @Entry
   @  R0 = &FE
   @  R1 = file (OS_F)
   @Exit
   @  R0 = stream_status (OSArgs_StreamStatus)
   @  R2 = fs_info (FileSwitch_FSInfo)

#  define OSArgs_ReadInfoW 0xfe
   @Entry
   @  R0 = &FE
   @  R1 = file (OS_FW)
   @Exit
   @  R0 = stream_status (OSArgs_StreamStatus)
   @  R2 = fs_info (FileSwitch_FSInfo)

#  define OSArgs_Ensure 0xff
   @Entry
   @  R0 = &FF
   @  R1 = file (OS_F)

#  define OSArgs_EnsureW 0xff
   @Entry
   @  R0 = &FF
   @  R1 = file (OS_FW)

#  define ArgsV 0x9

#endif
