; Assembler header file for OSReadSysInfo
; Written by DefMod (Dec  9 2012) on Sun Dec  9 15:43:51 2012
; Jonathan Coxhead, jonathan@doves.demon.co.uk, 18 May 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.

        [       :LNOT: :DEF: OSReadSysInfo_Hdr
        GBLS    OSReadSysInfo_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 constants
OSReadSysInfo_SpecialFunction   *       &FF
OSReadSysInfo_SpecialFunctionShift *       0
OSReadSysInfo_SpecialFunctionNone *       &0
OSReadSysInfo_SpecialFunctionIOEB *       &1
OSReadSysInfo_IOControl         *       &FF00
OSReadSysInfo_IOControlShift    *       8
OSReadSysInfo_IOControlIOC      *       &0
OSReadSysInfo_IOControlIOMD     *       &1
OSReadSysInfo_IOControlUndefined *       &FF
OSReadSysInfo_MemoryControl     *       &FF0000
OSReadSysInfo_MemoryControlShift *       16
OSReadSysInfo_MemoryControlMEMC1 *       &0
OSReadSysInfo_MemoryControlIOMD *       &1
OSReadSysInfo_MemoryControlUndefined *       &FF
OSReadSysInfo_VideoControl      *       &FF000000
OSReadSysInfo_VideoControlShift *       24
OSReadSysInfo_VideoControlVIDC1a *       &0
OSReadSysInfo_VideoControlVIDC20 *       &1
OSReadSysInfo_VideoControlUndefined *       &FF
OSReadSysInfo_IO                *       &FF
OSReadSysInfo_IOShift           *       0
OSReadSysInfo_IONone            *       &0
OSReadSysInfo_IO82C710          *       &1
OSReadSysInfo_LCDControl        *       &FF
OSReadSysInfo_LCDControlShift   *       0
OSReadSysInfo_LCDControlNone    *       &0
OSReadSysInfo_LCDControlType1   *       &1
OSReadSysInfo_LCDControlType2   *       &2
OSReadSysInfo_IOMDType          *       &FF00
OSReadSysInfo_IOMDTypeShift     *       8
OSReadSysInfo_IOMDTypeIOMD      *       &0
OSReadSysInfo_IOMDTypeIOMDL     *       &1
OSReadSysInfo_IOMDTypeNone      *       &FF
OSReadSysInfo_IIC2HighSpeed     *       &1000000
OSReadSysInfo_IOClockStateAtIdle *       &2000000
OSReadSysInfo_PlatformUnknown   *       &0
OSReadSysInfo_PlatformRiscPC    *       &1
OSReadSysInfo_PlatformA7000     *       &2
OSReadSysInfo_PlatformA7000Plus *       &3
OSReadSysInfo_PlatformPhoebe    *       &4
OSReadSysInfo_PlatformHAL       *       &5
OSReadSysInfo_PlatformVirtualRPC *       &6
OSReadSysInfo_PlatformA9        *       &7
OSReadSysInfo_PlatformSupportsPodules *       &1
OSReadSysInfo_PlatformSupportsPCI *       &2
OSReadSysInfo_PlatformSupportsMultiCPU *       &4
OSReadSysInfo_PlatformHasSoftPowerControl *       &8
OSReadSysInfo_PlatformRunsOSFromRAM *       &10
OSReadSysInfoKernelValueID_OSPageTable *       &0
OSReadSysInfoKernelValueID_HigestOSPageTablePtr *       &1
OSReadSysInfoKernelValueID_UnavailablePagesPPL *       &2
OSReadSysInfoKernelValueID_PhysMemTable *       &3
OSReadSysInfoKernelValueID_CacheCleanerFlipFlop *       &4
OSReadSysInfoKernelValueID_InternalTickerChain *       &5
OSReadSysInfoKernelValueID_ROMModueChain *       &6
OSReadSysInfoKernelValueID_DAList *       &7
OSReadSysInfoKernelValueID_DASpaceNode *       &8
OSReadSysInfoKernelValueID_ModuleChain *       &9
OSReadSysInfoKernelValueID_SWIHashTableEntries *       &A
OSReadSysInfoKernelValueID_SWIHashTable *       &B
OSReadSysInfoKernelValueID_IOSystemTypeFlags *       &C
OSReadSysInfoKernelValueID_L1PageTable *       &D
OSReadSysInfoKernelValueID_L2PageTable *       &E
OSReadSysInfoKernelValueID_TopUNDModeStack *       &F
OSReadSysInfoKernelValueID_TopSVCModeStack *       &10
OSReadSysInfoKernelValueID_StartSystemHeap *       &11
OSReadSysInfoKernelValueID_KernelMsgTransBlock *       &12
OSReadSysInfoKernelValueID_ErrorSemaphore *       &13
OSReadSysInfoKernelValueID_PrettyPrintDict *       &14
OSReadSysInfoKernelValueID_Timer0LatchValue *       &15
OSReadSysInfoKernelValueID_FastTickerVSpeed *       &16
OSReadSysInfoKernelValueID_VectorClaimantsTable *       &17
OSReadSysInfoKernelValueID_NumVectors *       &18
OSReadSysInfoKernelValueID_TopIRQModeStack *       &19
OSReadSysInfoKernelValueID_SWIDispatchTable *       &1A
OSReadSysInfoKernelValueID_BranchAfterSWI *       &1B
OSReadSysInfo_OSName            *       &0
OSReadSysInfo_PartNumber        *       &1
OSReadSysInfo_BuildTime         *       &2
OSReadSysInfo_DealerName        *       &3
OSReadSysInfo_UserName          *       &4
OSReadSysInfo_UserAddress       *       &5
OSReadSysInfo_OSDescription     *       &6

;Symbols for structure offsets and sizes
        ^       0
        #       Bits
OSReadSysInfo_Flags0            *       @

        ^       0
        #       Bits
OSReadSysInfo_Flags1            *       @

        ^       0
        #       Bits
OSReadSysInfo_Flags2            *       @

        ^       0
        #       Int
OSReadSysInfo_Platform          *       @

        ^       0
        #       Bits
OSReadSysInfo_PlatformFlags     *       @

        ^       0
        #       Bits
OSReadSysInfo_KernelValueID     *       @

        ^       0
        #       Int
OSReadSysInfo_ROMInformationCode *       @


;Symbols for SWI's and SWI reason codes
XOS_ReadSysInfo                 *       &20058
OS_ReadSysInfo                  *       &58

OSReadSysInfo_ScreenSize        *       &0
   ;Entry
   ;  R0 = &0
   ;Exit
   ;  R0 = screen_size (Int)

OSReadSysInfo_Mode              *       &1
   ;Entry
   ;  R0 = &1
   ;Exit
   ;  R0 = mode (OS_Mode)
   ;  R1 = monitor_type (Int)
   ;  R2 = sync (Int)

OSReadSysInfo_MachineId         *       &2
   ;Entry
   ;  R0 = &2
   ;Exit
   ;  R0 = config0 (OSReadSysInfo_Flags0)
   ;  R1 = config1 (OSReadSysInfo_Flags1)
   ;  R2 = config2 (OSReadSysInfo_Flags2)
   ;  R3 = id_lo (Bits)
   ;  R4 = id_hi (Bits)

OSReadSysInfo_71XFeatures       *       &3
   ;Entry
   ;  R0 = &3
   ;Exit
   ;  R0 = features (Bits)
   ;  R1 = features_extended0 (Bits)
   ;  R2 = features_extended1 (Bits)
   ;  R3 = features_extended2 (Bits)
   ;  R4 = features_extended3 (Bits)

OSReadSysInfo_EthernetAddress   *       &4
   ;Entry
   ;  R0 = &4
   ;Exit
   ;  R0 = address_lo (Bits)
   ;  R1 = address_hi (Bits)

OSReadSysInfo_RawMachineId      *       &5
   ;Entry
   ;  R0 = &5
   ;Exit
   ;  R0 = id_lo (Bits)
   ;  R1 = id_hi (Bits)

OSReadSysInfo_KernelValue       *       &6
   ;Entry
   ;  R0 = &6
   ;  R1 = &0
   ;  R2 = item (OSReadSysInfo_KernelValueID)
   ;Exit
   ;  R2 = value (Int)

OSReadSysInfo_KernelValues      *       &6
   ;Entry
   ;  R0 = &6
   ;  R1 -> item_list (Int)
   ;  R2 = value_buffer (pointer to OSReadSysInfo_KernelValueID)

OSReadSysInfoKernelValue_SVCSTK *       &10
   ;Entry
   ;  R0 = &6
   ;  R1 = &0
   ;  R2 = &10
   ;Exit
   ;  R2 = stack_top (pointer to data)

OSReadSysInfoKernelValue_SWIDispatchTable *       &1A
   ;Entry
   ;  R0 = &6
   ;  R1 = &0
   ;  R2 = &1A
   ;Exit
   ;  R2 = dispatch_table (pointer to data)

OSReadSysInfo_LastAbortInfo     *       &7
   ;Entry
   ;  R0 = &7
   ;Exit
   ;  R1 = abort_pc (pointer to data)
   ;  R2 = abort_psr (pointer to data)
   ;  R3 = fault_address (pointer to data)

OSReadSysInfo_PlatformClass     *       &8
   ;Entry
   ;  R0 = &8
   ;Exit
   ;  R0 = platform_class (OSReadSysInfo_Platform)
   ;  R1 = flags (OSReadSysInfo_PlatformFlags)
   ;  R2 = valid_flags (OSReadSysInfo_PlatformFlags)

OSReadSysInfo_ROMInformation    *       &9
   ;Entry
   ;  R0 = &9
   ;  R1 = code (OSReadSysInfo_ROMInformationCode)
   ;Exit
   ;  R0 -> information (String)

OSReadSysInfo_ReadOSVersion     *       &A
   ;Entry
   ;  R0 = &A
   ;Exit
   ;  R0 = os_version (Int)
   ;  R1 = kernel_version (Int)
   ;  R2 = sysinit_version_and_type (Int)
   ;  R3 corrupted

OSReadSysInfo_ReadDebugInfo     *       &B
   ;Entry
   ;  R0 = &B
   ;Exit
   ;  R0 = write_dbg (pointer to code)
   ;  R1 = read_dbg (pointer to code)

        ]
        END
