@ GNU AS assembler header file for HAL
@ Written by DefMod (Dec  9 2012) on Sun Dec  9 15:45:17 2012
@ Tom Hughes, tom@compton.nu, 23 Nov 2002

@ 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 HAL_Hdr
#  define HAL_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 structure offsets and sizes
        .struct 0
        .skip   Int
HAL_Device                     : 

        .struct 0
        .skip   Int
HAL_Timer                      : 


@Symbols for SWI's and SWI reason codes
#  define HAL_IRQEnable 0x1
   @Entry
   @  R0 = device (HAL_Device)
   @  R8 = &0
   @  R9 = &1
   @Exit
   @  R0 = was_enabled (Bool)
   @  R1 corrupted
   @  R2 corrupted
   @  R3 corrupted

#  define HAL_IRQDisable 0x2
   @Entry
   @  R0 = device (HAL_Device)
   @  R8 = &0
   @  R9 = &2
   @Exit
   @  R0 = was_enabled (Bool)
   @  R1 corrupted
   @  R2 corrupted
   @  R3 corrupted

#  define HAL_IRQClear 0x3
   @Entry
   @  R0 = device (HAL_Device)
   @  R8 = &0
   @  R9 = &3
   @Exit
   @  R0 corrupted
   @  R1 corrupted
   @  R2 corrupted
   @  R3 corrupted

#  define HAL_IRQSource 0x4
   @Entry
   @  R8 = &0
   @  R9 = &4
   @Exit
   @  R0 = device (HAL_Device)
   @  R1 corrupted
   @  R2 corrupted
   @  R3 corrupted

#  define HAL_IRQStatus 0x5
   @Entry
   @  R0 = device (HAL_Device)
   @  R8 = &0
   @  R9 = &5
   @Exit
   @  R0 = requested (Bool)
   @  R1 corrupted
   @  R2 corrupted
   @  R3 corrupted

#  define HAL_FIQEnable 0x6
   @Entry
   @  R0 = device (HAL_Device)
   @  R8 = &0
   @  R9 = &6
   @Exit
   @  R0 = was_enabled (Bool)
   @  R1 corrupted
   @  R2 corrupted
   @  R3 corrupted

#  define HAL_FIQDisable 0x7
   @Entry
   @  R0 = device (HAL_Device)
   @  R8 = &0
   @  R9 = &7
   @Exit
   @  R0 = was_enabled (Bool)
   @  R1 corrupted
   @  R2 corrupted
   @  R3 corrupted

#  define HAL_FIQDisableAll 0x8
   @Entry
   @  R0 = device (HAL_Device)
   @  R8 = &0
   @  R9 = &8
   @Exit
   @  R0 corrupted
   @  R1 corrupted
   @  R2 corrupted
   @  R3 corrupted

#  define HAL_FIQClear 0x9
   @Entry
   @  R0 = device (HAL_Device)
   @  R8 = &0
   @  R9 = &9
   @Exit
   @  R0 corrupted
   @  R1 corrupted
   @  R2 corrupted
   @  R3 corrupted

#  define HAL_FIQSource 0xa
   @Entry
   @  R8 = &0
   @  R9 = &A
   @Exit
   @  R0 = device (HAL_Device)
   @  R1 corrupted
   @  R2 corrupted
   @  R3 corrupted

#  define HAL_FIQStatus 0xb
   @Entry
   @  R0 = device (HAL_Device)
   @  R8 = &0
   @  R9 = &B
   @Exit
   @  R0 = requested (Bool)
   @  R1 corrupted
   @  R2 corrupted
   @  R3 corrupted

#  define HAL_Timers 0xc
   @Entry
   @  R8 = &0
   @  R9 = &C
   @Exit
   @  R0 = timers (Int)
   @  R1 corrupted
   @  R2 corrupted
   @  R3 corrupted

#  define HAL_TimerDevice 0xd
   @Entry
   @  R0 = timer (HAL_Timer)
   @  R8 = &0
   @  R9 = &D
   @Exit
   @  R0 = device (HAL_Device)
   @  R1 corrupted
   @  R2 corrupted
   @  R3 corrupted

#  define HAL_TimerGranularity 0xe
   @Entry
   @  R0 = timer (HAL_Timer)
   @  R8 = &0
   @  R9 = &E
   @Exit
   @  R0 = granularity (Int)
   @  R1 corrupted
   @  R2 corrupted
   @  R3 corrupted

#  define HAL_TimerMaxPeriod 0xf
   @Entry
   @  R0 = timer (HAL_Timer)
   @  R8 = &0
   @  R9 = &F
   @Exit
   @  R0 = max_period (Int)
   @  R1 corrupted
   @  R2 corrupted
   @  R3 corrupted

#  define HAL_TimerSetPeriod 0x10
   @Entry
   @  R0 = timer (HAL_Timer)
   @  R1 = period (Int)
   @  R8 = &0
   @  R9 = &10
   @Exit
   @  R0 corrupted
   @  R1 corrupted
   @  R2 corrupted
   @  R3 corrupted

#  define HAL_TimerPeriod 0x11
   @Entry
   @  R0 = timer (HAL_Timer)
   @  R8 = &0
   @  R9 = &11
   @Exit
   @  R0 = period (Int)
   @  R1 corrupted
   @  R2 corrupted
   @  R3 corrupted

#  define HAL_TimerReadCountdown 0x12
   @Entry
   @  R0 = timer (HAL_Timer)
   @  R8 = &0
   @  R9 = &12
   @Exit
   @  R0 = time_remaining (Int)
   @  R1 corrupted
   @  R2 corrupted
   @  R3 corrupted

#  define HAL_CounterRate 0x13
   @Entry
   @  R8 = &0
   @  R9 = &13
   @Exit
   @  R0 = rate (Int)
   @  R1 corrupted
   @  R2 corrupted
   @  R3 corrupted

#  define HAL_CounterPeriod 0x14
   @Entry
   @  R8 = &0
   @  R9 = &14
   @Exit
   @  R0 = period (Int)
   @  R1 corrupted
   @  R2 corrupted
   @  R3 corrupted

#  define HAL_CounterRead 0x15
   @Entry
   @  R8 = &0
   @  R9 = &15
   @Exit
   @  R0 = period (Int)
   @  R1 corrupted
   @  R2 corrupted
   @  R3 corrupted

#  define HAL_CounterDelay 0x16
   @Entry
   @  R0 = delay (Int)
   @  R8 = &0
   @  R9 = &16
   @Exit
   @  R0 corrupted
   @  R1 corrupted
   @  R2 corrupted
   @  R3 corrupted

#endif
