2 Copyright © 2002-2009, Chris Hodges. All rights reserved.
3 Copyright © 2009-2012, The AROS Development Team. All rights reserved.
7 #include <devices/usbhardware.h>
8 #include <exec/memory.h>
10 #include <proto/exec.h>
14 APTR
usbGetBuffer(APTR data
, ULONG len
, UWORD dir
)
18 if (((IPTR
) data
+ len
- 1) >> 32)
20 ret
= AllocVec(len
, MEMF_31BIT
| MEMF_PUBLIC
);
22 if (ret
&& (dir
== UHDIR_OUT
))
23 CopyMem(data
, ret
, len
);
29 void usbReleaseBuffer(APTR buffer
, APTR data
, ULONG len
, UWORD dir
)
31 if (buffer
&& (buffer
!= data
))
33 if (len
&& (dir
== UHDIR_IN
))
34 CopyMem(buffer
, data
, len
);