; Assembler header file for HAL
; Written by DefMod (Dec  9 2012) on Sun Dec  9 15:43:51 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.

        [       :LNOT: :DEF: HAL_Hdr
        GBLS    HAL_Hdr

        [       :LNOT: :DEF: Get_Types
        GBLS    Get_Types
        ]
        [       :LNOT: :DEF: Types_Hdr
Get_Types                       SETS    "GET oslib/Types.Hdr"
        |
Get_Types                       SETS    ""
        ]
        $Get_Types

        [       :LNOT: :DEF: Get_OS
        GBLS    Get_OS
        ]
        [       :LNOT: :DEF: OS_Hdr
Get_OS                          SETS    "GET oslib/OS.Hdr"
        |
Get_OS                          SETS    ""
        ]
        $Get_OS

;Symbols for structure offsets and sizes
        ^       0
        #       Int
HAL_Device                      *       @

        ^       0
        #       Int
HAL_Timer                       *       @


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

HAL_IRQDisable                  *       &2
   ;Entry
   ;  R0 = device (HAL_Device)
   ;  R8 = &0
   ;  R9 = &2
   ;Exit
   ;  R0 = was_enabled (Bool)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_IRQClear                    *       &3
   ;Entry
   ;  R0 = device (HAL_Device)
   ;  R8 = &0
   ;  R9 = &3
   ;Exit
   ;  R0 corrupted
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_IRQSource                   *       &4
   ;Entry
   ;  R8 = &0
   ;  R9 = &4
   ;Exit
   ;  R0 = device (HAL_Device)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_IRQStatus                   *       &5
   ;Entry
   ;  R0 = device (HAL_Device)
   ;  R8 = &0
   ;  R9 = &5
   ;Exit
   ;  R0 = requested (Bool)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_FIQEnable                   *       &6
   ;Entry
   ;  R0 = device (HAL_Device)
   ;  R8 = &0
   ;  R9 = &6
   ;Exit
   ;  R0 = was_enabled (Bool)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_FIQDisable                  *       &7
   ;Entry
   ;  R0 = device (HAL_Device)
   ;  R8 = &0
   ;  R9 = &7
   ;Exit
   ;  R0 = was_enabled (Bool)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_FIQDisableAll               *       &8
   ;Entry
   ;  R0 = device (HAL_Device)
   ;  R8 = &0
   ;  R9 = &8
   ;Exit
   ;  R0 corrupted
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_FIQClear                    *       &9
   ;Entry
   ;  R0 = device (HAL_Device)
   ;  R8 = &0
   ;  R9 = &9
   ;Exit
   ;  R0 corrupted
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_FIQSource                   *       &A
   ;Entry
   ;  R8 = &0
   ;  R9 = &A
   ;Exit
   ;  R0 = device (HAL_Device)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_FIQStatus                   *       &B
   ;Entry
   ;  R0 = device (HAL_Device)
   ;  R8 = &0
   ;  R9 = &B
   ;Exit
   ;  R0 = requested (Bool)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_Timers                      *       &C
   ;Entry
   ;  R8 = &0
   ;  R9 = &C
   ;Exit
   ;  R0 = timers (Int)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_TimerDevice                 *       &D
   ;Entry
   ;  R0 = timer (HAL_Timer)
   ;  R8 = &0
   ;  R9 = &D
   ;Exit
   ;  R0 = device (HAL_Device)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_TimerGranularity            *       &E
   ;Entry
   ;  R0 = timer (HAL_Timer)
   ;  R8 = &0
   ;  R9 = &E
   ;Exit
   ;  R0 = granularity (Int)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_TimerMaxPeriod              *       &F
   ;Entry
   ;  R0 = timer (HAL_Timer)
   ;  R8 = &0
   ;  R9 = &F
   ;Exit
   ;  R0 = max_period (Int)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_TimerSetPeriod              *       &10
   ;Entry
   ;  R0 = timer (HAL_Timer)
   ;  R1 = period (Int)
   ;  R8 = &0
   ;  R9 = &10
   ;Exit
   ;  R0 corrupted
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_TimerPeriod                 *       &11
   ;Entry
   ;  R0 = timer (HAL_Timer)
   ;  R8 = &0
   ;  R9 = &11
   ;Exit
   ;  R0 = period (Int)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_TimerReadCountdown          *       &12
   ;Entry
   ;  R0 = timer (HAL_Timer)
   ;  R8 = &0
   ;  R9 = &12
   ;Exit
   ;  R0 = time_remaining (Int)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_CounterRate                 *       &13
   ;Entry
   ;  R8 = &0
   ;  R9 = &13
   ;Exit
   ;  R0 = rate (Int)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_CounterPeriod               *       &14
   ;Entry
   ;  R8 = &0
   ;  R9 = &14
   ;Exit
   ;  R0 = period (Int)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_CounterRead                 *       &15
   ;Entry
   ;  R8 = &0
   ;  R9 = &15
   ;Exit
   ;  R0 = period (Int)
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

HAL_CounterDelay                *       &16
   ;Entry
   ;  R0 = delay (Int)
   ;  R8 = &0
   ;  R9 = &16
   ;Exit
   ;  R0 corrupted
   ;  R1 corrupted
   ;  R2 corrupted
   ;  R3 corrupted

        ]
        END
