Commit 35ce9ea3 authored by Jeffrey Lee's avatar Jeffrey Lee
Browse files

Sanitise HAL_USBControllerInfo

Detail:
  s/USB - For valid controllers, HAL_USBControllerInfo now always returns the correct USB struct size and fills in the controller type. The rest of the buffer is filled in only if the supplied size is large enough. This allows for proper probing of controllers without knowing the required buffer sizes beforehand.
Admin:
  Tested in BCM2835 ROM


Version 0.08. Tagged as 'BCM2835-0_08'
parent 37c448aa
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "0.07"
Module_Version SETA 7
Module_MajorVersion SETS "0.08"
Module_Version SETA 8
Module_MinorVersion SETS ""
Module_Date SETS "03 Jun 2012"
Module_ApplicationDate SETS "03-Jun-12"
Module_Date SETS "07 Jun 2012"
Module_ApplicationDate SETS "07-Jun-12"
Module_ComponentName SETS "BCM2835"
Module_ComponentPath SETS "mixed/RiscOS/Sources/HAL/BCM2835"
Module_FullVersion SETS "0.07"
Module_HelpVersion SETS "0.07 (03 Jun 2012)"
Module_FullVersion SETS "0.08"
Module_HelpVersion SETS "0.08 (07 Jun 2012)"
END
/* (0.07)
/* (0.08)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 0.07
#define Module_MajorVersion_CMHG 0.08
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 03 Jun 2012
#define Module_Date_CMHG 07 Jun 2012
#define Module_MajorVersion "0.07"
#define Module_Version 7
#define Module_MajorVersion "0.08"
#define Module_Version 8
#define Module_MinorVersion ""
#define Module_Date "03 Jun 2012"
#define Module_Date "07 Jun 2012"
#define Module_ApplicationDate "03-Jun-12"
#define Module_ApplicationDate "07-Jun-12"
#define Module_ComponentName "BCM2835"
#define Module_ComponentPath "mixed/RiscOS/Sources/HAL/BCM2835"
#define Module_FullVersion "0.07"
#define Module_HelpVersion "0.07 (03 Jun 2012)"
#define Module_LibraryVersionInfo "0:7"
#define Module_FullVersion "0.08"
#define Module_HelpVersion "0.08 (07 Jun 2012)"
#define Module_LibraryVersionInfo "0:8"
......@@ -44,27 +44,27 @@
; a1 = interface #
; a2 = usbinfo ptr
; a3 = sizeof(usbinfo)
; Return sizeof(usbinfo) or 0 for fail
; Return sizeof(usbinfo) or 0 for no more devices
; If supplied size isn't large enough, only the controller type will be filled in
HAL_USBControllerInfo
CMP a3, #USBINFO_SIZEOF
MOVNE a1, #0
MOVNE pc, lr
CMP a1, #0
MOVHI a1, #0
MOVHI pc, lr
; Fill in the usbinfo struct
MOV a1, #3 ; DWC
STR a1, [a2, #USBINFO_TYPE]
MOV a1, #0 ; flags
STR a1, [a2, #USBINFO_FLAGS]
LDR a1, PeriBase
ADD a1, a1, #USB_Base
STR a1, [a2, #USBINFO_HW]
MOV a1, #iDev_GPU_VCUSB
STR a1, [a2, #USBINFO_DEVNO]
LDR a1, FB_CacheMode
STR a1, [a2, #USBINFO_DMAOFFSET]
CMP a3, #USBINFO_SIZEOF
MOV a1, #USBINFO_SIZEOF
MOVLO pc, lr
MOV a4, #0 ; flags
STR a4, [a2, #USBINFO_FLAGS]
LDR a4, PeriBase
ADD a4, a4, #USB_Base
STR a4, [a2, #USBINFO_HW]
MOV a4, #iDev_GPU_VCUSB
STR a4, [a2, #USBINFO_DEVNO]
LDR a4, FB_CacheMode
STR a4, [a2, #USBINFO_DMAOFFSET]
MOV pc, lr
HAL_USBPortPower
......
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