@ GNU AS assembler header file for OSReadSysInfo
@ Written by DefMod (Dec  9 2012) on Sun Dec  9 15:50:01 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.

#ifndef OSReadSysInfo_Hdr
#  define OSReadSysInfo_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 OSReadSysInfo_SpecialFunction 0xff
#  define OSReadSysInfo_SpecialFunctionShift 0x0
#  define OSReadSysInfo_SpecialFunctionNone 0x0
#  define OSReadSysInfo_SpecialFunctionIOEB 0x1
#  define OSReadSysInfo_IOControl 0xff00
#  define OSReadSysInfo_IOControlShift 0x8
#  define OSReadSysInfo_IOControlIOC 0x0
#  define OSReadSysInfo_IOControlIOMD 0x1
#  define OSReadSysInfo_IOControlUndefined 0xff
#  define OSReadSysInfo_MemoryControl 0xff0000
#  define OSReadSysInfo_MemoryControlShift 0x10
#  define OSReadSysInfo_MemoryControlMEMC1 0x0
#  define OSReadSysInfo_MemoryControlIOMD 0x1
#  define OSReadSysInfo_MemoryControlUndefined 0xff
#  define OSReadSysInfo_VideoControl 0xff000000
#  define OSReadSysInfo_VideoControlShift 0x18
#  define OSReadSysInfo_VideoControlVIDC1a 0x0
#  define OSReadSysInfo_VideoControlVIDC20 0x1
#  define OSReadSysInfo_VideoControlUndefined 0xff
#  define OSReadSysInfo_IO 0xff
#  define OSReadSysInfo_IOShift 0x0
#  define OSReadSysInfo_IONone 0x0
#  define OSReadSysInfo_IO82C710 0x1
#  define OSReadSysInfo_LCDControl 0xff
#  define OSReadSysInfo_LCDControlShift 0x0
#  define OSReadSysInfo_LCDControlNone 0x0
#  define OSReadSysInfo_LCDControlType1 0x1
#  define OSReadSysInfo_LCDControlType2 0x2
#  define OSReadSysInfo_IOMDType 0xff00
#  define OSReadSysInfo_IOMDTypeShift 0x8
#  define OSReadSysInfo_IOMDTypeIOMD 0x0
#  define OSReadSysInfo_IOMDTypeIOMDL 0x1
#  define OSReadSysInfo_IOMDTypeNone 0xff
#  define OSReadSysInfo_IIC2HighSpeed 0x1000000
#  define OSReadSysInfo_IOClockStateAtIdle 0x2000000
#  define OSReadSysInfo_PlatformUnknown 0x0
#  define OSReadSysInfo_PlatformRiscPC 0x1
#  define OSReadSysInfo_PlatformA7000 0x2
#  define OSReadSysInfo_PlatformA7000Plus 0x3
#  define OSReadSysInfo_PlatformPhoebe 0x4
#  define OSReadSysInfo_PlatformHAL 0x5
#  define OSReadSysInfo_PlatformVirtualRPC 0x6
#  define OSReadSysInfo_PlatformA9 0x7
#  define OSReadSysInfo_PlatformSupportsPodules 0x1
#  define OSReadSysInfo_PlatformSupportsPCI 0x2
#  define OSReadSysInfo_PlatformSupportsMultiCPU 0x4
#  define OSReadSysInfo_PlatformHasSoftPowerControl 0x8
#  define OSReadSysInfo_PlatformRunsOSFromRAM 0x10
#  define OSReadSysInfoKernelValueID_OSPageTable 0x0
#  define OSReadSysInfoKernelValueID_HigestOSPageTablePtr 0x1
#  define OSReadSysInfoKernelValueID_UnavailablePagesPPL 0x2
#  define OSReadSysInfoKernelValueID_PhysMemTable 0x3
#  define OSReadSysInfoKernelValueID_CacheCleanerFlipFlop 0x4
#  define OSReadSysInfoKernelValueID_InternalTickerChain 0x5
#  define OSReadSysInfoKernelValueID_ROMModueChain 0x6
#  define OSReadSysInfoKernelValueID_DAList 0x7
#  define OSReadSysInfoKernelValueID_DASpaceNode 0x8
#  define OSReadSysInfoKernelValueID_ModuleChain 0x9
#  define OSReadSysInfoKernelValueID_SWIHashTableEntries 0xa
#  define OSReadSysInfoKernelValueID_SWIHashTable 0xb
#  define OSReadSysInfoKernelValueID_IOSystemTypeFlags 0xc
#  define OSReadSysInfoKernelValueID_L1PageTable 0xd
#  define OSReadSysInfoKernelValueID_L2PageTable 0xe
#  define OSReadSysInfoKernelValueID_TopUNDModeStack 0xf
#  define OSReadSysInfoKernelValueID_TopSVCModeStack 0x10
#  define OSReadSysInfoKernelValueID_StartSystemHeap 0x11
#  define OSReadSysInfoKernelValueID_KernelMsgTransBlock 0x12
#  define OSReadSysInfoKernelValueID_ErrorSemaphore 0x13
#  define OSReadSysInfoKernelValueID_PrettyPrintDict 0x14
#  define OSReadSysInfoKernelValueID_Timer0LatchValue 0x15
#  define OSReadSysInfoKernelValueID_FastTickerVSpeed 0x16
#  define OSReadSysInfoKernelValueID_VectorClaimantsTable 0x17
#  define OSReadSysInfoKernelValueID_NumVectors 0x18
#  define OSReadSysInfoKernelValueID_TopIRQModeStack 0x19
#  define OSReadSysInfoKernelValueID_SWIDispatchTable 0x1a
#  define OSReadSysInfoKernelValueID_BranchAfterSWI 0x1b
#  define OSReadSysInfo_OSName 0x0
#  define OSReadSysInfo_PartNumber 0x1
#  define OSReadSysInfo_BuildTime 0x2
#  define OSReadSysInfo_DealerName 0x3
#  define OSReadSysInfo_UserName 0x4
#  define OSReadSysInfo_UserAddress 0x5
#  define OSReadSysInfo_OSDescription 0x6

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

        .struct 0
        .skip   Bits
