revert between 56095 -> 55830 in arch
[AROS.git] / rom / usb / pciusb / buffer.c
blob105fa05187c9ab0e268b44b575b19cd86f2216d5
1 #include <aros/debug.h>
2 #include <devices/usbhardware.h>
3 #include <exec/memory.h>
4 #include <proto/exec.h>
6 #if __WORDSIZE == 64
8 APTR usbGetBuffer(APTR data, ULONG len, UWORD dir)
10 APTR ret = data;
12 if (len && (((IPTR)data + len - 1) >> 32) != 0)
14 ret = AllocVec(len, MEMF_31BIT|MEMF_PUBLIC);
16 if (ret && (dir == UHDIR_OUT))
17 CopyMem(data, ret, len);
20 return ret;
23 void usbReleaseBuffer(APTR buffer, APTR data, ULONG len, UWORD dir)
25 if (buffer && (buffer != data))
27 if (len && (dir == UHDIR_IN))
28 CopyMem(buffer, data, len);
30 FreeVec(buffer);
34 #endif