Commit 24b8966d authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Simplify HAL_IICDevice API

The only function to use the abandoned extensions to OS_ClaimDeviceVector, the 2nd & 3rd members of the structure never got used.
Change uses of HAL_IICDevice to pass in the bus, and expect the device number back.
Docs updated accordingly.

Version 5.35, 4.79.2.218. Tagged as 'Kernel-5_35-4_79_2_218'
parent 1ea51c48
......@@ -29,49 +29,6 @@ HAL_FIQDisable
HAL_FIQClear
HAL_FIQDisableAll
Interrupt specifications are generally described by a 3-word structure.
The 3 words correspond directly to the contents of registers R0,R3 and R4
on entry to OS_ClaimDeviceVector.
typedef struct irq_descriptor
{
int device;
union {
struct {
unsigned char *addr;
int maskandpolarity;
} bit;
struct {
int (*forme)(void *handle);
void *handle;
} func;
} sub;
} irq_descriptor;
OS_ClaimDeviceVector changes:
R3 and R4 must always be supplied. Set R3=R4=0 to claim "all" of an interrupt.
Bit 31 of the device number indicates that a routine is being supplied instead
of an address and a mask.
When supplying a bit mask, your handler is called if
([addr] AND maskandpolarity) EOR (maskandpolarity >> 8)
is nonzero. This is a RISC OS 3.8+ backwards-compatible extension to the original
check:
[addr] AND maskandpolarity
When supplying a routine, your handler is called if
forme(handle)
returns nonzero.
if
Timers
======
......
......@@ -13,11 +13,11 @@
GBLS Module_ComponentPath
Module_MajorVersion SETS "5.35"
Module_Version SETA 535
Module_MinorVersion SETS "4.79.2.217"
Module_Date SETS "07 Apr 2014"
Module_ApplicationDate SETS "07-Apr-14"
Module_MinorVersion SETS "4.79.2.218"
Module_Date SETS "14 Apr 2014"
Module_ApplicationDate SETS "14-Apr-14"
Module_ComponentName SETS "Kernel"
Module_ComponentPath SETS "castle/RiscOS/Sources/Kernel"
Module_FullVersion SETS "5.35 (4.79.2.217)"
Module_HelpVersion SETS "5.35 (07 Apr 2014) 4.79.2.217"
Module_FullVersion SETS "5.35 (4.79.2.218)"
Module_HelpVersion SETS "5.35 (14 Apr 2014) 4.79.2.218"
END
......@@ -5,19 +5,19 @@
*
*/
#define Module_MajorVersion_CMHG 5.35
#define Module_MinorVersion_CMHG 4.79.2.217
#define Module_Date_CMHG 07 Apr 2014
#define Module_MinorVersion_CMHG 4.79.2.218
#define Module_Date_CMHG 14 Apr 2014
#define Module_MajorVersion "5.35"
#define Module_Version 535
#define Module_MinorVersion "4.79.2.217"
#define Module_Date "07 Apr 2014"
#define Module_MinorVersion "4.79.2.218"
#define Module_Date "14 Apr 2014"
#define Module_ApplicationDate "07-Apr-14"
#define Module_ApplicationDate "14-Apr-14"
#define Module_ComponentName "Kernel"
#define Module_ComponentPath "castle/RiscOS/Sources/Kernel"
#define Module_FullVersion "5.35 (4.79.2.217)"
#define Module_HelpVersion "5.35 (07 Apr 2014) 4.79.2.217"
#define Module_FullVersion "5.35 (4.79.2.218)"
#define Module_HelpVersion "5.35 (14 Apr 2014) 4.79.2.218"
#define Module_LibraryVersionInfo "5:35"
......@@ -235,12 +235,9 @@ FillInDefaultIRQ1VDevices
TST a1, #IICFlag_HighLevel
TSTNE a1, #IICFlag_Background
BEQ %FT90
SUB sp, sp, #12
MOV a1, sp
MOV a2, v3
MOV a1, v3
CallHAL HAL_IICDevice
; I think it's safe to call A SWI here...
LDMIA sp!, {r0, r3, r4}
LDR r1, =IICIRQ
MOV r2, v3
SWI XOS_ClaimDeviceVector
......
......@@ -959,14 +959,10 @@ IICInit
STR a1, [R8, #IICBus_Type]
TST a1, #IICFlag_Background
BEQ %FT20
SUB sp, sp, #12
MOV a1, sp
MOV a2, R7
MOV a1, R7
CallHAL HAL_IICDevice
LDR a1, [sp]
STR a1, [R8, #IICBus_Device]
CallHAL HAL_IRQEnable
ADD sp, sp, #12
20
ADD R7, R7, #1
ADD R8, R8, #IICBus_Size
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment