; Copyright 2003 Tematic Ltd
;
; Licensed under the Apache License, Version 2.0 (the "License");
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
;     http://www.apache.org/licenses/LICENSE-2.0
;
; Unless required by applicable law or agreed to in writing, software
; distributed under the License is distributed on an "AS IS" BASIS,
; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
; See the License for the specific language governing permissions and
; limitations under the License.
;
#include "Global/RISCOS.h"
#include "Global/Services.h"
#include "../Version"

initialisation-code:	module_init

finalisation-code:  	module_final

service-call-handler:	module_services Service_ResourceFSStarted,
                                        Service_ResourceFSStarting,
                                        Service_USB,
                                        Service_PreReset,
                                        Service_PCI

title-string:	    	OHCIDriver

help-string:	     	OHCIDriver  OHCIDriverModule_MajorVersion_CMHG

date-string:	    	OHCIDriverModule_Module_Date_CMHG

#define HELPFILE(M) "Resources:$." #M
#define XHELPFILE(M) HELPFILE(M)
international-help-file: XHELPFILE(MSGLOC)

#ifdef OHCI_DEBUG
command-keyword-table:	module_commands

OHCIRegs(   min-args:0, max-args:0,
            help-text: "*OHCIRegs reads the registers from the OHCI controller\n",
            add-syntax:, invalid-syntax: "Syntax: *OHCIRegs"),

OHCIEDS(),

OHCIWrite(  min-args:2, max-args:2,
            help-text: "*OHCIWrite writes to a register in the OHCI controller.\n",
            add-syntax:, invalid-syntax: "Syntax: *OHCIWrite <offset> <value>"),

OHCIDebug(  min-args:1, max-args:2,
            help-text: "*OHCIDebug sets the debug level for debuglib output, optionally also setting the debug level for output controlled by the usbdebug variable within the ohcidriver.\n",
            add-syntax:, invalid-syntax: "Syntax: OHCIDebug <ohci> [<usb>]"),

TargetFM(   min-args:1, max-args:1,
            help-text: "*TargetFM sets the frame interval that will be targeted for phase synchronisation.\n",
            add-syntax:, invalid-syntax: "Syntax: TargetFM <n>");
#endif


;swi-chunk-base-number:	0x54ac0

;swi-handler-code:   	module_swis

;swi-decoding-table: 	OHCI_

#ifdef OHCI_DEBUG
event-handler:		vsync_entry/vsync Event_VSync
#endif

vector-handlers:    	usb_irq_entry/usb_irq_handler,
			softintr_entry/softintr
generic-veneers:    	callout_entry/callout_handler