From: <th...@us...> - 2002-11-23 12:46:31
|
Update of /cvsroot/ro-oslib/OSLib/!OsLib/Source/Core/oslib In directory sc8-pr-cvs1:/tmp/cvs-serv24194/Source/Core/oslib Modified Files: OS.swi Added Files: HAL.swi Log Message: Added the RISC O S 5 HAL interface based on details at www.iyonix.com/32bit. --- NEW FILE: HAL.swi --- TITLE HAL; AUTHOR "Tom Hughes, to...@co..., 23 Nov 2002"; NEEDS OS; TYPE HAL_Device = .Int, HAL_Timer = .Int; SWI HAL_IRQEnable = ( NUMBER 0x7A, ENTRY ( R0 = HAL_Device: device, R8 # 0, R9 # 1 "Unmasks the specified IRQ source - RISC O S 5+" ), EXIT ( R0! = .Bool: was_enabled ) ), HAL_IRQDisable = ( NUMBER 0x7A, ENTRY ( R0 = HAL_Device: device, R8 # 0, R9 # 2 "Masks the specified IRQ source - RISC O S 5+" ), EXIT ( R0! = .Bool: was_enabled ) ), HAL_IRQClear = ( NUMBER 0x7A, ENTRY ( R0 = HAL_Device: device, R8 # 0, R9 # 3 "Clears the specified IRQ source - RISC O S 5+" ) ), HAL_IRQSource = ( NUMBER 0x7A, ENTRY ( R8 # 0, R9 # 4 "Returns the number of the highest priority asserted IRQ - RISC O S 5+" ), EXIT ( R0! = HAL_Device: device ) ), HAL_IRQStatus = ( NUMBER 0x7A, ENTRY ( R0 = HAL_Device: device, R8 # 0, R9 # 5 "Returns non-zero if the specified device is requesting an IRQ - RISC O S 5+" ), EXIT ( R0! = .Bool: requested ) ), HAL_FIQEnable = ( NUMBER 0x7A, ENTRY ( R0 = HAL_Device: device, R8 # 0, R9 # 6 "Unmasks the specified FIQ source - RISC O S 5+" ), EXIT ( R0! = .Bool: was_enabled ) ), HAL_FIQDisable = ( NUMBER 0x7A, ENTRY ( R0 = HAL_Device: device, R8 # 0, R9 # 7 "Masks the specified FIQ source - RISC O S 5+" ), EXIT ( R0! = .Bool: was_enabled ) ), HAL_FIQDisableAll = ( NUMBER 0x7A, ENTRY ( R0 = HAL_Device: device, R8 # 0, R9 # 8 "Masks all FIQ sources - RISC O S 5+" ) ), HAL_FIQClear = ( NUMBER 0x7A, ENTRY ( R0 = HAL_Device: device, R8 # 0, R9 # 9 "Clears the specified FIQ source - RISC O S 5+" ) ), HAL_FIQSource = ( NUMBER 0x7A, ENTRY ( R8 # 0, R9 # 10 "Returns the number of the highest priority asserted FIQ - RISC O S 5+" ), EXIT ( R0! = HAL_Device: device ) ), HAL_FIQStatus = ( NUMBER 0x7A, ENTRY ( R0 = HAL_Device: device, R8 # 0, R9 # 11 "Returns non-zero if the specified device is requesting an FIQ - RISC O S 5+" ), EXIT ( R0! = .Bool: requested ) ); SWI HAL_Timers = ( NUMBER 0x7A, ENTRY ( R8 # 0, R9 # 12 "Returns number of timers - RISC O S 5+" ), EXIT ( R0! = .Int: timers ) ), HAL_TimerDevice = ( NUMBER 0x7A, ENTRY ( R0 = HAL_Timer: timer, R8 # 0, R9 # 13 "Returns IRQ device number of the specified timer - RISC O S 5+" ), EXIT ( R0! = HAL_Device: device ) ), HAL_TimerGranularity = ( NUMBER 0x7A, ENTRY ( R0 = HAL_Timer: timer, R8 # 0, R9 # 14 "Returns basic granularity of the specified timer in ticks per second - RISC O S 5+" ), EXIT ( R0! = .Int: granularity ) ), HAL_TimerMaxPeriod = ( NUMBER 0x7A, ENTRY ( R0 = HAL_Timer: timer, R8 # 0, R9 # 15 "Returns maximum period of the specified timer - RISC O S 5+" ), EXIT ( R0! = .Int: max_period ) ), HAL_TimerSetPeriod = ( NUMBER 0x7A, ENTRY ( R0 = HAL_Timer: timer, R1 = .Int: period, R8 # 0, R9 # 16 "Sets period of the specified timer - RISC O S 5+" ) ), HAL_TimerPeriod = ( NUMBER 0x7A, ENTRY ( R0 = HAL_Timer: timer, R8 # 0, R9 # 17 "Reads period of the specified timer - RISC O S 5+" ), EXIT ( R0! = .Int: period ) ), HAL_TimerReadCountdown = ( NUMBER 0x7A, ENTRY ( R0 = HAL_Timer: timer, R8 # 0, R9 # 18 "Returns the time until the next interrupt for the specified timer - RISC O S 5+" ), EXIT ( R0! = .Int: time_remaining ) ); SWI HAL_CounterRate = ( NUMBER 0x7A, ENTRY ( R8 # 0, R9 # 19 "Returns the rate of the counter in ticks per second - RISC O S 5+" ), EXIT ( R0! = .Int: rate ) ), HAL_CounterPeriod = ( NUMBER 0x7A, ENTRY ( R8 # 0, R9 # 20 "Returns the period of the counter in ticks - RISC O S 5+" ), EXIT ( R0! = .Int: period ) ), HAL_CounterRead = ( NUMBER 0x7A, ENTRY ( R8 # 0, R9 # 21 "Reads the current counter value - RISC O S 5+" ), EXIT ( R0! = .Int: period ) ), HAL_CounterDelay = ( NUMBER 0x7A, ENTRY ( R0 = .Int: delay, R8 # 0, R9 # 22 "Delay for at least the specified number of microseconds - RISC O S 5+" ) ) Index: OS.swi =================================================================== RCS file: /cvsroot/ro-oslib/OSLib/!OsLib/Source/Core/oslib/OS.swi,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** OS.swi 23 Nov 2002 12:12:59 -0000 1.7 --- OS.swi 23 Nov 2002 12:46:28 -0000 1.8 *************** *** 2282,2285 **** --- 2282,2326 ---- ( NUMBER 0x74 "Enter 26 bit user mode - RISC O S 4+"); + TYPE OS_HardwareFlags = .Bits; + + SWI OS_Hardware = + ( NUMBER 0x7A "Provides access to the hardware layer - RISC O S 5+", + ABSENT + ); + + SWI OS_HardwareCallHAL = + ( NUMBER 0x7A, + ENTRY + ( R0 = .Int: arg1, + R1 = .Int: arg2, + R2 = .Int: arg3, + R3 = .Int: arg4, + R4 = .Int: arg5, + R5 = .Int: arg6, + R6 = .Int: arg7, + R7 = .Int: arg8, + R8 | OS_HardwareFlags: flags, + R8 # 0 "Calls a HAL routine - RISC O S 5+", + R9 = .Int: call + ), + EXIT + ( R0 = .Int: result1, + R1 = .Int: result2, + R2 = .Int: result3, + R3 = .Int: result4 + ) ); + + SWI OS_HardwareFindHALRoutine = + ( NUMBER 0x7A, + ENTRY + ( R8 | OS_HardwareFlags: flags, + R8 # 1 "Finds the address of a HAL routine - RISC O S 5+", + R9 = .Int: call + ), + EXIT + ( R0! = .Ref .Asm: routine, + R1 = .Int: static_base + ) ); + SWI OS_ConvertStandardDateAndTime = ( NUMBER 0xC0 "Converts a 5-byte time into a string - prefer |