Commit d1804c84 authored by Robert Sprowson's avatar Robert Sprowson Committed by ROOL

Correct MAC endianness

The MAC address when encoded as a Dallas unique id is in network byte order.
For example, a Risc PC returns OS_ReadSysInfo 4 with r0=&A4123456 r1=&0000 because Acorn's EUI is 00:00:A4.

Version 0.84. Tagged as 'HAL_BCM2835-0_84'
parent e2f95b6e
/* (0.83) /* (0.84)
* *
* This file is automatically maintained by srccommit, do not edit manually. * This file is automatically maintained by srccommit, do not edit manually.
* *
*/ */
#define Module_MajorVersion_CMHG 0.83 #define Module_MajorVersion_CMHG 0.84
#define Module_MinorVersion_CMHG #define Module_MinorVersion_CMHG
#define Module_Date_CMHG 14 Mar 2020 #define Module_Date_CMHG 02 Apr 2020
#define Module_MajorVersion "0.83" #define Module_MajorVersion "0.84"
#define Module_Version 83 #define Module_Version 84
#define Module_MinorVersion "" #define Module_MinorVersion ""
#define Module_Date "14 Mar 2020" #define Module_Date "02 Apr 2020"
#define Module_ApplicationDate "14-Mar-20" #define Module_ApplicationDate "02-Apr-20"
#define Module_ComponentName "HAL_BCM2835" #define Module_ComponentName "HAL_BCM2835"
#define Module_FullVersion "0.83" #define Module_FullVersion "0.84"
#define Module_HelpVersion "0.83 (14 Mar 2020)" #define Module_HelpVersion "0.84 (02 Apr 2020)"
#define Module_LibraryVersionInfo "0:83" #define Module_LibraryVersionInfo "0:84"
...@@ -163,13 +163,15 @@ HAL_QueryPlatform ROUT ...@@ -163,13 +163,15 @@ HAL_QueryPlatform ROUT
MOVEQ a1, #0 MOVEQ a1, #0
MOVEQ a2, #0 MOVEQ a2, #0
LDMNEIA a3, {a1, a2} LDMNEIA a3, {a1, a2} ; MAC 11:22:33:44:55:66 => a2=xxxx6655 a1=44332211
AND a3, a1, #&ff000000 REV a3, a1
MOV a3, a3, LSR #24 REV a2, a2
ORR a2, a3, a2, LSL #8 MOV a2, a2, LSR #8
MOV a1, a1, LSL #8 ORR a1, a2, a3, LSL #24
BIC a1, a1, #&FF
MOV a2, a3, LSR #8 ; => a2=00112233 a1=44556600
ORR a1, a1, #&81 ; make it look like a Dallas unique id ORR a1, a1, #&81 ; make it look like a Dallas unique id
BIC a2, a2, #&ff000000
MOV a3, #0 ; compute a Dallas unique id CRC MOV a3, #0 ; compute a Dallas unique id CRC
MOV a4, #7 ; number of bytes to do MOV a4, #7 ; number of bytes to do
......
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