Commit c81481e7 authored by ROOL's avatar ROOL :robot:
Browse files

Clear up duplicate/unused OHCI/EHCI source files

Detail:
  Remove the (now) unused sources from when this component produced multiple targets. See Controllers/OHCIDriver & Controllers/EHCIDriver for the live copies.
  Remove unset USBHAL defines.
  Simplify the Makefile and !Mk* scripts.
  No longer export usbroothub_subr.h.
  Add a porting type "device_t" to usb_port.h.
Admin:
  Submission for USB bounty.

Version 1.23. Tagged as 'USBDriver-1_23'
parent be85a92e
/* (1.22)
/* (1.23)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.1.
*
*/
#define Module_MajorVersion_CMHG 1.22
#define Module_MajorVersion_CMHG 1.23
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 03 Sep 2017
#define Module_Date_CMHG 07 Oct 2017
#define Module_MajorVersion "1.22"
#define Module_Version 122
#define Module_MajorVersion "1.23"
#define Module_Version 123
#define Module_MinorVersion ""
#define Module_Date "03 Sep 2017"
#define Module_Date "07 Oct 2017"
#define Module_ApplicationDate "03-Sep-17"
#define Module_ApplicationDate "07-Oct-17"
#define Module_ComponentName "USBDriver"
#define Module_ComponentPath "mixed/RiscOS/Sources/HWSupport/USB/USBDriver"
#define Module_FullVersion "1.22"
#define Module_HelpVersion "1.22 (03 Sep 2017)"
#define Module_LibraryVersionInfo "1:22"
#define Module_FullVersion "1.23"
#define Module_HelpVersion "1.23 (07 Oct 2017)"
#define Module_LibraryVersionInfo "1:23"
......@@ -13,4 +13,4 @@
| limitations under the License.
|
dir <obey$dir>
amu_machine standalone COMPONENT=USBDriver CDEFINES="-DSTANDALONE" THROWBACK=-throwback
amu_machine standalone CDEFINES="-DSTANDALONE" THROWBACK=-throwback
......@@ -13,4 +13,4 @@
| limitations under the License.
|
dir <obey$dir>
amu_machine debug gpa_debug COMPONENT=USBDriver DEBUG=TRUE CDEFINES="-DSTANDALONE" THROWBACK=-throwback
amu_machine debug gpa_debug DEBUG=TRUE CDEFINES="-DSTANDALONE" THROWBACK=-throwback
......@@ -13,9 +13,4 @@
| limitations under the License.
|
Dir <Obey$Dir>
amu_machine export PHASE=hdrs COMPONENT=USBDriver
amu_machine export PHASE=libs COMPONENT=USBDriver
amu_machine export PHASE=hdrs COMPONENT=EHCIDriver
amu_machine export PHASE=libs COMPONENT=EHCIDriver
amu_machine export PHASE=hdrs COMPONENT=OHCIDriver
amu_machine export PHASE=libs COMPONENT=OHCIDriver
amu_machine export PHASE=hdrs
\ No newline at end of file
| Copyright 2011 Castle Technology 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.
|
Dir <Obey$Dir>
amu_machine export PHASE=hdrs COMPONENT=USBDriver THROWBACK=-throwback
amu_machine export PHASE=libs COMPONENT=USBDriver THROWBACK=-throwback
amu_machine export PHASE=hdrs COMPONENT=OHCIHALLib THROWBACK=-throwback
amu_machine export PHASE=libs COMPONENT=OHCIHALLib THROWBACK=-throwback
amu_machine export PHASE=hdrs COMPONENT=EHCIHALLib THROWBACK=-throwback
amu_machine export PHASE=libs COMPONENT=EHCIHALLib THROWBACK=-throwback
......@@ -13,4 +13,4 @@
| limitations under the License.
|
dir <obey$dir>
amu_machine rom COMPONENT=USBDriver THROWBACK=-throwback
amu_machine rom THROWBACK=-throwback
; Copyright 2011 Castle Technology 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.
;
; HAL USB workspace structure
; This workspace shouldn't be poked directly by the HAL. The only reason
; it gets exported is to allow USBHAL_WS_Size to be read, to allow the
; correct amount of memory to be reserved in the HAL workspace at sb
; USBHAL_WorkspaceOffset should then be set to the offset of this memory
; Note: This must be kept in sync with the matching C struct in dev/usb/usbhal.h
^ 0
USBHAL_WS_Heap_Normal # 4 ; Heap structure for malloc & free
USBHAL_WS_Heap_NCNB # 4 ; Heap structure for malloc_contig & free_contig
USBHAL_WS_allbuses # 8 ; TAILQ of buses
USBHAL_WS_usbbus_no # 4 ; Next number to use
USBHAL_WS_monotonictime # 4 ; Centisecond counter equivalent to OS_ReadMonotonicTime
USBHAL_WS_callouts # 4 ; Head of callouts list
USBHAL_WS_irqsema # 4 ; nonzero when processing interrupts
USBHAL_WS_rediscover # 4 ; re_discover callout
USBHAL_WS_t_handles # 4 ; tsleep handle list
USBHAL_WS_t_locks # 4 ; tsleep lock list
USBHAL_WS_nhandles # 4 ; tsleep handle count
USBHAL_WS_kbdflags # 4 ; Sticky keyboard scan bits
USBHAL_WS_callbacks # 4 ; Array of callbacks
USBHAL_WS_nextcb # 4 ; Index of next callback to run
USBHAL_WS_numcb # 4 ; Number of callbacks
USBHAL_WS_cbs_needed # 4 ; True if callbacks need processing
USBHAL_WS_Size # 0
END
......@@ -15,99 +15,59 @@
# Makefile for USBDriver
#
COMPONENT ?= USBDriver
COMPONENT = USBDriver
UNAME = "RISC_OS"
VPATH = ^.build ^.dev.usb
EXPLIBDIR = <Lib$Dir>.USB
DEVICELIST = Resources.<Locale>.USBDevs
CUSTOMEXP = custom
CINCLUDES = -Itbox:,TCPIPLibs:,^.,OS:,C:USB
CDEFINES += ${CDEBUG} -DKERNEL -D_KERNEL -Dpaddr_t=int -D__P(A)=A -DKLD_MODULE -DDISABLE_PACKED
RES_AREA = resource_files
LIBS = ${CALLXLIB} ${ASMUTILS}
CMHGDEPENDS = usbmouse usbmodule usbkboard
INSTRES_FILES = USBDevs
INSTRES_DEPENDS = ${DEVICELIST}
OBJS = usbmodule port usb usbdi usb_subr \
usbdi_util usb_quirks uhub usbmouse usbkboard \
hid bufman triggercbs call_veneer
#
# Debug switch
#
DEBUG ?= FALSE
ifeq (${DEBUG},TRUE)
CFLAGS += -DDEBUGLIB -DUSB_DEBUG -DOHCI_DEBUG -DEHCI_DEBUG
CMHGDEFINES += -DUSB_DEBUG -DOHCI_DEBUG -DEHCI_DEBUG
CFLAGS += -DUSB_DEBUG -DDEBUGLIB
CMHGDEFINES += -DUSB_DEBUG
LIBS += ${DEBUGLIBS} ${NET5LIBS}
endif
#
# Generate USBDriver and the controller drivers by choosing the list of objects
#
ifeq ("${COMPONENT}","EHCIHALLib")
OBJS = ehcimodule ehci port call_veneer \
triggercbs usbroothub_subr
OBJS_HAL = o_hal.ehci o_hal.usbroothub_subr o_hal.ehcihal o_hal.ehcihalasm
endif
ifeq ("${COMPONENT}","OHCIHALLib")
OBJS = ohcimodule ohci port call_veneer \
triggercbs
OBJS_HAL = o_hal.ohci
endif
ifeq ("${COMPONENT}","USBDriver")
CMHGDEPENDS = usbmouse usbmodule usbkboard
INSTRES_FILES = USBDevs
INSTRES_DEPENDS = ${DEVICELIST}
OBJS = usbmodule port usb usbdi usb_subr \
usbdi_util usb_quirks uhub usbmouse usbkboard \
hid bufman triggercbs call_veneer
OBJS_HAL = o_hal.usb o_hal.usbdi o_hal.usb_subr o_hal.usbdi_util \
o_hal.usb_quirks o_hal.uhub o_hal.porthal o_hal.halheap \
o_hal.usbhal
endif
include CModule
CFLAGS += -wp -wc
LDFLAGS += -LIST maps.${TARGET} -MAP -Xref -Symbols rm.sym${TARGET}
DBG_LIBS += ${NET5LIBS}
EXPLIBDIR = <Lib$Dir>.USB
#
# HAL library rules
#
.SUFFIXES: .o_hal
.c.o_hal:; ${CC} -APCS 3/nofp/noswst -wp -ff -DUSBHAL -c -depend !Depend -DKERNEL -D_KERNEL -Dpaddr_t=int -D__P(A)=A -DKLD_MODULE -DDISABLE_PACKED ${CINCLUDES} ${THROWBACK} -o $@ $<
.s.o_hal:; ${AS} ${ASFLAGS} -APCS 3/nofp/noswst -o $@ $<
#
# Produce the devices list
#
bin.makedevs: c.makedevs ${DIRS}
makedevs: c.makedevs ${DIRS}
${MAKE} -f makedevs/mk COMPONENT=makedevs THROWBACK=${THROWBACK}
${DEVICELIST}: bin.makedevs ^.dev.usb.h.usbdevs ^.dev.usb.h.usbdevs_data
${RUN}bin.makedevs > $@
${DEVICELIST}: makedevs ^.dev.usb.h.usbdevs ^.dev.usb.h.usbdevs_data
${RUN}makedevs > $@
#
# Supplemented or overridden targets
#
clean::
${XWIPE} o_hal ${WFLAGS}
${XWIPE} maps ${WFLAGS}
${XWIPE} bin ${WFLAGS}
${RM} ${DEVICELIST}
${RM} ^.dev.usb.h.usbdevs
${RM} ^.dev.usb.h.usbdevs_data
${DIRS}::
${MKDIR} o_hal
${MKDIR} maps
${MKDIR} bin
${RM} ${DEVICELIST}
${RM} makedevs
${RM} ^.dev.usb.h.usbdevs
${RM} ^.dev.usb.h.usbdevs_data
export: export_${PHASE}_${COMPONENT}
export: export_${PHASE}
@${NOP}
export_libs_${COMPONENT}: ${EXPLIBDIR}.o.${COMPONENT}
@${ECHO} ${COMPONENT}: library export complete
export_hdrs_USBDriver: h.${CMHGFILE} ^.dev.usb.h.usbdevs
export_hdrs: h.${CMHGFILE} ^.dev.usb.h.usbdevs
${MKDIR} o
${MKDIR} ${EXPLIBDIR}.dev.usb.h
${MKDIR} ${EXPLIBDIR}.sys.h
......@@ -121,13 +81,9 @@ export_hdrs_USBDriver: h.${CMHGFILE} ^.dev.usb.h.usbdevs
${CP} ^.dev.usb.h.usbdi ${EXPLIBDIR}.dev.usb.h.usbdi ${CPFLAGS}
${CP} ^.dev.usb.h.usbdivar ${EXPLIBDIR}.dev.usb.h.usbdivar ${CPFLAGS}
${CP} ^.dev.usb.h.usb_port ${EXPLIBDIR}.dev.usb.h.usb_port ${CPFLAGS}
${CP} ^.dev.usb.h.usbroothub_subr ${EXPLIBDIR}.dev.usb.h.usbroothub_subr ${CPFLAGS}
${CP} ^.sys.h.device ${EXPLIBDIR}.sys.h.device ${CPFLAGS}
${CP} ^.machine.h.bus ${EXPLIBDIR}.machine.h.bus ${CPFLAGS}
${CP} ^.VersionNum ${EXPLIBDIR}.LibVersion ${CPFLAGS}
# Workspace size for HAL allocation (only)
${CP} Hdr.usbhal ${EXPLIBDIR}.Hdr.usbhal ${CPFLAGS}
${CP} ^.dev.usb.h.usbhal ${EXPLIBDIR}.dev.usb.h.usbhal ${CPFLAGS}
# Conversion of the USB device database
${CP} ^.dev.usb.h.usbdevs ${EXPLIBDIR}.dev.usb.h.usbdevs ${CPFLAGS}
# Equivalent of ASMHDRS and ASMCHDRS and CMHGAUTOHDR
......@@ -137,8 +93,8 @@ export_hdrs_USBDriver: h.${CMHGFILE} ^.dev.usb.h.usbdevs
${FAPPEND} ${C_EXP_HDR}.USBDriver ${C_EXP_HDR}.USBDriver o._h_USBDriver
@${ECHO} ${COMPONENT}: header export complete
export_hdrs_EHCIHALLib export_hdrs_OHCIHALLib:
@${ECHO} ${COMPONENT}: header export complete
export_libs:
@${ECHO} ${COMPONENT}: no exported libraries
#
# Static dependencies
......@@ -146,8 +102,4 @@ export_hdrs_EHCIHALLib export_hdrs_OHCIHALLib:
^.dev.usb.h.usbdevs ^.dev.usb.h.usbdevs_data: ^.dev.usb.usbdevs ^.dev.usb.devlist2h/awk
${GAWK} -v os="${UNAME} -s" -f ^.dev.usb.devlist2h/awk ^.dev.usb.usbdevs
${EXPLIBDIR}.o.${COMPONENT}: ${OBJS_HAL} ${DIRS}
${MKDIR} ${EXPLIBDIR}.o
${AR} ${ARFLAGS} $@ ${OBJS_HAL}
# Dynamic dependencies:
/* Copyright 2011 Castle Technology 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.
*/
/* HAL version of ehcimodule.c */
#include <dev/usb/usbhal.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <machine/bus.h>
#include <sys/queue.h>
#include <sys/types.h>
#include <sys/systm.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usbdivar.h>
#include <dev/usb/ehcireg.h>
#include <dev/usb/ehcivar.h>
#include "Global/RISCOS.h"
#include "Global/Services.h"
#include "Global/HALEntries.h"
/* Have to avoid including stdio as there's a clash with the BSD stuff */
#define __stdio_h
#include "DebugLib/DebugLib.h"
typedef struct
{
int type;
int flags;
void *hw;
int devno;
} usbinfo;
extern size_t HAL_USBControllerInfo(int idx,usbinfo *info,size_t size);
extern int HAL_IRQEnable(int device);
extern int HAL_IRQDisable(int device);
extern void HAL_IRQClear(int device);
extern int (*GetHAL_USBPortPower(void))(int idx,int port,int state);
extern device_ptr_t register_bus(device_ptr_t bus);
static void init_device(usbinfo *info,int idx)
{
ehci_softc_t *ehci = malloc(sizeof(ehci_softc_t));
memset(ehci,0,sizeof(ehci_softc_t));
sprintf(ehci->sc_bus.bdev.dv_xname,"EHCI%d",idx);
ehci->sc_irqdevno = info->devno;
ehci->sc_ncomp = 2;
/* Abuse iot & ioh members to store base addr & flags */
ehci->iot = (bus_space_tag_t) info->hw;
ehci->ioh = (bus_space_handle_t) info->flags;
if(info->flags & HALUSBControllerFlag_EHCI_ETTF)
ehci->sc_flags |= EHCIF_ETTF;
ehci_init(ehci);
/* Enable IRQ */
HAL_IRQEnable(ehci->sc_irqdevno);
/* Register with USBDriver */
register_bus((device_ptr_t) ehci);
/* Switch on the ports (if under HAL control) */
if(info->flags & HALUSBControllerFlag_HAL_Port_Power && GetHAL_USBPortPower() != NULL)
{
for (int i = 0; i < ehci->sc_noport; i++)
{
GetHAL_USBPortPower()(idx, i, 1);
}
}
}
void USBHAL_EHCIDriver_Init(void)
{
/* Find and initialise all controllers. Note that this currently only
supports controllers exposed via HAL_USBControllerInfo */
int idx=0;
do {
usbinfo info;
size_t usbinfolen = HAL_USBControllerInfo(idx,&info,sizeof(info));
if((usbinfolen == sizeof(info)) && (info.type == HALUSBControllerType_EHCI))
init_device(&info,idx);
else if(!usbinfolen)
return;
idx++;
} while(1);
}
int usbhal_ehci_do_intr(struct usbd_bus *bus,int irqdevno)
{
ehci_softc_t *sc = (ehci_softc_t *)bus;
if(irqdevno != sc->sc_irqdevno)
return 0;
int ret = ehci_intr(sc);
return ret;
}
void usbhal_ehci_shutdown(struct usbd_bus *bus)
{
ehci_softc_t *sc = (ehci_softc_t *)bus;
/* Disable IRQ */
HAL_IRQDisable(sc->sc_irqdevno);
/* Reset controller */
EOWRITE4(sc, EHCI_USBCMD, 0);
EOWRITE4(sc, EHCI_USBCMD, EHCI_CMD_HCRESET);
EOREAD4(sc, EHCI_USBCMD);/* flush the command */
/* Wait a bit */
delay(1000);
/* Clear any lingering IRQ */
HAL_IRQClear(sc->sc_irqdevno);
}
/* #define these because I'm feeling lazy */
#define ehci_base ((volatile int *)iot)
#define registers_32bit (((int)ioh) & HALUSBControllerFlag_32bit_Regs)
void bus_space_write_4 (bus_space_tag_t iot, bus_space_handle_t ioh, int o, int x)
{
ehci_base[o>>2] = x;
}
int bus_space_read_4 (bus_space_tag_t iot, bus_space_handle_t ioh, int o)
{
return ehci_base[o>>2];
}
void bus_space_write_2 (bus_space_tag_t iot, bus_space_handle_t ioh, int o, int x)
{
if (registers_32bit)
{
x &= 0xFFFF;
if (o&2)
ehci_base[o>>2]=(ehci_base[o>>2]&0xFFFF)|(x<<16);
else
ehci_base[o>>2]=(ehci_base[o>>2]&0xFFFF0000)|x;
}
else
((uint16_t*) ehci_base)[o>>1] = x;
}
int bus_space_read_2 (bus_space_tag_t iot, bus_space_handle_t ioh, int o)
{
if (registers_32bit)
{
if (o&2)
return ((uint32_t*)ehci_base)[o>>2]>>16;
else
return ((uint32_t*)ehci_base)[o>>2]&0xFFFF;
}
return ((uint16_t*) ehci_base)[o>>1];
}
void bus_space_write_1 (bus_space_tag_t iot, bus_space_handle_t ioh, int o, int x)
{
if (registers_32bit)
{
x &= 0xFF;
int t = ehci_base[o>>2];
t &= ~(0xFF<<((o&3)*8));
t |= x<<((o&3)*8);
ehci_base[o>>2] = t;
}
else
((uint8_t*) ehci_base)[o] = x;
}
int bus_space_read_1 (bus_space_tag_t iot, bus_space_handle_t ioh, int o)
{
if (registers_32bit)
return (((uint32_t*)ehci_base)[o/4]>>((o&3)*8))&0xff;
return ((uint8_t*) ehci_base)[o];
}
This diff is collapsed.
This diff is collapsed.
......@@ -12,11 +12,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/* This is the module version of port.c
For the HAL version, see usbhal.c and porthal.s
*/
#include <stddef.h>
#include <string.h>
#include <stdio.h>
......
This diff is collapsed.
......@@ -14,7 +14,7 @@
#
# Makefile for makedevs
TARGET = bin.makedevs
TARGET = makedevs
OBJS = makedevs
CINCLUDES = -I^.
......
IMPORT HAL_USBPortPower [WEAK]
EXPORT GetHAL_USBPortPower
AREA |Asm$$Data|, CODE, READONLY
GetHAL_USBPortPower
LDR a1, %FT01
MOV pc, lr
01 ; This needs to be a weak reference from a READONLY area because
; not every HAL exposes this symbol, and traditional static data
; isn't supported in HAL code
DCD HAL_USBPortPower
END
This diff is collapsed.
; Copyright 2011 Castle Technology 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.
;
; Assembler version of port.c, for use with HAL version of the USB drivers
; See also usbhal.c for some bits which were easier done in C.
GET Hdr:ListOpts
GET Hdr:Macros
GET Hdr:System
GET Hdr.usbhal
sb RN 9
AREA |C$$code|, CODE, READONLY
; External interfaces to HAL code
IMPORT USBHAL_WorkspaceOffset
IMPORT HAL_CounterDelay
IMPORT snprintf
IMPORT printf
; Internal interfaces to rest of HAL USB code
EXPORT spltty
EXPORT splx
EXPORT splbio
EXPORT delay
EXPORT selrecord
EXPORT selwakeup
EXPORT config_deactivate
EXPORT uiomove
EXPORT psignal
EXPORT kthread_create
EXPORT kthread_create1
EXPORT kthread_exit
EXPORT device_probe_and_attach
EXPORT ratecheck
EXPORT malloc_contig
EXPORT free_contig
EXPORT min
EXPORT logprintf
EXPORT cold
EXPORT hz
EXPORT _snprintf
EXPORT malloc
EXPORT free
IMPORT HALHeap_GetArea
IMPORT HALHeap_GetAreaAligned
IMPORT HALHeap_FreeArea
cold
DCD 0
hz
DCD 1000
spltty
MRS a1, CPSR
AND a1, a1, #I32_bit
MOV pc, lr
splx
TST a1, #I32_bit
MRSEQ a2, CPSR
BICEQ a2, a2, #I32_bit
MSREQ CPSR_c, a2
MOV pc, lr
splbio
MRS a1, CPSR
ORR a2, a1, #I32_bit
AND a1, a1, #I32_bit
MSR CPSR_c, a2
MOV pc, lr
delay
B HAL_CounterDelay
logprintf
B printf
kthread_create1
config_deactivate
uiomove
kthread_create
ratecheck
MOV a1, #0
selrecord
selwakeup
psignal
kthread_exit
device_probe_and_attach
MOV pc, lr
min
CMP a1, a2
MOVGT a1, a2
MOV pc, lr
_snprintf
B snprintf
malloc
; Note that this is a vanilla implementation, i.e. no M_ZERO support
; (but the usbdriver sources already deal with that)
MOV r1, r0
LDR r2, =USBHAL_WorkspaceOffset+USBHAL_WS_Heap_Normal
LDR r0, [sb, r2]
B HALHeap_GetArea
free
MOV r1, r0
LDR r2, =USBHAL_WorkspaceOffset+USBHAL_WS_Heap_Normal
LDR r0, [sb, r2]
B HALHeap_FreeArea
malloc_contig
; R0 = length
; R1 = alignment
ADD r0, r0, #3 ; Make size multiple of 4 for easy memset
BIC r0, r0, #3
Push "r0,lr"
LDR r3, =USBHAL_WorkspaceOffset+USBHAL_WS_Heap_NCNB
MOV r2, r1
MOV r1, r0
LDR r0, [sb, r3]
BL HALHeap_GetAreaAligned
Pull "r1,lr"
CMP r0, #0
MOVEQ pc, lr
; Zero the memory
MOV ip, #0
10
SUBS r1, r1, #4
STR ip, [r0, r1]
BGT %BT10
MOV pc, lr
free_contig
; R0 = pointer to pointer
LDR r2, =USBHAL_WorkspaceOffset+USBHAL_WS_Heap_NCNB
LDR r1, [r0]
LDR r0, [sb, r2]
B HALHeap_FreeArea
END
This diff is collapsed.
......@@ -31,9 +31,6 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef __riscos
#include <dev/usb/usbhal.h>
#endif
#include <sys/cdefs.h>
#ifndef __riscos
__KERNEL_RCSID(0, "$NetBSD: hid.c,v 1.30 2010/05/14 17:32:57 plunky Exp $");
......
This diff is collapsed.
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