OSReadSysInfo_Flags1           : 

        .struct 0
        .skip   Bits
OSReadSysInfo_Flags2           : 

        .struct 0
        .skip   Int
OSReadSysInfo_Platform         : 

        .struct 0
        .skip   Bits
OSReadSysInfo_PlatformFlags    : 

        .struct 0
        .skip   Bits
OSReadSysInfo_KernelValueID    : 

        .struct 0
        .skip   Int
OSReadSysInfo_ROMInformationCode: 


@Symbols for SWI's and SWI reason codes
.set XOS_ReadSysInfo,0x20058
.set OS_ReadSysInfo,0x58

#  define OSReadSysInfo_ScreenSize 0x0
   @Entry
   @  R0 = &0
   @Exit
   @  R0 = screen_size (Int)

#  define OSReadSysInfo_Mode 0x1
   @Entry
   @  R0 = &1
   @Exit
   @  R0 = mode (OS_Mode)
   @  R1 = monitor_type (Int)
   @  R2 = sync (Int)

#  define OSReadSysInfo_MachineId 0x2
   @Entry
   @  R0 = &2
   @Exit
   @  R0 = config0 (OSReadSysInfo_Flags0)
   @  R1 = config1 (OSReadSysInfo_Flags1)
   @  R2 = config2 (OSReadSysInfo_Flags2)
   @  R3 = id_lo (Bits)
   @  R4 = id_hi (Bits)

#  define OSReadSysInfo_71XFeatures 0x3
   @Entry
   @  R0 = &3
   @Exit
   @  R0 = features (Bits)
   @  R1 = features_extended0 (Bits)
   @  R2 = features_extended1 (Bits)
   @  R3 = features_extended2 (Bits)
   @  R4 = features_extended3 (Bits)

#  define OSReadSysInfo_EthernetAddress 0x4
   @Entry
   @  R0 = &4
   @Exit
   @  R0 = address_lo (Bits)
   @  R1 = address_hi (Bits)

#  define OSReadSysInfo_RawMachineId 0x5
   @Entry
   @  R0 = &5
   @Exit
   @  R0 = id_lo (Bits)
   @  R1 = id_hi (Bits)

#  define OSReadSysInfo_KernelValue 0x6
   @Entry
   @  R0 = &6
   @  R1 = &0
   @  R2 = item (OSReadSysInfo_KernelValueID)
   @Exit
   @  R2 = value (Int)

#  define OSReadSysInfo_KernelValues 0x6
   @Entry
   @  R0 = &6
   @  R1 -> item_list (Int)
   @  R2 = value_buffer (pointer to OSReadSysInfo_KernelValueID)

#  define OSReadSysInfoKernelValue_SVCSTK 0x10
   @Entry
   @  R0 = &6
   @  R1 = &0
   @  R2 = &10
   @Exit
   @  R2 = stack_top (pointer to data)

#  define OSReadSysInfoKernelValue_SWIDispatchTable 0x1a
   @Entry
   @  R0 = &6
   @  R1 = &0
   @  R2 = &1A
   @Exit
   @  R2 = dispatch_table (pointer to data)

#  define OSReadSysInfo_LastAbortInfo 0x7
   @Entry
   @  R0 = &7
   @Exit
   @  R1 = abort_pc (pointer to data)
   @  R2 = abort_psr (pointer to data)
   @  R3 = fault_address (pointer to data)

#  define OSReadSysInfo_PlatformClass 0x8
   @Entry
   @  R0 = &8
   @Exit
   @  R0 = platform_class (OSReadSysInfo_Platform)
   @  R1 = flags (OSReadSysInfo_PlatformFlags)
   @  R2 = valid_flags (OSReadSysInfo_PlatformFlags)

#  define OSReadSysInfo_ROMInformation 0x9
   @Entry
   @  R0 = &9
   @  R1 = code (OSReadSysInfo_ROMInformationCode)
   @Exit
   @  R0 -> information (String)

#  define OSReadSysInfo_ReadOSVersion 0xa
   @Entry
   @  R0 = &A
   @Exit
   @  R0 = os_version (Int)
   @  R1 = kernel_version (Int)
   @  R2 = sysinit_version_and_type (Int)
   @  R3 corrupted

#  define OSReadSysInfo_ReadDebugInfo 0xb
   @Entry
   @  R0 = &B
   @Exit
   @  R0 = write_dbg (pointer to code)
   @  R1 = read_dbg (pointer to code)

#endif
